Mouse pointer works a bit better
SDL2 showed native and MG mouse pointer at the same time. Attempt to fix it.
This commit is contained in:
parent
d80ca9e0b2
commit
8991507526
|
@ -4996,8 +4996,6 @@ int glestMain(int argc, char** argv) {
|
||||||
|
|
||||||
mainWindow= new MainWindow(program);
|
mainWindow= new MainWindow(program);
|
||||||
|
|
||||||
mainWindow->setUseDefaultCursorOnly(config.getBool("No2DMouseRendering","false"));
|
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
GameSettings startupGameSettings;
|
GameSettings startupGameSettings;
|
||||||
|
@ -5247,7 +5245,6 @@ int glestMain(int argc, char** argv) {
|
||||||
}
|
}
|
||||||
|
|
||||||
showCursor(true);
|
showCursor(true);
|
||||||
mainWindow->setUseDefaultCursorOnly(true);
|
|
||||||
|
|
||||||
const Metrics &metrics= Metrics::getInstance();
|
const Metrics &metrics= Metrics::getInstance();
|
||||||
renderer.clearBuffers();
|
renderer.clearBuffers();
|
||||||
|
|
|
@ -203,12 +203,13 @@ Program::Program() {
|
||||||
|
|
||||||
void Program::initNormal(WindowGl *window){
|
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__);
|
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);
|
init(window);
|
||||||
|
|
||||||
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",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
setState(new Intro(this));
|
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__);
|
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;
|
this->programStateOldSystemError = this->programState;
|
||||||
bool msgBoxEnabled = msgBox.getEnabled();
|
bool msgBoxEnabled = msgBox.getEnabled();
|
||||||
|
|
||||||
bool showingOSCursor = isCursorShowing();
|
|
||||||
if(dynamic_cast<Game *>(programStateNew) != NULL) {
|
if(dynamic_cast<Game *>(programStateNew) != NULL) {
|
||||||
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",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
@ -666,16 +666,11 @@ void Program::setState(ProgramState *programStateNew, bool cleanupOldState) {
|
||||||
updateCameraTimer.reset();
|
updateCameraTimer.reset();
|
||||||
fpsTimer.reset();
|
fpsTimer.reset();
|
||||||
|
|
||||||
if(showingOSCursor == false) {
|
Config &config = Config::getInstance();
|
||||||
Config &config = Config::getInstance();
|
if(dynamic_cast<Intro *>(programStateNew) != NULL && msgBoxEnabled == true) {
|
||||||
if(config.getBool("No2DMouseRendering","false") == false) {
|
showCursor(true);
|
||||||
showCursor(false);
|
} else {
|
||||||
}
|
showCursor(config.getBool("No2DMouseRendering","false"));
|
||||||
sleep(0);
|
|
||||||
|
|
||||||
if(dynamic_cast<Intro *>(programStateNew) != NULL && msgBoxEnabled == true) {
|
|
||||||
showCursor(true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this->programStateOldSystemError = NULL;
|
this->programStateOldSystemError = NULL;
|
||||||
|
|
|
@ -124,7 +124,6 @@ private:
|
||||||
protected:
|
protected:
|
||||||
//int w, h;
|
//int w, h;
|
||||||
static bool isActive;
|
static bool isActive;
|
||||||
static bool no2DMouseRendering;
|
|
||||||
static bool allowAltEnterFullscreenToggle;
|
static bool allowAltEnterFullscreenToggle;
|
||||||
static int lastShowMouseState;
|
static int lastShowMouseState;
|
||||||
|
|
||||||
|
@ -187,9 +186,6 @@ public:
|
||||||
void destroy();
|
void destroy();
|
||||||
void minimize();
|
void minimize();
|
||||||
|
|
||||||
static void setUseDefaultCursorOnly(bool value) { no2DMouseRendering = value; }
|
|
||||||
static bool getUseDefaultCursorOnly() { return no2DMouseRendering; }
|
|
||||||
|
|
||||||
static void setAllowAltEnterFullscreenToggle(bool value) { allowAltEnterFullscreenToggle = value; }
|
static void setAllowAltEnterFullscreenToggle(bool value) { allowAltEnterFullscreenToggle = value; }
|
||||||
static bool getAllowAltEnterFullscreenToggle() { return allowAltEnterFullscreenToggle; }
|
static bool getAllowAltEnterFullscreenToggle() { return allowAltEnterFullscreenToggle; }
|
||||||
|
|
||||||
|
|
|
@ -1685,7 +1685,7 @@ void showCursor(bool b) {
|
||||||
if(isCursorShowing() == b) {
|
if(isCursorShowing() == b) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
//printf("showCursor(bool b) b=%d\n",b);
|
||||||
SDL_ShowCursor(b == true ? SDL_ENABLE : SDL_DISABLE);
|
SDL_ShowCursor(b == true ? SDL_ENABLE : SDL_DISABLE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,7 +50,6 @@ bool Window::isFullScreen = false;
|
||||||
SDL_keysym Window::keystate;
|
SDL_keysym Window::keystate;
|
||||||
|
|
||||||
bool Window::isActive = false;
|
bool Window::isActive = false;
|
||||||
bool Window::no2DMouseRendering = false;
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
bool Window::allowAltEnterFullscreenToggle = false;
|
bool Window::allowAltEnterFullscreenToggle = false;
|
||||||
#else
|
#else
|
||||||
|
@ -428,7 +427,7 @@ bool Window::handleEvent() {
|
||||||
// bool willShowCursor = (!Window::isActive || (Window::lastShowMouseState == SDL_ENABLE) || Window::getUseDefaultCursorOnly());
|
// bool willShowCursor = (!Window::isActive || (Window::lastShowMouseState == SDL_ENABLE) || Window::getUseDefaultCursorOnly());
|
||||||
// showCursor(willShowCursor);
|
// showCursor(willShowCursor);
|
||||||
// }
|
// }
|
||||||
showCursor(true);
|
showCursor(false);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user