From b98864d134b747c8f594c9194918b93040f88c1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Wed, 14 Oct 2020 18:07:05 +0300 Subject: Radar, WaterCannon, win/glfw skels --- src/skel/glfw/glfw.cpp | 27 ++++++++++++--------------- src/skel/win/resource.h | 2 +- src/skel/win/win.cpp | 36 ++++++++++++++++++++---------------- 3 files changed, 33 insertions(+), 32 deletions(-) (limited to 'src/skel') diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index 08e5c021..319b7bb0 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -152,7 +152,7 @@ const char *_psGetUserFilesFolder() &KeycbData) == ERROR_SUCCESS ) { RegCloseKey(hKey); - strcat(szUserFiles, "\\GTA3 User Files"); + strcat(szUserFiles, "\\GTA Vice City User Files"); _psCreateFolder(szUserFiles); return szUserFiles; } @@ -386,10 +386,6 @@ psInitialize(void) InitialiseLanguage(); -#ifndef GTA3_1_1_PATCH - FrontEndMenuManager.LoadSettings(); -#endif - #endif gGameState = GS_START_UP; @@ -422,7 +418,7 @@ psInitialize(void) } else if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) { - if ( verInfo.dwMajorVersion > 4 || verInfo.dwMajorVersion == 4 && verInfo.dwMinorVersion == 1 ) + if ( verInfo.dwMajorVersion > 4 || verInfo.dwMajorVersion == 4 && verInfo.dwMinorVersion != 0 ) { debug("Operating System is Win98\n"); _dwOperatingSystemVersion = OS_WIN98; @@ -439,13 +435,9 @@ psInitialize(void) #ifndef PS2_MENU - -#ifdef GTA3_1_1_PATCH FrontEndMenuManager.LoadSettings(); #endif -#endif - #ifdef _WIN32 MEMORYSTATUS memstats; @@ -1250,14 +1242,17 @@ void resizeCB(GLFWwindow* window, int width, int height) { * memory things don't work. */ /* redraw window */ - if (RwInitialised && (gGameState == GS_PLAYING_GAME #ifndef MASTER - || gGameState == GS_ANIMVIEWER -#endif - )) + if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER)) { - RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void*)TRUE); + RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void *)TRUE); } +#else + if (RwInitialised && gGameState == GS_PLAYING_GAME) + { + RsEventHandler(rsIDLE, (void *)TRUE); + } +#endif if (RwInitialised && height > 0 && width > 0) { RwRect r; @@ -1765,6 +1760,7 @@ main(int argc, char *argv[]) printf("Into TheGame!!!\n"); #else LoadingScreen(nil, nil, "loadsc0"); + // LoadingScreen(nil, nil, "loadsc0"); // duplicate #endif if ( !CGame::InitialiseOnceAfterRW() ) RsGlobal.quit = TRUE; @@ -1781,6 +1777,7 @@ main(int argc, char *argv[]) case GS_INIT_FRONTEND: { LoadingScreen(nil, nil, "loadsc0"); + // LoadingScreen(nil, nil, "loadsc0"); // duplicate FrontEndMenuManager.m_bGameNotLoaded = true; diff --git a/src/skel/win/resource.h b/src/skel/win/resource.h index 84dffb95..93f14216 100644 --- a/src/skel/win/resource.h +++ b/src/skel/win/resource.h @@ -8,7 +8,7 @@ #define IDEXIT 1002 #define IDC_SELECTDEVICE 1005 -#define IDI_MAIN_ICON 1042 +#define IDI_MAIN_ICON 100 // Next default values for new objects // #ifdef APSTUDIO_INVOKED diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index 1d1037af..149c9045 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -189,7 +189,7 @@ const char *_psGetUserFilesFolder() &KeycbData) == ERROR_SUCCESS ) { RegCloseKey(hKey); - strcat(szUserFiles, "\\GTA3 User Files"); + strcat(szUserFiles, "\\GTA Vice City User Files"); _psCreateFolder(szUserFiles); return szUserFiles; } @@ -650,10 +650,6 @@ psInitialize(void) C_PcSave::SetSaveDirectory(_psGetUserFilesFolder()); InitialiseLanguage(); -#ifndef GTA3_1_1_PATCH - FrontEndMenuManager.LoadSettings(); -#endif - #endif gGameState = GS_START_UP; @@ -688,7 +684,7 @@ psInitialize(void) } else if ( verInfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) { - if ( verInfo.dwMajorVersion > 4 || verInfo.dwMajorVersion == 4 && verInfo.dwMinorVersion == 1 ) + if ( verInfo.dwMajorVersion > 4 || verInfo.dwMajorVersion == 4 && verInfo.dwMinorVersion != 0 ) { debug("Operating System is Win98\n"); _dwOperatingSystemVersion = OS_WIN98; @@ -701,11 +697,7 @@ psInitialize(void) } #ifndef PS2_MENU - -#ifdef GTA3_1_1_PATCH FrontEndMenuManager.LoadSettings(); -#endif - #endif dwDXVersion = GetDXVersion(); @@ -945,8 +937,7 @@ void HandleGraphEvent(void) /* ***************************************************************************** - */ - + */ LRESULT CALLBACK MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam) { @@ -1016,10 +1007,17 @@ MainWndProc(HWND window, UINT message, WPARAM wParam, LPARAM lParam) RECT rect; /* redraw window */ +#ifndef MASTER if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER)) { RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void *)TRUE); } +#else + if (RwInitialised && gGameState == GS_PLAYING_GAME) + { + RsEventHandler(rsIDLE, (void *)TRUE); + } +#endif /* Manually resize window */ rect.left = rect.top = 0; @@ -1327,7 +1325,7 @@ InitApplication(HANDLE instance) windowClass.cbClsExtra = 0; windowClass.cbWndExtra = 0; windowClass.hInstance = (HINSTANCE)instance; - windowClass.hIcon = nil; + windowClass.hIcon = LoadIcon((HINSTANCE)instance, (LPCSTR)IDI_MAIN_ICON); windowClass.hCursor = LoadCursor(nil, IDC_ARROW); windowClass.hbrBackground = nil; windowClass.lpszMenuName = NULL; @@ -1382,17 +1380,17 @@ UINT GetBestRefreshRate(UINT width, UINT height, UINT depth) #endif if ( mode.Width == width && mode.Height == height && mode.Format == format ) { - if ( mode.RefreshRate == 0 ) + if ( mode.RefreshRate == 0 ) { + d3d->Release(); return 0; + } if ( mode.RefreshRate < refreshRate && mode.RefreshRate >= 60 ) refreshRate = mode.RefreshRate; } } -#ifdef FIX_BUGS d3d->Release(); -#endif if ( refreshRate == -1 ) return -1; @@ -2255,6 +2253,8 @@ WinMain(HINSTANCE instance, if ( startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0 ) ++gGameState; + else if ( CPad::GetPad(0)->NewState.CheckForInput() ) + ++gGameState; else if ( CPad::GetPad(0)->GetLeftMouseJustDown() ) ++gGameState; else if ( CPad::GetPad(0)->GetEnterJustDown() ) @@ -2292,6 +2292,8 @@ WinMain(HINSTANCE instance, if ( startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0 ) ++gGameState; + else if ( CPad::GetPad(0)->NewState.CheckForInput() ) + ++gGameState; else if ( CPad::GetPad(0)->GetLeftMouseJustDown() ) ++gGameState; else if ( CPad::GetPad(0)->GetEnterJustDown() ) @@ -2328,6 +2330,7 @@ WinMain(HINSTANCE instance, printf("Into TheGame!!!\n"); #else LoadingScreen(nil, nil, "loadsc0"); + // LoadingScreen(nil, nil, "loadsc0"); // duplicate #endif if ( !CGame::InitialiseOnceAfterRW() ) RsGlobal.quit = TRUE; @@ -2345,6 +2348,7 @@ WinMain(HINSTANCE instance, case GS_INIT_FRONTEND: { LoadingScreen(nil, nil, "loadsc0"); + // LoadingScreen(nil, nil, "loadsc0"); // duplicate FrontEndMenuManager.m_bGameNotLoaded = true; -- cgit v1.2.3