diff --git a/source/glest_game/main/main.cpp b/source/glest_game/main/main.cpp index 5c4af463..251f4c2e 100644 --- a/source/glest_game/main/main.cpp +++ b/source/glest_game/main/main.cpp @@ -4996,8 +4996,6 @@ int glestMain(int argc, char** argv) { mainWindow= new MainWindow(program); - mainWindow->setUseDefaultCursorOnly(config.getBool("No2DMouseRendering","false")); - SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__); GameSettings startupGameSettings; @@ -5247,7 +5245,6 @@ int glestMain(int argc, char** argv) { } showCursor(true); - mainWindow->setUseDefaultCursorOnly(true); const Metrics &metrics= Metrics::getInstance(); renderer.clearBuffers(); diff --git a/source/glest_game/main/program.cpp b/source/glest_game/main/program.cpp index bb232ca4..7e991318 100644 --- a/source/glest_game/main/program.cpp +++ b/source/glest_game/main/program.cpp @@ -203,12 +203,13 @@ Program::Program() { void Program::initNormal(WindowGl *window){ if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); - + Config &config = Config::getInstance(); init(window); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); setState(new Intro(this)); + showCursor(config.getBool("No2DMouseRendering","false")); if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); } @@ -603,7 +604,6 @@ void Program::setState(ProgramState *programStateNew, bool cleanupOldState) { this->programStateOldSystemError = this->programState; bool msgBoxEnabled = msgBox.getEnabled(); - bool showingOSCursor = isCursorShowing(); if(dynamic_cast(programStateNew) != NULL) { if(SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__); @@ -666,16 +666,11 @@ void Program::setState(ProgramState *programStateNew, bool cleanupOldState) { updateCameraTimer.reset(); fpsTimer.reset(); - if(showingOSCursor == false) { - Config &config = Config::getInstance(); - if(config.getBool("No2DMouseRendering","false") == false) { - showCursor(false); - } - sleep(0); - - if(dynamic_cast(programStateNew) != NULL && msgBoxEnabled == true) { - showCursor(true); - } + Config &config = Config::getInstance(); + if(dynamic_cast(programStateNew) != NULL && msgBoxEnabled == true) { + showCursor(true); + } else { + showCursor(config.getBool("No2DMouseRendering","false")); } this->programStateOldSystemError = NULL; diff --git a/source/shared_lib/include/platform/sdl/window.h b/source/shared_lib/include/platform/sdl/window.h index 8b164f69..8669cefa 100644 --- a/source/shared_lib/include/platform/sdl/window.h +++ b/source/shared_lib/include/platform/sdl/window.h @@ -124,7 +124,6 @@ private: protected: //int w, h; static bool isActive; - static bool no2DMouseRendering; static bool allowAltEnterFullscreenToggle; static int lastShowMouseState; @@ -187,9 +186,6 @@ public: void destroy(); void minimize(); - static void setUseDefaultCursorOnly(bool value) { no2DMouseRendering = value; } - static bool getUseDefaultCursorOnly() { return no2DMouseRendering; } - static void setAllowAltEnterFullscreenToggle(bool value) { allowAltEnterFullscreenToggle = value; } static bool getAllowAltEnterFullscreenToggle() { return allowAltEnterFullscreenToggle; } diff --git a/source/shared_lib/sources/platform/common/platform_common.cpp b/source/shared_lib/sources/platform/common/platform_common.cpp index aa38bc94..dc934d25 100644 --- a/source/shared_lib/sources/platform/common/platform_common.cpp +++ b/source/shared_lib/sources/platform/common/platform_common.cpp @@ -1685,7 +1685,7 @@ void showCursor(bool b) { if(isCursorShowing() == b) { return; } - + //printf("showCursor(bool b) b=%d\n",b); SDL_ShowCursor(b == true ? SDL_ENABLE : SDL_DISABLE); } diff --git a/source/shared_lib/sources/platform/sdl/window.cpp b/source/shared_lib/sources/platform/sdl/window.cpp index 94b31477..6554a683 100644 --- a/source/shared_lib/sources/platform/sdl/window.cpp +++ b/source/shared_lib/sources/platform/sdl/window.cpp @@ -50,7 +50,6 @@ bool Window::isFullScreen = false; SDL_keysym Window::keystate; bool Window::isActive = false; -bool Window::no2DMouseRendering = false; #ifdef WIN32 bool Window::allowAltEnterFullscreenToggle = false; #else @@ -428,7 +427,7 @@ bool Window::handleEvent() { // bool willShowCursor = (!Window::isActive || (Window::lastShowMouseState == SDL_ENABLE) || Window::getUseDefaultCursorOnly()); // showCursor(willShowCursor); // } - showCursor(true); + showCursor(false); } break; }