author | tron |
Sun, 24 Jul 2005 14:12:37 +0000 | |
changeset 2186 | 461a2aff3486 |
parent 2177 | 73d67828ea5e |
child 2210 | 58a293892a66 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
0 | 3 |
#ifndef HAL_H |
4 |
#define HAL_H |
|
5 |
||
6 |
typedef struct { |
|
1301
313804601383
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
7 |
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
|
8 |
void (*stop)(void); |
0 | 9 |
} HalCommonDriver; |
10 |
||
11 |
typedef struct { |
|
1301
313804601383
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
12 |
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
|
13 |
void (*stop)(void); |
0 | 14 |
void (*make_dirty)(int left, int top, int width, int height); |
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
|
15 |
int (*main_loop)(void); |
0 | 16 |
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
|
17 |
void (*toggle_fullscreen)(bool fullscreen); |
0 | 18 |
} HalVideoDriver; |
19 |
||
20 |
enum { |
|
21 |
ML_QUIT = 0, |
|
22 |
ML_SWITCHDRIVER = 1, |
|
23 |
}; |
|
24 |
||
25 |
typedef struct { |
|
1301
313804601383
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
26 |
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
|
27 |
void (*stop)(void); |
0 | 28 |
} HalSoundDriver; |
29 |
||
30 |
typedef struct { |
|
1301
313804601383
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
31 |
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
|
32 |
void (*stop)(void); |
0 | 33 |
|
34 |
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
|
35 |
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
|
36 |
bool (*is_song_playing)(void); |
0 | 37 |
void (*set_volume)(byte vol); |
38 |
} HalMusicDriver; |
|
39 |
||
40 |
typedef struct { |
|
41 |
const char *name; |
|
42 |
const char *longname; |
|
43 |
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
|
44 |
uint32 flags; |
0 | 45 |
} DriverDesc; |
46 |
||
47 |
enum { |
|
48 |
HALERR_OK = 0, |
|
49 |
HALERR_ERROR = 1, |
|
50 |
}; |
|
51 |
||
52 |
VARDEF HalMusicDriver *_music_driver; |
|
53 |
VARDEF HalSoundDriver *_sound_driver; |
|
54 |
VARDEF HalVideoDriver *_video_driver; |
|
55 |
||
56 |
extern const DriverDesc _video_driver_descs[]; |
|
57 |
extern const DriverDesc _sound_driver_descs[]; |
|
58 |
extern const DriverDesc _music_driver_descs[]; |
|
59 |
||
60 |
enum DriverType { |
|
61 |
VIDEO_DRIVER = 0, |
|
62 |
SOUND_DRIVER = 1, |
|
63 |
MUSIC_DRIVER = 2, |
|
64 |
}; |
|
65 |
||
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
|
66 |
extern void GameLoop(void); |
0 | 67 |
extern bool _dbg_screen_rect; |
68 |
||
69 |
||
70 |
// Deals with finding savegames |
|
71 |
typedef struct { |
|
72 |
uint16 id; |
|
73 |
byte type; |
|
74 |
uint64 mtime; |
|
75 |
char title[64]; |
|
76 |
char name[256-12-64]; |
|
77 |
} FiosItem; |
|
78 |
||
79 |
enum { |
|
80 |
FIOS_TYPE_DRIVE = 0, |
|
81 |
FIOS_TYPE_PARENT = 1, |
|
82 |
FIOS_TYPE_DIR = 2, |
|
83 |
FIOS_TYPE_FILE = 3, |
|
84 |
FIOS_TYPE_OLDFILE = 4, |
|
85 |
FIOS_TYPE_SCENARIO = 5, |
|
86 |
FIOS_TYPE_OLD_SCENARIO = 6, |
|
87 |
}; |
|
88 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
89 |
|
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
90 |
// Variables to display file lists |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
91 |
FiosItem *_fios_list; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
92 |
int _fios_num; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
93 |
int _saveload_mode; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
94 |
|
0 | 95 |
// get the name of an oldstyle savegame |
96 |
void GetOldSaveGameName(char *title, const char *file); |
|
97 |
// get the name of an oldstyle scenario |
|
98 |
void GetOldScenarioGameName(char *title, const char *file); |
|
99 |
||
100 |
// Get a list of savegames |
|
101 |
FiosItem *FiosGetSavegameList(int *num, int mode); |
|
102 |
// Get a list of scenarios |
|
103 |
FiosItem *FiosGetScenarioList(int *num, int mode); |
|
104 |
// Free the list of savegames |
|
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
|
105 |
void FiosFreeSavegameList(void); |
0 | 106 |
// Browse to. Returns a filename w/path if we reached a file. |
107 |
char *FiosBrowseTo(const FiosItem *item); |
|
1596
c1c439a2d5b2
(svn r2100) - Fix: [1024703]: Infinite access for A:\ (win32). Patch [1171208]. Only requery drive(s) if the user changes a directory, also surpress the OS error box that pops up on some windows machines. Tron + glx (and me)
darkvater
parents:
1594
diff
changeset
|
108 |
// Return path, free space and stringID |
c1c439a2d5b2
(svn r2100) - Fix: [1024703]: Infinite access for A:\ (win32). Patch [1171208]. Only requery drive(s) if the user changes a directory, also surpress the OS error box that pops up on some windows machines. Tron + glx (and me)
darkvater
parents:
1594
diff
changeset
|
109 |
StringID FiosGetDescText(const char **path, uint32 *tot); |
0 | 110 |
// Delete a name |
111 |
void FiosDelete(const char *name); |
|
112 |
// Make a filename from a name |
|
113 |
void FiosMakeSavegameName(char *buf, const char *name); |
|
114 |
||
1594
1cbbb77f5bb2
(svn r2098) Make a variable static, move a function declaration to a header and remove unnecessary preprocessor magic
tron
parents:
1499
diff
changeset
|
115 |
int CDECL compare_FiosItems(const void *a, const void *b); |
1cbbb77f5bb2
(svn r2098) Make a variable static, move a function declaration to a header and remove unnecessary preprocessor magic
tron
parents:
1499
diff
changeset
|
116 |
|
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
|
117 |
void CreateConsole(void); |
0 | 118 |
|
119 |
#endif /* HAL_H */ |