author | celestar |
Sun, 11 Mar 2007 09:28:58 +0000 | |
branch | custombridgeheads |
changeset 5651 | 335d9bd345b0 |
parent 5650 | aefc131bf5ce |
child 5887 | 063ca43b682c |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
0 | 3 |
#ifndef HAL_H |
4 |
#define HAL_H |
|
5 |
||
5650
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
6 |
#ifdef __cplusplus |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
7 |
extern "C" { |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
8 |
#endif //__cplusplus |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
9 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
10 |
enum WindowKeyCodes { |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
11 |
WKC_SHIFT = 0x8000, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
12 |
WKC_CTRL = 0x4000, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
13 |
WKC_ALT = 0x2000, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
14 |
WKC_META = 0x1000, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
15 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
16 |
// Special ones |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
17 |
WKC_NONE = 0, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
18 |
WKC_ESC = 1, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
19 |
WKC_BACKSPACE = 2, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
20 |
WKC_INSERT = 3, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
21 |
WKC_DELETE = 4, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
22 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
23 |
WKC_PAGEUP = 5, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
24 |
WKC_PAGEDOWN = 6, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
25 |
WKC_END = 7, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
26 |
WKC_HOME = 8, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
27 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
28 |
// Arrow keys |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
29 |
WKC_LEFT = 9, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
30 |
WKC_UP = 10, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
31 |
WKC_RIGHT = 11, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
32 |
WKC_DOWN = 12, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
33 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
34 |
// Return & tab |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
35 |
WKC_RETURN = 13, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
36 |
WKC_TAB = 14, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
37 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
38 |
// Numerical keyboard |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
39 |
WKC_NUM_0 = 16, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
40 |
WKC_NUM_1 = 17, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
41 |
WKC_NUM_2 = 18, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
42 |
WKC_NUM_3 = 19, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
43 |
WKC_NUM_4 = 20, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
44 |
WKC_NUM_5 = 21, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
45 |
WKC_NUM_6 = 22, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
46 |
WKC_NUM_7 = 23, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
47 |
WKC_NUM_8 = 24, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
48 |
WKC_NUM_9 = 25, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
49 |
WKC_NUM_DIV = 26, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
50 |
WKC_NUM_MUL = 27, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
51 |
WKC_NUM_MINUS = 28, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
52 |
WKC_NUM_PLUS = 29, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
53 |
WKC_NUM_ENTER = 30, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
54 |
WKC_NUM_DECIMAL = 31, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
55 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
56 |
// Space |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
57 |
WKC_SPACE = 32, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
58 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
59 |
// Function keys |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
60 |
WKC_F1 = 33, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
61 |
WKC_F2 = 34, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
62 |
WKC_F3 = 35, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
63 |
WKC_F4 = 36, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
64 |
WKC_F5 = 37, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
65 |
WKC_F6 = 38, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
66 |
WKC_F7 = 39, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
67 |
WKC_F8 = 40, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
68 |
WKC_F9 = 41, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
69 |
WKC_F10 = 42, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
70 |
WKC_F11 = 43, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
71 |
WKC_F12 = 44, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
72 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
73 |
// backquote is the key left of "1" |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
74 |
// we only store this key here, no matter what character is really mapped to it |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
75 |
// on a particular keyboard. (US keyboard: ` and ~ ; German keyboard: ^ and °) |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
76 |
WKC_BACKQUOTE = 45, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
77 |
WKC_PAUSE = 46, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
78 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
79 |
// 0-9 are mapped to 48-57 |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
80 |
// A-Z are mapped to 65-90 |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
81 |
// a-z are mapped to 97-122 |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
82 |
}; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
83 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
84 |
|
0 | 85 |
typedef struct { |
1301
313804601383
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
86 |
const char *(*start)(const char * const *parm); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
87 |
void (*stop)(void); |
0 | 88 |
} HalCommonDriver; |
89 |
||
90 |
typedef struct { |
|
1301
313804601383
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
91 |
const char *(*start)(const char * const *parm); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
92 |
void (*stop)(void); |
0 | 93 |
void (*make_dirty)(int left, int top, int width, int height); |
2228 | 94 |
void (*main_loop)(void); |
0 | 95 |
bool (*change_resolution)(int w, int h); |
1829
0b6de3b4458a
(svn r2334) - Fix (regression): moved togglefullscreen into the video-driver, now windows works, dedicated works and sdl works. Also reverted the change to the makefile.
Darkvater
parents:
1596
diff
changeset
|
96 |
void (*toggle_fullscreen)(bool fullscreen); |
0 | 97 |
} HalVideoDriver; |
98 |
||
99 |
typedef struct { |
|
1301
313804601383
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
100 |
const char *(*start)(const char * const *parm); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
101 |
void (*stop)(void); |
0 | 102 |
} HalSoundDriver; |
103 |
||
104 |
typedef struct { |
|
1301
313804601383
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
105 |
const char *(*start)(const char * const *parm); |
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
106 |
void (*stop)(void); |
0 | 107 |
|
108 |
void (*play_song)(const char *filename); |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
109 |
void (*stop_song)(void); |
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
110 |
bool (*is_song_playing)(void); |
0 | 111 |
void (*set_volume)(byte vol); |
112 |
} HalMusicDriver; |
|
113 |
||
5650
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
114 |
extern HalMusicDriver *_music_driver; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
115 |
extern HalSoundDriver *_sound_driver; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
116 |
extern HalVideoDriver *_video_driver; |
0 | 117 |
|
118 |
enum DriverType { |
|
119 |
VIDEO_DRIVER = 0, |
|
120 |
SOUND_DRIVER = 1, |
|
121 |
MUSIC_DRIVER = 2, |
|
122 |
}; |
|
123 |
||
5650
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
124 |
enum GameModes { |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
125 |
GM_MENU, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
126 |
GM_NORMAL, |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
127 |
GM_EDITOR |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
128 |
}; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
129 |
|
4217
58e6b9449c80
(svn r5761) - Cleanup: Really minor whitespace changes, and remove an extern from a function decleration in header file.
Darkvater
parents:
3329
diff
changeset
|
130 |
void GameLoop(void); |
0 | 131 |
|
1093
e8d26c7dc42f
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
132 |
void CreateConsole(void); |
0 | 133 |
|
5650
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
134 |
typedef int32 CursorID; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
135 |
typedef byte Pixel; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
136 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
137 |
typedef struct Point { |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
138 |
int x,y; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
139 |
} Point; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
140 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
141 |
typedef struct Rect { |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
142 |
int left,top,right,bottom; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
143 |
} Rect; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
144 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
145 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
146 |
typedef struct CursorVars { |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
147 |
Point pos, size, offs, delta; ///< position, size, offset from top-left, and movement |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
148 |
Point draw_pos, draw_size; ///< position and size bounding-box for drawing |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
149 |
CursorID sprite; ///< current image of cursor |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
150 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
151 |
int wheel; ///< mouse wheel movement |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
152 |
const CursorID *animate_list, *animate_cur; ///< in case of animated cursor, list of frames |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
153 |
uint animate_timeout; ///< current frame in list of animated cursor |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
154 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
155 |
bool visible; ///< cursor is visible |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
156 |
bool dirty; ///< the rect occupied by the mouse is dirty (redraw) |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
157 |
bool fix_at; ///< mouse is moving, but cursor is not (used for scrolling) |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
158 |
bool in_window; ///< mouse inside this window, determines drawing logic |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
159 |
} CursorVars; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
160 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
161 |
typedef struct DrawPixelInfo { |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
162 |
Pixel *dst_ptr; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
163 |
int left, top, width, height; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
164 |
int pitch; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
165 |
uint16 zoom; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
166 |
} DrawPixelInfo; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
167 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
168 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
169 |
extern byte _dirkeys; // 1 = left, 2 = up, 4 = right, 8 = down |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
170 |
extern bool _fullscreen; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
171 |
extern CursorVars _cursor; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
172 |
extern bool _ctrl_pressed; // Is Ctrl pressed? |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
173 |
extern bool _shift_pressed; // Is Shift pressed? |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
174 |
extern byte _fast_forward; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
175 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
176 |
extern bool _left_button_down; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
177 |
extern bool _left_button_clicked; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
178 |
extern bool _right_button_down; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
179 |
extern bool _right_button_clicked; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
180 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
181 |
extern DrawPixelInfo _screen; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
182 |
extern bool _exit_game; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
183 |
extern bool _networking; ///< are we in networking mode? |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
184 |
extern byte _game_mode; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
185 |
extern byte _pause; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
186 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
187 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
188 |
void HandleKeypress(uint32 key); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
189 |
void HandleMouseEvents(void); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
190 |
void CSleep(int milliseconds); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
191 |
void UpdateWindows(void); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
192 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
193 |
uint32 InteractiveRandom(void); /* Used for random sequences that are not the same on the other end of the multiplayer link */ |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
194 |
uint InteractiveRandomRange(uint max); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
195 |
void DrawTextMessage(void); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
196 |
void DrawMouseCursor(void); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
197 |
void ScreenSizeChanged(void); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
198 |
void HandleExitGameRequest(void); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
199 |
void GameSizeChanged(void); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
200 |
void UndrawMouseCursor(void); |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
201 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
202 |
extern int _pal_first_dirty; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
203 |
extern int _pal_last_dirty; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
204 |
extern int _num_resolutions; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
205 |
extern uint16 _resolutions[32][2]; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
206 |
extern uint16 _cur_resolution[2]; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
207 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
208 |
typedef struct Colour { |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
209 |
byte r; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
210 |
byte g; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
211 |
byte b; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
212 |
} Colour; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
213 |
extern Colour _cur_palette[256]; |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
214 |
|
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
215 |
#ifdef __cplusplus |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
216 |
} // extern "C" |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
217 |
#endif //__cplusplus |
aefc131bf5ce
(svn r8149) [cbh] - Sync with -r8038:8038 from trunk (the cpp merge)
celestar
parents:
5643
diff
changeset
|
218 |
|
0 | 219 |
#endif /* HAL_H */ |