summaryrefslogtreecommitdiffstats
path: root/src/core/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/main.cpp')
-rw-r--r--src/core/main.cpp56
1 files changed, 43 insertions, 13 deletions
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 8ac16d0e..2f266a9e 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -141,9 +141,29 @@ Idle(void *arg)
CTimer::Update();
CSprite2d::InitPerFrame();
CFont::InitPerFrame();
+
+ // We're basically merging FrontendIdle and Idle (just like TheGame on PS2)
+#ifdef PS2_SAVE_DIALOG
+ // Only exists on PC FrontendIdle, probably some PS2 bug fix
+ if (FrontEndMenuManager.m_bMenuActive)
+ CSprite2d::SetRecipNearClip();
+
+ if (FrontEndMenuManager.m_bGameNotLoaded) {
+ CPad::UpdatePads();
+ FrontEndMenuManager.Process();
+ } else {
+ CPointLights::InitPerFrame();
+ CGame::Process();
+ DMAudio.Service();
+ }
+
+ if (RsGlobal.quit)
+ return;
+#else
CPointLights::InitPerFrame();
CGame::Process();
DMAudio.Service();
+#endif
if(CGame::bDemoMode && CTimer::GetTimeInMilliseconds() > (3*60 + 30)*1000 && !CCutsceneMgr::IsCutsceneProcessing()){
FrontEndMenuManager.m_bStartGameLoading = true;
@@ -159,14 +179,16 @@ Idle(void *arg)
if(arg == nil)
return;
- if((!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.field_452 == 1) &&
+ if((!FrontEndMenuManager.m_bMenuActive || FrontEndMenuManager.m_bRenderGameInMenu) &&
TheCamera.GetScreenFadeStatus() != FADE_2){
#ifdef GTA_PC
- // This is from SA, but it's nice for windowed mode
- RwV2d pos;
- pos.x = SCREEN_WIDTH/2.0f;
- pos.y = SCREEN_HEIGHT/2.0f;
- RsMouseSetPos(&pos);
+ if (!FrontEndMenuManager.m_bRenderGameInMenu) {
+ // This is from SA, but it's nice for windowed mode
+ RwV2d pos;
+ pos.x = SCREEN_WIDTH / 2.0f;
+ pos.y = SCREEN_HEIGHT / 2.0f;
+ RsMouseSetPos(&pos);
+ }
#endif
CRenderer::ConstructRenderList();
CRenderer::PreRender();
@@ -210,6 +232,10 @@ Idle(void *arg)
return;
}
+#ifdef PS2_SAVE_DIALOG
+ if (FrontEndMenuManager.m_bMenuActive)
+ DefinedState();
+#endif
RenderMenus();
DoFade();
Render2dStuffAfterFade();
@@ -228,7 +254,7 @@ FrontendIdle(void)
#endif
CTimer::Update();
- CSprite2d::SetRecipNearClip();
+ CSprite2d::SetRecipNearClip(); // this should be on InitialiseRenderWare according to PS2 asm. seems like a bug fix
CSprite2d::InitPerFrame();
CFont::InitPerFrame();
CPad::UpdatePads();
@@ -248,11 +274,11 @@ FrontendIdle(void)
if(!RsCameraBeginUpdate(Scene.camera))
return;
- DefinedState();
+ DefinedState(); // seems redundant, but breaks resolution change.
RenderMenus();
DoFade();
Render2dStuffAfterFade();
- CFont::DrawFonts();
+// CFont::DrawFonts(); // redundant
DoRWStuffEndOfFrame();
}
@@ -744,16 +770,16 @@ LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
#ifdef CHATTYSPLASH
// my attempt
static wchar tmpstr[80];
- float scale = SCREEN_SCALE_Y(0.8f);
- vpos -= 50*scale;
- CFont::SetScale(scale, scale);
+ float yscale = SCREEN_SCALE_Y(0.9f);
+ vpos -= 45*yscale;
+ CFont::SetScale(SCREEN_SCALE_X(0.75f), yscale);
CFont::SetPropOn();
CFont::SetRightJustifyOff();
CFont::SetFontStyle(FONT_BANK);
CFont::SetColor(CRGBA(255, 255, 255, 255));
AsciiToUnicode(str1, tmpstr);
CFont::PrintString(hpos, vpos, tmpstr);
- vpos += 25*scale;
+ vpos += 22*yscale;
AsciiToUnicode(str2, tmpstr);
CFont::PrintString(hpos, vpos, tmpstr);
#endif
@@ -999,7 +1025,11 @@ AppEventHandler(RsEvent event, void *param)
case rsFRONTENDIDLE:
{
+#ifdef PS2_SAVE_DIALOG
+ Idle((void*)1);
+#else
FrontendIdle();
+#endif
return rsEVENTPROCESSED;
}