From 1c11a8081f246dda91ff11d4207d87bb93260b1a Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Sun, 28 Jun 2020 00:01:51 +0300 Subject: mips overdose --- src/skel/win/win.cpp | 185 +++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 165 insertions(+), 20 deletions(-) (limited to 'src/skel') diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index 9a885818..2b083f06 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -87,8 +87,10 @@ static psGlobalType PsGlobal; #include "Frontend.h" #include "Game.h" #include "PCSave.h" +#include "MemoryCard.h" #include "Sprite2d.h" #include "AnimViewer.h" +#include "Font.h" VALIDATE_SIZE(psGlobalType, 0x28); @@ -598,12 +600,49 @@ psInitialise(void) PsGlobal.joy2 = nil; CFileMgr::Initialise(); + +#ifdef PS2_MENU + CPad::Initialise(); + CPad::GetPad(0)->Mode = 0; + + CGame::frenchGame = false; + CGame::germanGame = false; + CGame::nastyGame = true; + CMenuManager::m_PrefsAllowNastyGame = true; + WORD lang = PRIMARYLANGID(GetSystemDefaultLCID()); + if ( lang == LANG_ITALIAN ) + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_ITALIAN; + else if ( lang == LANG_SPANISH ) + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_SPANISH; + else if ( lang == LANG_GERMAN ) + { + CGame::germanGame = true; + CGame::nastyGame = false; + CMenuManager::m_PrefsAllowNastyGame = false; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_GERMAN; + } + else if ( lang == LANG_FRENCH ) + { + CGame::frenchGame = true; + CGame::nastyGame = false; + CMenuManager::m_PrefsAllowNastyGame = false; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_FRENCH; + } + else + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_AMERICAN; + + FrontEndMenuManager.InitialiseMenuContentsAfterLoadingGame(); + + TheMemoryCard.Init(); +#else C_PcSave::SetSaveDirectory(_psGetUserFilesFolder()); InitialiseLanguage(); #ifndef GTA3_1_1_PATCH FrontEndMenuManager.LoadSettings(); +#endif + #endif gGameState = GS_START_UP; @@ -650,8 +689,12 @@ psInitialise(void) } } +#ifndef PS2_MENU + #ifdef GTA3_1_1_PATCH FrontEndMenuManager.LoadSettings(); +#endif + #endif dwDXVersion = GetDXVersion(); @@ -1437,7 +1480,9 @@ psSelectDevice() FrontEndMenuManager.m_nPrefsDepth = vm.depth; #endif +#ifndef PS2_MENU FrontEndMenuManager.m_nCurrOption = 0; +#endif /* Set up the video mode and set the apps window * dimensions to match */ @@ -1715,27 +1760,27 @@ void InitialiseLanguage() { case LANG_GERMAN: { - CMenuManager::m_PrefsLanguage = LANGUAGE_GERMAN; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_GERMAN; break; } case LANG_SPANISH: { - CMenuManager::m_PrefsLanguage = LANGUAGE_SPANISH; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_SPANISH; break; } case LANG_FRENCH: { - CMenuManager::m_PrefsLanguage = LANGUAGE_FRENCH; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_FRENCH; break; } case LANG_ITALIAN: { - CMenuManager::m_PrefsLanguage = LANGUAGE_ITALIAN; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_ITALIAN; break; } default: { - CMenuManager::m_PrefsLanguage = LANGUAGE_AMERICAN; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_AMERICAN; break; } } @@ -1884,13 +1929,12 @@ WinMain(HINSTANCE instance, StaticPatcher::Apply(); SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE); -/* // TODO: make this an option somewhere AllocConsole(); freopen("CONIN$", "r", stdin); freopen("CONOUT$", "w", stdout); freopen("CONOUT$", "w", stderr); -*/ + /* * Initialize the platform independent data. @@ -2033,24 +2077,35 @@ WinMain(HINSTANCE instance, SetErrorMode(SEM_FAILCRITICALERRORS); - if (!TurnOnAnimViewer) { -#ifdef NO_MOVIES - gGameState = GS_INIT_FRONTEND; - TRACE("gGameState = GS_INIT_FRONTEND"); - + +#ifdef PS2_MENU + int32 r = TheMemoryCard.CheckCardStateAtGameStartUp(CARD_ONE); + if ( r == CMemoryCard::ERR_DIRNOENTRY || r == CMemoryCard::ERR_NOFORMAT + && r != CMemoryCard::ERR_OPENNOENTRY && r != CMemoryCard::ERR_NONE ) + { LoadingScreen(nil, nil, "loadsc0"); - if (!CGame::InitialiseOnceAfterRW()) - RsGlobal.quit = TRUE; + + TheText.Unload(); + TheText.Load(); + + CFont::Initialise(); + + FrontEndMenuManager.DrawMemoryCardStartUpMenus(); + } #endif - } else { + + if (TurnOnAnimViewer) + { #ifndef MASTER CAnimViewer::Initialise(); +#ifndef PS2_MENU FrontEndMenuManager.m_bGameNotLoaded = false; +#endif gGameState = GS_ANIMVIEWER; TurnOnAnimViewer = false; #endif } - + while ( TRUE ) { RwInitialised = TRUE; @@ -2069,8 +2124,18 @@ WinMain(HINSTANCE instance, /* * Enter the message processing loop... */ - +#ifdef PS2_MENU + if (TheMemoryCard.m_bWantToLoad) + LoadSplash(GetLevelSplashScreen(CGame::currLevel)); + + TheMemoryCard.m_bWantToLoad = false; + + CTimer::Update(); + + while( !RsGlobal.quit && !(FrontEndMenuManager.m_bWantToRestart || TheMemoryCard.b_FoundRecentSavedGameWantToLoad) ) +#else while( !RsGlobal.quit && !FrontEndMenuManager.m_bWantToRestart ) +#endif { if( PeekMessage(&message, nil, 0U, 0U, PM_REMOVE|PM_NOYIELD) ) { @@ -2090,7 +2155,11 @@ WinMain(HINSTANCE instance, { case GS_START_UP: { +#ifdef NO_MOVIES + gGameState = GS_INIT_ONCE; +#else gGameState = GS_INIT_LOGO_MPEG; +#endif TRACE("gGameState = GS_INIT_LOGO_MPEG"); break; } @@ -2165,16 +2234,30 @@ WinMain(HINSTANCE instance, CloseClip(); CoUninitialize(); - LoadingScreen(nil, nil, "loadsc0"); +#ifdef PS2_MENU + extern char version_name[64]; + if ( CGame::frenchGame || CGame::germanGame ) + LoadingScreen(NULL, version_name, "loadsc24"); + else + LoadingScreen(NULL, version_name, "loadsc0"); + printf("Into TheGame!!!\n"); +#else + LoadingScreen(nil, nil, "loadsc0"); +#endif if ( !CGame::InitialiseOnceAfterRW() ) RsGlobal.quit = TRUE; - + +#ifdef PS2_MENU + gGameState = GS_INIT_PLAYING_GAME; +#else gGameState = GS_INIT_FRONTEND; TRACE("gGameState = GS_INIT_FRONTEND;"); +#endif break; } +#ifndef PS2_MENU case GS_INIT_FRONTEND: { LoadingScreen(nil, nil, "loadsc0"); @@ -2202,13 +2285,21 @@ WinMain(HINSTANCE instance, if (wp.showCmd != SW_SHOWMINIMIZED) RsEventHandler(rsFRONTENDIDLE, nil); +#ifdef PS2_MENU + if ( !FrontEndMenuManager.m_bMenuActive || TheMemoryCard.m_bWantToLoad ) +#else if ( !FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bWantToLoad ) +#endif { gGameState = GS_INIT_PLAYING_GAME; TRACE("gGameState = GS_INIT_PLAYING_GAME;"); } +#ifdef PS2_MENU + if (TheMemoryCard.m_bWantToLoad ) +#else if ( FrontEndMenuManager.m_bWantToLoad ) +#endif { InitialiseGame(); FrontEndMenuManager.m_bGameNotLoaded = false; @@ -2217,11 +2308,37 @@ WinMain(HINSTANCE instance, } break; } +#endif case GS_INIT_PLAYING_GAME: { +#ifdef PS2_MENU + CGame::Initialise("DATA\\GTA3.DAT"); + + //LoadingScreen("Starting Game", NULL, GetRandomSplashScreen()); + + if ( TheMemoryCard.CheckCardInserted(CARD_ONE) == CMemoryCard::NO_ERR_SUCCESS + && TheMemoryCard.ChangeDirectory(CARD_ONE, TheMemoryCard.Cards[CARD_ONE].dir) + && TheMemoryCard.FindMostRecentFileName(CARD_ONE, TheMemoryCard.MostRecentFile) == true + && TheMemoryCard.CheckDataNotCorrupt(TheMemoryCard.MostRecentFile)) + { + strcpy(TheMemoryCard.LoadFileName, TheMemoryCard.MostRecentFile); + TheMemoryCard.b_FoundRecentSavedGameWantToLoad = true; + + if (CMenuManager::m_PrefsLanguage != TheMemoryCard.GetLanguageToLoad()) + { + CMenuManager::m_PrefsLanguage = TheMemoryCard.GetLanguageToLoad(); + TheText.Unload(); + TheText.Load(); + } + + CGame::currLevel = (eLevelName)TheMemoryCard.GetLevelToLoad(); + } +#else InitialiseGame(); + FrontEndMenuManager.m_bGameNotLoaded = false; +#endif gGameState = GS_PLAYING_GAME; TRACE("gGameState = GS_PLAYING_GAME;"); break; @@ -2271,16 +2388,43 @@ WinMain(HINSTANCE instance, RwInitialised = FALSE; FrontEndMenuManager.UnloadTextures(); +#ifdef PS2_MENU + if ( !(FrontEndMenuManager.m_bWantToRestart || TheMemoryCard.b_FoundRecentSavedGameWantToLoad)) + break; +#else if ( !FrontEndMenuManager.m_bWantToRestart ) break; +#endif CPad::ResetCheats(); CPad::StopPadsShaking(); - DMAudio.ChangeMusicMode(MUSICMODE_DISABLE); +#ifdef PS2_MENU + CGame::ShutDownForRestart(); +#endif + CTimer::Stop(); +#ifdef PS2_MENU + if (FrontEndMenuManager.m_bWantToRestart || TheMemoryCard.b_FoundRecentSavedGameWantToLoad) + { + if (TheMemoryCard.b_FoundRecentSavedGameWantToLoad) + { + FrontEndMenuManager.m_bWantToRestart = true; + TheMemoryCard.m_bWantToLoad = true; + } + + CGame::InitialiseWhenRestarting(); + DMAudio.ChangeMusicMode(MUSICMODE_GAME); + FrontEndMenuManager.m_bWantToRestart = false; + + continue; + } + + CGame::ShutDown(); CTimer::Stop(); + break; +#else if ( FrontEndMenuManager.m_bWantToLoad ) { CGame::ShutDownForRestart(); @@ -2312,6 +2456,7 @@ WinMain(HINSTANCE instance, FrontEndMenuManager.m_bFirstTime = false; FrontEndMenuManager.m_bWantToRestart = false; +#endif } -- cgit v1.2.3 From 63fdcf7e64655767d3c56917d50141602b565447 Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Mon, 29 Jun 2020 10:29:02 +0300 Subject: menu fixes --- src/skel/win/win.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/skel') diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index d923d93d..d7216d2e 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -1929,12 +1929,13 @@ WinMain(HINSTANCE instance, StaticPatcher::Apply(); SystemParametersInfo(SPI_SETFOREGROUNDLOCKTIMEOUT, 0, nil, SPIF_SENDCHANGE); +/* // TODO: make this an option somewhere AllocConsole(); freopen("CONIN$", "r", stdin); freopen("CONOUT$", "w", stdout); freopen("CONOUT$", "w", stderr); - +*/ /* * Initialize the platform independent data. -- cgit v1.2.3 From d9cb9583bfa114a40993c1252d39270c696af7f6 Mon Sep 17 00:00:00 2001 From: Fire-Head Date: Mon, 29 Jun 2020 11:04:30 +0300 Subject: update glfw.cpp --- src/skel/glfw/glfw.cpp | 206 +++++++++++++++++++++++++++++++++++++++++++++++-- src/skel/win/win.cpp | 2 + 2 files changed, 201 insertions(+), 7 deletions(-) (limited to 'src/skel') diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index 3ef0ab63..0728f6c2 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -27,8 +27,10 @@ #include "Frontend.h" #include "Game.h" #include "PCSave.h" +#include "MemoryCard.h" #include "Sprite2d.h" #include "AnimViewer.h" +#include "Font.h" #define MAX_SUBSYSTEMS (16) @@ -287,11 +289,69 @@ psInitialize(void) CFileMgr::Initialise(); +#ifdef PS2_MENU + CPad::Initialise(); + CPad::GetPad(0)->Mode = 0; + + CGame::frenchGame = false; + CGame::germanGame = false; + CGame::nastyGame = true; + CMenuManager::m_PrefsAllowNastyGame = true; + +#ifndef _WIN32 + // Mandatory for Linux(Unix? Posix?) to set lang. to environment lang. + setlocale(LC_ALL, ""); + + char *systemLang, *keyboardLang; + + systemLang = setlocale (LC_ALL, NULL); + keyboardLang = setlocale (LC_CTYPE, NULL); + + short lang; + lang = !strncmp(systemLang, "fr_",3) ? LANG_FRENCH : + !strncmp(systemLang, "de_",3) ? LANG_GERMAN : + !strncmp(systemLang, "en_",3) ? LANG_ENGLISH : + !strncmp(systemLang, "it_",3) ? LANG_ITALIAN : + !strncmp(systemLang, "es_",3) ? LANG_SPANISH : + LANG_OTHER; +#else + WORD lang = PRIMARYLANGID(GetSystemDefaultLCID()); +#endif + + if ( lang == LANG_ITALIAN ) + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_ITALIAN; + else if ( lang == LANG_SPANISH ) + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_SPANISH; + else if ( lang == LANG_GERMAN ) + { + CGame::germanGame = true; + CGame::nastyGame = false; + CMenuManager::m_PrefsAllowNastyGame = false; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_GERMAN; + } + else if ( lang == LANG_FRENCH ) + { + CGame::frenchGame = true; + CGame::nastyGame = false; + CMenuManager::m_PrefsAllowNastyGame = false; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_FRENCH; + } + else + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_AMERICAN; + + FrontEndMenuManager.InitialiseMenuContentsAfterLoadingGame(); + + TheMemoryCard.Init(); +#else C_PcSave::SetSaveDirectory(_psGetUserFilesFolder()); InitialiseLanguage(); +#ifndef GTA3_1_1_PATCH FrontEndMenuManager.LoadSettings(); +#endif + +#endif gGameState = GS_START_UP; TRACE("gGameState = GS_START_UP"); @@ -334,6 +394,14 @@ psInitialize(void) _dwOperatingSystemVersion = OS_WIN95; } } + +#ifndef PS2_MENU + +#ifdef GTA3_1_1_PATCH + FrontEndMenuManager.LoadSettings(); +#endif + +#endif MEMORYSTATUS memstats; GlobalMemoryStatus(&memstats); @@ -343,6 +411,14 @@ psInitialize(void) debug("Physical memory size %u\n", memstats.dwTotalPhys); debug("Available physical memory %u\n", memstats.dwAvailPhys); #else + +#ifndef PS2_MENU + +#ifdef GTA3_1_1_PATCH + FrontEndMenuManager.LoadSettings(); +#endif + +#endif struct sysinfo systemInfo; sysinfo(&systemInfo); @@ -664,7 +740,9 @@ psSelectDevice() FrontEndMenuManager.m_nPrefsDepth = vm.depth; #endif +#ifndef PS2_MENU FrontEndMenuManager.m_nCurrOption = 0; +#endif /* Set up the video mode and set the apps window * dimensions to match */ @@ -1005,27 +1083,27 @@ void InitialiseLanguage() { case LANG_GERMAN: { - CMenuManager::m_PrefsLanguage = LANGUAGE_GERMAN; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_GERMAN; break; } case LANG_SPANISH: { - CMenuManager::m_PrefsLanguage = LANGUAGE_SPANISH; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_SPANISH; break; } case LANG_FRENCH: { - CMenuManager::m_PrefsLanguage = LANGUAGE_FRENCH; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_FRENCH; break; } case LANG_ITALIAN: { - CMenuManager::m_PrefsLanguage = LANGUAGE_ITALIAN; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_ITALIAN; break; } default: { - CMenuManager::m_PrefsLanguage = LANGUAGE_AMERICAN; + CMenuManager::m_PrefsLanguage = CMenuManager::LANGUAGE_AMERICAN; break; } } @@ -1425,14 +1503,33 @@ main(int argc, char *argv[]) SetErrorMode(SEM_FAILCRITICALERRORS); #endif +#ifdef PS2_MENU + int32 r = TheMemoryCard.CheckCardStateAtGameStartUp(CARD_ONE); + if ( r == CMemoryCard::ERR_DIRNOENTRY || r == CMemoryCard::ERR_NOFORMAT + && r != CMemoryCard::ERR_OPENNOENTRY && r != CMemoryCard::ERR_NONE ) + { + LoadingScreen(nil, nil, "loadsc0"); + + TheText.Unload(); + TheText.Load(); + + CFont::Initialise(); + + FrontEndMenuManager.DrawMemoryCardStartUpMenus(); + } +#endif + + if (TurnOnAnimViewer) + { #ifndef MASTER - if (TurnOnAnimViewer) { CAnimViewer::Initialise(); +#ifndef PS2_MENU FrontEndMenuManager.m_bGameNotLoaded = false; +#endif gGameState = GS_ANIMVIEWER; TurnOnAnimViewer = false; - } #endif + } initkeymap(); @@ -1452,7 +1549,18 @@ main(int argc, char *argv[]) * Enter the message processing loop... */ +#ifdef PS2_MENU + if (TheMemoryCard.m_bWantToLoad) + LoadSplash(GetLevelSplashScreen(CGame::currLevel)); + + TheMemoryCard.m_bWantToLoad = false; + + CTimer::Update(); + + while( !RsGlobal.quit && !(FrontEndMenuManager.m_bWantToRestart || TheMemoryCard.b_FoundRecentSavedGameWantToLoad) && !glfwWindowShouldClose(PSGLOBAL(window)) ) +#else while( !RsGlobal.quit && !FrontEndMenuManager.m_bWantToRestart && !glfwWindowShouldClose(PSGLOBAL(window))) +#endif { glfwPollEvents(); if( ForegroundApp ) @@ -1461,7 +1569,11 @@ main(int argc, char *argv[]) { case GS_START_UP: { +#ifdef NO_MOVIES gGameState = GS_INIT_ONCE; +#else + gGameState = GS_INIT_LOGO_MPEG; +#endif TRACE("gGameState = GS_INIT_ONCE"); break; } @@ -1470,13 +1582,27 @@ main(int argc, char *argv[]) { //CoUninitialize(); +#ifdef PS2_MENU + extern char version_name[64]; + if ( CGame::frenchGame || CGame::germanGame ) + LoadingScreen(NULL, version_name, "loadsc24"); + else + LoadingScreen(NULL, version_name, "loadsc0"); + + printf("Into TheGame!!!\n"); +#else LoadingScreen(nil, nil, "loadsc0"); +#endif if ( !CGame::InitialiseOnceAfterRW() ) RsGlobal.quit = TRUE; +#ifdef PS2_MENU + gGameState = GS_INIT_PLAYING_GAME; +#else gGameState = GS_INIT_FRONTEND; TRACE("gGameState = GS_INIT_FRONTEND;"); +#endif break; } @@ -1500,18 +1626,27 @@ main(int argc, char *argv[]) break; } +#ifndef PS2_MENU case GS_FRONTEND: { if(!glfwGetWindowAttrib(PSGLOBAL(window), GLFW_ICONIFIED)) RsEventHandler(rsFRONTENDIDLE, nil); +#ifdef PS2_MENU + if ( !FrontEndMenuManager.m_bMenuActive || TheMemoryCard.m_bWantToLoad ) +#else if ( !FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bWantToLoad ) +#endif { gGameState = GS_INIT_PLAYING_GAME; TRACE("gGameState = GS_INIT_PLAYING_GAME;"); } +#ifdef PS2_MENU + if (TheMemoryCard.m_bWantToLoad ) +#else if ( FrontEndMenuManager.m_bWantToLoad ) +#endif { InitialiseGame(); FrontEndMenuManager.m_bGameNotLoaded = false; @@ -1520,11 +1655,37 @@ main(int argc, char *argv[]) } break; } +#endif case GS_INIT_PLAYING_GAME: { +#ifdef PS2_MENU + CGame::Initialise("DATA\\GTA3.DAT"); + + //LoadingScreen("Starting Game", NULL, GetRandomSplashScreen()); + + if ( TheMemoryCard.CheckCardInserted(CARD_ONE) == CMemoryCard::NO_ERR_SUCCESS + && TheMemoryCard.ChangeDirectory(CARD_ONE, TheMemoryCard.Cards[CARD_ONE].dir) + && TheMemoryCard.FindMostRecentFileName(CARD_ONE, TheMemoryCard.MostRecentFile) == true + && TheMemoryCard.CheckDataNotCorrupt(TheMemoryCard.MostRecentFile)) + { + strcpy(TheMemoryCard.LoadFileName, TheMemoryCard.MostRecentFile); + TheMemoryCard.b_FoundRecentSavedGameWantToLoad = true; + + if (CMenuManager::m_PrefsLanguage != TheMemoryCard.GetLanguageToLoad()) + { + CMenuManager::m_PrefsLanguage = TheMemoryCard.GetLanguageToLoad(); + TheText.Unload(); + TheText.Load(); + } + + CGame::currLevel = (eLevelName)TheMemoryCard.GetLevelToLoad(); + } +#else InitialiseGame(); + FrontEndMenuManager.m_bGameNotLoaded = false; +#endif gGameState = GS_PLAYING_GAME; TRACE("gGameState = GS_PLAYING_GAME;"); break; @@ -1573,16 +1734,46 @@ main(int argc, char *argv[]) RwInitialised = FALSE; FrontEndMenuManager.UnloadTextures(); +#ifdef PS2_MENU + if ( !(FrontEndMenuManager.m_bWantToRestart || TheMemoryCard.b_FoundRecentSavedGameWantToLoad)) + break; +#else if ( !FrontEndMenuManager.m_bWantToRestart ) break; +#endif CPad::ResetCheats(); CPad::StopPadsShaking(); DMAudio.ChangeMusicMode(MUSICMODE_DISABLE); +#ifdef PS2_MENU + CGame::ShutDownForRestart(); +#endif + CTimer::Stop(); +#ifdef PS2_MENU + if (FrontEndMenuManager.m_bWantToRestart || TheMemoryCard.b_FoundRecentSavedGameWantToLoad) + { + if (TheMemoryCard.b_FoundRecentSavedGameWantToLoad) + { + FrontEndMenuManager.m_bWantToRestart = true; + TheMemoryCard.m_bWantToLoad = true; + } + + CGame::InitialiseWhenRestarting(); + DMAudio.ChangeMusicMode(MUSICMODE_GAME); + FrontEndMenuManager.m_bWantToRestart = false; + + continue; + } + + CGame::ShutDown(); + CTimer::Stop(); + + break; +#else if ( FrontEndMenuManager.m_bWantToLoad ) { CGame::ShutDownForRestart(); @@ -1614,6 +1805,7 @@ main(int argc, char *argv[]) FrontEndMenuManager.m_bFirstTime = false; FrontEndMenuManager.m_bWantToRestart = false; +#endif } diff --git a/src/skel/win/win.cpp b/src/skel/win/win.cpp index d7216d2e..484c6fe8 100644 --- a/src/skel/win/win.cpp +++ b/src/skel/win/win.cpp @@ -2399,7 +2399,9 @@ WinMain(HINSTANCE instance, CPad::ResetCheats(); CPad::StopPadsShaking(); + DMAudio.ChangeMusicMode(MUSICMODE_DISABLE); + #ifdef PS2_MENU CGame::ShutDownForRestart(); #endif -- cgit v1.2.3