Simplified GUI screen updates

This commit is contained in:
Dimitris Panokostas 2020-02-06 12:14:07 +01:00
parent 996bcbe5ab
commit 406808dfe6
9 changed files with 12 additions and 89 deletions

View file

@ -371,10 +371,6 @@ static void CreateFilesysHardfileLoop()
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
// Finally we update the screen.
UpdateGuiScreen();
}
@ -409,10 +405,6 @@ bool CreateFilesysHardfile()
// Prepare the screen once
uae_gui->logic();
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
UpdateGuiScreen();
CreateFilesysHardfileLoop();

View file

@ -538,10 +538,6 @@ static void EditFilesysHardfileLoop()
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
// Finally we update the screen.
UpdateGuiScreen();
}
@ -622,10 +618,6 @@ bool EditFilesysHardfile(const int unit_no)
// Prepare the screen once
uae_gui->logic();
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
UpdateGuiScreen();
EditFilesysHardfileLoop();

View file

@ -375,10 +375,6 @@ static void EditFilesysVirtualLoop()
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
// Finally we update the screen.
UpdateGuiScreen();
}
@ -433,10 +429,6 @@ bool EditFilesysVirtual(const int unit_no)
// Prepare the screen once
uae_gui->logic();
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
UpdateGuiScreen();
EditFilesysVirtualLoop();

View file

@ -121,7 +121,7 @@ void message_UpdateScreen()
vc_dispmanx_element_change_source(updateHandle, message_element, message_resource);
vc_dispmanx_update_submit_sync(updateHandle);
#else
SDL_RenderClear(renderer);
SDL_UpdateTexture(msg_texture, nullptr, msg_screen->pixels, msg_screen->pitch);
SDL_RenderCopyEx(renderer, msg_texture, nullptr, nullptr, rotation_angle, nullptr, SDL_FLIP_NONE);
SDL_RenderPresent(renderer);
#endif
@ -234,10 +234,6 @@ void message_checkInput()
msg_gui->logic();
// Now we let the Gui object draw itself.
msg_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(msg_texture, nullptr, msg_screen->pixels, msg_screen->pitch);
#endif
message_UpdateScreen();
}
@ -396,10 +392,6 @@ void message_gui_run()
// Prepare the screen once
msg_gui->logic();
msg_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(msg_texture, nullptr, msg_screen->pixels, msg_screen->pitch);
#endif
message_UpdateScreen();
while (!msg_done)

View file

@ -158,7 +158,6 @@ static void checkfilename(char* current)
}
}
class SelectFileActionListener : public gcn::ActionListener
{
public:
@ -485,14 +484,9 @@ static void SelectFileLoop()
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
#ifdef USE_DISPMANX
// Finally we update the screen.
UpdateGuiScreen();
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
}
// Finally we update the screen.
UpdateGuiScreen();
}
}
@ -513,10 +507,6 @@ bool SelectFile(const char* title, char* value, const char* filter[], const bool
// Prepare the screen once
uae_gui->logic();
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
UpdateGuiScreen();
SelectFileLoop();

View file

@ -389,14 +389,9 @@ static void SelectFolderLoop()
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
#ifdef USE_DISPMANX
// Finally we update the screen.
UpdateGuiScreen();
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
}
// Finally we update the screen.
UpdateGuiScreen();
}
}
@ -412,10 +407,6 @@ bool SelectFolder(const char* title, char* value)
// Prepare the screen once
uae_gui->logic();
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
UpdateGuiScreen();
SelectFolderLoop();

View file

@ -234,20 +234,17 @@ static void ShowHelpLoop(void)
gui_input->pushInput(event);
#endif
}
if (gotEvent)
{
// Now we let the Gui object perform its logic.
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
#ifdef USE_DISPMANX
UpdateGuiScreen();
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
// Finally we update the screen.
UpdateGuiScreen();
}
if (SDL_GetTicks() - time < 10) {
SDL_Delay(10);
}
@ -267,10 +264,6 @@ void ShowHelp(const char* title, const std::vector<std::string>& text)
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
UpdateGuiScreen();
ShowHelpLoop();

View file

@ -142,20 +142,17 @@ static void ShowMessageWaitInputLoop()
//-------------------------------------------------
gui_input->pushInput(event);
}
if (gotEvent)
{
// Now we let the Gui object perform its logic.
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
#ifdef USE_DISPMANX
UpdateGuiScreen();
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
// Finally we update the screen.
UpdateGuiScreen();
}
if (SDL_GetTicks() - time < 10) {
SDL_Delay(10);
}
@ -296,19 +293,17 @@ static void ShowMessageLoop()
gui_input->pushInput(event);
#endif
}
if (gotEvent)
{
// Now we let the Gui object perform its logic.
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
// Finally we update the screen.
UpdateGuiScreen();
}
if (SDL_GetTicks() - time < 10) {
SDL_Delay(10);
}
@ -337,10 +332,6 @@ bool ShowMessage(const char* title, const char* line1, const char* line2, const
// Prepare the screen once
uae_gui->logic();
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
UpdateGuiScreen();
ShowMessageLoop();
@ -364,10 +355,6 @@ const char* ShowMessageForInput(const char* title, const char* line1, const char
// Prepare the screen once
uae_gui->logic();
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
UpdateGuiScreen();
ShowMessageWaitInputLoop();

View file

@ -273,11 +273,12 @@ void UpdateGuiScreen()
vc_dispmanx_element_change_source(updateHandle, gui_element, gui_resource);
vc_dispmanx_update_submit_sync(updateHandle);
#else
SDL_RenderClear(renderer);
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
if (rotation_angle == 0 || rotation_angle == 180)
renderQuad = { 0, 0, gui_screen->w, gui_screen->h };
else
renderQuad = { -(GUI_WIDTH - GUI_HEIGHT) / 2, (GUI_WIDTH - GUI_HEIGHT) / 2, gui_screen->w, gui_screen->h };
SDL_RenderCopyEx(renderer, gui_texture, nullptr, &renderQuad, rotation_angle, nullptr, SDL_FLIP_NONE);
#ifdef SOFTWARE_CURSOR
swcursor(true);
@ -828,10 +829,7 @@ void checkInput()
uae_gui->logic();
// Now we let the Gui object draw itself.
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
UpdateGuiScreen();
}
}
@ -862,10 +860,6 @@ void amiberry_gui_run()
// Prepare the screen once
uae_gui->logic();
uae_gui->draw();
#ifdef USE_DISPMANX
#else
SDL_UpdateTexture(gui_texture, nullptr, gui_screen->pixels, gui_screen->pitch);
#endif
UpdateGuiScreen();
//-------------------------------------------------