Skip to content

Commit c6a5753

Browse files
author
Niko
committed
progress
1 parent 50401de commit c6a5753

File tree

3 files changed

+18
-16
lines changed

3 files changed

+18
-16
lines changed

decompile/General/AltMods/DebugMenu/Profiler.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ int Debug_GetPreciseTime()
2323
return sysClock;
2424
}
2525

26+
struct ProfilerSection* DebugProfiler_GetOpen()
27+
{
28+
return ptrOpenSect;
29+
}
30+
2631
void DebugProfiler_Init()
2732
{
2833
int size = sizeof(struct ProfilerSection) * 32;
@@ -100,25 +105,19 @@ void DebugProfiler_SectionRestart(int time)
100105
ptrOpenSect->timeStart = time;
101106
}
102107

103-
void DebugProfiler_SectionEnd()
108+
int DebugProfiler_SectionEnd()
104109
{
105110
if(ptrOpenSect == 0)
106-
return;
111+
return 0;
107112

108113
ptrOpenSect->timeEnd = Debug_GetPreciseTime();
109114

110-
#if 0
111-
if (ptrOpenSect->b != 0)
112-
{
113-
int time = ptrOpenSect->timeEnd - ptrOpenSect->timeStart;
114-
115-
if(time > 0)
116-
printf("Level: %d\n", time);
117-
}
118-
#endif
115+
int ret = ptrOpenSect->timeEnd - ptrOpenSect->timeStart;
119116

120117
ptrOpenSect = 0;
121118
numSectionsUsed++;
119+
120+
return ret;
122121
}
123122

124123
int DebugProfiler_Scale(int input)

decompile/General/MAIN/MainFrame_02_GameLogic.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ void DECOMP_MainFrame_GameLogic(struct GameTracker* gGT, struct GamepadSystem* g
301301
}
302302

303303
#ifdef USE_PROFILER
304-
void DebugProfiler_SectionEnd();
304+
int DebugProfiler_SectionEnd();
305305
DebugProfiler_SectionEnd();
306306
#endif
307307

decompile/General/MAIN/MainFrame_08_RenderFrame.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -297,8 +297,11 @@ void DECOMP_MainFrame_RenderFrame(struct GameTracker* gGT, struct GamepadSystem*
297297

298298
// Instance Profiler
299299
#ifdef USE_PROFILER
300-
void DebugProfiler_SectionEnd();
300+
int DebugProfiler_SectionEnd();
301+
int x =
301302
DebugProfiler_SectionEnd();
303+
304+
printf("Retail Instance: %d\n", x);
302305
#endif
303306

304307
DECOMP_PushBuffer_FadeAllWindows();
@@ -383,7 +386,7 @@ void DECOMP_MainFrame_RenderFrame(struct GameTracker* gGT, struct GamepadSystem*
383386

384387
// Level Profiler
385388
#ifdef USE_PROFILER
386-
void DebugProfiler_SectionEnd();
389+
int DebugProfiler_SectionEnd();
387390
DebugProfiler_SectionEnd();
388391
#endif
389392

@@ -419,7 +422,7 @@ void DECOMP_MainFrame_RenderFrame(struct GameTracker* gGT, struct GamepadSystem*
419422

420423
// RaceFlag_DrawSelf Profiler
421424
#ifdef USE_PROFILER
422-
void DebugProfiler_SectionEnd();
425+
int DebugProfiler_SectionEnd();
423426
DebugProfiler_SectionEnd();
424427
#endif
425428
}
@@ -440,7 +443,7 @@ void DECOMP_MainFrame_RenderFrame(struct GameTracker* gGT, struct GamepadSystem*
440443

441444
// VSYNC Profiler
442445
#ifdef USE_PROFILER
443-
void DebugProfiler_SectionEnd();
446+
int DebugProfiler_SectionEnd();
444447
DebugProfiler_SectionEnd();
445448

446449
if((gGT->gameMode1 & (LOADING|1)) == 0)

0 commit comments

Comments
 (0)