Wing Commander
Reconstructed Win32 source (1996)
Toggle main menu visibility
Loading...
Searching...
No Matches
timer.c
Go to the documentation of this file.
1
/**
2
* @file
3
* @ingroup shell
4
* @brief Win32 frame timer and developer step waiting.
5
*
6
* Address range 42afa0-42b04f.
7
*/
8
#include "
wc1.h
"
9
10
11
/* Linker commons defined here; LINK orders them by identifier hash. */
12
TextContext
stLeftVduTextContext
;
/* 0x005a74f0 */
13
Viewport
stSpaceBufferViewport
;
/* 0x005a7510 */
14
Viewport
stRightVduViewport
;
/* 0x005a7530 */
15
Viewport
stPilotHandBackdropView
;
/* 0x005a7550 */
16
struct
Shape
*
pCockpitWeaponShapePtr
;
/* 0x005a7564 */
17
Viewport
stCurrentConvTextViewport
;
/* 0x005a7570 */
18
char
szDefaultTxtBuf
[0xc8];
/* 0x005a7590 */
19
struct
Shape
*
pCockpitIndicatorShape
;
/* 0x005a7658 */
20
struct
Shape
*
pCurrentConstellationShape
;
/* 0x005a765c */
21
22
/* Function start: 0x42AFA0 */
23
void
WaitForDebugStep
(
void
)
24
{
25
while
(
TakeDebugStepFlag
() == 0) ;
26
}
27
28
/* Function start: 0x42AFB0 */
29
void
CALLBACK
FrameTimerCallback
(UINT timerId, UINT message,
30
DWORD user, DWORD first, DWORD second)
31
{
32
(
void
)timerId;
33
(
void
)message;
34
(
void
)user;
35
(
void
)first;
36
(
void
)second;
37
bFrameTickPendingFlag
= 0;
38
}
39
40
/* Function start: 0x42AFC0 */
41
void
SetMultimediaTimerCallback
(
int
period)
42
{
43
int
milliseconds = period * 1000 / 60;
44
45
if
(period == 0) {
46
bFrameTickPendingFlag
= 0;
47
if
(
nCurrentFrameTimerIdValue
!= 0) {
48
timeKillEvent(
nCurrentFrameTimerIdValue
);
49
nCurrentFrameTimerIdValue
= 0;
50
}
51
}
else
{
52
if
(
nCurrentFrameTimerIdValue
!= 0) {
53
timeKillEvent(
nCurrentFrameTimerIdValue
);
54
nCurrentFrameTimerIdValue
= 0;
55
}
56
bFrameTickPendingFlag
= 1;
57
nCurrentFrameTimerIdValue
= timeSetEvent(milliseconds, milliseconds,
58
FrameTimerCallback
, 0, 0);
59
}
60
}
void
void(__cdecl *pIxFree)(void *)
stPilotHandBackdropView
Viewport stPilotHandBackdropView
Definition
timer.c:15
stRightVduViewport
Viewport stRightVduViewport
Definition
timer.c:14
pCockpitWeaponShapePtr
struct Shape * pCockpitWeaponShapePtr
Definition
timer.c:16
pCurrentConstellationShape
struct Shape * pCurrentConstellationShape
Definition
timer.c:20
stCurrentConvTextViewport
Viewport stCurrentConvTextViewport
Definition
timer.c:17
szDefaultTxtBuf
char szDefaultTxtBuf[0xc8]
Definition
timer.c:18
stSpaceBufferViewport
Viewport stSpaceBufferViewport
Definition
timer.c:13
stLeftVduTextContext
TextContext stLeftVduTextContext
Definition
timer.c:12
pCockpitIndicatorShape
struct Shape * pCockpitIndicatorShape
Definition
timer.c:19
bFrameTickPendingFlag
volatile int bFrameTickPendingFlag
Definition
mathfp.c:16
nCurrentFrameTimerIdValue
unsigned int nCurrentFrameTimerIdValue
Definition
main.c:90
Shape
Definition
wc1base.h:90
TextContext
Definition
wc1base.h:235
Viewport
Definition
wc1base.h:73
wc1.h
Umbrella header for the game core.
WaitForDebugStep
void WaitForDebugStep(void)
Definition
timer.c:23
SetMultimediaTimerCallback
void SetMultimediaTimerCallback(int period)
Definition
timer.c:41
FrameTimerCallback
void CALLBACK FrameTimerCallback(UINT timerId, UINT message, DWORD user, DWORD first, DWORD second)
Definition
timer.c:29
TakeDebugStepFlag
unsigned char TakeDebugStepFlag(void)
Definition
pilot.cpp:194
src
timer.c
Generated by
1.18.0