hal.h
author peter1138
Tue, 07 Nov 2006 22:34:59 +0000
changeset 5054 cf05383e4df5
parent 4223 0f9535dda7ed
child 5167 2b9d61386688
permissions -rw-r--r--
(svn r7106) -Feature: Allow over-building of compatible railtypes, i.e. normal and
electrified rail. If building electrified rail, normal rail is upgraded
for you (for the normal cost).
2186
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2177
diff changeset
     1
/* $Id$ */
461a2aff3486 (svn r2701) Insert Id tags into all source files
tron
parents: 2177
diff changeset
     2
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     3
#ifndef HAL_H
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     4
#define HAL_H
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     5
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     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
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
     9
} HalCommonDriver;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    10
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    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
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    14
	void (*make_dirty)(int left, int top, int width, int height);
2228
7014d372374f (svn r2748) Remove unused cruft from the main loop
tron
parents: 2219
diff changeset
    15
	void (*main_loop)(void);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    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
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    18
} HalVideoDriver;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    19
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    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
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    23
} HalSoundDriver;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    24
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    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
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    28
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    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
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    32
	void (*set_volume)(byte vol);
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    33
} HalMusicDriver;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    34
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    35
VARDEF HalMusicDriver *_music_driver;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    36
VARDEF HalSoundDriver *_sound_driver;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    37
VARDEF HalVideoDriver *_video_driver;
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    38
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    39
enum DriverType {
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    40
	VIDEO_DRIVER = 0,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    41
	SOUND_DRIVER = 1,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    42
	MUSIC_DRIVER = 2,
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    43
};
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    44
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
    45
void GameLoop(void);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    46
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
    47
void CreateConsole(void);
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    48
3329
992d1f7cb747 (svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
Darkvater
parents: 3287
diff changeset
    49
#if defined(WIN32) || defined(WIN64) || defined(__WATCOMC__)
992d1f7cb747 (svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
Darkvater
parents: 3287
diff changeset
    50
# define FS2OTTD(name) name
992d1f7cb747 (svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
Darkvater
parents: 3287
diff changeset
    51
# define OTTD2FS(name) name
992d1f7cb747 (svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
Darkvater
parents: 3287
diff changeset
    52
#else
992d1f7cb747 (svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
Darkvater
parents: 3287
diff changeset
    53
const char *FS2OTTD(const char *name);
992d1f7cb747 (svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
Darkvater
parents: 3287
diff changeset
    54
const char *OTTD2FS(const char *name);
992d1f7cb747 (svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
Darkvater
parents: 3287
diff changeset
    55
#endif
992d1f7cb747 (svn r4105) - Feature: Add proper ISO-8859-15 <> LOCALCODE conversion. As the mess that is makefile can't properly support it at the moment, it is only available for MACOSX. Windows doesn't need FS conversion and I have no idea about OS/2 so it's disabled for them.
Darkvater
parents: 3287
diff changeset
    56
0
29654efe3188 (svn r1) Import of revision 975 of old (crashed) SVN
truelight
parents:
diff changeset
    57
#endif /* HAL_H */