diff options
Diffstat (limited to 'backends/platform/3ds/osystem-graphics.cpp')
-rw-r--r-- | backends/platform/3ds/osystem-graphics.cpp | 31 |
1 files changed, 20 insertions, 11 deletions
diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp index 7204a9fb05..8d4047b6ed 100644 --- a/backends/platform/3ds/osystem-graphics.cpp +++ b/backends/platform/3ds/osystem-graphics.cpp @@ -276,20 +276,10 @@ void OSystem_3DS::updateScreen() { return; // updateFocus(); + updateMagnify(); C3D_FrameBegin(0); _gameTopTexture.transfer(); - if (_magnifyMode == MODE_MAGON) { - _topX = (_cursorX < _topHalfWidth) ? - 0 : ((_cursorX < (_gameWidth - _topHalfWidth)) ? - _cursorX - _topHalfWidth : _gameWidth - _topWidth); - _topY = (_cursorY < _topHalfHeight) ? - 0 : ((_cursorY < _gameHeight - _topHalfHeight) ? - _cursorY - _topHalfHeight : _gameHeight - _topHeight); - _gameTopTexture.setScale(1.f,1.f); - _gameTopTexture.setPosition(0,0); - _gameTopTexture.setOffset(_topX, _topY); - } if (_overlayVisible) { _overlay.transfer(); } @@ -430,6 +420,25 @@ void OSystem_3DS::updateFocus() { } } +void OSystem_3DS::updateMagnify() { + if (_magnifyMode == MODE_MAGON && config.screen != kScreenBoth) { + // Only allow to magnify when both screens are enabled + _magnifyMode = MODE_MAGOFF; + } + + if (_magnifyMode == MODE_MAGON) { + _topX = (_cursorX < _topHalfWidth) ? + 0 : ((_cursorX < (_gameWidth - _topHalfWidth)) ? + _cursorX - _topHalfWidth : _gameWidth - _topWidth); + _topY = (_cursorY < _topHalfHeight) ? + 0 : ((_cursorY < _gameHeight - _topHalfHeight) ? + _cursorY - _topHalfHeight : _gameHeight - _topHeight); + _gameTopTexture.setScale(1.f,1.f); + _gameTopTexture.setPosition(0,0); + _gameTopTexture.setOffset(_topX, _topY); + } +} + void OSystem_3DS::showOverlay() { _overlayVisible = true; updateSize(); |