remove duplicate debug code
This commit is contained in:
parent
fa6f9e197e
commit
ebae1add37
5 changed files with 56 additions and 79 deletions
28
src/render.c
28
src/render.c
|
@ -550,31 +550,7 @@ static void Render()
|
|||
while (UseOpenGL && ddraw->render.run && WaitForSingleObject(ddraw->render.sem, INFINITE) != WAIT_FAILED)
|
||||
{
|
||||
#if _DEBUG
|
||||
static DWORD tick_fps = 0;
|
||||
static DWORD frame_count = 0;
|
||||
static char debugText[512] = { 0 };
|
||||
static double frameTime = 0;
|
||||
RECT debugrc = { 0, 0, ddraw->width, ddraw->height };
|
||||
|
||||
if (ddraw->primary && ddraw->primary->palette)
|
||||
DrawText(ddraw->primary->hDC, debugText, -1, &debugrc, DT_NOCLIP);
|
||||
|
||||
tick_start = timeGetTime();
|
||||
if (tick_start >= tick_fps)
|
||||
{
|
||||
snprintf(
|
||||
debugText,
|
||||
sizeof(debugText),
|
||||
"FPS: %lu | Time: %2.2f ms ",
|
||||
frame_count,
|
||||
frameTime);
|
||||
|
||||
frame_count = 0;
|
||||
tick_fps = tick_start + 1000;
|
||||
|
||||
CounterStart();
|
||||
}
|
||||
frame_count++;
|
||||
DrawFrameInfoStart();
|
||||
#endif
|
||||
|
||||
ScaleW = (float)ddraw->width / SurfaceTexWidth;
|
||||
|
@ -804,7 +780,7 @@ static void Render()
|
|||
glFinish();
|
||||
|
||||
#if _DEBUG
|
||||
if (frame_count == 1) frameTime = CounterStop();
|
||||
DrawFrameInfoEnd();
|
||||
#endif
|
||||
|
||||
if (MaxFPS > 0)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue