clean up timebar ifdefs

This commit is contained in:
aap 2020-10-25 16:17:30 +01:00
parent 83947e6958
commit e3a1041a47
3 changed files with 18 additions and 44 deletions

View file

@ -1008,9 +1008,7 @@ Idle(void *arg)
CTimer::Update(); CTimer::Update();
#ifdef TIMEBARS
tbInit(); tbInit();
#endif
CSprite2d::InitPerFrame(); CSprite2d::InitPerFrame();
CFont::InitPerFrame(); CFont::InitPerFrame();
@ -1026,39 +1024,27 @@ Idle(void *arg)
FrontEndMenuManager.Process(); FrontEndMenuManager.Process();
} else { } else {
CPointLights::InitPerFrame(); CPointLights::InitPerFrame();
#ifdef TIMEBARS
tbStartTimer(0, "CGame::Process"); tbStartTimer(0, "CGame::Process");
#endif
CGame::Process(); CGame::Process();
#ifdef TIMEBARS
tbEndTimer("CGame::Process"); tbEndTimer("CGame::Process");
tbStartTimer(0, "DMAudio.Service"); tbStartTimer(0, "DMAudio.Service");
#endif
DMAudio.Service(); DMAudio.Service();
#ifdef TIMEBARS
tbEndTimer("DMAudio.Service"); tbEndTimer("DMAudio.Service");
#endif
} }
if (RsGlobal.quit) if (RsGlobal.quit)
return; return;
#else #else
CPointLights::InitPerFrame(); CPointLights::InitPerFrame();
#ifdef TIMEBARS
tbStartTimer(0, "CGame::Process"); tbStartTimer(0, "CGame::Process");
#endif
CGame::Process(); CGame::Process();
#ifdef TIMEBARS
tbEndTimer("CGame::Process"); tbEndTimer("CGame::Process");
tbStartTimer(0, "DMAudio.Service"); tbStartTimer(0, "DMAudio.Service");
#endif
DMAudio.Service(); DMAudio.Service();
#ifdef TIMEBARS
tbEndTimer("DMAudio.Service"); tbEndTimer("DMAudio.Service");
#endif
#endif #endif
if(CGame::bDemoMode && CTimer::GetTimeInMilliseconds() > (3*60 + 30)*1000 && !CCutsceneMgr::IsCutsceneProcessing()){ if(CGame::bDemoMode && CTimer::GetTimeInMilliseconds() > (3*60 + 30)*1000 && !CCutsceneMgr::IsCutsceneProcessing()){
@ -1098,18 +1084,13 @@ Idle(void *arg)
RsMouseSetPos(&pos); RsMouseSetPos(&pos);
} }
#endif #endif
#ifdef TIMEBARS
tbStartTimer(0, "CnstrRenderList"); tbStartTimer(0, "CnstrRenderList");
#endif
CRenderer::ConstructRenderList(); CRenderer::ConstructRenderList();
#ifdef TIMEBARS
tbEndTimer("CnstrRenderList"); tbEndTimer("CnstrRenderList");
tbStartTimer(0, "PreRender"); tbStartTimer(0, "PreRender");
#endif
CRenderer::PreRender(); CRenderer::PreRender();
#ifdef TIMEBARS
tbEndTimer("PreRender"); tbEndTimer("PreRender");
#endif
#ifdef FIX_BUGS #ifdef FIX_BUGS
RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void *)FALSE); // TODO: temp? this fixes OpenGL render but there should be a better place for this 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()); RwCameraSetFogDistance(Scene.camera, CTimeCycle::GetFogStart());
#endif #endif
#ifdef TIMEBARS
tbStartTimer(0, "RenderScene"); tbStartTimer(0, "RenderScene");
#endif
RenderScene(); RenderScene();
#ifdef TIMEBARS
tbEndTimer("RenderScene"); tbEndTimer("RenderScene");
#endif
#ifdef EXTENDED_PIPELINES #ifdef EXTENDED_PIPELINES
CustomPipes::EnvMapRender(); CustomPipes::EnvMapRender();
@ -1150,21 +1127,16 @@ Idle(void *arg)
RenderDebugShit(); RenderDebugShit();
RenderEffects(); RenderEffects();
#ifdef TIMEBARS
tbStartTimer(0, "RenderMotionBlur"); tbStartTimer(0, "RenderMotionBlur");
#endif
if((TheCamera.m_BlurType == MOTION_BLUR_NONE || TheCamera.m_BlurType == MOTION_BLUR_LIGHT_SCENE) && if((TheCamera.m_BlurType == MOTION_BLUR_NONE || TheCamera.m_BlurType == MOTION_BLUR_LIGHT_SCENE) &&
TheCamera.m_ScreenReductionPercentage > 0.0f) TheCamera.m_ScreenReductionPercentage > 0.0f)
TheCamera.SetMotionBlurAlpha(150); TheCamera.SetMotionBlurAlpha(150);
TheCamera.RenderMotionBlur(); TheCamera.RenderMotionBlur();
#ifdef TIMEBARS
tbEndTimer("RenderMotionBlur"); tbEndTimer("RenderMotionBlur");
tbStartTimer(0, "Render2dStuff"); tbStartTimer(0, "Render2dStuff");
#endif
Render2dStuff(); Render2dStuff();
#ifdef TIMEBARS
tbEndTimer("Render2dStuff"); tbEndTimer("Render2dStuff");
#endif
}else{ }else{
#ifdef ASPECT_RATIO_SCALE #ifdef ASPECT_RATIO_SCALE
CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO); CameraSize(Scene.camera, nil, SCREEN_VIEWWINDOW, SCREEN_ASPECT_RATIO);
@ -1181,35 +1153,28 @@ Idle(void *arg)
if (FrontEndMenuManager.m_bMenuActive) if (FrontEndMenuManager.m_bMenuActive)
DefinedState(); DefinedState();
#endif #endif
#ifdef TIMEBARS
tbStartTimer(0, "RenderMenus"); tbStartTimer(0, "RenderMenus");
#endif
RenderMenus(); RenderMenus();
#ifdef TIMEBARS
tbEndTimer("RenderMenus"); tbEndTimer("RenderMenus");
tbStartTimer(0, "DoFade");
#endif
#ifdef PS2_MENU #ifdef PS2_MENU
if ( TheMemoryCard.m_bWantToLoad ) if ( TheMemoryCard.m_bWantToLoad )
return; return;
#endif #endif
tbStartTimer(0, "DoFade");
DoFade(); DoFade();
#ifdef TIMEBARS
tbEndTimer("DoFade"); tbEndTimer("DoFade");
tbStartTimer(0, "Render2dStuff-Fade"); tbStartTimer(0, "Render2dStuff-Fade");
#endif
Render2dStuffAfterFade(); Render2dStuffAfterFade();
#ifdef TIMEBARS
tbEndTimer("Render2dStuff-Fade"); tbEndTimer("Render2dStuff-Fade");
#endif
CCredits::Render(); CCredits::Render();
#ifdef TIMEBARS
if (gbShowTimebars) if (gbShowTimebars)
tbDisplay(); tbDisplay();
#endif
DoRWStuffEndOfFrame(); DoRWStuffEndOfFrame();

View file

@ -16,6 +16,8 @@ extern bool gbPrintShite;
extern bool gbModelViewer; extern bool gbModelViewer;
#ifdef TIMEBARS #ifdef TIMEBARS
extern bool gbShowTimebars; extern bool gbShowTimebars;
#else
#define gbShowTimebars false
#endif #endif
class CSprite2d; class CSprite2d;

View file

@ -1,6 +1,13 @@
#pragma once #pragma once
#ifdef TIMEBARS
void tbInit(); void tbInit();
void tbStartTimer(int32, Const char*); void tbStartTimer(int32, Const char*);
void tbEndTimer(Const char*); void tbEndTimer(Const char*);
void tbDisplay(); void tbDisplay();
#else
#define tbInit()
#define tbStartTimer(a, b)
#define tbEndTimer(a)
#define tbDisplay()
#endif