Wing Commander
Reconstructed Win32 source (1996)
Toggle main menu visibility
Loading...
Searching...
No Matches
mathutil.c
Go to the documentation of this file.
1
/**
2
* @file
3
* @ingroup data
4
* @brief Integer min and max, a packet-release helper, and the
5
* single-precision angular constants.
6
*
7
* Address range 41d0c0-41d11f. MinShort and MaxShort have 94 call sites
8
* across the game core. The constants' read-only data follows the barracks
9
* menu regions and precedes the DirectDraw GUIDs, as only a unit linked
10
* between those two can place it.
11
*/
12
#include "
wc1.h
"
13
14
/* Nothing in the shipped executable references these three values. */
15
const
float
fPi
= 3.1415927410125732421875f;
/* 0x004630dc */
16
const
float
fDegreesPerRadian
= 57.295780181884765625f;
/* 0x004630e0 */
17
const
float
fRadiansPerDegree
= 0.01745329238474369049072265625f;
/* 0x004630e4 */
18
19
/* Function start: 0x41D0C0 */
20
short
MinShort
(
short
a,
short
b)
21
{
22
if
(a < b)
23
return
a;
24
return
b;
25
}
26
27
/* One cockpit sizing call supplies a third argument; only the first two are read. */
28
/* Function start: 0x41D0E0 */
29
short
MaxShort
(
short
a,
short
b, ...)
30
{
31
if
(a > b)
32
return
a;
33
return
b;
34
}
35
36
/* Function start: 0x41D100 */
37
void
FreePacketAndClear
(
void
*slot,
unsigned
short
releaseFlags)
38
{
39
void
**p;
40
41
p = (
void
**)slot;
42
if
(*p != 0) {
43
ReleasePacketHandle
(*p);
44
*p = 0;
45
}
46
}
fRadiansPerDegree
const float fRadiansPerDegree
Definition
mathutil.c:17
fPi
const float fPi
Definition
mathutil.c:15
fDegreesPerRadian
const float fDegreesPerRadian
Definition
mathutil.c:16
wc1.h
Umbrella header for the game core.
MinShort
short MinShort(short a, short b)
Definition
mathutil.c:20
ReleasePacketHandle
void ReleasePacketHandle(void *handle)
Definition
ending.c:50
MaxShort
short MaxShort(short a, short b,...)
Definition
mathutil.c:29
FreePacketAndClear
void FreePacketAndClear(void *slot, unsigned short releaseFlags)
Definition
mathutil.c:37
src
mathutil.c
Generated by
1.18.0