Wing Commander II
Reconstructed Win32 source (1996)
Toggle main menu visibility
Loading...
Searching...
No Matches
palette.c
Go to the documentation of this file.
1
/*
2
* Saves and restores the game palette.
3
*
4
* Retail object 0x417550-0x41760F (link order; see docs/ORDER.md).
5
*/
6
#include "
game.h
"
7
8
/* Function start: 0x417550 */
9
void
SaveGamePalette
(
void
)
10
{
11
short
index;
12
13
for
(index = 0; index < 256; index++) {
14
if
((index & 15) == 0)
15
WaitForVerticalBlankThunk
();
16
GetPaletteEntry
(index,
g_ausPaletteWords
[index]);
17
}
18
}
19
20
/* Function start: 0x4175AD */
21
void
RestoreGamePalette
(
void
)
22
{
23
short
index;
24
25
for
(index = 0; (short)index < 256; index++) {
26
if
((index & 15) == 0)
27
WaitForVerticalBlankThunk
();
28
SetPaletteEntry
(index, (
short
*)
g_ausPaletteWords
[index]);
29
}
30
}
31
32
/* Linker commons defined here. LINK lays a unit's commons out by the
33
* identifiers' hash keys, so these spellings follow the original addresses. */
34
unsigned
short
g_ausPaletteWords
[256][3];
/* 0x005d3220 */
SetPaletteEntry
void SetPaletteEntry(short index, short *rgb)
Definition
gr.c:676
RestoreGamePalette
void RestoreGamePalette(void)
Definition
palette.c:21
WaitForVerticalBlankThunk
void WaitForVerticalBlankThunk(void)
Definition
eventmgr.c:189
GetPaletteEntry
void GetPaletteEntry(short index, unsigned short *rgb)
Definition
gr.c:670
SaveGamePalette
void SaveGamePalette(void)
Definition
palette.c:9
game.h
Shared Win32 declarations, types and library interfaces.
g_ausPaletteWords
unsigned short g_ausPaletteWords[256][3]
Definition
palette.c:34
src
palette.c
Generated by
1.18.0