author | matthijs |
Wed, 22 Mar 2006 22:26:16 +0000 | |
branch | 0.4.5 |
changeset 9958 | bed516c67d61 |
parent 9948 | 877dccfeb22e |
child 3329 | 992d1f7cb747 |
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); |
2228 | 15 |
void (*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 |
typedef struct { |
|
1301
313804601383
(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
e8d26c7dc42f
(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
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 |
|
29 |
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
|
30 |
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
|
31 |
bool (*is_song_playing)(void); |
0 | 32 |
void (*set_volume)(byte vol); |
33 |
} HalMusicDriver; |
|
34 |
||
35 |
VARDEF HalMusicDriver *_music_driver; |
|
36 |
VARDEF HalSoundDriver *_sound_driver; |
|
37 |
VARDEF HalVideoDriver *_video_driver; |
|
38 |
||
39 |
enum DriverType { |
|
40 |
VIDEO_DRIVER = 0, |
|
41 |
SOUND_DRIVER = 1, |
|
42 |
MUSIC_DRIVER = 2, |
|
43 |
}; |
|
44 |
||
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
|
45 |
extern void GameLoop(void); |
0 | 46 |
|
47 |
||
48 |
// Deals with finding savegames |
|
49 |
typedef struct { |
|
50 |
byte type; |
|
51 |
uint64 mtime; |
|
52 |
char title[64]; |
|
53 |
char name[256-12-64]; |
|
54 |
} FiosItem; |
|
55 |
||
56 |
enum { |
|
57 |
FIOS_TYPE_DRIVE = 0, |
|
58 |
FIOS_TYPE_PARENT = 1, |
|
59 |
FIOS_TYPE_DIR = 2, |
|
60 |
FIOS_TYPE_FILE = 3, |
|
61 |
FIOS_TYPE_OLDFILE = 4, |
|
62 |
FIOS_TYPE_SCENARIO = 5, |
|
63 |
FIOS_TYPE_OLD_SCENARIO = 6, |
|
2559
08e648022cb0
(svn r3096) - Feature: 'HOME' icon to saveload dialogs that jumps to the default save/load directory based on the dialog (added icon to openttd.grf, introduced FIOS_TYPE_DIRECT that allows arbitrary directory jumping).
Darkvater
parents:
2326
diff
changeset
|
64 |
FIOS_TYPE_DIRECT = 7, |
0 | 65 |
}; |
66 |
||
543
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
67 |
|
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
68 |
// Variables to display file lists |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
69 |
FiosItem *_fios_list; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
70 |
int _fios_num; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
71 |
int _saveload_mode; |
e3b43338096b
(svn r942) -Merged branch/network back into the trunk
truelight
parents:
223
diff
changeset
|
72 |
|
0 | 73 |
// get the name of an oldstyle savegame |
74 |
void GetOldSaveGameName(char *title, const char *file); |
|
75 |
// get the name of an oldstyle scenario |
|
76 |
void GetOldScenarioGameName(char *title, const char *file); |
|
77 |
||
78 |
// Get a list of savegames |
|
79 |
FiosItem *FiosGetSavegameList(int *num, int mode); |
|
80 |
// Get a list of scenarios |
|
81 |
FiosItem *FiosGetScenarioList(int *num, int mode); |
|
82 |
// 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
|
83 |
void FiosFreeSavegameList(void); |
0 | 84 |
// Browse to. Returns a filename w/path if we reached a file. |
85 |
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
|
86 |
// 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
|
87 |
StringID FiosGetDescText(const char **path, uint32 *tot); |
0 | 88 |
// Delete a name |
2255
ddcaf9e333ff
(svn r2775) Deleting a file can fail, display an error message when it happens
tron
parents:
2237
diff
changeset
|
89 |
bool FiosDelete(const char *name); |
0 | 90 |
// Make a filename from a name |
9948 | 91 |
void FiosMakeSavegameName(char *buf, const char *name, size_t size); |
0 | 92 |
|
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
|
93 |
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
|
94 |
|
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
|
95 |
void CreateConsole(void); |
0 | 96 |
|
97 |
#endif /* HAL_H */ |