summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-10-25 16:17:30 +0100
committeraap <aap@papnet.eu>2020-10-25 16:17:30 +0100
commite3a1041a471aaaa3d906caeb23d1d334071978b2 (patch)
tree26c28ac72597af9ffec486f6b02bb9e38ad99d60
parentRemove redundant includes (diff)
downloadre3-e3a1041a471aaaa3d906caeb23d1d334071978b2.tar
re3-e3a1041a471aaaa3d906caeb23d1d334071978b2.tar.gz
re3-e3a1041a471aaaa3d906caeb23d1d334071978b2.tar.bz2
re3-e3a1041a471aaaa3d906caeb23d1d334071978b2.tar.lz
re3-e3a1041a471aaaa3d906caeb23d1d334071978b2.tar.xz
re3-e3a1041a471aaaa3d906caeb23d1d334071978b2.tar.zst
re3-e3a1041a471aaaa3d906caeb23d1d334071978b2.zip
-rw-r--r--src/core/main.cpp51
-rw-r--r--src/core/main.h2
-rw-r--r--src/core/timebars.h9
3 files changed, 18 insertions, 44 deletions
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 5fea9c4b..b6a32b55 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -1008,9 +1008,7 @@ Idle(void *arg)
CTimer::Update();
-#ifdef TIMEBARS
tbInit();
-#endif
CSprite2d::InitPerFrame();
CFont::InitPerFrame();
@@ -1026,40 +1024,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 +1084,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 +1116,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 +1127,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 +1153,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();
diff --git a/src/core/main.h b/src/core/main.h
index 7eb080cb..13fff447 100644
--- a/src/core/main.h
+++ b/src/core/main.h
@@ -16,6 +16,8 @@ extern bool gbPrintShite;
extern bool gbModelViewer;
#ifdef TIMEBARS
extern bool gbShowTimebars;
+#else
+#define gbShowTimebars false
#endif
class CSprite2d;
diff --git a/src/core/timebars.h b/src/core/timebars.h
index 3871b61c..c4939802 100644
--- a/src/core/timebars.h
+++ b/src/core/timebars.h
@@ -1,6 +1,13 @@
#pragma once
+#ifdef TIMEBARS
void tbInit();
void tbStartTimer(int32, Const char*);
void tbEndTimer(Const char*);
-void tbDisplay(); \ No newline at end of file
+void tbDisplay();
+#else
+#define tbInit()
+#define tbStartTimer(a, b)
+#define tbEndTimer(a)
+#define tbDisplay()
+#endif