author | truelight |
Thu, 24 Mar 2005 14:43:40 +0000 | |
changeset 1540 | 6eef12dab5bf |
parent 1499 | 4d141d000000 |
child 1594 | 00485cb74836 |
permissions | -rw-r--r-- |
0 | 1 |
#ifndef HAL_H |
2 |
#define HAL_H |
|
3 |
||
4 |
typedef struct { |
|
1301
bf64ba5b6774
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
5 |
const char *(*start)(const char * const *parm); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
6 |
void (*stop)(void); |
0 | 7 |
} HalCommonDriver; |
8 |
||
9 |
typedef struct { |
|
1301
bf64ba5b6774
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
10 |
const char *(*start)(const char * const *parm); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
11 |
void (*stop)(void); |
0 | 12 |
void (*make_dirty)(int left, int top, int width, int height); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
13 |
int (*main_loop)(void); |
0 | 14 |
bool (*change_resolution)(int w, int h); |
15 |
} HalVideoDriver; |
|
16 |
||
17 |
enum { |
|
18 |
ML_QUIT = 0, |
|
19 |
ML_SWITCHDRIVER = 1, |
|
20 |
}; |
|
21 |
||
22 |
typedef struct { |
|
1301
bf64ba5b6774
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
23 |
const char *(*start)(const char * const *parm); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
24 |
void (*stop)(void); |
0 | 25 |
} HalSoundDriver; |
26 |
||
27 |
typedef struct { |
|
1301
bf64ba5b6774
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
28 |
const char *(*start)(const char * const *parm); |
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
29 |
void (*stop)(void); |
0 | 30 |
|
31 |
void (*play_song)(const char *filename); |
|
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
32 |
void (*stop_song)(void); |
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
33 |
bool (*is_song_playing)(void); |
0 | 34 |
void (*set_volume)(byte vol); |
35 |
} HalMusicDriver; |
|
36 |
||
37 |
typedef struct { |
|
38 |
const char *name; |
|
39 |
const char *longname; |
|
40 |
const void *drv; |
|
223
0e5cc5a65df6
(svn r224) -Fix: Music now finally works on WinXP. DirectMusic is now default for an OS >= WinNT4 (WinNT4, Win2k, WinXP), and MIDI driver for lower OS's (Win95, Win98, WinME, etc).
darkvater
parents:
222
diff
changeset
|
41 |
uint32 flags; |
0 | 42 |
} DriverDesc; |
43 |
||
44 |
enum { |
|
45 |
HALERR_OK = 0, |
|
46 |
HALERR_ERROR = 1, |
|
47 |
}; |
|
48 |
||
49 |
extern const HalMusicDriver _null_music_driver; |
|
50 |
extern const HalVideoDriver _null_video_driver; |
|
51 |
extern const HalSoundDriver _null_sound_driver; |
|
52 |
||
53 |
VARDEF HalMusicDriver *_music_driver; |
|
54 |
VARDEF HalSoundDriver *_sound_driver; |
|
55 |
VARDEF HalVideoDriver *_video_driver; |
|
56 |
||
57 |
extern const DriverDesc _video_driver_descs[]; |
|
58 |
extern const DriverDesc _sound_driver_descs[]; |
|
59 |
extern const DriverDesc _music_driver_descs[]; |
|
60 |
||
61 |
#if defined(WITH_SDL) |
|
62 |
extern const HalSoundDriver _sdl_sound_driver; |
|
63 |
extern const HalVideoDriver _sdl_video_driver; |
|
64 |
#endif |
|
65 |
||
66 |
#if defined(UNIX) |
|
67 |
extern const HalMusicDriver _extmidi_music_driver; |
|
193
0a7025304867
(svn r194) -Codechange: stripping trailing-spaces. Please keep this that way!
truelight
parents:
0
diff
changeset
|
68 |
#endif |
0 | 69 |
|
70 |
#if defined(__BEOS__) |
|
71 |
extern const HalMusicDriver _bemidi_music_driver; |
|
72 |
#endif |
|
73 |
||
810
a1494b19bd2a
(svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents:
543
diff
changeset
|
74 |
#if defined(__OS2__) |
a1494b19bd2a
(svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents:
543
diff
changeset
|
75 |
extern const HalMusicDriver _os2_music_driver; |
a1494b19bd2a
(svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents:
543
diff
changeset
|
76 |
#endif |
a1494b19bd2a
(svn r1281) -Fix: the OS/2 is now finished. Fixes:
truelight
parents:
543
diff
changeset
|
77 |
|
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
78 |
extern const HalVideoDriver _dedicated_video_driver; |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
79 |
|
0 | 80 |
enum DriverType { |
81 |
VIDEO_DRIVER = 0, |
|
82 |
SOUND_DRIVER = 1, |
|
83 |
MUSIC_DRIVER = 2, |
|
84 |
}; |
|
85 |
||
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
86 |
extern void GameLoop(void); |
0 | 87 |
extern bool _dbg_screen_rect; |
88 |
||
89 |
void LoadDriver(int driver, const char *name); |
|
90 |
||
1301
bf64ba5b6774
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
91 |
const char *GetDriverParam(const char * const *parm, const char *name); |
bf64ba5b6774
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
92 |
bool GetDriverParamBool(const char * const *parm, const char *name); |
bf64ba5b6774
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
93 |
int GetDriverParamInt(const char * const *parm, const char *name, int def); |
0 | 94 |
|
95 |
||
96 |
||
97 |
// Deals with finding savegames |
|
98 |
typedef struct { |
|
99 |
uint16 id; |
|
100 |
byte type; |
|
101 |
uint64 mtime; |
|
102 |
char title[64]; |
|
103 |
char name[256-12-64]; |
|
104 |
} FiosItem; |
|
105 |
||
106 |
enum { |
|
107 |
FIOS_TYPE_DRIVE = 0, |
|
108 |
FIOS_TYPE_PARENT = 1, |
|
109 |
FIOS_TYPE_DIR = 2, |
|
110 |
FIOS_TYPE_FILE = 3, |
|
111 |
FIOS_TYPE_OLDFILE = 4, |
|
112 |
FIOS_TYPE_SCENARIO = 5, |
|
113 |
FIOS_TYPE_OLD_SCENARIO = 6, |
|
114 |
}; |
|
115 |
||
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
116 |
|
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
117 |
// Variables to display file lists |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
118 |
FiosItem *_fios_list; |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
119 |
int _fios_num; |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
120 |
int _saveload_mode; |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
121 |
|
0 | 122 |
// get the name of an oldstyle savegame |
123 |
void GetOldSaveGameName(char *title, const char *file); |
|
124 |
// get the name of an oldstyle scenario |
|
125 |
void GetOldScenarioGameName(char *title, const char *file); |
|
126 |
||
127 |
// Get a list of savegames |
|
128 |
FiosItem *FiosGetSavegameList(int *num, int mode); |
|
129 |
// Get a list of scenarios |
|
130 |
FiosItem *FiosGetScenarioList(int *num, int mode); |
|
131 |
// Free the list of savegames |
|
1093
4fdc46eaf423
(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 FiosFreeSavegameList(void); |
0 | 133 |
// Browse to. Returns a filename w/path if we reached a file. |
134 |
char *FiosBrowseTo(const FiosItem *item); |
|
135 |
// Get descriptive texts. |
|
136 |
// Returns a path as well as a |
|
137 |
// string describing the path. |
|
222
b88456001397
(svn r223) -Fix: Const correctness and miscellaneous fixes. Thank you Tron for your diligent fixing of warnings (and some possibly bugs) (Tron)
darkvater
parents:
193
diff
changeset
|
138 |
StringID FiosGetDescText(const char **path); |
0 | 139 |
// Delete a name |
140 |
void FiosDelete(const char *name); |
|
141 |
// Make a filename from a name |
|
142 |
void FiosMakeSavegameName(char *buf, const char *name); |
|
143 |
||
1093
4fdc46eaf423
(svn r1594) Convert all undefined parameter lists to (void) and add the appropriate warning flags in the Makefile
tron
parents:
810
diff
changeset
|
144 |
void CreateConsole(void); |
0 | 145 |
|
146 |
#endif /* HAL_H */ |