@@ -16,18 +16,18 @@ static byte *DecodeString(byte *buff, co
static byte **_langpack_offs;
static byte *_langpack;
static uint _langtab_num[32]; // Offset into langpack offs
static uint _langtab_start[32]; // Offset into langpack offs
#ifdef WITH_REV_HACK
#define WITH_REV
const char _openttd_revision[] = WITH_REV_HACK;
#endif
#ifdef WITH_REV
extern const char _openttd_revision[];
#else
typedef byte *PlayerNameGeneratorProc(byte *buffr);
typedef struct {
uint32 ident;
@@ -484,13 +484,19 @@ static void MakeWindow(bool full_screen)
x = (GetSystemMetrics(SM_CXSCREEN)-w)>>1;
y = (GetSystemMetrics(SM_CYSCREEN)-h)>>1;
if (_wnd.main_wnd) {
SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
} else {
_wnd.main_wnd = CreateWindow("TTD", "OpenTTD", style, x, y, w, h, 0, 0, _inst, 0);
char Windowtitle[50] = "OpenTTD ";
// also show revision number/release in window title
strncat(Windowtitle, _openttd_revision, sizeof(Windowtitle)-(strlen(Windowtitle) + 1));
_wnd.main_wnd = CreateWindow("TTD", Windowtitle, style, x, y, w, h, 0, 0, _inst, 0);
if (_wnd.main_wnd == NULL)
error("CreateWindow failed");
}
@@ -1776,22 +1782,22 @@ void FiosDelete(const char *name)
#define Windows_2000 5
#define Windows_NT3_51 4
/* flags show the minimum required OS to use a given feature. Currently
only dwMajorVersion is used
only dwMajorVersion and dwMinorVersion (WindowsME) are used
MajorVersion MinorVersion
Windows Server 2003 5 2
Windows XP 5 1
Windows 2000 5 0
Windows NT 4.0 4 0
Windows Me 4 90
Windows 98 4 10
Windows 95 4 0
Windows NT 3.51 3 51
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},
@@ -1824,14 +1830,17 @@ byte GetOSVersion()
OSVERSIONINFO osvi;
ZeroMemory(&osvi, sizeof(OSVERSIONINFO));
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
if (GetVersionEx(&osvi)) {
DEBUG(misc, 2) ("Windows Version is %d", osvi.dwMajorVersion);
return (byte)osvi.dwMajorVersion;
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;
Status change: