diff --git a/SDL2.dll b/SDL2.dll index af9f0bb..d0849bf 100644 Binary files a/SDL2.dll and b/SDL2.dll differ diff --git a/code/REDALERT/CONQUER.CPP b/code/REDALERT/CONQUER.CPP index 20cba0d..fccd6cf 100644 --- a/code/REDALERT/CONQUER.CPP +++ b/code/REDALERT/CONQUER.CPP @@ -143,6 +143,9 @@ extern void Do_Draw(void); bool bNoMovies = false; #endif +KeyNumType g_globalKeyNumType = KN_NONE; +int g_globalKeyFlags = 0; + /**************************************** ** Function prototypes for this module ** *****************************************/ @@ -1635,6 +1638,8 @@ void Color_Cycle(void) *=============================================================================================*/ void Call_Back(void) { + WWSDL_ProcessEvents(g_globalKeyNumType, g_globalKeyFlags); + /* ** Music and speech maintenance */ diff --git a/code/REDALERT/DIALOG.CPP b/code/REDALERT/DIALOG.CPP index 5dd28e1..001ab27 100644 --- a/code/REDALERT/DIALOG.CPP +++ b/code/REDALERT/DIALOG.CPP @@ -99,7 +99,7 @@ void Dialog_Box(int x, int y, int w, int h) int cx = w/2; int cy = h/2; // jmarshall - void const * shapedata = MFCD::Retrieve("DD-BKGND.SHP"); + //void const * shapedata = MFCD::Retrieve("DD-BKGND.SHP"); //#ifdef WIN32 // CC_Draw_Shape(shapedata, 0, cx-312, cy-192, WINDOW_PARTIAL, SHAPE_WIN_REL); // CC_Draw_Shape(shapedata, 1, cx, cy-192, WINDOW_PARTIAL, SHAPE_WIN_REL); @@ -197,17 +197,17 @@ void Dialog_Box(int x, int y, int w, int h) //CC_Draw_Shape(shapedata, 2, 0, h-(12*RESFACTOR), WINDOW_PARTIAL, SHAPE_WIN_REL); //CC_Draw_Shape(shapedata, 3, w-(12*RESFACTOR-1), h-(12*RESFACTOR), WINDOW_PARTIAL, SHAPE_WIN_REL); -#ifdef WIN32 - WWMouse->Draw_Mouse(&HidPage); - HidPage.Blit(SeenBuff, x, y, x, y, w, h, false); - WWMouse->Erase_Mouse(&HidPage, FALSE); -#else -// Shadow_Blit(0, 0, 320, 200, HidPage, SeenPage, Map.ShadowPage->Get_Buffer()); - Hide_Mouse(); - HidPage.Blit(SeenBuff); - Show_Mouse(); -// Shadow_Blit(0, 0, 320, 200, HidPage, SeenPage, ((GraphicBufferClass*)Map.Shadow_Address())->Get_Buffer()); -#endif +//#ifdef WIN32 +// WWMouse->Draw_Mouse(&HidPage); +// HidPage.Blit(SeenBuff, x, y, x, y, w, h, false); +// WWMouse->Erase_Mouse(&HidPage, FALSE); +//#else +//// Shadow_Blit(0, 0, 320, 200, HidPage, SeenPage, Map.ShadowPage->Get_Buffer()); +// Hide_Mouse(); +// HidPage.Blit(SeenBuff); +// Show_Mouse(); +//// Shadow_Blit(0, 0, 320, 200, HidPage, SeenPage, ((GraphicBufferClass*)Map.Shadow_Address())->Get_Buffer()); +//#endif Set_Logic_Page(oldpage); GL_ResetClipRect(); diff --git a/code/REDALERT/FUNCTION.H b/code/REDALERT/FUNCTION.H index ab85a68..90fe9ba 100644 --- a/code/REDALERT/FUNCTION.H +++ b/code/REDALERT/FUNCTION.H @@ -1183,5 +1183,6 @@ __forceinline void COM_SetExtension(char* path, int maxSize, const char* extensi } extern bool g_inMainMenu; - +extern KeyNumType g_globalKeyNumType; +extern int g_globalKeyFlags; #endif \ No newline at end of file diff --git a/code/REDALERT/GADGET.CPP b/code/REDALERT/GADGET.CPP index ca5a3f6..3b8d5aa 100644 --- a/code/REDALERT/GADGET.CPP +++ b/code/REDALERT/GADGET.CPP @@ -533,10 +533,7 @@ KeyNumType GadgetClass::Input(void) ** rather the the mouse position at the time we get around to this function. */ // jmarshall - int flags = 0; - WWSDL_ProcessEvents(key, flags); - - Show_Mouse(); // jmarshall: thsi shouldn't be here! + int flags = g_globalKeyFlags; // jmarshall end /* diff --git a/code/REDALERT/MPLAYER.CPP b/code/REDALERT/MPLAYER.CPP index e750394..9b0b91e 100644 --- a/code/REDALERT/MPLAYER.CPP +++ b/code/REDALERT/MPLAYER.CPP @@ -694,7 +694,7 @@ int Surrender_Dialog(int text) //..................................................................... // Refresh display if needed //..................................................................... - if (display) { + { display = false; //.................................................................. @@ -730,6 +730,9 @@ int Surrender_Dialog(int text) // Get user input //..................................................................... KeyNumType input = commands->Input(); +// jmarshall + Call_Back(); +// jmarshall end //..................................................................... // Process input diff --git a/code/REDALERT/NULLDLG.CPP b/code/REDALERT/NULLDLG.CPP index d956acf..03e77e5 100644 --- a/code/REDALERT/NULLDLG.CPP +++ b/code/REDALERT/NULLDLG.CPP @@ -651,11 +651,6 @@ oh_dear_its_a_label: } } - /* - ........................ Invoke game callback ......................... - */ - Call_Back(); - #ifdef WIN32 /* ** If we have just received input focus again after running in the background then @@ -795,6 +790,11 @@ oh_dear_its_a_label: bool droplist_is_dropped = housebtn.IsDropped; input = commands->Input(); + /* + ........................ Invoke game callback ......................... + */ + Call_Back(); + Load_Title_Page(true); /* diff --git a/code/REDALERT/WINSTUB.CPP b/code/REDALERT/WINSTUB.CPP index cd7e1fb..dabdaf1 100644 --- a/code/REDALERT/WINSTUB.CPP +++ b/code/REDALERT/WINSTUB.CPP @@ -679,7 +679,8 @@ void WWSDL_ProcessEvents(KeyNumType& key, int& flags, bool presentBuffer) { // if (flags == LEFTRELEASE || flags == RIGHTRELEASE) // flags = 0; - SDL_Event event; + static SDL_Event event; + memset(&event, 0, sizeof(SDL_Event)); while (SDL_PollEvent(&event)) { switch (event.type) {