102 Dalmatians: Puppies to the Rescue
Decompilation Source Reference |
GitLab repository
Toggle main menu visibility
Loading...
Searching...
No Matches
timer.c
Go to the documentation of this file.
1
/* Recovered game implementation; original addresses identify provenance. */
2
#include "
pcdogs/platform/constants.h
"
3
#include "
pcdogs/game/globals.h
"
4
#include "
pcdogs/image/globals.h
"
5
#include "
pcdogs/platform/functions.h
"
6
7
// Original pcdogs.exe: 0x405c40
8
// Forwards to the elapsed-game-tick routine, returning milliseconds since its lazily initialized start tick.
9
uint32_t
Timer_GetElapsedTickCountThunk
()
10
{
11
/* tailcall */
12
return
Timer_GetElapsedTickCount
();
13
}
14
15
// Original pcdogs.exe: 0x43cef0
16
// The x87 product stays in ST(0) until the caller stores it.
17
long
double
Timer_GetGameTime
(
void
)
18
{
19
return
(
long
double
)GetTickCount() * 0.001f;
20
}
21
22
// Original pcdogs.exe: 0x444fc0
23
// Lazily initializes the game-start tick and returns unsigned millisecond subtraction, preserving counter wraparound.
24
uint32_t
Timer_GetElapsedTickCount
()
25
{
26
if
((uint32_t)
g_gameStartTime
==
TIMER_UNINITIALIZED_TICK
)
27
g_gameStartTime
= timeGetTime();
28
29
return
timeGetTime() -
g_gameStartTime
;
30
}
globals.h
g_gameStartTime
#define g_gameStartTime
Definition
globals.h:23
globals.h
constants.h
TIMER_UNINITIALIZED_TICK
#define TIMER_UNINITIALIZED_TICK
Definition
constants.h:8
functions.h
Timer_GetElapsedTickCountThunk
uint32_t Timer_GetElapsedTickCountThunk()
Definition
timer.c:9
Timer_GetElapsedTickCount
uint32_t Timer_GetElapsedTickCount()
Definition
timer.c:24
Timer_GetGameTime
long double Timer_GetGameTime(void)
Definition
timer.c:17
src
platform
timer.c
Generated by
1.17.0