aboutsummaryrefslogtreecommitdiff
path: root/windows.c
diff options
context:
space:
mode:
Diffstat (limited to 'windows.c')
-rw-r--r--windows.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/windows.c b/windows.c
index 52b2ac3..5273e17 100644
--- a/windows.c
+++ b/windows.c
@@ -2678,18 +2678,18 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
cmd = wParam & ~0xF; /* low 4 bits reserved to Windows */
switch (cmd) {
case IDM_NEW:
- if (!midend_process_key(fe->me, 0, 0, UI_NEWGAME, NULL))
+ if (midend_process_key(fe->me, 0, 0, UI_NEWGAME) == PKR_QUIT)
PostQuitMessage(0);
break;
case IDM_RESTART:
midend_restart_game(fe->me);
break;
case IDM_UNDO:
- if (!midend_process_key(fe->me, 0, 0, UI_UNDO, NULL))
+ if (midend_process_key(fe->me, 0, 0, UI_UNDO) == PKR_QUIT)
PostQuitMessage(0);
break;
case IDM_REDO:
- if (!midend_process_key(fe->me, 0, 0, UI_REDO, NULL))
+ if (midend_process_key(fe->me, 0, 0, UI_REDO) == PKR_QUIT)
PostQuitMessage(0);
break;
case IDM_COPY:
@@ -2711,7 +2711,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
}
break;
case IDM_QUIT:
- if (!midend_process_key(fe->me, 0, 0, UI_QUIT, NULL))
+ if (midend_process_key(fe->me, 0, 0, UI_QUIT) == PKR_QUIT)
PostQuitMessage(0);
break;
case IDM_CONFIG:
@@ -2998,7 +2998,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
}
if (key != -1) {
- if (!midend_process_key(fe->me, 0, 0, key, NULL))
+ if (midend_process_key(fe->me, 0, 0, key) == PKR_QUIT)
PostQuitMessage(0);
} else {
MSG m;
@@ -3028,10 +3028,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
else
button = LEFT_BUTTON;
- if (!midend_process_key(fe->me,
- (signed short)LOWORD(lParam) - fe->bitmapPosition.left,
- (signed short)HIWORD(lParam) - fe->bitmapPosition.top,
- button, NULL))
+ if (midend_process_key(fe->me,
+ (signed short)LOWORD(lParam) - fe->bitmapPosition.left,
+ (signed short)HIWORD(lParam) - fe->bitmapPosition.top,
+ button) == PKR_QUIT)
PostQuitMessage(0);
SetCapture(hwnd);
@@ -3055,10 +3055,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
else
button = LEFT_RELEASE;
- if (!midend_process_key(fe->me,
- (signed short)LOWORD(lParam) - fe->bitmapPosition.left,
- (signed short)HIWORD(lParam) - fe->bitmapPosition.top,
- button, NULL))
+ if (midend_process_key(fe->me,
+ (signed short)LOWORD(lParam) - fe->bitmapPosition.left,
+ (signed short)HIWORD(lParam) - fe->bitmapPosition.top,
+ button) == PKR_QUIT)
PostQuitMessage(0);
ReleaseCapture();
@@ -3075,10 +3075,10 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
else
button = LEFT_DRAG;
- if (!midend_process_key(fe->me,
- (signed short)LOWORD(lParam) - fe->bitmapPosition.left,
- (signed short)HIWORD(lParam) - fe->bitmapPosition.top,
- button, NULL))
+ if (midend_process_key(fe->me,
+ (signed short)LOWORD(lParam) - fe->bitmapPosition.left,
+ (signed short)HIWORD(lParam) - fe->bitmapPosition.top,
+ button) == PKR_QUIT)
PostQuitMessage(0);
}
break;
@@ -3092,7 +3092,7 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
(keystate[VK_CONTROL] & 0x80))
key = UI_REDO;
}
- if (!midend_process_key(fe->me, 0, 0, key, NULL))
+ if (midend_process_key(fe->me, 0, 0, key) == PKR_QUIT)
PostQuitMessage(0);
}
return 0;