src/video/win32_v.cpp
changeset 6577 ee768d653dd0
parent 6574 e1d1a12faaf7
child 6602 391adb618a4c
equal deleted inserted replaced
6576:71d5e2a50d59 6577:ee768d653dd0
    34 bool _double_size;
    34 bool _double_size;
    35 bool _window_maximize;
    35 bool _window_maximize;
    36 uint _display_hz;
    36 uint _display_hz;
    37 uint _fullscreen_bpp;
    37 uint _fullscreen_bpp;
    38 static uint16 _bck_resolution[2];
    38 static uint16 _bck_resolution[2];
       
    39 #if !defined(UNICODE)
       
    40 uint _codepage;
       
    41 #endif
    39 
    42 
    40 static void MakePalette()
    43 static void MakePalette()
    41 {
    44 {
    42 	LOGPALETTE *pal;
    45 	LOGPALETTE *pal;
    43 	uint i;
    46 	uint i;
   209 static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
   212 static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
   210 {
   213 {
   211 	switch (msg) {
   214 	switch (msg) {
   212 		case WM_CREATE:
   215 		case WM_CREATE:
   213 			SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
   216 			SetTimer(hwnd, TID_POLLMOUSE, MOUSE_POLL_DELAY, (TIMERPROC)TrackMouseTimerProc);
       
   217 #if !defined(UNICODE)
       
   218 			_codepage = GetACP(); // get system codepage as some kind of a default
       
   219 #endif /* UNICODE */
   214 			break;
   220 			break;
   215 
   221 
   216 		case WM_PAINT: {
   222 		case WM_PAINT: {
   217 			PAINTSTRUCT ps;
   223 			PAINTSTRUCT ps;
   218 			HDC dc,dc2;
   224 			HDC dc,dc2;
   344 			}
   350 			}
   345 			MyShowCursor(false);
   351 			MyShowCursor(false);
   346 			HandleMouseEvents();
   352 			HandleMouseEvents();
   347 			return 0;
   353 			return 0;
   348 		}
   354 		}
       
   355 
       
   356 #if !defined(UNICODE)
       
   357 		case WM_INPUTLANGCHANGE: {
       
   358 			TCHAR locale[6];
       
   359 			LCID lcid = GB(lParam, 0, 16);
       
   360 
       
   361 			int len = GetLocaleInfo(lcid, LOCALE_IDEFAULTANSICODEPAGE, locale, lengthof(locale));
       
   362 			if (len != 0) _codepage = _ttoi(locale);
       
   363 			return 1;
       
   364 		}
       
   365 #endif /* UNICODE */
   349 
   366 
   350 		case WM_KEYDOWN: {
   367 		case WM_KEYDOWN: {
   351 			// this is the rewritten ascii input function
   368 			// this is the rewritten ascii input function
   352 			// it disables windows deadkey handling --> more linux like :D
   369 			// it disables windows deadkey handling --> more linux like :D
   353 			wchar_t w = 0;
   370 			wchar_t w = 0;