Wing Commander II
Reconstructed Win32 source (1996)
Loading...
Searching...
No Matches
timer.c
Go to the documentation of this file.
1/*
2 * Multimedia frame timer callback.
3 *
4 * Retail object 0x40A2D0-0x40A39F (link order; see docs/ORDER.md).
5 */
6#include "game.h"
7
8/* Function start: 0x40A2D0 */
9void CALLBACK FrameTimerCallback(UINT timerId, UINT message,
10 DWORD user, DWORD first, DWORD second)
11{
12 (void)timerId;
13 (void)message;
14 (void)user;
15 (void)first;
16 (void)second;
18}
19
20/* Function start: 0x40A2E7 */
22{
23 /* Retail reserves a dword it never touches above the period. */
24 int resolution;
25 int milliseconds = period * 1000 / 60;
26
27 if (period == 0) {
29 if (g_uFrameTimerEventId != 0) {
30 timeKillEvent(g_uFrameTimerEventId);
32 }
33 return;
34 }
35 if (g_uFrameTimerEventId != 0) {
36 timeKillEvent(g_uFrameTimerEventId);
38 }
40 g_uFrameTimerEventId = timeSetEvent(milliseconds, milliseconds,
41 FrameTimerCallback, 0, 0);
42 return;
43}
44
45/* Linker commons defined here. LINK lays a unit's commons out by the
46 * identifiers' hash keys, so these spellings follow the original addresses. */
47unsigned int g_uFrameTimerEventId; /* 0x005d3bec */
void(__cdecl *g_pIxFree)(void *)
void SetMultimediaTimerCallback(int period)
Definition timer.c:21
void CALLBACK FrameTimerCallback(UINT timerId, UINT message, DWORD user, DWORD first, DWORD second)
Definition timer.c:9
Shared Win32 declarations, types and library interfaces.
unsigned int g_uFrameTimerEventId
Definition timer.c:47
volatile int g_5_nFrameTimerWaitTicksValue
Definition eventmgr.c:2537