mirror of
https://github.com/glest/glest-source.git
synced 2025-08-11 19:04:00 +02:00
bugfix for vc++ compiling
This commit is contained in:
@@ -149,7 +149,7 @@ public:
|
|||||||
|
|
||||||
void cleanupCRCThread() {
|
void cleanupCRCThread() {
|
||||||
if(preCacheThread != NULL) {
|
if(preCacheThread != NULL) {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
const double MAX_THREAD_WAIT = 60;
|
const double MAX_THREAD_WAIT = 60;
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("START - shutting down crc threads\n");
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("START - shutting down crc threads\n");
|
||||||
@@ -170,13 +170,13 @@ void cleanupCRCThread() {
|
|||||||
preCacheThread=NULL;
|
preCacheThread=NULL;
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("C - shutting down crc threads\n");
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("C - shutting down crc threads\n");
|
||||||
}
|
}
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("D - shutting down crc threads\n");
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("D - shutting down crc threads\n");
|
||||||
|
|
||||||
if(preCacheThread->canShutdown(false) == true) {
|
if(preCacheThread->canShutdown(false) == true) {
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
delete preCacheThread;
|
delete preCacheThread;
|
||||||
preCacheThread=NULL;
|
preCacheThread=NULL;
|
||||||
|
|
||||||
@@ -186,13 +186,13 @@ void cleanupCRCThread() {
|
|||||||
}
|
}
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("F - shutting down crc threads\n");
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("F - shutting down crc threads\n");
|
||||||
preCacheThread = NULL;
|
preCacheThread = NULL;
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void cleanupProcessObjects() {
|
static void cleanupProcessObjects() {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
|
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
|
||||||
showCursor(true);
|
showCursor(true);
|
||||||
@@ -204,7 +204,7 @@ static void cleanupProcessObjects() {
|
|||||||
//printf("In main IRCThreadcheck [%p]...\n",ircClient);
|
//printf("In main IRCThreadcheck [%p]...\n",ircClient);
|
||||||
if(ircClient != NULL) {
|
if(ircClient != NULL) {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("#2 IRCCLient Cache SHUTDOWN\n");
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("#2 IRCCLient Cache SHUTDOWN\n");
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
//printf("Closing IRC CLient %d\n",__LINE__);
|
//printf("Closing IRC CLient %d\n",__LINE__);
|
||||||
ircClient->disconnect();
|
ircClient->disconnect();
|
||||||
@@ -218,7 +218,7 @@ static void cleanupProcessObjects() {
|
|||||||
//printf("In main IRCThreadcheck [%p] signalled quit...\n",ircClient);
|
//printf("In main IRCThreadcheck [%p] signalled quit...\n",ircClient);
|
||||||
printf("Closing IRC CLient %d\n",__LINE__);
|
printf("Closing IRC CLient %d\n",__LINE__);
|
||||||
ircClient->signalQuit();
|
ircClient->signalQuit();
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
ircClient->disconnect();
|
ircClient->disconnect();
|
||||||
ircClient = NULL;
|
ircClient = NULL;
|
||||||
@@ -232,8 +232,8 @@ static void cleanupProcessObjects() {
|
|||||||
//printf("Closing IRC CLient %d\n",__LINE__);
|
//printf("Closing IRC CLient %d\n",__LINE__);
|
||||||
|
|
||||||
cleanupCRCThread();
|
cleanupCRCThread();
|
||||||
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
//SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
//printf("Closing IRC CLient %d\n",__LINE__);
|
//printf("Closing IRC CLient %d\n",__LINE__);
|
||||||
if(Renderer::isEnded() == false) {
|
if(Renderer::isEnded() == false) {
|
||||||
@@ -244,7 +244,7 @@ static void cleanupProcessObjects() {
|
|||||||
|
|
||||||
//printf("Closing IRC CLient %d\n",__LINE__);
|
//printf("Closing IRC CLient %d\n",__LINE__);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
SystemFlags::Close();
|
SystemFlags::Close();
|
||||||
SystemFlags::SHUTDOWN_PROGRAM_MODE=true;
|
SystemFlags::SHUTDOWN_PROGRAM_MODE=true;
|
||||||
@@ -296,7 +296,7 @@ static void cleanupProcessObjects() {
|
|||||||
|
|
||||||
//printf("Closing IRC CLient %d\n",__LINE__);
|
//printf("Closing IRC CLient %d\n",__LINE__);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
|
||||||
SystemFlags::globalCleanupHTTP();
|
SystemFlags::globalCleanupHTTP();
|
||||||
@@ -625,7 +625,7 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ExceptionHandler::handleRuntimeError(const char *msg, bool getStackTraceString) {
|
void ExceptionHandler::handleRuntimeError(const char *msg, bool getStackTraceString) {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
static bool inErrorNow = false;
|
static bool inErrorNow = false;
|
||||||
if(inErrorNow == true) {
|
if(inErrorNow == true) {
|
||||||
@@ -639,13 +639,13 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||||||
|
|
||||||
logError(msg,true);
|
logError(msg,true);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] program = %p gameInitialized = %d msg [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,mainProgram,gameInitialized,msg);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] program = %p gameInitialized = %d msg [%s]\n",__FILE__,__FUNCTION__,__LINE__,mainProgram,gameInitialized,msg);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] [%s] gameInitialized = %d, program = %p\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,gameInitialized,mainProgram);
|
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] [%s] gameInitialized = %d, program = %p\n",__FILE__,__FUNCTION__,__LINE__,msg,gameInitialized,mainProgram);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%s] gameInitialized = %d, program = %p\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,gameInitialized,mainProgram);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%s] gameInitialized = %d, program = %p\n",__FILE__,__FUNCTION__,__LINE__,msg,gameInitialized,mainProgram);
|
||||||
|
|
||||||
string errMsg = (msg != NULL ? msg : "null");
|
string errMsg = (msg != NULL ? msg : "null");
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
bool gotStackTrace = false;
|
bool gotStackTrace = false;
|
||||||
if(getStackTraceString == true && disableBacktrace == false && sdl_quitCalled == false) {
|
if(getStackTraceString == true && disableBacktrace == false && sdl_quitCalled == false) {
|
||||||
@@ -654,27 +654,27 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||||||
gotStackTrace = true;
|
gotStackTrace = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
logError(errMsg.c_str(),false);
|
logError(errMsg.c_str(),false);
|
||||||
|
|
||||||
if(gotStackTrace == true) {
|
if(gotStackTrace == true) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,errMsg.c_str());
|
SystemFlags::OutputDebug(SystemFlags::debugError,"In [%s::%s Line: %d] [%s]\n",__FILE__,__FUNCTION__,__LINE__,errMsg.c_str());
|
||||||
}
|
}
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%s]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,errMsg.c_str());
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%s]\n",__FILE__,__FUNCTION__,__LINE__,errMsg.c_str());
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
//abort();
|
//abort();
|
||||||
|
|
||||||
if(mainProgram && gameInitialized == true) {
|
if(mainProgram && gameInitialized == true) {
|
||||||
//printf("\nprogram->getState() [%p]\n",program->getState());
|
//printf("\nprogram->getState() [%p]\n",program->getState());
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(mainProgram->getState() != NULL) {
|
if(mainProgram->getState() != NULL) {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
mainProgram->showMessage(errMsg.c_str());
|
mainProgram->showMessage(errMsg.c_str());
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(glActiveTexture != NULL) {
|
if(glActiveTexture != NULL) {
|
||||||
for(;GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false && mainProgram->isMessageShowing();) {
|
for(;GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false && mainProgram->isMessageShowing();) {
|
||||||
@@ -694,9 +694,9 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
mainProgram->showMessage(errMsg.c_str());
|
mainProgram->showMessage(errMsg.c_str());
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(glActiveTexture != NULL) {
|
if(glActiveTexture != NULL) {
|
||||||
for(;GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false && mainProgram->isMessageShowing();) {
|
for(;GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false && mainProgram->isMessageShowing();) {
|
||||||
@@ -715,10 +715,10 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
string err = "#2 An error occurred and ";
|
string err = "#2 An error occurred and ";
|
||||||
if(sdl_quitCalled == false) {
|
if(sdl_quitCalled == false) {
|
||||||
@@ -731,19 +731,19 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
err += string(", attaching the generated ") + getCrashDumpFileName() + string(" file.");
|
err += string(", attaching the generated ") + getCrashDumpFileName() + string(" file.");
|
||||||
#endif
|
#endif
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
message(err);
|
message(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
// Now try to shutdown threads if possible
|
// Now try to shutdown threads if possible
|
||||||
delete mainProgram;
|
delete mainProgram;
|
||||||
mainProgram = NULL;
|
mainProgram = NULL;
|
||||||
// END
|
// END
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
@@ -756,20 +756,20 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||||||
inErrorNow = false;
|
inErrorNow = false;
|
||||||
throw runtimeErrorMsg;
|
throw runtimeErrorMsg;
|
||||||
#endif
|
#endif
|
||||||
//printf("In [%s::%s Line: %d] [%s] gameInitialized = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,gameInitialized);
|
//printf("In [%s::%s Line: %d] [%s] gameInitialized = %d\n",__FILE__,__FUNCTION__,__LINE__,msg,gameInitialized);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
cleanupProcessObjects();
|
cleanupProcessObjects();
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(sdl_quitCalled == false) {
|
if(sdl_quitCalled == false) {
|
||||||
sdl_quitCalled = true;
|
sdl_quitCalled = true;
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
inErrorNow = false;
|
inErrorNow = false;
|
||||||
|
|
||||||
@@ -777,22 +777,22 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ExceptionHandler::DisplayMessage(const char *msg, bool exitApp) {
|
int ExceptionHandler::DisplayMessage(const char *msg, bool exitApp) {
|
||||||
//printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,exitApp);
|
//printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",__FILE__,__FUNCTION__,__LINE__,msg,exitApp);
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,exitApp);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",__FILE__,__FUNCTION__,__LINE__,msg,exitApp);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] msg [%s] exitApp = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,exitApp);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] msg [%s] exitApp = %d\n",__FILE__,__FUNCTION__,__LINE__,msg,exitApp);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,exitApp);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",__FILE__,__FUNCTION__,__LINE__,msg,exitApp);
|
||||||
|
|
||||||
if(mainProgram && gameInitialized == true) {
|
if(mainProgram && gameInitialized == true) {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,exitApp);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",__FILE__,__FUNCTION__,__LINE__,msg,exitApp);
|
||||||
mainProgram->showMessage(msg);
|
mainProgram->showMessage(msg);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,exitApp);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",__FILE__,__FUNCTION__,__LINE__,msg,exitApp);
|
||||||
message(msg);
|
message(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,exitApp);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",__FILE__,__FUNCTION__,__LINE__,msg,exitApp);
|
||||||
|
|
||||||
if(exitApp == true) {
|
if(exitApp == true) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s\n",msg);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s\n",msg);
|
||||||
@@ -802,7 +802,7 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||||||
mainProgram = NULL;
|
mainProgram = NULL;
|
||||||
// END
|
// END
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,exitApp);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",__FILE__,__FUNCTION__,__LINE__,msg,exitApp);
|
||||||
cleanupProcessObjects();
|
cleanupProcessObjects();
|
||||||
|
|
||||||
if(sdl_quitCalled == false) {
|
if(sdl_quitCalled == false) {
|
||||||
@@ -812,7 +812,7 @@ void stackdumper(unsigned int type, EXCEPTION_POINTERS *ep, bool fatalExit) {
|
|||||||
exit(-1);
|
exit(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,msg,exitApp);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] msg [%s] exitApp = %d\n",__FILE__,__FUNCTION__,__LINE__,msg,exitApp);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -830,10 +830,10 @@ MainWindow::MainWindow(Program *program) : WindowGl() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
MainWindow::~MainWindow(){
|
MainWindow::~MainWindow(){
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
delete program;
|
delete program;
|
||||||
program = NULL;
|
program = NULL;
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::eventMouseDown(int x, int y, MouseButton mouseButton){
|
void MainWindow::eventMouseDown(int x, int y, MouseButton mouseButton){
|
||||||
@@ -864,7 +864,7 @@ void MainWindow::eventMouseDown(int x, int y, MouseButton mouseButton){
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
switch(mouseButton) {
|
switch(mouseButton) {
|
||||||
case mbLeft:
|
case mbLeft:
|
||||||
@@ -880,7 +880,7 @@ void MainWindow::eventMouseDown(int x, int y, MouseButton mouseButton){
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
ProgramState *programState = program->getState();
|
ProgramState *programState = program->getState();
|
||||||
if(programState != NULL) {
|
if(programState != NULL) {
|
||||||
@@ -897,13 +897,13 @@ void MainWindow::eventMouseDown(int x, int y, MouseButton mouseButton){
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::eventMouseUp(int x, int y, MouseButton mouseButton){
|
void MainWindow::eventMouseUp(int x, int y, MouseButton mouseButton){
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
const Metrics &metrics = Metrics::getInstance();
|
const Metrics &metrics = Metrics::getInstance();
|
||||||
int vx = metrics.toVirtualX(x);
|
int vx = metrics.toVirtualX(x);
|
||||||
@@ -913,14 +913,14 @@ void MainWindow::eventMouseUp(int x, int y, MouseButton mouseButton){
|
|||||||
throw megaglest_runtime_error("In [MainWindow::eventMouseUp] ERROR, program == NULL!");
|
throw megaglest_runtime_error("In [MainWindow::eventMouseUp] ERROR, program == NULL!");
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
ProgramState *programState = program->getState();
|
ProgramState *programState = program->getState();
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(programState != NULL) {
|
if(programState != NULL) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
switch(mouseButton) {
|
switch(mouseButton) {
|
||||||
case mbLeft:
|
case mbLeft:
|
||||||
@@ -935,13 +935,13 @@ void MainWindow::eventMouseUp(int x, int y, MouseButton mouseButton){
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::eventMouseDoubleClick(int x, int y, MouseButton mouseButton) {
|
void MainWindow::eventMouseDoubleClick(int x, int y, MouseButton mouseButton) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
const Metrics &metrics= Metrics::getInstance();
|
const Metrics &metrics= Metrics::getInstance();
|
||||||
int vx = metrics.toVirtualX(x);
|
int vx = metrics.toVirtualX(x);
|
||||||
@@ -951,14 +951,14 @@ void MainWindow::eventMouseDoubleClick(int x, int y, MouseButton mouseButton) {
|
|||||||
throw megaglest_runtime_error("In [MainWindow::eventMouseDoubleClick] ERROR, program == NULL!");
|
throw megaglest_runtime_error("In [MainWindow::eventMouseDoubleClick] ERROR, program == NULL!");
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
ProgramState *programState = program->getState();
|
ProgramState *programState = program->getState();
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(programState != NULL) {
|
if(programState != NULL) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
switch(mouseButton){
|
switch(mouseButton){
|
||||||
case mbLeft:
|
case mbLeft:
|
||||||
@@ -974,9 +974,9 @@ void MainWindow::eventMouseDoubleClick(int x, int y, MouseButton mouseButton) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::eventMouseMove(int x, int y, const MouseState *ms){
|
void MainWindow::eventMouseMove(int x, int y, const MouseState *ms){
|
||||||
@@ -999,7 +999,7 @@ void MainWindow::eventMouseMove(int x, int y, const MouseState *ms){
|
|||||||
|
|
||||||
void MainWindow::eventMouseWheel(int x, int y, int zDelta) {
|
void MainWindow::eventMouseWheel(int x, int y, int zDelta) {
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
const Metrics &metrics= Metrics::getInstance();
|
const Metrics &metrics= Metrics::getInstance();
|
||||||
int vx = metrics.toVirtualX(x);
|
int vx = metrics.toVirtualX(x);
|
||||||
@@ -1015,7 +1015,7 @@ void MainWindow::eventMouseWheel(int x, int y, int zDelta) {
|
|||||||
programState->eventMouseWheel(vx, vy, zDelta);
|
programState->eventMouseWheel(vx, vy, zDelta);
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::render() {
|
void MainWindow::render() {
|
||||||
@@ -1115,13 +1115,13 @@ void MainWindow::toggleLanguage(string language) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
|
void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,key.keysym.sym);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key.keysym.sym);
|
||||||
|
|
||||||
//SDL_keysym keystate = Window::getKeystate();
|
//SDL_keysym keystate = Window::getKeystate();
|
||||||
SDL_keysym keystate = key.keysym;
|
SDL_keysym keystate = key.keysym;
|
||||||
//printf("keystate.mod = %d key = %d lalt [%d] ralt [%d] alt [%d]\n",keystate.mod,key.keysym.unicode,(keystate.mod & KMOD_LALT),(keystate.mod & KMOD_RALT),(keystate.mod & KMOD_ALT));
|
//printf("keystate.mod = %d key = %d lalt [%d] ralt [%d] alt [%d]\n",keystate.mod,key.keysym.unicode,(keystate.mod & KMOD_LALT),(keystate.mod & KMOD_RALT),(keystate.mod & KMOD_ALT));
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c][%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,key,key);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] key = [%c][%d]\n",__FILE__,__FUNCTION__,__LINE__,key,key);
|
||||||
|
|
||||||
if(program == NULL) {
|
if(program == NULL) {
|
||||||
throw megaglest_runtime_error("In [MainWindow::eventKeyDown] ERROR, program == NULL!");
|
throw megaglest_runtime_error("In [MainWindow::eventKeyDown] ERROR, program == NULL!");
|
||||||
@@ -1140,12 +1140,12 @@ void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
|
|||||||
|
|
||||||
program->keyDown(key);
|
program->keyDown(key);
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(keystate.mod & (KMOD_LALT | KMOD_RALT)) {
|
if(keystate.mod & (KMOD_LALT | KMOD_RALT)) {
|
||||||
//if(key == vkReturn) {
|
//if(key == vkReturn) {
|
||||||
if(isKeyPressed(SDLK_RETURN,key) == true) {
|
if(isKeyPressed(SDLK_RETURN,key) == true) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] ALT-ENTER pressed\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] ALT-ENTER pressed\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
// This stupidity only required in win32.
|
// This stupidity only required in win32.
|
||||||
// We reload the textures so that the canvas paints textures properly
|
// We reload the textures so that the canvas paints textures properly
|
||||||
@@ -1156,12 +1156,12 @@ void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(program != NULL && program->isInSpecialKeyCaptureEvent() == false) {
|
if(program != NULL && program->isInSpecialKeyCaptureEvent() == false) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
vector<int> modifiersToCheck;
|
vector<int> modifiersToCheck;
|
||||||
modifiersToCheck.push_back(KMOD_LCTRL);
|
modifiersToCheck.push_back(KMOD_LCTRL);
|
||||||
@@ -1244,7 +1244,7 @@ void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
|
|||||||
snprintf(szBuf,8096,"Screenshot will be saved to: %s",path.c_str());
|
snprintf(szBuf,8096,"Screenshot will be saved to: %s",path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] %s\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,szBuf);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] %s\n",__FILE__,__FUNCTION__,__LINE__,szBuf);
|
||||||
|
|
||||||
bool showScreenshotSavedMsg = Config::getInstance().getBool("DisableScreenshotConsoleText","false");
|
bool showScreenshotSavedMsg = Config::getInstance().getBool("DisableScreenshotConsoleText","false");
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Screenshot console showScreenshotSavedMsg = %d\n",showScreenshotSavedMsg);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Screenshot console showScreenshotSavedMsg = %d\n",showScreenshotSavedMsg);
|
||||||
@@ -1267,21 +1267,21 @@ void MainWindow::eventKeyDown(SDL_KeyboardEvent key) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::eventKeyUp(SDL_KeyboardEvent key) {
|
void MainWindow::eventKeyUp(SDL_KeyboardEvent key) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,key);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key);
|
||||||
if(program == NULL) {
|
if(program == NULL) {
|
||||||
throw megaglest_runtime_error("In [MainWindow::eventKeyUp] ERROR, program == NULL!");
|
throw megaglest_runtime_error("In [MainWindow::eventKeyUp] ERROR, program == NULL!");
|
||||||
}
|
}
|
||||||
|
|
||||||
program->keyUp(key);
|
program->keyUp(key);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,key);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d]\n",__FILE__,__FUNCTION__,__LINE__,key);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::eventKeyPress(SDL_KeyboardEvent c) {
|
void MainWindow::eventKeyPress(SDL_KeyboardEvent c) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d]\n",__FILE__,__FUNCTION__,__LINE__,c);
|
||||||
if(program == NULL) {
|
if(program == NULL) {
|
||||||
throw megaglest_runtime_error("In [MainWindow::eventKeyPress] ERROR, program == NULL!");
|
throw megaglest_runtime_error("In [MainWindow::eventKeyPress] ERROR, program == NULL!");
|
||||||
}
|
}
|
||||||
@@ -1289,12 +1289,12 @@ void MainWindow::eventKeyPress(SDL_KeyboardEvent c) {
|
|||||||
program->keyPress(c);
|
program->keyPress(c);
|
||||||
|
|
||||||
if(program != NULL && program->isInSpecialKeyCaptureEvent() == false) {
|
if(program != NULL && program->isInSpecialKeyCaptureEvent() == false) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
|
Config &configKeys = Config::getInstance(std::pair<ConfigType,ConfigType>(cfgMainKeys,cfgUserKeys));
|
||||||
//if(c == configKeys.getCharKey("HotKeyToggleOSMouseEnabled")) {
|
//if(c == configKeys.getCharKey("HotKeyToggleOSMouseEnabled")) {
|
||||||
if(isKeyPressed(configKeys.getSDLKey("HotKeyToggleOSMouseEnabled"),c) == true) {
|
if(isKeyPressed(configKeys.getSDLKey("HotKeyToggleOSMouseEnabled"),c) == true) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
bool showCursorState = false;
|
bool showCursorState = false;
|
||||||
int state = SDL_ShowCursor(SDL_QUERY);
|
int state = SDL_ShowCursor(SDL_QUERY);
|
||||||
@@ -1307,10 +1307,10 @@ void MainWindow::eventKeyPress(SDL_KeyboardEvent c) {
|
|||||||
renderer.setNo2DMouseRendering(showCursorState);
|
renderer.setNo2DMouseRendering(showCursorState);
|
||||||
|
|
||||||
Window::lastShowMouseState = SDL_ShowCursor(SDL_QUERY);
|
Window::lastShowMouseState = SDL_ShowCursor(SDL_QUERY);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::lastShowMouseState = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,Window::lastShowMouseState);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Window::lastShowMouseState = %d\n",__FILE__,__FUNCTION__,__LINE__,Window::lastShowMouseState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,c);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] [%d]\n",__FILE__,__FUNCTION__,__LINE__,c);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::eventActivate(bool active) {
|
void MainWindow::eventActivate(bool active) {
|
||||||
@@ -4136,7 +4136,7 @@ int glestMain(int argc, char** argv) {
|
|||||||
// Setup debug logging etc
|
// Setup debug logging etc
|
||||||
setupLogging(config, haveSpecialOutputCommandLineOption);
|
setupLogging(config, haveSpecialOutputCommandLineOption);
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::charSet = %d, Font::fontIsMultibyte = %d, fontIsRightToLeft = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,Shared::Graphics::Font::charCount,Shared::Graphics::Font::fontTypeName.c_str(),Shared::Platform::charSet,Shared::Graphics::Font::fontIsMultibyte, Shared::Graphics::Font::fontIsRightToLeft);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::charSet = %d, Font::fontIsMultibyte = %d, fontIsRightToLeft = %d\n",__FILE__,__FUNCTION__,__LINE__,Shared::Graphics::Font::charCount,Shared::Graphics::Font::fontTypeName.c_str(),Shared::Platform::charSet,Shared::Graphics::Font::fontIsMultibyte, Shared::Graphics::Font::fontIsRightToLeft);
|
||||||
|
|
||||||
NetworkInterface::setDisplayMessageFunction(ExceptionHandler::DisplayMessage);
|
NetworkInterface::setDisplayMessageFunction(ExceptionHandler::DisplayMessage);
|
||||||
MenuStateMasterserver::setDisplayMessageFunction(ExceptionHandler::DisplayMessage);
|
MenuStateMasterserver::setDisplayMessageFunction(ExceptionHandler::DisplayMessage);
|
||||||
@@ -4147,7 +4147,7 @@ int glestMain(int argc, char** argv) {
|
|||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s, STREFLOP NOT enabled.\n",getNetworkVersionString().c_str());
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s, STREFLOP NOT enabled.\n",getNetworkVersionString().c_str());
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugUnitCommands,"START\n");
|
SystemFlags::OutputDebug(SystemFlags::debugUnitCommands,"START\n");
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugPathFinder,"START\n");
|
SystemFlags::OutputDebug(SystemFlags::debugPathFinder,"START\n");
|
||||||
|
|
||||||
@@ -4157,7 +4157,7 @@ int glestMain(int argc, char** argv) {
|
|||||||
std::pair<string,string>(Config::glestkeys_ini_filename,Config::glestuserkeys_ini_filename),
|
std::pair<string,string>(Config::glestkeys_ini_filename,Config::glestuserkeys_ini_filename),
|
||||||
std::pair<bool,bool>(true,false));
|
std::pair<bool,bool>(true,false));
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SHOW_INI_SETTINGS]) == true) {
|
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SHOW_INI_SETTINGS]) == true) {
|
||||||
ShowINISettings(argc,argv,config,configKeys);
|
ShowINISettings(argc,argv,config,configKeys);
|
||||||
@@ -4310,7 +4310,7 @@ int glestMain(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::charSet = %d, Font::fontIsMultibyte = %d, Font::fontIsRightToLeft = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,Shared::Graphics::Font::charCount,Shared::Graphics::Font::fontTypeName.c_str(),Shared::Platform::charSet,Shared::Graphics::Font::fontIsMultibyte,Shared::Graphics::Font::fontIsRightToLeft);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::charSet = %d, Font::fontIsMultibyte = %d, Font::fontIsRightToLeft = %d\n",__FILE__,__FUNCTION__,__LINE__,Shared::Graphics::Font::charCount,Shared::Graphics::Font::fontTypeName.c_str(),Shared::Platform::charSet,Shared::Graphics::Font::fontIsMultibyte,Shared::Graphics::Font::fontIsRightToLeft);
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Using Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::charSet = %d, Font::fontIsMultibyte = %d, Font::fontIsRightToLeft = %d\n",Shared::Graphics::Font::charCount,Shared::Graphics::Font::fontTypeName.c_str(),Shared::Platform::charSet,Shared::Graphics::Font::fontIsMultibyte,Shared::Graphics::Font::fontIsRightToLeft);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("Using Font::charCount = %d, Font::fontTypeName [%s] Shared::Platform::charSet = %d, Font::fontIsMultibyte = %d, Font::fontIsRightToLeft = %d\n",Shared::Graphics::Font::charCount,Shared::Graphics::Font::fontTypeName.c_str(),Shared::Platform::charSet,Shared::Graphics::Font::fontIsMultibyte,Shared::Graphics::Font::fontIsRightToLeft);
|
||||||
|
|
||||||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_USE_FONT]) == true) {
|
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_USE_FONT]) == true) {
|
||||||
@@ -4342,7 +4342,7 @@ int glestMain(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SHOW_MAP_CRC]) == true) {
|
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_SHOW_MAP_CRC]) == true) {
|
||||||
int foundParamIndIndex = -1;
|
int foundParamIndIndex = -1;
|
||||||
@@ -4790,7 +4790,7 @@ int glestMain(int argc, char** argv) {
|
|||||||
|
|
||||||
if(SystemFlags::getSystemSettingType(SystemFlags::debugPathFinder).enabled == true) {
|
if(SystemFlags::getSystemSettingType(SystemFlags::debugPathFinder).enabled == true) {
|
||||||
renderer.setAllowRenderUnitTitles(SystemFlags::getSystemSettingType(SystemFlags::debugPathFinder).enabled);
|
renderer.setAllowRenderUnitTitles(SystemFlags::getSystemSettingType(SystemFlags::debugPathFinder).enabled);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugPathFinder,"In [%s::%s Line: %d] renderer.setAllowRenderUnitTitles = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,SystemFlags::getSystemSettingType(SystemFlags::debugPathFinder).enabled);
|
SystemFlags::OutputDebug(SystemFlags::debugPathFinder,"In [%s::%s Line: %d] renderer.setAllowRenderUnitTitles = %d\n",__FILE__,__FUNCTION__,__LINE__,SystemFlags::getSystemSettingType(SystemFlags::debugPathFinder).enabled);
|
||||||
}
|
}
|
||||||
renderer.setAllowRenderUnitTitles(true);
|
renderer.setAllowRenderUnitTitles(true);
|
||||||
|
|
||||||
@@ -4818,13 +4818,13 @@ int glestMain(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
// Cache Player textures - END
|
// Cache Player textures - END
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
mainWindow= new MainWindow(program);
|
mainWindow= new MainWindow(program);
|
||||||
|
|
||||||
mainWindow->setUseDefaultCursorOnly(config.getBool("No2DMouseRendering","false"));
|
mainWindow->setUseDefaultCursorOnly(config.getBool("No2DMouseRendering","false"));
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
GameSettings startupGameSettings;
|
GameSettings startupGameSettings;
|
||||||
|
|
||||||
@@ -5039,11 +5039,11 @@ int glestMain(int argc, char** argv) {
|
|||||||
program->initNormal(mainWindow);
|
program->initNormal(mainWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
// Initialize Renderer
|
// Initialize Renderer
|
||||||
//Renderer &renderer= Renderer::getInstance();
|
//Renderer &renderer= Renderer::getInstance();
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] OpenGL Info:\n%s\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,renderer.getGlInfo().c_str());
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] OpenGL Info:\n%s\n",__FILE__,__FUNCTION__,__LINE__,renderer.getGlInfo().c_str());
|
||||||
|
|
||||||
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_OPENGL_INFO]) == true) {
|
if(hasCommandArgument(argc, argv,GAME_ARGS[GAME_ARG_OPENGL_INFO]) == true) {
|
||||||
//Renderer &renderer= Renderer::getInstance();
|
//Renderer &renderer= Renderer::getInstance();
|
||||||
@@ -5213,11 +5213,11 @@ int glestMain(int argc, char** argv) {
|
|||||||
// endPathWithSlash(userData);
|
// endPathWithSlash(userData);
|
||||||
// }
|
// }
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
CheckForDuplicateData();
|
CheckForDuplicateData();
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
//throw "BLAH!";
|
//throw "BLAH!";
|
||||||
|
|
||||||
@@ -5226,8 +5226,8 @@ int glestMain(int argc, char** argv) {
|
|||||||
//printf("%d\n", *foo); // causes segfault
|
//printf("%d\n", *foo); // causes segfault
|
||||||
// END
|
// END
|
||||||
bool startCRCPrecacheThread = config.getBool("PreCacheCRCThread","true");
|
bool startCRCPrecacheThread = config.getBool("PreCacheCRCThread","true");
|
||||||
//printf("### In [%s::%s Line: %d] precache thread enabled = %d SystemFlags::VERBOSE_MODE_ENABLED = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,startCRCPrecacheThread,SystemFlags::VERBOSE_MODE_ENABLED);
|
//printf("### In [%s::%s Line: %d] precache thread enabled = %d SystemFlags::VERBOSE_MODE_ENABLED = %d\n",__FILE__,__FUNCTION__,__LINE__,startCRCPrecacheThread,SystemFlags::VERBOSE_MODE_ENABLED);
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] precache thread enabled = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,startCRCPrecacheThread);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] precache thread enabled = %d\n",__FILE__,__FUNCTION__,__LINE__,startCRCPrecacheThread);
|
||||||
if(startCRCPrecacheThread == true) {
|
if(startCRCPrecacheThread == true) {
|
||||||
vector<string> techDataPaths = config.getPathListForType(ptTechs);
|
vector<string> techDataPaths = config.getPathListForType(ptTechs);
|
||||||
static string mutexOwnerId = string(extractFileFromDirectoryPath(__FILE__).c_str()) + string("_") + intToStr(__LINE__);
|
static string mutexOwnerId = string(extractFileFromDirectoryPath(__FILE__).c_str()) + string("_") + intToStr(__LINE__);
|
||||||
@@ -5397,7 +5397,7 @@ int glestMain(int argc, char** argv) {
|
|||||||
printf("\nHeadless server is about to quit...\n");
|
printf("\nHeadless server is about to quit...\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] starting normal application shutdown\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d] starting normal application shutdown\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
|
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
|
||||||
soundThreadManager = program->getSoundThreadManager(true);
|
soundThreadManager = program->getSoundThreadManager(true);
|
||||||
@@ -5409,11 +5409,11 @@ int glestMain(int argc, char** argv) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
cleanupCRCThread();
|
cleanupCRCThread();
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
showCursor(true);
|
showCursor(true);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
}
|
}
|
||||||
catch(const megaglest_runtime_error &e) {
|
catch(const megaglest_runtime_error &e) {
|
||||||
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
|
if(GlobalStaticFlags::getIsNonGraphicalModeEnabled() == false) {
|
||||||
@@ -5480,25 +5480,25 @@ int glestMain(int argc, char** argv) {
|
|||||||
|
|
||||||
cleanupCRCThread();
|
cleanupCRCThread();
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
//printf("Closing IRC CLient %d\n",__LINE__);
|
//printf("Closing IRC CLient %d\n",__LINE__);
|
||||||
|
|
||||||
delete mainWindow;
|
delete mainWindow;
|
||||||
mainWindow = NULL;
|
mainWindow = NULL;
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
//showCursor(true);
|
//showCursor(true);
|
||||||
//restoreVideoMode(true);
|
//restoreVideoMode(true);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
GraphicComponent::clearRegisteredComponents();
|
GraphicComponent::clearRegisteredComponents();
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
//printf("Closing IRC CLient %d\n",__LINE__);
|
//printf("Closing IRC CLient %d\n",__LINE__);
|
||||||
|
|
||||||
@@ -5525,7 +5525,7 @@ int glestMain(int argc, char** argv) {
|
|||||||
#if defined(__GNUC__) && !defined(__FreeBSD__) && !defined(BSD)
|
#if defined(__GNUC__) && !defined(__FreeBSD__) && !defined(BSD)
|
||||||
void handleSIGSEGV(int sig) {
|
void handleSIGSEGV(int sig) {
|
||||||
char szBuf[8096]="";
|
char szBuf[8096]="";
|
||||||
snprintf(szBuf, 8096,"In [%s::%s Line: %d] Error detected: signal %d:\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__, sig);
|
snprintf(szBuf, 8096,"In [%s::%s Line: %d] Error detected: signal %d:\n",__FILE__,__FUNCTION__,__LINE__, sig);
|
||||||
printf("%s",szBuf);
|
printf("%s",szBuf);
|
||||||
//abort();
|
//abort();
|
||||||
|
|
||||||
@@ -5623,17 +5623,17 @@ __try {
|
|||||||
IRCThread::setGlobalCacheContainerName(GameConstants::ircClientCacheLookupKey);
|
IRCThread::setGlobalCacheContainerName(GameConstants::ircClientCacheLookupKey);
|
||||||
int result = glestMain(argc, argv);
|
int result = glestMain(argc, argv);
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
cleanupProcessObjects();
|
cleanupProcessObjects();
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(sdl_quitCalled == false) {
|
if(sdl_quitCalled == false) {
|
||||||
sdl_quitCalled = true;
|
sdl_quitCalled = true;
|
||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
if(SystemFlags::VERBOSE_MODE_ENABLED) printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
return result;
|
return result;
|
||||||
#ifdef WIN32_STACK_TRACE
|
#ifdef WIN32_STACK_TRACE
|
||||||
} __except(stackdumper(0, GetExceptionInformation(),true), EXCEPTION_CONTINUE_SEARCH) { return 0; }
|
} __except(stackdumper(0, GetExceptionInformation(),true), EXCEPTION_CONTINUE_SEARCH) { return 0; }
|
||||||
|
@@ -4490,14 +4490,22 @@ Unit * Unit::loadGame(const XmlNode *rootNode, GameSettings *settings, Faction *
|
|||||||
try {
|
try {
|
||||||
result->progress = unitNode->getAttribute("progress")->getIntValue();
|
result->progress = unitNode->getAttribute("progress")->getIntValue();
|
||||||
}
|
}
|
||||||
|
#ifdef WIN32
|
||||||
|
catch(const exception &) {
|
||||||
|
#else
|
||||||
catch(const exception &ex) {
|
catch(const exception &ex) {
|
||||||
|
#endif
|
||||||
result->progress = unitNode->getAttribute("progress")->getFloatValue();
|
result->progress = unitNode->getAttribute("progress")->getFloatValue();
|
||||||
}
|
}
|
||||||
// float lastAnimProgress; //between 0 and 1
|
// float lastAnimProgress; //between 0 and 1
|
||||||
try {
|
try {
|
||||||
result->lastAnimProgress = unitNode->getAttribute("lastAnimProgress")->getIntValue();
|
result->lastAnimProgress = unitNode->getAttribute("lastAnimProgress")->getIntValue();
|
||||||
}
|
}
|
||||||
|
#ifdef WIN32
|
||||||
|
catch(const exception &) {
|
||||||
|
#else
|
||||||
catch(const exception &ex) {
|
catch(const exception &ex) {
|
||||||
|
#endif
|
||||||
result->lastAnimProgress = unitNode->getAttribute("lastAnimProgress")->getFloatValue();
|
result->lastAnimProgress = unitNode->getAttribute("lastAnimProgress")->getFloatValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4505,7 +4513,11 @@ Unit * Unit::loadGame(const XmlNode *rootNode, GameSettings *settings, Faction *
|
|||||||
try {
|
try {
|
||||||
result->animProgress = unitNode->getAttribute("animProgress")->getIntValue();
|
result->animProgress = unitNode->getAttribute("animProgress")->getIntValue();
|
||||||
}
|
}
|
||||||
|
#ifdef WIN32
|
||||||
|
catch(const exception &) {
|
||||||
|
#else
|
||||||
catch(const exception &ex) {
|
catch(const exception &ex) {
|
||||||
|
#endif
|
||||||
result->animProgress = unitNode->getAttribute("animProgress")->getFloatValue();
|
result->animProgress = unitNode->getAttribute("animProgress")->getFloatValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -58,7 +58,8 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
SDL_Thread* thread;
|
SDL_Thread* thread;
|
||||||
std::auto_ptr<Mutex> mutexthreadAccessor;
|
//std::auto_ptr<Mutex> mutexthreadAccessor;
|
||||||
|
Mutex *mutexthreadAccessor;
|
||||||
bool threadObjectValid();
|
bool threadObjectValid();
|
||||||
|
|
||||||
bool deleteAfterExecute;
|
bool deleteAfterExecute;
|
||||||
|
@@ -187,7 +187,7 @@ void Thread::shutdownThreads() {
|
|||||||
Thread::~Thread() {
|
Thread::~Thread() {
|
||||||
if(Thread::getEnableVerboseMode()) printf("In ~Thread Line: %d [%p] thread = %p\n",__LINE__,this,thread);
|
if(Thread::getEnableVerboseMode()) printf("In ~Thread Line: %d [%p] thread = %p\n",__LINE__,this,thread);
|
||||||
|
|
||||||
MutexSafeWrapper safeMutex(mutexthreadAccessor.get());
|
MutexSafeWrapper safeMutex(mutexthreadAccessor);
|
||||||
if(thread != NULL) {
|
if(thread != NULL) {
|
||||||
SDL_WaitThread(thread, NULL);
|
SDL_WaitThread(thread, NULL);
|
||||||
thread = NULL;
|
thread = NULL;
|
||||||
@@ -198,6 +198,8 @@ Thread::~Thread() {
|
|||||||
|
|
||||||
removeThreadFromList();
|
removeThreadFromList();
|
||||||
|
|
||||||
|
delete mutexthreadAccessor;
|
||||||
|
mutexthreadAccessor = NULL;
|
||||||
if(Thread::getEnableVerboseMode()) printf("In ~Thread Line: %d [%p] thread = %p\n",__LINE__,this,thread);
|
if(Thread::getEnableVerboseMode()) printf("In ~Thread Line: %d [%p] thread = %p\n",__LINE__,this,thread);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -210,7 +212,7 @@ std::vector<Thread *> Thread::getThreadList() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Thread::start() {
|
void Thread::start() {
|
||||||
MutexSafeWrapper safeMutex(mutexthreadAccessor.get());
|
MutexSafeWrapper safeMutex(mutexthreadAccessor);
|
||||||
|
|
||||||
BaseThread *base_thread = dynamic_cast<BaseThread *>(this);
|
BaseThread *base_thread = dynamic_cast<BaseThread *>(this);
|
||||||
if(base_thread) base_thread->setStarted(true);
|
if(base_thread) base_thread->setStarted(true);
|
||||||
@@ -229,7 +231,7 @@ void Thread::start() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Thread::threadObjectValid() {
|
bool Thread::threadObjectValid() {
|
||||||
MutexSafeWrapper safeMutex(mutexthreadAccessor.get());
|
MutexSafeWrapper safeMutex(mutexthreadAccessor);
|
||||||
return (thread != NULL);
|
return (thread != NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -328,7 +330,7 @@ void Thread::queueAutoCleanThread() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Thread::kill() {
|
void Thread::kill() {
|
||||||
MutexSafeWrapper safeMutex(mutexthreadAccessor.get());
|
MutexSafeWrapper safeMutex(mutexthreadAccessor);
|
||||||
SDL_KillThread(thread);
|
SDL_KillThread(thread);
|
||||||
thread = NULL;
|
thread = NULL;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user