|
@@ -17,20 +17,6 @@
|
|
|
#include <fcntl.h>
|
|
|
#include "variables.h"
|
|
|
#include "win32.h"
|
|
|
|
|
|
#include "driver.h"
|
|
|
|
|
|
#include "music/dmusic.h"
|
|
|
#include "music/null_m.h"
|
|
|
#include "music/win32_m.h"
|
|
|
|
|
|
#include "sound/null_s.h"
|
|
|
#include "sound/sdl_s.h"
|
|
|
#include "sound/win32_s.h"
|
|
|
|
|
|
#include "video/dedicated_v.h"
|
|
|
#include "video/null_v.h"
|
|
|
#include "video/sdl_v.h"
|
|
|
#include "video/win32_v.h"
|
|
|
|
|
|
static bool _has_console;
|
|
@@ -933,73 +919,6 @@ void FiosDelete(const char *name)
|
|
|
DeleteFile(path);
|
|
|
}
|
|
|
|
|
|
#define Windows_2000 5
|
|
|
#define Windows_NT3_51 4
|
|
|
|
|
|
/* flags show the minimum required OS to use a given feature. Currently
|
|
|
only dwMajorVersion and dwMinorVersion (WindowsME) are used
|
|
|
MajorVersion MinorVersion
|
|
|
Windows Server 2003 5 2 dmusic
|
|
|
Windows XP 5 1 dmusic
|
|
|
Windows 2000 5 0 dmusic
|
|
|
Windows NT 4.0 4 0 win32
|
|
|
Windows Me 4 90 dmusic
|
|
|
Windows 98 4 10 win32
|
|
|
Windows 95 4 0 win32
|
|
|
Windows NT 3.51 3 51 ?????
|
|
|
*/
|
|
|
|
|
|
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
|
|
|
{"win32", "Win32 GDI Video Driver", &_win32_video_driver, Windows_NT3_51},
|
|
|
#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
|
|
|
{"win32", "Win32 WaveOut Driver", &_win32_sound_driver, Windows_NT3_51},
|
|
|
{ NULL, NULL, NULL, 0 }
|
|
|
};
|
|
|
|
|
|
const DriverDesc _music_driver_descs[] = {
|
|
|
{"null", "Null Music Driver", &_null_music_driver, 0},
|
|
|
#ifdef WIN32_ENABLE_DIRECTMUSIC_SUPPORT
|
|
|
{"dmusic", "DirectMusic MIDI Driver", &_dmusic_midi_driver, Windows_2000},
|
|
|
#endif
|
|
|
// Win32 MIDI driver has higher priority than DMusic, so this one is chosen
|
|
|
{"win32", "Win32 MIDI Driver", &_win32_music_driver, Windows_NT3_51},
|
|
|
{ NULL, NULL, NULL, 0 }
|
|
|
};
|
|
|
|
|
|
byte GetOSVersion(void)
|
|
|
{
|
|
|
OSVERSIONINFO osvi;
|
|
|
|
|
|
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
|
|
|
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
|
|
|
|
|
if (GetVersionEx(&osvi)) {
|
|
|
DEBUG(misc, 2) ("Windows Version is %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
|
|
|
// WinME needs directmusic too (dmusic, Windows_2000 mode), all others default to OK
|
|
|
if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90) { return Windows_2000;} // WinME
|
|
|
|
|
|
return osvi.dwMajorVersion;
|
|
|
}
|
|
|
|
|
|
// GetVersionEx failed, but we can safely assume at least Win95/WinNT3.51 is used
|
|
|
DEBUG(misc, 0) ("Windows version retrieval failed, defaulting to level 4");
|
|
|
return Windows_NT3_51;
|
|
|
}
|
|
|
|
|
|
bool FileExists(const char *filename)
|
|
|
{
|
|
|
HANDLE hand = CreateFile(filename, 0, 0, NULL, OPEN_EXISTING, 0, NULL);
|