Minor cleanups

This commit is contained in:
Henrik Rydgård committed 2023-12-10 12:37:35 +01:00
1 parent 653b19ae53
commit 600fb7cc22
3 files changed
+7 -5

No files matched your search

-4
View File
@@ -6,7 +6,6 @@
#include "Common/UI/UI.h"
#include "Common/UI/View.h"
#include "Common/UI/ViewGroup.h"
#include "Common/UI/IconCache.h"
#include "Common/Log.h"
#include "Common/TimeUtil.h"
@@ -64,8 +63,6 @@ void ScreenManager::update() {
if (stack_.size()) {
stack_.back().screen->update();
}
g_iconCache.FrameUpdate();
}
void ScreenManager::switchToNext() {
@@ -139,7 +136,6 @@ void ScreenManager::axis(const AxisInput *axes, size_t count) {
void ScreenManager::deviceLost() {
for (auto &iter : stack_)
iter.screen->deviceLost();
g_iconCache.ClearTextures();
}
void ScreenManager::deviceRestored() {
+2
View File
@@ -327,6 +327,8 @@ void GameSettingsScreen::CreateGraphicsSettings(UI::ViewGroup *graphicsSettings)
int max_res = std::min(max_res_temp, (int)ARRAY_SIZE(deviceResolutions));
UI::PopupMultiChoice *hwscale = graphicsSettings->Add(new PopupMultiChoice(&g_Config.iAndroidHwScale, gr->T("Display Resolution (HW scaler)"), deviceResolutions, 0, max_res, I18NCat::GRAPHICS, screenManager()));
hwscale->OnChoice.Add([](UI::EventParams &) {
System_PostUIMessage(UIMessage::GPU_RENDER_RESIZED);
System_PostUIMessage(UIMessage::GPU_DISPLAY_RESIZED);
System_RecreateActivity();
return UI::EVENT_DONE;
});
+5 -1
View File
@@ -956,6 +956,7 @@ void NativeShutdownGraphics() {
if (g_screenManager) {
g_screenManager->deviceLost();
}
g_iconCache.ClearTextures();
if (gpu)
gpu->DeviceLost();
@@ -1104,7 +1105,6 @@ void NativeFrame(GraphicsContext *graphicsContext) {
Achievements::Idle();
g_DownloadManager.Update();
g_screenManager->update();
g_Discord.Update();
g_BackgroundAudio.Play();
@@ -1124,6 +1124,10 @@ void NativeFrame(GraphicsContext *graphicsContext) {
g_BackgroundAudio.Update();
}
g_iconCache.FrameUpdate();
g_screenManager->update();
// Apply the UIContext bounds as a 2D transformation matrix.
// TODO: This should be moved into the draw context...
Matrix4x4 ortho = ComputeOrthoMatrix(g_display.dp_xres, g_display.dp_yres);