bugfix for startup errors to properly display on both windows and linux

This commit is contained in:
Mark Vejvoda
2010-03-23 08:56:41 +00:00
parent 221b099c67
commit 270ff57512

View File

@@ -32,6 +32,7 @@ using namespace Shared::Util;
namespace Glest{ namespace Game{ namespace Glest{ namespace Game{
string debugLogFile = ""; string debugLogFile = "";
bool gameInitialized = false;
// ===================================================== // =====================================================
// class ExceptionHandler // class ExceptionHandler
@@ -44,7 +45,7 @@ public:
SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s\n",msg.c_str()); SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s\n",msg.c_str());
Program *program = Program::getInstance(); Program *program = Program::getInstance();
if(program) { if(program && gameInitialized == true) {
//SystemFlags::Close(); //SystemFlags::Close();
program->showMessage(msg.c_str()); program->showMessage(msg.c_str());
} }
@@ -56,7 +57,7 @@ public:
SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s\n",msg); SystemFlags::OutputDebug(SystemFlags::debugSystem,"%s\n",msg);
Program *program = Program::getInstance(); Program *program = Program::getInstance();
if(program) { if(program && gameInitialized == true) {
//SystemFlags::Close(); //SystemFlags::Close();
program->showMessage(msg); program->showMessage(msg);
} }
@@ -71,7 +72,7 @@ public:
static int DisplayMessage(const char *msg, bool exitApp) { static int DisplayMessage(const char *msg, bool exitApp) {
Program *program = Program::getInstance(); Program *program = Program::getInstance();
if(program) { if(program && gameInitialized == true) {
program->showMessage(msg); program->showMessage(msg);
} }
else { else {
@@ -213,6 +214,7 @@ int glestMain(int argc, char** argv){
//throw runtime_error("test!"); //throw runtime_error("test!");
//ExceptionHandler::DisplayMessage("test!", false); //ExceptionHandler::DisplayMessage("test!", false);
gameInitialized = true;
//main loop //main loop
while(Window::handleEvent()){ while(Window::handleEvent()){
program->loop(); program->loop();