Skip to content
Permalink
Browse files

3DS: Fix centering of the game screen

(cherry picked from commit 4810a5d)
  • Loading branch information...
bgK committed Nov 5, 2019
1 parent a151356 commit 236d15ec3a8b54d218c300be76eb7fbf55f8e139
Showing with 4 additions and 4 deletions.
  1. +4 −4 backends/platform/3ds/osystem-graphics.cpp
@@ -178,23 +178,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);

0 comments on commit 236d15e

Please sign in to comment.
You can’t perform that action at this time.