SDL: Change signature of getDpiScalingFactor to return the result

This commit is contained in:
Thierry Crozat 2021-08-11 22:50:20 +01:00
parent ad31dfc8d5
commit 5caacb763b
3 changed files with 16 additions and 21 deletions

View file

@ -250,9 +250,7 @@ bool OpenGLSdlGraphicsManager::getFeatureState(OSystem::Feature f) const {
}
float OpenGLSdlGraphicsManager::getHiDPIScreenFactor() const {
float scale;
getDpiScalingFactor(&scale);
return scale;
return getDpiScalingFactor();
}
void OpenGLSdlGraphicsManager::initSize(uint w, uint h, const Graphics::PixelFormat *format) {
@ -292,8 +290,7 @@ void OpenGLSdlGraphicsManager::notifyResize(const int width, const int height) {
// event is processed after recreating the window at the new resolution.
int currentWidth, currentHeight;
getWindowSizeFromSdl(&currentWidth, &currentHeight);
float scale;
getDpiScalingFactor(&scale);
float scale = getDpiScalingFactor();
debug(3, "req: %d x %d cur: %d x %d, scale: %f", width, height, currentWidth, currentHeight, scale);
handleResize(currentWidth, currentHeight);
@ -647,8 +644,7 @@ bool OpenGLSdlGraphicsManager::notifyEvent(const Common::Event &event) {
getWindowSizeFromSdl(&windowWidth, &windowHeight);
// FIXME HACK. I don't like this at all, but macOS requires window size in LoDPI
#ifdef __APPLE__
float scale;
getDpiScalingFactor(&scale);
float scale = getDpiScalingFactor();
windowWidth /= scale;
windowHeight /= scale;
#endif