summaryrefslogtreecommitdiff
path: root/src/video
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2007-03-07 18:58:28 +0000
committerDarkvater <Darkvater@openttd.org>2007-03-07 18:58:28 +0000
commit1a2576cd7ea8051ab5da17bc192924fe5ba871c3 (patch)
treeba99aff4f6b2c185df22ce8dd28562996f0a5441 /src/video
parent663bf46352c27241f17bf2cb1591344c4b347368 (diff)
downloadopenttd-1a2576cd7ea8051ab5da17bc192924fe5ba871c3.tar.xz
(svn r9055) -Codechange: Change windows unicode handling and allow a pure non-unicode build to function. Win9x binaries will be possible with mingw/nightly system.
Diffstat (limited to 'src/video')
-rw-r--r--src/video/win32_v.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp
index 4e9f43236..aecfbd226 100644
--- a/src/video/win32_v.cpp
+++ b/src/video/win32_v.cpp
@@ -36,6 +36,9 @@ bool _window_maximize;
uint _display_hz;
uint _fullscreen_bpp;
static uint16 _bck_resolution[2];
+#if !defined(UNICODE)
+uint _codepage;
+#endif
static void MakePalette()
{
@@ -211,6 +214,9 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
switch (msg) {
case WM_CREATE:
SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
+#if !defined(UNICODE)
+ _codepage = GetACP(); // get system codepage as some kind of a default
+#endif /* UNICODE */
break;
case WM_PAINT: {
@@ -347,6 +353,17 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
return 0;
}
+#if !defined(UNICODE)
+ case WM_INPUTLANGCHANGE: {
+ TCHAR locale[6];
+ LCID lcid = GB(lParam, 0, 16);
+
+ int len = GetLocaleInfo(lcid, LOCALE_IDEFAULTANSICODEPAGE, locale, lengthof(locale));
+ if (len != 0) _codepage = _ttoi(locale);
+ return 1;
+ }
+#endif /* UNICODE */
+
case WM_KEYDOWN: {
// this is the rewritten ascii input function
// it disables windows deadkey handling --> more linux like :D