mirror of
https://github.com/jmarshall23/CnC_Remastered_Collection.git
synced 2026-08-12 08:00:55 +02:00
Removed old wndproc code which fixes ESP crash.
This commit is contained in:
+3
-177
@@ -320,180 +320,6 @@ void Check_For_Focus_Loss(void)
|
||||
|
||||
extern bool InMovie;
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
int low_param = LOWORD(wParam);
|
||||
|
||||
if (message == CCFocusMessage) {
|
||||
Start_Primary_Sound_Buffer(TRUE);
|
||||
if (!InMovie) {
|
||||
Theme.Stop();
|
||||
Theme.Queue_Song(THEME_PICK_ANOTHER);
|
||||
}
|
||||
return(0);
|
||||
}
|
||||
|
||||
#ifdef WINSOCK_IPX
|
||||
/*
|
||||
** Pass on any messages intended for the winsock message handler.
|
||||
*/
|
||||
if ( PacketTransport ) {
|
||||
if ( message == (UINT) PacketTransport->Protocol_Event_Message() ) {
|
||||
if ( PacketTransport->Message_Handler (hwnd, message, wParam, lParam) ){
|
||||
return ( DefWindowProc (hwnd, message, wParam, lParam) );
|
||||
}else{
|
||||
return (0);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif //WINSOCK_IPX
|
||||
|
||||
|
||||
/*
|
||||
** Pass this message through to the keyboard handler. If the message
|
||||
** was processed and requires no further action, then return with
|
||||
** this information.
|
||||
*/
|
||||
if (Keyboard->Message_Handler(hWnd, message, wParam, lParam)) {
|
||||
return(1);
|
||||
}
|
||||
|
||||
switch ( message ) {
|
||||
// case WM_SYSKEYDOWN:
|
||||
// Mono_Printf("wparam=%08X lparam=%08X\n", (long)wParam, (long)lParam);
|
||||
// fall through
|
||||
|
||||
// case WM_MOUSEMOVE:
|
||||
// case WM_KEYDOWN:
|
||||
// case WM_SYSKEYUP:
|
||||
// case WM_KEYUP:
|
||||
// case WM_LBUTTONDOWN:
|
||||
// case WM_LBUTTONUP:
|
||||
// case WM_LBUTTONDBLCLK:
|
||||
// case WM_MBUTTONDOWN:
|
||||
// case WM_MBUTTONUP:
|
||||
// case WM_MBUTTONDBLCLK:
|
||||
// case WM_RBUTTONDOWN:
|
||||
// case WM_RBUTTONUP:
|
||||
// case WM_RBUTTONDBLCLK:
|
||||
// Keyboard->Message_Handler(hwnd, message, wParam, lParam);
|
||||
// return(0);
|
||||
|
||||
/*
|
||||
** Windoze message says we have to shut down. Try and do it cleanly.
|
||||
*/
|
||||
case WM_DESTROY:
|
||||
Prog_End("WM_DESTROY", false);
|
||||
Invalidate_Cached_Icons();
|
||||
VisiblePage.Un_Init();
|
||||
HiddenPage.Un_Init();
|
||||
AllSurfaces.Release();
|
||||
if (!InDebugger) Reset_Video_Mode();
|
||||
//Stop_Profiler();
|
||||
PostQuitMessage( 0 );
|
||||
|
||||
/*
|
||||
** If we are shutting down gracefully than flag that the message loop has finished.
|
||||
** If this is a forced shutdown (ReadyToQuit == 0) then try and close down everything
|
||||
** before we exit.
|
||||
*/
|
||||
switch (ReadyToQuit) {
|
||||
case 1:
|
||||
ReadyToQuit = 2;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
//Shutdown_Network();
|
||||
#ifndef WINSOCK_IPX
|
||||
if (Winsock.Get_Connected()) Winsock.Close();
|
||||
/*
|
||||
** Free the THIPX32 dll
|
||||
*/
|
||||
//Unload_IPX_Dll();
|
||||
#endif //WINSOCK_IPX
|
||||
ExitProcess(0);
|
||||
break;
|
||||
case 3:
|
||||
//Shutdown_Network();
|
||||
#ifndef WINSOCK_IPX
|
||||
/*
|
||||
** Call the function to disable the IPX callback as horrible things can
|
||||
** happen if we get a callback after the process has exited!
|
||||
*/
|
||||
if (Session.Type == GAME_IPX){
|
||||
IPX_Shut_Down95();
|
||||
}
|
||||
/*
|
||||
** Free the THIPX32 dll
|
||||
*/
|
||||
#ifdef FIXIT_CSII // checked - ajw 9/28/98
|
||||
#else
|
||||
Unload_IPX_Dll();
|
||||
#endif
|
||||
|
||||
if (Winsock.Get_Connected()) Winsock.Close();
|
||||
#endif //WINSOCK_IPX
|
||||
ReadyToQuit = 2;
|
||||
break;
|
||||
|
||||
}
|
||||
return(0);
|
||||
|
||||
case WM_ACTIVATEAPP:
|
||||
GameInFocus=(BOOL)wParam;
|
||||
if (!GameInFocus) Focus_Loss();
|
||||
AllSurfaces.Set_Surface_Focus (GameInFocus);
|
||||
AllSurfaces.Restore_Surfaces();
|
||||
// if (GameInFocus) {
|
||||
// Restore_Cached_Icons();
|
||||
// Map.Flag_To_Redraw(true);
|
||||
// Start_Primary_Sound_Buffer(TRUE);
|
||||
// if (WWMouse) WWMouse->Set_Cursor_Clip();
|
||||
// }
|
||||
return(0);
|
||||
#ifdef NEVER
|
||||
case WM_ACTIVATE:
|
||||
if (low_param == WA_INACTIVE) {
|
||||
GameInFocus = FALSE;
|
||||
Focus_Loss();
|
||||
}
|
||||
return(0);
|
||||
#endif //NEVER
|
||||
|
||||
|
||||
case WM_SYSCOMMAND:
|
||||
switch ( wParam ) {
|
||||
|
||||
case SC_CLOSE:
|
||||
/*
|
||||
** Windows sent us a close message. Probably in response to Alt-F4. Ignore it by
|
||||
** pretending to handle the message and returning true;
|
||||
*/
|
||||
return (0);
|
||||
|
||||
case SC_SCREENSAVE:
|
||||
/*
|
||||
** Windoze is about to start the screen saver. If we just return without passing
|
||||
** this message to DefWindowProc then the screen saver will not be allowed to start.
|
||||
*/
|
||||
return (0);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
#ifndef WINSOCK_IPX
|
||||
case WM_ACCEPT:
|
||||
case WM_HOSTBYADDRESS:
|
||||
case WM_HOSTBYNAME:
|
||||
case WM_ASYNCEVENT:
|
||||
case WM_UDPASYNCEVENT:
|
||||
Winsock.Message_Handler(hWnd, message, wParam, lParam);
|
||||
return (0);
|
||||
#endif //WINSOCK_IPX
|
||||
}
|
||||
|
||||
return DefWindowProc (hWnd, message, wParam, lParam);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -840,9 +666,9 @@ void WWSDL_ProcessEvents(KeyNumType& key, int& flags, bool presentBuffer) {
|
||||
while (SDL_PollEvent(&event)) {
|
||||
switch (event.type)
|
||||
{
|
||||
case SDL_SYSWMEVENT:
|
||||
WndProc( event.syswm.msg->msg.win.hwnd , event.syswm.msg->msg.win.msg, event.syswm.msg->msg.win.wParam, event.syswm.msg->msg.win.lParam );
|
||||
break;
|
||||
//case SDL_SYSWMEVENT:
|
||||
// WndProc( event.syswm.msg->msg.win.hwnd , event.syswm.msg->msg.win.msg, event.syswm.msg->msg.win.wParam, event.syswm.msg->msg.win.lParam );
|
||||
// break;
|
||||
|
||||
case SDL_MOUSEBUTTONDOWN:
|
||||
if (event.button.button == SDL_BUTTON_LEFT) {
|
||||
|
||||
Reference in New Issue
Block a user