summaryrefslogtreecommitdiff
path: root/video
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-11-28 19:58:13 +0000
committerDarkvater <darkvater@openttd.org>2006-11-28 19:58:13 +0000
commitd8d210056d5f504f4a3136eb9d0cd14bb39cfbda (patch)
tree3056b2d5953729442df4da61533a3e29d896191f /video
parent4e7109113750d383fae9086638c17646f6df74b5 (diff)
downloadopenttd-d8d210056d5f504f4a3136eb9d0cd14bb39cfbda.tar.xz
(svn r7278) -Codechange: [win32] Add UNICODE support so it should compile on OS's using UNICODE
API exclusively.
Diffstat (limited to 'video')
-rw-r--r--video/dedicated_v.c5
-rw-r--r--video/win32_v.c9
2 files changed, 8 insertions, 6 deletions
diff --git a/video/dedicated_v.c b/video/dedicated_v.c
index 4c827d913..e0124e02c 100644
--- a/video/dedicated_v.c
+++ b/video/dedicated_v.c
@@ -64,6 +64,7 @@ static void DedicatedSignalHandler(int sig)
#include <windows.h> /* GetTickCount */
#include <conio.h>
#include <time.h>
+#include <tchar.h>
static HANDLE _hInputReady, _hWaitForInputHandling;
static HANDLE _hThread; // Thread to close
static char _win_console_thread_buffer[200];
@@ -121,10 +122,10 @@ static const char *DedicatedVideoStart(const char * const *parm)
_debug_misc_level = 0;
#ifdef WIN32
- // For win32 we need to allocate an console (debug mode does the same)
+ // For win32 we need to allocate a console (debug mode does the same)
CreateConsole();
CreateWindowsConsoleThread();
- SetConsoleTitle("OpenTTD Dedicated Server");
+ SetConsoleTitle(_T("OpenTTD Dedicated Server"));
#endif
#ifdef __OS2__
diff --git a/video/win32_v.c b/video/win32_v.c
index 9381e8b5f..a2f46378e 100644
--- a/video/win32_v.c
+++ b/video/win32_v.c
@@ -11,6 +11,7 @@
#include "../window.h"
#include "win32_v.h"
#include <windows.h>
+#include <tchar.h>
static struct {
HWND main_wnd;
@@ -517,7 +518,7 @@ static void RegisterWndClass(void)
LoadCursor(NULL, IDC_ARROW),
0,
0,
- "OTTD"
+ _T("OTTD")
};
registered = true;
@@ -588,11 +589,11 @@ static void MakeWindow(bool full_screen)
SetWindowPos(_wnd.main_wnd, 0, x, y, w, h, SWP_NOACTIVATE | SWP_NOOWNERZORDER | SWP_NOZORDER);
} else {
extern const char _openttd_revision[];
- char Windowtitle[50];
+ TCHAR Windowtitle[50];
- snprintf(Windowtitle, lengthof(Windowtitle), "OpenTTD %s", _openttd_revision);
+ _sntprintf(Windowtitle, sizeof(Windowtitle), _T("OpenTTD %s"), MB_TO_WIDE(_openttd_revision));
- _wnd.main_wnd = CreateWindow("OTTD", Windowtitle, style, x, y, w, h, 0, 0, GetModuleHandle(NULL), 0);
+ _wnd.main_wnd = CreateWindow(_T("OTTD"), Windowtitle, style, x, y, w, h, 0, 0, GetModuleHandle(NULL), 0);
if (_wnd.main_wnd == NULL) error("CreateWindow failed");
}
}