Merge pull request #67 from MrSmith33/master

Fix 64-bit build.
This commit is contained in:
Vadim Lopatin 2015-02-24 07:04:49 +03:00
commit bde4b0d44e
1 changed files with 73 additions and 73 deletions

View File

@ -751,7 +751,7 @@ class Win32Platform : Platform {
TranslateMessage(&msg); TranslateMessage(&msg);
DispatchMessage(&msg); DispatchMessage(&msg);
} }
return msg.wParam; return cast(int)msg.wParam;
} }
private Win32Window[ulong] _windowMap; private Win32Window[ulong] _windowMap;
/// add window to window map /// add window to window map
@ -836,7 +836,7 @@ class Win32Platform : Platform {
EmptyClipboard(); EmptyClipboard();
wstring w = toUTF16(text); wstring w = toUTF16(text);
HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE, HGLOBAL hglbCopy = GlobalAlloc(GMEM_MOVEABLE,
(w.length + 1) * TCHAR.sizeof); cast(uint)((w.length + 1) * TCHAR.sizeof));
if (hglbCopy == NULL) { if (hglbCopy == NULL) {
CloseClipboard(); CloseClipboard();
return; return;
@ -1151,14 +1151,14 @@ LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_SYSKEYUP: case WM_SYSKEYUP:
if (window !is null) { if (window !is null) {
int repeatCount = lParam & 0xFFFF; int repeatCount = lParam & 0xFFFF;
if (window.onKey(message == WM_KEYDOWN || message == WM_SYSKEYDOWN ? KeyAction.KeyDown : KeyAction.KeyUp, wParam, repeatCount, 0, message == WM_SYSKEYUP || message == WM_SYSKEYDOWN)) if (window.onKey(message == WM_KEYDOWN || message == WM_SYSKEYDOWN ? KeyAction.KeyDown : KeyAction.KeyUp, cast(uint)wParam, repeatCount, 0, message == WM_SYSKEYUP || message == WM_SYSKEYDOWN))
return 0; // processed return 0; // processed
} }
break; break;
case WM_UNICHAR: case WM_UNICHAR:
if (window !is null) { if (window !is null) {
int repeatCount = lParam & 0xFFFF; int repeatCount = lParam & 0xFFFF;
if (window.onKey(KeyAction.Text, wParam, repeatCount, wParam == UNICODE_NOCHAR ? 0 : wParam)) if (window.onKey(KeyAction.Text, cast(uint)wParam, repeatCount, wParam == UNICODE_NOCHAR ? 0 : cast(uint)wParam))
return 1; // processed return 1; // processed
return 1; return 1;
} }
@ -1166,7 +1166,7 @@ LRESULT WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
case WM_CHAR: case WM_CHAR:
if (window !is null) { if (window !is null) {
int repeatCount = lParam & 0xFFFF; int repeatCount = lParam & 0xFFFF;
if (window.onKey(KeyAction.Text, wParam, repeatCount, wParam == UNICODE_NOCHAR ? 0 : wParam)) if (window.onKey(KeyAction.Text, cast(uint)wParam, repeatCount, wParam == UNICODE_NOCHAR ? 0 : cast(uint)wParam))
return 1; // processed return 1; // processed
return 1; return 1;
} }