From 0ab994809d5b3b71bbcf8a17c68fdad5d28f196b Mon Sep 17 00:00:00 2001 From: Dimitris Panokostas Date: Thu, 23 Feb 2017 00:34:24 +0100 Subject: [PATCH] Renamed UpdateScreen() to UpdateGuiScreen() To avoid confusion with the emulation screen --- src/osdep/gui/CreateFilesysHardfile.cpp | 2 +- src/osdep/gui/EditFilesysHardfile.cpp | 2 +- src/osdep/gui/EditFilesysVirtual.cpp | 104 ++++++++++++------------ src/osdep/gui/InGameMessage.cpp | 2 +- src/osdep/gui/SelectFile.cpp | 2 +- src/osdep/gui/ShowMessage.cpp | 2 +- src/osdep/gui/gui_handling.h | 2 +- src/osdep/gui/main_window.cpp | 4 +- 8 files changed, 60 insertions(+), 60 deletions(-) diff --git a/src/osdep/gui/CreateFilesysHardfile.cpp b/src/osdep/gui/CreateFilesysHardfile.cpp index 8989910c..e1c35a86 100644 --- a/src/osdep/gui/CreateFilesysHardfile.cpp +++ b/src/osdep/gui/CreateFilesysHardfile.cpp @@ -251,7 +251,7 @@ static void CreateFilesysHardfileLoop() uae_gui->draw(); // Finally we update the screen. - UpdateScreen(); + UpdateGuiScreen(); } } diff --git a/src/osdep/gui/EditFilesysHardfile.cpp b/src/osdep/gui/EditFilesysHardfile.cpp index 8565b725..4aac6fd9 100644 --- a/src/osdep/gui/EditFilesysHardfile.cpp +++ b/src/osdep/gui/EditFilesysHardfile.cpp @@ -316,7 +316,7 @@ static void EditFilesysHardfileLoop() uae_gui->draw(); // Finally we update the screen. - UpdateScreen(); + UpdateGuiScreen(); } } diff --git a/src/osdep/gui/EditFilesysVirtual.cpp b/src/osdep/gui/EditFilesysVirtual.cpp index ed1c3ba4..ddb14445 100644 --- a/src/osdep/gui/EditFilesysVirtual.cpp +++ b/src/osdep/gui/EditFilesysVirtual.cpp @@ -201,62 +201,62 @@ static void ExitEditFilesysVirtual(void) static void EditFilesysVirtualLoop(void) { - while(!dialogFinished) - { - SDL_Event event; - while(SDL_PollEvent(&event)) - { - if (event.type == SDL_KEYDOWN) - { - switch(event.key.keysym.sym) - { - case VK_ESCAPE: - dialogFinished = true; - break; - - case VK_UP: - if(HandleNavigation(DIRECTION_UP)) - continue; // Don't change value when enter ComboBox -> don't send event to control - break; - - case VK_DOWN: - if(HandleNavigation(DIRECTION_DOWN)) - continue; // Don't change value when enter ComboBox -> don't send event to control - break; + while (!dialogFinished) + { + SDL_Event event; + while (SDL_PollEvent(&event)) + { + if (event.type == SDL_KEYDOWN) + { + switch (event.key.keysym.sym) + { + case VK_ESCAPE: + dialogFinished = true; + break; - case VK_LEFT: - if(HandleNavigation(DIRECTION_LEFT)) - continue; // Don't change value when enter Slider -> don't send event to control - break; - - case VK_RIGHT: - if(HandleNavigation(DIRECTION_RIGHT)) - continue; // Don't change value when enter Slider -> don't send event to control - break; + case VK_UP: + if (HandleNavigation(DIRECTION_UP)) + continue; // Don't change value when enter ComboBox -> don't send event to control + break; - case VK_X: - case VK_A: - event.key.keysym.sym = SDLK_RETURN; - gui_input->pushInput(event); // Fire key down - event.type = SDL_KEYUP; // and the key up - break; - } - } + case VK_DOWN: + if (HandleNavigation(DIRECTION_DOWN)) + continue; // Don't change value when enter ComboBox -> don't send event to control + break; - //------------------------------------------------- - // Send event to guisan-controls - //------------------------------------------------- - gui_input->pushInput(event); - } + case VK_LEFT: + if (HandleNavigation(DIRECTION_LEFT)) + continue; // Don't change value when enter Slider -> don't send event to control + break; - // Now we let the Gui object perform its logic. - uae_gui->logic(); - // Now we let the Gui object draw itself. - uae_gui->draw(); - // Finally we update the screen. - - UpdateScreen(); - } + case VK_RIGHT: + if (HandleNavigation(DIRECTION_RIGHT)) + continue; // Don't change value when enter Slider -> don't send event to control + break; + + case VK_X: + case VK_A: + event.key.keysym.sym = SDLK_RETURN; + gui_input->pushInput(event); // Fire key down + event.type = SDL_KEYUP; // and the key up + break; + } + } + + //------------------------------------------------- + // Send event to guisan-controls + //------------------------------------------------- + gui_input->pushInput(event); + } + + // Now we let the Gui object perform its logic. + uae_gui->logic(); + // Now we let the Gui object draw itself. + uae_gui->draw(); + // Finally we update the screen. + + UpdateGuiScreen(); + } } diff --git a/src/osdep/gui/InGameMessage.cpp b/src/osdep/gui/InGameMessage.cpp index 557c9b73..59eff1e5 100644 --- a/src/osdep/gui/InGameMessage.cpp +++ b/src/osdep/gui/InGameMessage.cpp @@ -125,7 +125,7 @@ void InGameMessage(const char *msg) // Finally we update the screen. if (!drawn) { - UpdateScreen(); + UpdateGuiScreen(); } drawn = true; } diff --git a/src/osdep/gui/SelectFile.cpp b/src/osdep/gui/SelectFile.cpp index dd866c12..0cc6100a 100644 --- a/src/osdep/gui/SelectFile.cpp +++ b/src/osdep/gui/SelectFile.cpp @@ -352,7 +352,7 @@ static void SelectFileLoop() uae_gui->draw(); // Finally we update the screen. - UpdateScreen(); + UpdateGuiScreen(); if (!dialogCreated) { diff --git a/src/osdep/gui/ShowMessage.cpp b/src/osdep/gui/ShowMessage.cpp index 155acd67..f98f0c9d 100644 --- a/src/osdep/gui/ShowMessage.cpp +++ b/src/osdep/gui/ShowMessage.cpp @@ -144,7 +144,7 @@ static void ShowMessageLoop() uae_gui->draw(); // Finally we update the screen. - UpdateScreen(); + UpdateGuiScreen(); } } diff --git a/src/osdep/gui/gui_handling.h b/src/osdep/gui/gui_handling.h index b2dee6a4..88faaf5f 100644 --- a/src/osdep/gui/gui_handling.h +++ b/src/osdep/gui/gui_handling.h @@ -124,6 +124,6 @@ extern char *screenshot_filename; extern int currentStateNum; extern int delay_savestate_frame; -extern void UpdateScreen(); +extern void UpdateGuiScreen(); #endif // _GUI_HANDLING_H diff --git a/src/osdep/gui/main_window.cpp b/src/osdep/gui/main_window.cpp index 4967298e..adcd5326 100644 --- a/src/osdep/gui/main_window.cpp +++ b/src/osdep/gui/main_window.cpp @@ -139,7 +139,7 @@ void RegisterRefreshFunc(void (*func)()) refreshFuncAfterDraw = func; } -void UpdateScreen() +void UpdateGuiScreen() { // Update the texture from the surface SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch); @@ -319,7 +319,7 @@ namespace sdl uae_gui->draw(); // Finally we update the screen. - UpdateScreen(); + UpdateGuiScreen(); if (refreshFuncAfterDraw != nullptr) {