diff options
author | Sergeanur <s.anureev@yandex.ua> | 2020-06-29 11:56:50 +0200 |
---|---|---|
committer | Sergeanur <s.anureev@yandex.ua> | 2020-06-29 11:56:50 +0200 |
commit | b26eec5dafc7720d2c8e61db7dd6da29442cab94 (patch) | |
tree | 4dfc58239c4555d4d4e6d0b327b65b7dab6cae65 /src/core/main.cpp | |
parent | renamed 2dfx shadowRange to Size (diff) | |
parent | Update MemoryCard.cpp (diff) | |
download | re3-b26eec5dafc7720d2c8e61db7dd6da29442cab94.tar re3-b26eec5dafc7720d2c8e61db7dd6da29442cab94.tar.gz re3-b26eec5dafc7720d2c8e61db7dd6da29442cab94.tar.bz2 re3-b26eec5dafc7720d2c8e61db7dd6da29442cab94.tar.lz re3-b26eec5dafc7720d2c8e61db7dd6da29442cab94.tar.xz re3-b26eec5dafc7720d2c8e61db7dd6da29442cab94.tar.zst re3-b26eec5dafc7720d2c8e61db7dd6da29442cab94.zip |
Diffstat (limited to 'src/core/main.cpp')
-rw-r--r-- | src/core/main.cpp | 65 |
1 files changed, 47 insertions, 18 deletions
diff --git a/src/core/main.cpp b/src/core/main.cpp index d6837ba9..6e6092f3 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -58,6 +58,7 @@ #include "Console.h" #include "timebars.h" #include "GenericGameStorage.h" +#include "MemoryCard.h" #include "SceneEdit.h" #include "debugmenu.h" @@ -185,14 +186,27 @@ DoFade(void) if(CTimer::GetIsPaused()) return; +#ifdef PS2_MENU + if(TheMemoryCard.JustLoadedDontFadeInYet){ + TheMemoryCard.JustLoadedDontFadeInYet = false; + TheMemoryCard.TimeStartedCountingForFade = CTimer::GetTimeInMilliseconds(); + } +#else if(JustLoadedDontFadeInYet){ JustLoadedDontFadeInYet = false; TimeStartedCountingForFade = CTimer::GetTimeInMilliseconds(); } +#endif +#ifdef PS2_MENU + if(TheMemoryCard.StillToFadeOut){ + if(CTimer::GetTimeInMilliseconds() - TheMemoryCard.TimeStartedCountingForFade > TheMemoryCard.TimeToStayFadedBeforeFadeOut){ + TheMemoryCard.StillToFadeOut = false; +#else if(StillToFadeOut){ if(CTimer::GetTimeInMilliseconds() - TimeStartedCountingForFade > TimeToStayFadedBeforeFadeOut){ StillToFadeOut = false; +#endif TheCamera.Fade(3.0f, FADE_IN); TheCamera.ProcessFade(); TheCamera.ProcessMusicFade(); @@ -925,17 +939,16 @@ Render2dStuff(void) void RenderMenus(void) { -#ifdef PS2 - if (FrontEndMenuManager.m_bWantToDraw) + if (FrontEndMenuManager.m_bMenuActive) { +#ifdef PS2 gMainHeap.PushMemId(_TODOCONST(17)); +#endif FrontEndMenuManager.DrawFrontEnd(); +#ifdef PS2 gMainHeap.PopMemId(); - } -#else - if(FrontEndMenuManager.m_bMenuActive) - FrontEndMenuManager.DrawFrontEnd(); #endif + } } void @@ -979,14 +992,25 @@ Idle(void *arg) #endif if(CGame::bDemoMode && CTimer::GetTimeInMilliseconds() > (3*60 + 30)*1000 && !CCutsceneMgr::IsCutsceneProcessing()){ +#ifdef PS2_MENU + TheMemoryCard.m_bWantToLoad = false; + FrontEndMenuManager.m_bWantToRestart = true; +#else FrontEndMenuManager.m_bWantToRestart = true; FrontEndMenuManager.m_bWantToLoad = false; +#endif return; } +#ifdef PS2_MENU + if ( FrontEndMenuManager.m_bWantToRestart || TheMemoryCard.b_FoundRecentSavedGameWantToLoad ) +#else if(FrontEndMenuManager.m_bWantToRestart || b_FoundRecentSavedGameWantToLoad) +#endif + { return; - + } + SetLightsWithTimeOfDayColour(Scene.world); if(arg == nil) @@ -1048,7 +1072,7 @@ Idle(void *arg) #ifdef TIMEBARS tbStartTimer(0, "RenderMotionBlur"); #endif - if((TheCamera.m_BlurType == MBLUR_NONE || TheCamera.m_BlurType == MBLUR_NORMAL) && + if((TheCamera.m_BlurType == MOTION_BLUR_NONE || TheCamera.m_BlurType == MOTION_BLUR_LIGHT_SCENE) && TheCamera.m_ScreenReductionPercentage > 0.0f) TheCamera.SetMotionBlurAlpha(150); TheCamera.RenderMotionBlur(); @@ -1081,6 +1105,11 @@ Idle(void *arg) tbEndTimer("RenderMenus"); tbStartTimer(0, "DoFade"); #endif + +#ifdef PS2_MENU + if ( TheMemoryCard.m_bWantToLoad ) + return; +#endif DoFade(); #ifdef TIMEBARS tbEndTimer("DoFade"); @@ -1255,6 +1284,7 @@ TheModelViewer(void) } #endif +#ifdef PS2 void TheGame(void) { printf("Into TheGame!!!\n"); @@ -1276,12 +1306,12 @@ void TheGame(void) LoadingScreen("Starting Game", NULL, splash); #ifdef GTA_PS2 - if ( TheMemoryCard.CheckCardInserted(_TODOCONST(0)) == _TODOCONST(26) - && TheMemoryCard.ChangeDirectory(_TODOCONST(0), TheMemoryCard.field154) - && TheMemoryCard.FindMostRecentFileName(_TODOCONST(0), TheMemoryCard.field37) == 1 - && TheMemoryCard.CheckDataNotCorrupt(TheMemoryCard.field37)) + 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.field37); + strcpy(TheMemoryCard.LoadFileName, TheMemoryCard.MostRecentFile); TheMemoryCard.b_FoundRecentSavedGameWantToLoad = true; if (FrontEndMenuManager.m_PrefsLanguage != TheMemoryCard.GetLanguageToLoad()) @@ -1385,7 +1415,7 @@ void TheGame(void) RenderDebugShit(); RenderEffects(); - if ((TheCamera.m_BlurType == MBLUR_NONE || TheCamera.m_BlurType == MBLUR_NORMAL) && TheCamera.m_ScreenReductionPercentage > 0.0f) + if ((TheCamera.m_BlurType == MOTION_BLUR_NONE || TheCamera.m_BlurType == MOTION_BLUR_LIGHT_SCENE) && TheCamera.m_ScreenReductionPercentage > 0.0f) TheCamera.SetMotionBlurAlpha(150); TheCamera.RenderMotionBlur(); @@ -1767,8 +1797,6 @@ void GameInit() } } -// Not used anyway. PS2 main() port -#ifdef _WIN32 int main(int argc, char *argv[]) { @@ -1779,9 +1807,10 @@ main(int argc, char *argv[]) SystemInit(); #ifdef PS2 - int32 state = TheMemoryCard.CheckCardStateAtGameStartUp(_TODOCONST(0)); + int32 r = TheMemoryCard.CheckCardStateAtGameStartUp(CARD_ONE); - if ( state == _TODOCONST(2) || state == _TODOCONST(1) && state != _TODOCONST(3) && state != _TODOCONST(0) ) + if ( r == CMemoryCard::ERR_DIRNOENTRY || r == CMemoryCard::ERR_NOFORMAT + && r != CMemoryCard::ERR_OPENNOENTRY && r != CMemoryCard::ERR_NONE ) { GameInit(); |