win32_gui: gettting x64 build to work

This commit is contained in:
Alex Kompel
2015-04-14 08:54:44 -07:00
parent 3c6f01f022
commit 62617092b5
13 changed files with 144 additions and 109 deletions
+15 -7
View File
@@ -188,7 +188,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
if( !data ) panic("out of memory");
ZeroMemory(data, sizeof(NHMainWindow));
data->mapAcsiiModeSave = MAP_MODE_ASCII12x16;
SetWindowLong(hWnd, GWL_USERDATA, (LONG)data);
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)data);
/* update menu items */
CheckMenuItem(
@@ -214,7 +214,7 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
case WM_KEYDOWN:
{
data = (PNHMainWindow)GetWindowLong(hWnd, GWL_USERDATA);
data = (PNHMainWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
/* translate arrow keys into nethack commands */
switch (wParam)
@@ -525,8 +525,8 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
WM_QUIT somehow */
/* clean up */
free( (PNHMainWindow)GetWindowLong(hWnd, GWL_USERDATA) );
SetWindowLong(hWnd, GWL_USERDATA, (LONG)0);
free( (PNHMainWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA) );
SetWindowLongPtr(hWnd, GWLP_USERDATA, (LONG_PTR)0);
// PostQuitMessage(0);
exit(1);
@@ -540,6 +540,10 @@ LRESULT CALLBACK MainWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lPar
void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(hWnd);
UNREFERENCED_PARAMETER(wParam);
UNREFERENCED_PARAMETER(lParam);
switch(wParam) {
/* new window was just added */
@@ -585,7 +589,7 @@ void mswin_layout_main_window(HWND changed_child)
if( GetNHApp()->bAutoLayout ) {
GetClientRect(GetNHApp()->hMainWnd, &client_rt);
data = (PNHMainWindow)GetWindowLong(GetNHApp()->hMainWnd, GWL_USERDATA);
data = (PNHMainWindow)GetWindowLongPtr(GetNHApp()->hMainWnd, GWLP_USERDATA);
/* get sizes of child windows */
wnd_status = mswin_hwnd_from_winid(WIN_STATUS);
@@ -752,10 +756,12 @@ void mswin_layout_main_window(HWND changed_child)
LRESULT onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
int wmId, wmEvent;
PNHMainWindow data;
data = (PNHMainWindow)GetWindowLong(hWnd, GWL_USERDATA);
data = (PNHMainWindow)GetWindowLongPtr(hWnd, GWLP_USERDATA);
wmId = LOWORD(wParam);
wmEvent = HIWORD(wParam);
@@ -972,6 +978,8 @@ LRESULT onWMCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
// Mesage handler for about box.
LRESULT CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
UNREFERENCED_PARAMETER(lParam);
char buf[BUFSZ];
TCHAR wbuf[BUFSZ];
RECT main_rt, dlg_rt;
@@ -1040,7 +1048,7 @@ void mswin_select_map_mode(int mode)
winid map_id;
map_id = WIN_MAP;
data = (PNHMainWindow)GetWindowLong(GetNHApp()->hMainWnd, GWL_USERDATA);
data = (PNHMainWindow)GetWindowLongPtr(GetNHApp()->hMainWnd, GWLP_USERDATA);
/* override for Rogue level */
if( Is_rogue_level(&u.uz) && !IS_MAP_ASCII(mode) ) return;