- play no videos when running special commands like validations
This commit is contained in:
parent
6b27343145
commit
6f48ec6330
|
@ -2989,6 +2989,25 @@ int glestMain(int argc, char** argv) {
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if( hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_OPENGL_INFO]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SDL_INFO]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_LUA_INFO]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_CURL_INFO]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_XERCES_INFO]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VERSION]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SHOW_INI_SETTINGS]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_SCENARIO]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_TILESET]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_LIST_MAPS]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_LIST_TECHTRESS]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_LIST_SCENARIOS]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_LIST_TILESETS]) == true ||
|
||||||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_LIST_TUTORIALS]) == true) {
|
||||||
|
VideoPlayer::setDisabled(true);
|
||||||
|
}
|
||||||
|
|
||||||
//throw megaglest_runtime_error("Test!");
|
//throw megaglest_runtime_error("Test!");
|
||||||
|
|
||||||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SDL_INFO]) == true) {
|
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SDL_INFO]) == true) {
|
||||||
|
@ -4396,7 +4415,6 @@ int glestMain(int argc, char** argv) {
|
||||||
if( hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]) == true ||
|
if( hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_TECHTREES]) == true ||
|
||||||
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]) == true ||
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_FACTIONS]) == true ||
|
||||||
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_SCENARIO]) == true) {
|
hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_VALIDATE_SCENARIO]) == true) {
|
||||||
|
|
||||||
runTechValidationReport(argc, argv);
|
runTechValidationReport(argc, argv);
|
||||||
|
|
||||||
delete mainWindow;
|
delete mainWindow;
|
||||||
|
|
|
@ -48,6 +48,7 @@ protected:
|
||||||
VideoLoadingCallbackInterface *loadingCB;
|
VideoLoadingCallbackInterface *loadingCB;
|
||||||
ctx *ctxPtr;
|
ctx *ctxPtr;
|
||||||
|
|
||||||
|
static bool disabled;
|
||||||
void init();
|
void init();
|
||||||
|
|
||||||
void cleanupPlayer();
|
void cleanupPlayer();
|
||||||
|
@ -62,6 +63,9 @@ public:
|
||||||
string pluginsPath,bool verboseEnabled=false);
|
string pluginsPath,bool verboseEnabled=false);
|
||||||
virtual ~VideoPlayer();
|
virtual ~VideoPlayer();
|
||||||
|
|
||||||
|
static void setDisabled(bool value) { disabled = value; }
|
||||||
|
static bool getDisabled() { return disabled; }
|
||||||
|
|
||||||
void PlayVideo();
|
void PlayVideo();
|
||||||
void StopVideo() { stop = true; }
|
void StopVideo() { stop = true; }
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ typedef unsigned __int64 uint64_t;
|
||||||
#include <vlc/vlc.h>
|
#include <vlc/vlc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#if defined(WIN32)
|
#if defined(WIN32)
|
||||||
/**
|
/**
|
||||||
* @param location The location of the registry key. For example "Software\\Bethesda Softworks\\Morrowind"
|
* @param location The location of the registry key. For example "Software\\Bethesda Softworks\\Morrowind"
|
||||||
|
@ -136,6 +137,8 @@ public:
|
||||||
|
|
||||||
namespace Shared{ namespace Graphics{
|
namespace Shared{ namespace Graphics{
|
||||||
|
|
||||||
|
bool VideoPlayer::disabled = false;
|
||||||
|
|
||||||
// Load a texture
|
// Load a texture
|
||||||
static void loadTexture(class ctx *ctx) {
|
static void loadTexture(class ctx *ctx) {
|
||||||
if(ctx->verboseEnabled) printf("In [%s] Line: %d\n",__FUNCTION__,__LINE__);
|
if(ctx->verboseEnabled) printf("In [%s] Line: %d\n",__FUNCTION__,__LINE__);
|
||||||
|
@ -430,6 +433,9 @@ VideoPlayer::VideoPlayer(VideoLoadingCallbackInterface *loadingCB,
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoPlayer::init() {
|
void VideoPlayer::init() {
|
||||||
|
if(VideoPlayer::disabled == true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
ctxPtr = new ctx();
|
ctxPtr = new ctx();
|
||||||
ctxPtr->loadingCB = loadingCB;
|
ctxPtr->loadingCB = loadingCB;
|
||||||
ctxPtr->x = x;
|
ctxPtr->x = x;
|
||||||
|
@ -464,6 +470,10 @@ void VideoPlayer::cleanupPlayer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VideoPlayer::initPlayer(string mediaURL) {
|
bool VideoPlayer::initPlayer(string mediaURL) {
|
||||||
|
if(VideoPlayer::disabled == true) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAS_LIBVLC
|
#ifdef HAS_LIBVLC
|
||||||
ctxPtr->libvlc = NULL;
|
ctxPtr->libvlc = NULL;
|
||||||
ctxPtr->m = NULL;
|
ctxPtr->m = NULL;
|
||||||
|
@ -915,6 +925,9 @@ bool VideoPlayer::initPlayer(string mediaURL) {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VideoPlayer::initPlayer() {
|
bool VideoPlayer::initPlayer() {
|
||||||
|
if(VideoPlayer::disabled == true) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef HAS_LIBVLC
|
#ifdef HAS_LIBVLC
|
||||||
|
|
||||||
|
@ -1010,6 +1023,10 @@ void VideoPlayer::closePlayer() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void VideoPlayer::PlayVideo() {
|
void VideoPlayer::PlayVideo() {
|
||||||
|
if(VideoPlayer::disabled == true) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
#ifdef HAS_LIBVLC
|
#ifdef HAS_LIBVLC
|
||||||
libvlc_instance_t *libvlc = NULL;
|
libvlc_instance_t *libvlc = NULL;
|
||||||
|
@ -1273,6 +1290,10 @@ bool VideoPlayer::isPlaying() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VideoPlayer::playFrame(bool swapBuffers) {
|
bool VideoPlayer::playFrame(bool swapBuffers) {
|
||||||
|
if(VideoPlayer::disabled == true) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
//bool needToQuit = false;
|
//bool needToQuit = false;
|
||||||
int action = 0, pause = 0, n = 0;
|
int action = 0, pause = 0, n = 0;
|
||||||
if(successLoadingLib == true &&
|
if(successLoadingLib == true &&
|
||||||
|
|
Loading…
Reference in New Issue
Block a user