2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
#ifndef HAL_H
|
|
|
|
#define HAL_H
|
|
|
|
|
|
|
|
typedef struct {
|
2005-02-05 18:05:42 +00:00
|
|
|
const char *(*start)(const char * const *parm);
|
2005-01-22 20:23:18 +00:00
|
|
|
void (*stop)(void);
|
2004-08-09 17:04:08 +00:00
|
|
|
} HalCommonDriver;
|
|
|
|
|
|
|
|
typedef struct {
|
2005-02-05 18:05:42 +00:00
|
|
|
const char *(*start)(const char * const *parm);
|
2005-01-22 20:23:18 +00:00
|
|
|
void (*stop)(void);
|
2004-08-09 17:04:08 +00:00
|
|
|
void (*make_dirty)(int left, int top, int width, int height);
|
2005-07-29 16:40:29 +00:00
|
|
|
void (*main_loop)(void);
|
2004-08-09 17:04:08 +00:00
|
|
|
bool (*change_resolution)(int w, int h);
|
2005-05-16 16:19:32 +00:00
|
|
|
void (*toggle_fullscreen)(bool fullscreen);
|
2004-08-09 17:04:08 +00:00
|
|
|
} HalVideoDriver;
|
|
|
|
|
|
|
|
typedef struct {
|
2005-02-05 18:05:42 +00:00
|
|
|
const char *(*start)(const char * const *parm);
|
2005-01-22 20:23:18 +00:00
|
|
|
void (*stop)(void);
|
2004-08-09 17:04:08 +00:00
|
|
|
} HalSoundDriver;
|
|
|
|
|
|
|
|
typedef struct {
|
2005-02-05 18:05:42 +00:00
|
|
|
const char *(*start)(const char * const *parm);
|
2005-01-22 20:23:18 +00:00
|
|
|
void (*stop)(void);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
void (*play_song)(const char *filename);
|
2005-01-22 20:23:18 +00:00
|
|
|
void (*stop_song)(void);
|
|
|
|
bool (*is_song_playing)(void);
|
2004-08-09 17:04:08 +00:00
|
|
|
void (*set_volume)(byte vol);
|
|
|
|
} HalMusicDriver;
|
|
|
|
|
|
|
|
VARDEF HalMusicDriver *_music_driver;
|
|
|
|
VARDEF HalSoundDriver *_sound_driver;
|
|
|
|
VARDEF HalVideoDriver *_video_driver;
|
|
|
|
|
|
|
|
enum DriverType {
|
|
|
|
VIDEO_DRIVER = 0,
|
|
|
|
SOUND_DRIVER = 1,
|
|
|
|
MUSIC_DRIVER = 2,
|
|
|
|
};
|
|
|
|
|
2005-01-22 20:23:18 +00:00
|
|
|
extern void GameLoop(void);
|
2004-08-09 17:04:08 +00:00
|
|
|
extern bool _dbg_screen_rect;
|
|
|
|
|
|
|
|
|
|
|
|
// Deals with finding savegames
|
|
|
|
typedef struct {
|
|
|
|
uint16 id;
|
|
|
|
byte type;
|
|
|
|
uint64 mtime;
|
|
|
|
char title[64];
|
|
|
|
char name[256-12-64];
|
|
|
|
} FiosItem;
|
|
|
|
|
|
|
|
enum {
|
|
|
|
FIOS_TYPE_DRIVE = 0,
|
|
|
|
FIOS_TYPE_PARENT = 1,
|
|
|
|
FIOS_TYPE_DIR = 2,
|
|
|
|
FIOS_TYPE_FILE = 3,
|
|
|
|
FIOS_TYPE_OLDFILE = 4,
|
|
|
|
FIOS_TYPE_SCENARIO = 5,
|
|
|
|
FIOS_TYPE_OLD_SCENARIO = 6,
|
|
|
|
};
|
|
|
|
|
2004-12-04 17:54:56 +00:00
|
|
|
|
|
|
|
// Variables to display file lists
|
|
|
|
FiosItem *_fios_list;
|
|
|
|
int _fios_num;
|
|
|
|
int _saveload_mode;
|
|
|
|
|
2004-08-09 17:04:08 +00:00
|
|
|
// get the name of an oldstyle savegame
|
|
|
|
void GetOldSaveGameName(char *title, const char *file);
|
|
|
|
// get the name of an oldstyle scenario
|
|
|
|
void GetOldScenarioGameName(char *title, const char *file);
|
|
|
|
|
|
|
|
// Get a list of savegames
|
|
|
|
FiosItem *FiosGetSavegameList(int *num, int mode);
|
|
|
|
// Get a list of scenarios
|
|
|
|
FiosItem *FiosGetScenarioList(int *num, int mode);
|
|
|
|
// Free the list of savegames
|
2005-01-22 20:23:18 +00:00
|
|
|
void FiosFreeSavegameList(void);
|
2004-08-09 17:04:08 +00:00
|
|
|
// Browse to. Returns a filename w/path if we reached a file.
|
|
|
|
char *FiosBrowseTo(const FiosItem *item);
|
2005-03-28 13:30:51 +00:00
|
|
|
// Return path, free space and stringID
|
|
|
|
StringID FiosGetDescText(const char **path, uint32 *tot);
|
2004-08-09 17:04:08 +00:00
|
|
|
// Delete a name
|
|
|
|
void FiosDelete(const char *name);
|
|
|
|
// Make a filename from a name
|
|
|
|
void FiosMakeSavegameName(char *buf, const char *name);
|
|
|
|
|
2005-03-28 08:48:41 +00:00
|
|
|
int CDECL compare_FiosItems(const void *a, const void *b);
|
|
|
|
|
2005-01-22 20:23:18 +00:00
|
|
|
void CreateConsole(void);
|
2004-08-09 17:04:08 +00:00
|
|
|
|
|
|
|
#endif /* HAL_H */
|