author | tron |
Fri, 29 Jul 2005 18:22:04 +0000 | |
changeset 2230 | e461b07aead7 |
parent 2228 | 93cdde0f85ba |
child 2237 | 7afa286cd570 |
permissions | -rw-r--r-- |
2186 | 1 |
/* $Id$ */ |
2 |
||
0 | 3 |
#ifndef HAL_H |
4 |
#define HAL_H |
|
5 |
||
6 |
typedef struct { |
|
1301
bf64ba5b6774
(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
4fdc46eaf423
(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
bf64ba5b6774
(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
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 |
void (*stop)(void); |
0 | 14 |
void (*make_dirty)(int left, int top, int width, int height); |
2228 | 15 |
void (*main_loop)(void); |
0 | 16 |
bool (*change_resolution)(int w, int h); |
1829
e90fe433fa7d
(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 |
typedef struct { |
|
1301
bf64ba5b6774
(svn r1805) Teach the driver layer a few things about const correctness
tron
parents:
1093
diff
changeset
|
21 |
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
|
22 |
void (*stop)(void); |
0 | 23 |
} HalSoundDriver; |
24 |
||
25 |
typedef struct { |
|
1301
bf64ba5b6774
(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
4fdc46eaf423
(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 |
|
29 |
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
|
30 |
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
|
31 |
bool (*is_song_playing)(void); |
0 | 32 |
void (*set_volume)(byte vol); |
33 |
} HalMusicDriver; |
|
34 |
||
35 |
enum { |
|
36 |
HALERR_OK = 0, |
|
37 |
HALERR_ERROR = 1, |
|
38 |
}; |
|
39 |
||
40 |
VARDEF HalMusicDriver *_music_driver; |
|
41 |
VARDEF HalSoundDriver *_sound_driver; |
|
42 |
VARDEF HalVideoDriver *_video_driver; |
|
43 |
||
44 |
enum DriverType { |
|
45 |
VIDEO_DRIVER = 0, |
|
46 |
SOUND_DRIVER = 1, |
|
47 |
MUSIC_DRIVER = 2, |
|
48 |
}; |
|
49 |
||
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
|
50 |
extern void GameLoop(void); |
0 | 51 |
extern bool _dbg_screen_rect; |
52 |
||
53 |
||
54 |
// Deals with finding savegames |
|
55 |
typedef struct { |
|
56 |
uint16 id; |
|
57 |
byte type; |
|
58 |
uint64 mtime; |
|
59 |
char title[64]; |
|
60 |
char name[256-12-64]; |
|
61 |
} FiosItem; |
|
62 |
||
63 |
enum { |
|
64 |
FIOS_TYPE_DRIVE = 0, |
|
65 |
FIOS_TYPE_PARENT = 1, |
|
66 |
FIOS_TYPE_DIR = 2, |
|
67 |
FIOS_TYPE_FILE = 3, |
|
68 |
FIOS_TYPE_OLDFILE = 4, |
|
69 |
FIOS_TYPE_SCENARIO = 5, |
|
70 |
FIOS_TYPE_OLD_SCENARIO = 6, |
|
71 |
}; |
|
72 |
||
543
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
73 |
|
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
74 |
// Variables to display file lists |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
75 |
FiosItem *_fios_list; |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
76 |
int _fios_num; |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
77 |
int _saveload_mode; |
946badd71033
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
78 |
|
0 | 79 |
// get the name of an oldstyle savegame |
80 |
void GetOldSaveGameName(char *title, const char *file); |
|
81 |
// get the name of an oldstyle scenario |
|
82 |
void GetOldScenarioGameName(char *title, const char *file); |
|
83 |
||
84 |
// Get a list of savegames |
|
85 |
FiosItem *FiosGetSavegameList(int *num, int mode); |
|
86 |
// Get a list of scenarios |
|
87 |
FiosItem *FiosGetScenarioList(int *num, int mode); |
|
88 |
// 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
|
89 |
void FiosFreeSavegameList(void); |
0 | 90 |
// Browse to. Returns a filename w/path if we reached a file. |
91 |
char *FiosBrowseTo(const FiosItem *item); |
|
1596
483007886b59
(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
|
92 |
// Return path, free space and stringID |
483007886b59
(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
|
93 |
StringID FiosGetDescText(const char **path, uint32 *tot); |
0 | 94 |
// Delete a name |
95 |
void FiosDelete(const char *name); |
|
96 |
// Make a filename from a name |
|
97 |
void FiosMakeSavegameName(char *buf, const char *name); |
|
98 |
||
1594
00485cb74836
(svn r2098) Make a variable static, move a function declaration to a header and remove unnecessary preprocessor magic
tron
parents:
1499
diff
changeset
|
99 |
int CDECL compare_FiosItems(const void *a, const void *b); |
00485cb74836
(svn r2098) Make a variable static, move a function declaration to a header and remove unnecessary preprocessor magic
tron
parents:
1499
diff
changeset
|
100 |
|
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
|
101 |
void CreateConsole(void); |
0 | 102 |
|
103 |
#endif /* HAL_H */ |