Skip to content

Commit

Permalink
HUD elements position and size now are updated everytime the aspect r…
Browse files Browse the repository at this point in the history
…atio changes
  • Loading branch information
vitor251093 committed Feb 3, 2024
1 parent 68a066b commit 32e5cc1
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/frontend/qt_sdl/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -811,14 +811,6 @@ bool EmuThread::setGameScene(int newGameScene)

// Updating GameScene inside shader
static_cast<GLRenderer&>(NDS->GPU.GetRenderer3D()).GetCompositor().SetGameScene(newGameScene);

float aspectTop = (Config::WindowWidth * 1.f) / Config::WindowHeight;
for (auto ratio : aspectRatios)
{
if (ratio.id == Config::ScreenAspectTop && ratio.ratio != 0)
aspectTop = ratio.ratio * 4.0/3;
}
static_cast<GLRenderer&>(NDS->GPU.GetRenderer3D()).GetCompositor().SetAspectRatio(aspectTop);
}

// Screens position and size
Expand Down Expand Up @@ -1366,6 +1358,10 @@ void ScreenHandler::screenSetupLayout(int w, int h)

Config::WindowHeight = h;
Config::WindowWidth = w;

if (emuThread != nullptr && emuThread->NDS != nullptr) {
static_cast<GLRenderer&>(emuThread->NDS->GPU.GetRenderer3D()).GetCompositor().SetAspectRatio(aspectTop);
}
}

QSize ScreenHandler::screenGetMinSize(int factor = 1)
Expand Down

0 comments on commit 32e5cc1

Please sign in to comment.