Browse Source

Fix PostMessageA an remove more unused event code

pull/504/head
Anders Jenbo 6 years ago
parent
commit
046064fcfe
  1. 6
      Source/player.cpp
  2. 3
      SourceS/miniwin/misc.h
  3. 9
      SourceX/miniwin/misc_msg.cpp

6
Source/player.cpp

@ -2068,7 +2068,7 @@ void StartNewLvl(int pnum, int fom, int lvl)
if (pnum == myplr) {
plr[pnum]._pmode = PM_NEWLVL;
plr[pnum]._pInvincible = TRUE;
PostMessage(ghMainWnd, fom, 0, 0);
PostMessage(fom, 0, 0);
if (gbMaxPlayers > 1) {
NetSendCmdParam2(TRUE, CMD_NEWLVL, fom, lvl);
}
@ -2094,7 +2094,7 @@ void RestartTownLvl(int pnum)
if (pnum == myplr) {
plr[pnum]._pmode = PM_NEWLVL;
plr[pnum]._pInvincible = TRUE;
PostMessage(ghMainWnd, WM_DIABRETOWN, 0, 0);
PostMessage(WM_DIABRETOWN, 0, 0);
}
}
@ -2114,7 +2114,7 @@ void StartWarpLvl(int pnum, int pidx)
SetCurrentPortal(pidx);
plr[pnum]._pmode = PM_NEWLVL;
plr[pnum]._pInvincible = TRUE;
PostMessage(ghMainWnd, WM_DIABWARPLVL, 0, 0);
PostMessage(WM_DIABWARPLVL, 0, 0);
}
}

3
SourceS/miniwin/misc.h

@ -113,7 +113,6 @@ typedef struct tagSIZE {
} SIZE;
typedef struct tagMSG {
HWND hwnd;
UINT message;
WPARAM wParam;
LPARAM lParam;
@ -199,7 +198,7 @@ WINBOOL WINAPI PeekMessageA(LPMSG lpMsg);
WINBOOL WINAPI TranslateMessage(const MSG *lpMsg);
LRESULT WINAPI DispatchMessageA(const MSG *lpMsg);
WINBOOL WINAPI PostMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
WINBOOL WINAPI PostMessageA(UINT Msg, WPARAM wParam, LPARAM lParam);
bool SpawnWindow(LPCSTR lpWindowName, int nWidth, int nHeight);

9
SourceX/miniwin/misc_msg.cpp

@ -652,7 +652,7 @@ WINBOOL TranslateMessage(const MSG *lpMsg)
#endif
// XXX: This does not add extended info to lParam
PostMessageA(lpMsg->hwnd, DVL_WM_CHAR, key, 0);
PostMessageA(DVL_WM_CHAR, key, 0);
}
}
@ -690,15 +690,12 @@ LRESULT DispatchMessageA(const MSG *lpMsg)
assert(CurrentProc);
// assert(CurrentProc == GM_Game);
return CurrentProc(lpMsg->hwnd, lpMsg->message, lpMsg->wParam, lpMsg->lParam);
return CurrentProc(NULL, lpMsg->message, lpMsg->wParam, lpMsg->lParam);
}
WINBOOL PostMessageA(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
WINBOOL PostMessageA(UINT Msg, WPARAM wParam, LPARAM lParam)
{
assert(hWnd == 0);
MSG msg;
msg.hwnd = hWnd;
msg.message = Msg;
msg.wParam = wParam;
msg.lParam = lParam;

Loading…
Cancel
Save