summaryrefslogtreecommitdiffstats
path: root/src/skel/glfw/glfw.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/skel/glfw/glfw.cpp')
-rw-r--r--src/skel/glfw/glfw.cpp53
1 files changed, 36 insertions, 17 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index 920bb8a9..21b5c3c0 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -173,7 +173,11 @@ psCameraBeginUpdate(RwCamera *camera)
void
psCameraShowRaster(RwCamera *camera)
{
- if (CMenuManager::m_PrefsVsync)
+#ifdef LEGACY_MENU_OPTIONS
+ if (FrontEndMenuManager.m_PrefsVsync || FrontEndMenuManager.m_bMenuActive)
+#else
+ if (FrontEndMenuManager.m_PrefsFrameLimiter || FrontEndMenuManager.m_bMenuActive)
+#endif
RwCameraShowRaster(camera, PSGLOBAL(window), rwRASTERFLIPWAITVSYNC);
else
RwCameraShowRaster(camera, PSGLOBAL(window), rwRASTERFLIPDONTWAIT);
@@ -843,12 +847,23 @@ void _InputInitialiseJoys()
}
}
-long _InputInitialiseMouse()
+long _InputInitialiseMouse(bool exclusive)
{
glfwSetInputMode(PSGLOBAL(window), GLFW_CURSOR, GLFW_CURSOR_HIDDEN);
return 0;
}
+void _InputShutdownMouse()
+{
+ // Not needed
+}
+
+bool _InputMouseNeedsExclusive()
+{
+ // That was the cause of infamous mouse bug on Win. Not supported on glfw anyway
+ return false;
+}
+
void psPostRWinit(void)
{
RwVideoMode vm;
@@ -862,7 +877,7 @@ void psPostRWinit(void)
glfwSetJoystickCallback(joysChangeCB);
_InputInitialiseJoys();
- _InputInitialiseMouse();
+ _InputInitialiseMouse(false);
if(!(vm.flags & rwVIDEOMODEEXCLUSIVE))
glfwSetWindowSize(PSGLOBAL(window), RsGlobal.maximumWidth, RsGlobal.maximumHeight);
@@ -1041,7 +1056,7 @@ void InitialiseLanguage()
|| primLayout == LANG_GERMAN )
{
CGame::nastyGame = false;
- CMenuManager::m_PrefsAllowNastyGame = false;
+ FrontEndMenuManager.m_PrefsAllowNastyGame = false;
CGame::germanGame = true;
}
@@ -1050,7 +1065,7 @@ void InitialiseLanguage()
|| primLayout == LANG_FRENCH )
{
CGame::nastyGame = false;
- CMenuManager::m_PrefsAllowNastyGame = false;
+ FrontEndMenuManager.m_PrefsAllowNastyGame = false;
CGame::frenchGame = true;
}
@@ -1061,7 +1076,7 @@ void InitialiseLanguage()
#ifdef NASTY_GAME
CGame::nastyGame = true;
- CMenuManager::m_PrefsAllowNastyGame = true;
+ FrontEndMenuManager.m_PrefsAllowNastyGame = true;
CGame::noProstitutes = false;
#endif
@@ -1096,33 +1111,33 @@ void InitialiseLanguage()
}
}
- CMenuManager::OS_Language = primUserLCID;
+ FrontEndMenuManager.OS_Language = primUserLCID;
switch ( lang )
{
case LANG_GERMAN:
{
- CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_GERMAN;
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_GERMAN;
break;
}
case LANG_SPANISH:
{
- CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_SPANISH;
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_SPANISH;
break;
}
case LANG_FRENCH:
{
- CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_FRENCH;
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_FRENCH;
break;
}
case LANG_ITALIAN:
{
- CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_ITALIAN;
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_ITALIAN;
break;
}
default:
{
- CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_AMERICAN;
+ FrontEndMenuManager.m_PrefsLanguage = CMenuManager::LANGUAGE_AMERICAN;
break;
}
}
@@ -1391,7 +1406,7 @@ WinMain(HINSTANCE instance,
RwChar** argv;
SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE);
-#if 0
+#if 1
// TODO: make this an option somewhere
AllocConsole();
freopen("CONIN$", "r", stdin);
@@ -1520,7 +1535,7 @@ main(int argc, char *argv[])
{
CFileMgr::SetDirMyDocuments();
- int32 gta3set = CFileMgr::OpenFile("gta3.set", "r");
+ int32 gta3set = CFileMgr::OpenFile("gta_vc.set", "r");
if ( gta3set )
{
@@ -1644,7 +1659,7 @@ main(int argc, char *argv[])
FrontEndMenuManager.m_bGameNotLoaded = true;
- CMenuManager::m_bStartUpFrontEndRequested = true;
+ FrontEndMenuManager.m_bStartUpFrontEndRequested = true;
if ( defaultFullscreenRes )
{
@@ -1728,7 +1743,7 @@ main(int argc, char *argv[])
float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
if ( RwInitialised )
{
- if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
+ if (!FrontEndMenuManager.m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
RsEventHandler(rsIDLE, (void *)TRUE);
}
break;
@@ -1739,7 +1754,7 @@ main(int argc, char *argv[])
float ms = (float)CTimer::GetCurrentTimeInCycles() / (float)CTimer::GetCyclesPerMillisecond();
if (RwInitialised)
{
- if (!CMenuManager::m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
+ if (!FrontEndMenuManager.m_PrefsFrameLimiter || (1000.0f / (float)RsGlobal.maxFPS) < ms)
RsEventHandler(rsANIMVIEWER, (void*)TRUE);
}
break;
@@ -1992,5 +2007,9 @@ int strcasecmp(const char* str1, const char* str2)
{
return _strcmpi(str1, str2);
}
+int strncasecmp(const char *str1, const char *str2, size_t len)
+{
+ return _strnicmp(str1, str2, len);
+}
#endif
#endif