aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Bouclet2019-11-05 06:09:04 +0100
committerBastien Bouclet2019-11-05 06:09:04 +0100
commit4810a5d8d35c5caa79f9a3a1e93d882de32b2d87 (patch)
tree6edfa73edbb5afc8f668a8b8e374e8fd147dcc62
parent3fcbbbef44da830dc7fc54c6f0ef0cb98b45f858 (diff)
downloadscummvm-rg350-4810a5d8d35c5caa79f9a3a1e93d882de32b2d87.tar.gz
scummvm-rg350-4810a5d8d35c5caa79f9a3a1e93d882de32b2d87.tar.bz2
scummvm-rg350-4810a5d8d35c5caa79f9a3a1e93d882de32b2d87.zip
3DS: Fix centering of the game screen
-rw-r--r--backends/platform/3ds/osystem-graphics.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp
index 1e340f84d9..5c65cac648 100644
--- a/backends/platform/3ds/osystem-graphics.cpp
+++ b/backends/platform/3ds/osystem-graphics.cpp
@@ -180,23 +180,23 @@ void OSystem_3DS::updateSize() {
float r = 400.f / _gameWidth;
_gameTopTexture.setScale(r, r);
_gameTopX = 0;
- _gameTopY = (240.f - r * _gameHeight) / 2.f;
+ _gameTopY = (240.f / r - _gameHeight) / 2.f;
} else {
float r = 240.f / _gameHeight;
_gameTopTexture.setScale(r, r);
_gameTopY = 0;
- _gameTopX = (400.f - r * _gameWidth) / 2.f;
+ _gameTopX = (400.f / r - _gameWidth) / 2.f;
}
if (ratio > 320.f / 240.f) {
float r = 320.f / _gameWidth;
_gameBottomTexture.setScale(r, r);
_gameBottomX = 0;
- _gameBottomY = (240.f - r * _gameHeight) / 2.f;
+ _gameBottomY = (240.f / r - _gameHeight) / 2.f;
} else {
float r = 240.f / _gameHeight;
_gameBottomTexture.setScale(r, r);
_gameBottomY = 0;
- _gameBottomX = (320.f - r * _gameWidth) / 2.f;
+ _gameBottomX = (320.f / r - _gameWidth) / 2.f;
}
}
_gameTopTexture.setPosition(_gameTopX, _gameTopY);