mirror of https://github.com/OpenTTD/OpenTTD
(svn r293) -Feature: Windows now shows (available) revision, release information in title bar
parent
c62f670bca
commit
b7fd924806
12
strings.c
12
strings.c
|
@ -19,12 +19,12 @@ static uint _langtab_num[32]; // Offset into langpack offs
|
||||||
static uint _langtab_start[32]; // Offset into langpack offs
|
static uint _langtab_start[32]; // Offset into langpack offs
|
||||||
|
|
||||||
#ifdef WITH_REV_HACK
|
#ifdef WITH_REV_HACK
|
||||||
#define WITH_REV
|
#define WITH_REV
|
||||||
const char _openttd_revision[] = WITH_REV_HACK;
|
const char _openttd_revision[] = WITH_REV_HACK;
|
||||||
#endif
|
#else
|
||||||
|
#ifdef WITH_REV
|
||||||
#ifdef WITH_REV
|
extern const char _openttd_revision[];
|
||||||
extern const char _openttd_revision[];
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef byte *PlayerNameGeneratorProc(byte *buffr);
|
typedef byte *PlayerNameGeneratorProc(byte *buffr);
|
||||||
|
|
33
win32.c
33
win32.c
|
@ -487,7 +487,13 @@ static void MakeWindow(bool full_screen)
|
||||||
if (_wnd.main_wnd) {
|
if (_wnd.main_wnd) {
|
||||||
SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
|
SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
|
||||||
} else {
|
} else {
|
||||||
_wnd.main_wnd = CreateWindow("TTD", "OpenTTD", style, x, y, w, h, 0, 0, _inst, 0);
|
char Windowtitle[50] = "OpenTTD ";
|
||||||
|
#ifdef WITH_REV_HACK
|
||||||
|
// also show revision number/release in window title
|
||||||
|
extern const char _openttd_revision[];
|
||||||
|
strncat(Windowtitle, _openttd_revision, sizeof(Windowtitle)-(strlen(Windowtitle) + 1));
|
||||||
|
#endif
|
||||||
|
_wnd.main_wnd = CreateWindow("TTD", Windowtitle, style, x, y, w, h, 0, 0, _inst, 0);
|
||||||
if (_wnd.main_wnd == NULL)
|
if (_wnd.main_wnd == NULL)
|
||||||
error("CreateWindow failed");
|
error("CreateWindow failed");
|
||||||
}
|
}
|
||||||
|
@ -1779,16 +1785,16 @@ void FiosDelete(const char *name)
|
||||||
#define Windows_NT3_51 4
|
#define Windows_NT3_51 4
|
||||||
|
|
||||||
/* flags show the minimum required OS to use a given feature. Currently
|
/* 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
|
MajorVersion MinorVersion
|
||||||
Windows Server 2003 5 2
|
Windows Server 2003 5 2 dmusic
|
||||||
Windows XP 5 1
|
Windows XP 5 1 dmusic
|
||||||
Windows 2000 5 0
|
Windows 2000 5 0 dmusic
|
||||||
Windows NT 4.0 4 0
|
Windows NT 4.0 4 0 win32
|
||||||
Windows Me 4 90
|
Windows Me 4 90 dmusic
|
||||||
Windows 98 4 10
|
Windows 98 4 10 win32
|
||||||
Windows 95 4 0
|
Windows 95 4 0 win32
|
||||||
Windows NT 3.51 3 51
|
Windows NT 3.51 3 51 ?????
|
||||||
*/
|
*/
|
||||||
|
|
||||||
const DriverDesc _video_driver_descs[] = {
|
const DriverDesc _video_driver_descs[] = {
|
||||||
|
@ -1827,8 +1833,11 @@ byte GetOSVersion()
|
||||||
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
|
||||||
|
|
||||||
if (GetVersionEx(&osvi)) {
|
if (GetVersionEx(&osvi)) {
|
||||||
DEBUG(misc, 2) ("Windows Version is %d", osvi.dwMajorVersion);
|
DEBUG(misc, 2) ("Windows Version is %d.%d", osvi.dwMajorVersion, osvi.dwMinorVersion);
|
||||||
return (byte)osvi.dwMajorVersion;
|
// 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
|
// GetVersionEx failed, but we can safely assume at least Win95/WinNT3.51 is used
|
||||||
|
|
Loading…
Reference in New Issue