|
|
/* $Id$ */
|
|
|
|
|
|
#include "stdafx.h"
|
|
|
#include "openttd.h"
|
|
|
#include "hal.h"
|
|
|
#include "variables.h"
|
|
|
#include "string.h"
|
|
|
#include "table/strings.h"
|
|
|
#include "gfx.h"
|
|
|
#include "gui.h"
|
|
|
#include "functions.h"
|
|
|
#include "macros.h"
|
|
|
|
|
|
#include <direct.h>
|
|
|
#include <unistd.h>
|
|
|
#include <sys/stat.h>
|
|
|
#include <stdarg.h>
|
|
@@ -19,34 +20,24 @@
|
|
|
#include <ctype.h>
|
|
|
#include <time.h>
|
|
|
#include <dos.h>
|
|
|
|
|
|
#define INCL_DOS
|
|
|
#define INCL_WIN
|
|
|
#define INCL_WINCLIPBOARD
|
|
|
|
|
|
#include <os2.h>
|
|
|
|
|
|
#include <i86.h>
|
|
|
|
|
|
#include "sound/null_s.h"
|
|
|
#include "sound/sdl_s.h"
|
|
|
|
|
|
#include "video/dedicated_v.h"
|
|
|
#include "video/null_v.h"
|
|
|
#include "video/sdl_v.h"
|
|
|
|
|
|
#include "music/null_m.h"
|
|
|
#include "music/os2_m.h"
|
|
|
|
|
|
static inline int strcasecmp(const char* s1, const char* s2)
|
|
|
{
|
|
|
return stricmp(s1, s2);
|
|
|
}
|
|
|
|
|
|
static char *_fios_path;
|
|
|
static char *_fios_save_path;
|
|
|
static char *_fios_scn_path;
|
|
|
static FiosItem *_fios_items;
|
|
|
static int _fios_count, _fios_alloc;
|
|
|
|
|
|
static FiosItem *FiosAlloc(void)
|
|
@@ -423,56 +414,24 @@ void FiosMakeSavegameName(char *buf, con
|
|
|
|
|
|
sprintf(buf, "%s\\%s%s", _fios_path, name, extension);
|
|
|
}
|
|
|
|
|
|
void FiosDelete(const char *name)
|
|
|
{
|
|
|
char path[512];
|
|
|
|
|
|
snprintf(path, lengthof(path), "%s\\%s", _fios_path, name);
|
|
|
unlink(path);
|
|
|
}
|
|
|
|
|
|
const DriverDesc _video_driver_descs[] = {
|
|
|
{ "null", "Null Video Driver", &_null_video_driver, 0},
|
|
|
#if defined(WITH_SDL)
|
|
|
{ "sdl", "SDL Video Driver", &_sdl_video_driver, 1},
|
|
|
#endif
|
|
|
#ifdef ENABLE_NETWORK
|
|
|
{ "dedicated", "Dedicated Video Driver", &_dedicated_video_driver, 0},
|
|
|
#endif
|
|
|
{ NULL, NULL, NULL, 0}
|
|
|
};
|
|
|
|
|
|
const DriverDesc _sound_driver_descs[] = {
|
|
|
{ "null", "Null Sound Driver", &_null_sound_driver, 0},
|
|
|
#if defined(WITH_SDL)
|
|
|
{ "sdl", "SDL Sound Driver", &_sdl_sound_driver, 1},
|
|
|
#endif
|
|
|
{ NULL, NULL, NULL, 0}
|
|
|
};
|
|
|
|
|
|
const DriverDesc _music_driver_descs[] = {
|
|
|
{ "os2", "OS/2 Music Driver", &_os2_music_driver, 0},
|
|
|
{ "null", "Null Music Driver", &_null_music_driver, 1},
|
|
|
{ NULL, NULL, NULL, 0}
|
|
|
};
|
|
|
|
|
|
/* GetOSVersion returns the minimal required version of OS to be able to use that driver.
|
|
|
Not needed for OS/2. */
|
|
|
byte GetOSVersion(void)
|
|
|
{
|
|
|
return 2; // any arbitrary number bigger then 0
|
|
|
}
|
|
|
|
|
|
bool FileExists(const char *filename)
|
|
|
{
|
|
|
return access(filename, 0) == 0;
|
|
|
}
|
|
|
|
|
|
static int LanguageCompareFunc(const void *a, const void *b)
|
|
|
{
|
|
|
return strcmp(*(const char* const *)a, *(const char* const *)b);
|
|
|
}
|
|
|
|
|
|
int GetLanguageList(char **languages, int max)
|
|
|
{
|