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.cpp78
1 files changed, 29 insertions, 49 deletions
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 5fea9c4b..cd234588 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -64,6 +64,7 @@
#include "debugmenu.h"
#include "Clock.h"
#include "custompipes.h"
+#include "frontendoption.h"
GlobalScene Scene;
@@ -88,7 +89,11 @@ RwRGBA gColourTop;
bool gameAlreadyInitialised;
float NumberOfChunksLoaded;
+#ifdef GTA_PS2
+#define TOTALNUMCHUNKS 48.0f
+#else
#define TOTALNUMCHUNKS 73.0f
+#endif
bool g_SlowMode = false;
char version_name[64];
@@ -404,6 +409,13 @@ Initialise3D(void *param)
DebugMenuInit();
DebugMenuPopulate();
#endif // !DEBUGMENU
+#ifdef CUSTOM_FRONTEND_OPTIONS
+ // Apparently this func. can be run multiple times at the start.
+ if (numCustomFrontendOptions == 0 && numCustomFrontendScreens == 0) {
+ // needs stored language and TheText to be loaded, and last TheText reload is at the start of here
+ CustomFrontendOptionsPopulate();
+ }
+#endif
bool ret = CGame::InitialiseRenderWare();
#ifdef EXTENDED_PIPELINES
CustomPipes::CustomPipeInit(); // need Scene.world for this
@@ -617,20 +629,20 @@ LoadingIslandScreen(const char *levelName)
CFont::SetScale(1.5f, 1.5f);
CFont::SetPropOn();
CFont::SetRightJustifyOn();
- CFont::SetRightJustifyWrap(150.0f);
+ CFont::SetRightJustifyWrap(SCREEN_SCALE_X(150.0f));
CFont::SetFontStyle(FONT_HEADING);
sprintf(str, "WELCOME TO");
AsciiToUnicode(str, wstr);
CFont::SetDropColor(CRGBA(0, 0, 0, 255));
CFont::SetDropShadowPosition(3);
CFont::SetColor(CRGBA(243, 237, 71, 255));
- CFont::SetScale(SCREEN_STRETCH_X(1.2f), SCREEN_STRETCH_Y(1.2f));
- CFont::PrintString(SCREEN_WIDTH - 20, SCREEN_STRETCH_FROM_BOTTOM(110.0f), TheText.Get("WELCOME"));
+ CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.2f));
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_STRETCH_FROM_BOTTOM(110.0f), TheText.Get("WELCOME"));
TextCopy(wstr, name);
TheText.UpperCase(wstr);
CFont::SetColor(CRGBA(243, 237, 71, 255));
- CFont::SetScale(SCREEN_STRETCH_X(1.2f), SCREEN_STRETCH_Y(1.2f));
- CFont::PrintString(SCREEN_WIDTH-20, SCREEN_STRETCH_FROM_BOTTOM(80.0f), wstr);
+ CFont::SetScale(SCREEN_SCALE_X(1.2f), SCREEN_SCALE_Y(1.2f));
+ CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(20.0f), SCREEN_STRETCH_FROM_BOTTOM(80.0f), wstr);
CFont::DrawFonts();
DoRWStuffEndOfFrame();
}
@@ -768,6 +780,8 @@ DisplayGameDebugText()
char str[200];
wchar ustr[200];
+
+#ifdef DRAW_GAME_VERSION_TEXT
wchar ver[200];
AsciiToUnicode(version_name, ver);
@@ -783,6 +797,7 @@ DisplayGameDebugText()
CFont::SetBackGroundOnlyTextOff();
CFont::SetColor(CRGBA(255, 108, 0, 255));
CFont::PrintString(SCREEN_SCALE_X(10.0f), SCREEN_SCALE_Y(10.0f), ver);
+#endif
FrameSamples++;
FramesPerSecondCounter += 1000.0f / (CTimer::GetTimeStepNonClippedInSeconds() * 1000.0f);
@@ -841,7 +856,7 @@ DisplayGameDebugText()
CFont::SetRightJustifyOff();
CFont::SetJustifyOff();
CFont::SetBackGroundOnlyTextOff();
- CFont::SetWrapx(640.0f);
+ CFont::SetWrapx(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH));
CFont::SetFontStyle(FONT_HEADING);
CFont::SetColor(CRGBA(0, 0, 0, 255));
@@ -1008,9 +1023,7 @@ Idle(void *arg)
CTimer::Update();
-#ifdef TIMEBARS
tbInit();
-#endif
CSprite2d::InitPerFrame();
CFont::InitPerFrame();
@@ -1026,40 +1039,28 @@ Idle(void *arg)
FrontEndMenuManager.Process();
} else {
CPointLights::InitPerFrame();
-#ifdef TIMEBARS
tbStartTimer(0, "CGame::Process");
-#endif
CGame::Process();
-#ifdef TIMEBARS
tbEndTimer("CGame::Process");
tbStartTimer(0, "DMAudio.Service");
-#endif
DMAudio.Service();
-#ifdef TIMEBARS
tbEndTimer("DMAudio.Service");
-#endif
}
if (RsGlobal.quit)
return;
#else
CPointLights::InitPerFrame();
-#ifdef TIMEBARS
+
tbStartTimer(0, "CGame::Process");
-#endif
CGame::Process();
-#ifdef TIMEBARS
tbEndTimer("CGame::Process");
- tbStartTimer(0, "DMAudio.Service");
-#endif
+ tbStartTimer(0, "DMAudio.Service");
DMAudio.Service();
-
-#ifdef TIMEBARS
tbEndTimer("DMAudio.Service");
#endif
-#endif
if(CGame::bDemoMode && CTimer::GetTimeInMilliseconds() > (3*60 + 30)*1000 && !CCutsceneMgr::IsCutsceneProcessing()){
#ifdef PS2_MENU
@@ -1098,18 +1099,13 @@ Idle(void *arg)
RsMouseSetPos(&pos);
}
#endif
-#ifdef TIMEBARS
tbStartTimer(0, "CnstrRenderList");
-#endif
CRenderer::ConstructRenderList();
-#ifdef TIMEBARS
tbEndTimer("CnstrRenderList");
+
tbStartTimer(0, "PreRender");
-#endif
CRenderer::PreRender();
-#ifdef TIMEBARS
tbEndTimer("PreRender");
-#endif
#ifdef FIX_BUGS
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); // TODO: temp? this fixes OpenGL render but there should be a better place for this
@@ -1135,13 +1131,9 @@ Idle(void *arg)
RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart());
#endif
-#ifdef TIMEBARS
tbStartTimer(0, "RenderScene");
-#endif
RenderScene();
-#ifdef TIMEBARS
tbEndTimer("RenderScene");
-#endif
#ifdef EXTENDED_PIPELINES
CustomPipes::EnvMapRender();
@@ -1150,21 +1142,16 @@ Idle(void *arg)
RenderDebugShit();
RenderEffects();
-#ifdef TIMEBARS
tbStartTimer(0, "RenderMotionBlur");
-#endif
if((TheCamera.m_BlurType == MOTION_BLUR_NONE || TheCamera.m_BlurType == MOTION_BLUR_LIGHT_SCENE) &&
TheCamera.m_ScreenReductionPercentage > 0.0f)
TheCamera.SetMotionBlurAlpha(150);
TheCamera.RenderMotionBlur();
-#ifdef TIMEBARS
tbEndTimer("RenderMotionBlur");
+
tbStartTimer(0, "Render2dStuff");
-#endif
Render2dStuff();
-#ifdef TIMEBARS
tbEndTimer("Render2dStuff");
-#endif
}else{
#ifdef ASPECT_RATIO_SCALE
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO);
@@ -1181,35 +1168,28 @@ Idle(void *arg)
if (FrontEndMenuManager.m_bMenuActive)
DefinedState();
#endif
-#ifdef TIMEBARS
tbStartTimer(0, "RenderMenus");
-#endif
RenderMenus();
-#ifdef TIMEBARS
tbEndTimer("RenderMenus");
- tbStartTimer(0, "DoFade");
-#endif
#ifdef PS2_MENU
if ( TheMemoryCard.m_bWantToLoad )
return;
#endif
+
+ tbStartTimer(0, "DoFade");
DoFade();
-#ifdef TIMEBARS
tbEndTimer("DoFade");
+
tbStartTimer(0, "Render2dStuff-Fade");
-#endif
Render2dStuffAfterFade();
-#ifdef TIMEBARS
tbEndTimer("Render2dStuff-Fade");
-#endif
+
CCredits::Render();
-#ifdef TIMEBARS
if (gbShowTimebars)
tbDisplay();
-#endif
DoRWStuffEndOfFrame();