-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathc_intrf.h
129 lines (88 loc) · 2.91 KB
/
c_intrf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#ifndef C_INTRF_H
#define C_INTRF_H
#include "types.h"
void StartUp(void);
/* Initialize all Joystick stuff, load in all configuration data, parse
* commandline data, obtain current directory (One time initialization) */
void SystemInit(void);
// print character
void PrintChar(char);
// Print ASCIIZ string
void PrintStr(char const*);
// Wait for a key to be pressed
char WaitForKey(void);
// returns 0 if there are no keys in the keyboard buffer, 0xFF otherwise
u1 Check_Key(void);
/* Wait if there are no keys in buffer, then return key. For extended keys,
* return a 0, then the extended key afterwards. */
char Get_Key(void);
// Delay for n / 65536 of a second
void delay(u4 n);
// Executes before starting/continuing a game
void InitPreGame(void);
/* Executes after pre-game init, can execute multiple times after a single
* InitPreGame */
void SetupPreGame(void);
// Called after game is ended
void DeInitPostGame(void);
void GUIInit(void);
void GUIDeInit(void);
// Returns 1 in videotroub if trouble occurs
void initvideo(void);
void deinitvideo(void);
// In-game screen render w/ triple buffer check
void DrawScreen(void);
// GUI screen render
void vidpastecopyscr(void);
// One-time input device init
void UpdateDevices(void);
void JoyRead(void);
// Sets keys according to input device selected
void SetInputDevice(u1 device, u1 player);
// return non-zero if successful
u4 Init_Mouse(void);
// Returns both pressed and coordinates: YYYYYYYYXXXXXXXXBBBBBBBBBBBBBBBB
u4 Get_MouseData(void);
// Sets the X boundaries
void Set_MouseXMax(u4 min, u4 max);
// Sets the Y boundaries
void Set_MouseYMax(u4 min, u4 max);
// Sets Mouse Position
void Set_MousePosition(u4 x, u4 y);
// returns x,y displacement in pixel: YYYYYYYYYYYYYYYYXXXXXXXXXXXXXXXX
u4 Get_MousePositionDisplacement(void);
void MouseWindow(void);
void StopSound(void);
void StartSound(void);
// Call the timer update function here
void Check60hz(void);
/* GUI Video Mode Names - Make sure that all names are of the same length and
* end with a NULL terminator */
extern char const GUIVideoModeNames[][18];
// Total Number of Video Modes
extern u4 const NumVideoModes;
extern u1 GUIHQ2X[]; // Hq2x Filter
extern u1 GUIM7VID[]; // Hires Mode 7
extern u1 GUINTVID[]; // NTSC Filter
extern u1 GUIBIFIL[]; // Bilinear Filter
extern u1 GUIDSIZE[]; // D Modes
extern u1 GUIHQ3X[]; // Hq3x Filter
extern u1 GUIHQ4X[]; // Hq4x Filter
extern u1 GUIKEEP43[]; // Keep 4:3 Ratio
extern u1 GUIWFVID[]; // Fullscreen
#ifdef __UNIXSDL__
extern u1 GUIRESIZE[]; // SDL Resizable
#endif
#ifdef __WIN32__
extern u1 GUIDSMODE[]; // Win D-Stretched Modes
extern u1 GUISMODE[]; // Win Stretched Modes
#else
extern u1 GUII2VID[]; // Interpolation
#endif
// Input Device Names
extern char const GUIInputNames[][17];
// Total Number of Input Devices
extern u4 const NumInputDevices;
// GUI Description codes for each corresponding key pressed value
extern char const ScanCodeListing[];
#endif