Skip to content

Commit

Permalink
reorder DisableInputWndProc and GameWndProc
Browse files Browse the repository at this point in the history
  • Loading branch information
pionere committed Aug 29, 2024
1 parent 499f8be commit 60dac83
Showing 1 changed file with 28 additions and 29 deletions.
57 changes: 28 additions & 29 deletions Source/diablo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1078,13 +1078,7 @@ static void UpdateActionBtnState(int vKey, bool dir)
void DisableInputWndProc(const Dvl_Event* e)
{
switch (e->type) {
case DVL_WM_KEYDOWN:
UpdateActionBtnState(e->vkcode, true);
break; // return;
case DVL_WM_KEYUP:
UpdateActionBtnState(e->vkcode, false);
break; // return;
case DVL_WM_TEXT:
case DVL_WM_NONE:
//case DVL_WM_SYSKEYDOWN:
//case DVL_WM_SYSCOMMAND:
break; // return;
Expand All @@ -1106,14 +1100,21 @@ void DisableInputWndProc(const Dvl_Event* e)
case DVL_WM_RBUTTONUP:
UpdateActionBtnState(DVL_VK_RBUTTON, false);
break; // return;
case DVL_WM_KEYDOWN:
UpdateActionBtnState(e->vkcode, true);
break; // return;
case DVL_WM_KEYUP:
UpdateActionBtnState(e->vkcode, false);
break; // return;
case DVL_WM_TEXT:
break; // return;
case DVL_WM_CAPTURECHANGED:
gbActionBtnDown = false;
gbAltActionBtnDown = false;
break; // return;
case DVL_WM_PAINT:
gbRedrawFlags = REDRAW_ALL;
break; // return;
case DVL_WM_NONE:
// case DVL_WM_QUERYENDSESSION:
// case DVL_DWM_NEXTLVL:
// case DVL_DWM_PREVLVL:
Expand All @@ -1126,7 +1127,7 @@ void DisableInputWndProc(const Dvl_Event* e)
// case DVL_DWM_RETOWN:
// case DVL_DWM_NEWGAME:
// case DVL_DWM_LOADGAME:
break;
// break;
default:
ASSUME_UNREACHABLE
}
Expand All @@ -1137,23 +1138,8 @@ void DisableInputWndProc(const Dvl_Event* e)
static void GameWndProc(const Dvl_Event* e)
{
switch (e->type) {
case DVL_WM_KEYDOWN:
PressKey(e->vkcode);
break; // return;
case DVL_WM_KEYUP:
ReleaseKey(e->vkcode);
break; // return;
case DVL_WM_TEXT:
#ifndef USE_SDL1
if (gmenu_is_active()) {
break; // return;
}
if (gbTalkflag) {
plrmsg_CatToText(e->text.text);
break; // return;
}
#endif
break; // return;
case DVL_WM_NONE:
break;
//case DVL_WM_SYSKEYDOWN:
// if (PressSysKey(wParam))
// break; // return;
Expand Down Expand Up @@ -1193,13 +1179,29 @@ static void GameWndProc(const Dvl_Event* e)
//GetMousePos(wParam);
ReleaseKey(DVL_VK_RBUTTON);
break; // return;
case DVL_WM_KEYDOWN:
PressKey(e->vkcode);
break; // return;
case DVL_WM_KEYUP:
ReleaseKey(e->vkcode);
break; // return;
case DVL_WM_TEXT:
#ifndef USE_SDL1
if (gmenu_is_active())
break; // return;
else if (gbTalkflag)
plrmsg_CatToText(e->text.text);
#endif
break; // return;
case DVL_WM_CAPTURECHANGED:
gbActionBtnDown = false;
gbAltActionBtnDown = false;
break; // return;
case DVL_WM_PAINT:
gbRedrawFlags = REDRAW_ALL;
break; // return;
// case DVL_WM_QUERYENDSESSION:
// break;
case DVL_DWM_NEXTLVL:
case DVL_DWM_PREVLVL:
case DVL_DWM_SETLVL:
Expand All @@ -1226,9 +1228,6 @@ static void GameWndProc(const Dvl_Event* e)
//gbRedrawFlags = REDRAW_ALL;
}
break; // return;
case DVL_WM_NONE:
// case DVL_WM_QUERYENDSESSION:
break;
default:
ASSUME_UNREACHABLE
}
Expand Down

0 comments on commit 60dac83

Please sign in to comment.