aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/3ds/osystem-graphics.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2019-11-05 06:09:04 +0100
committerBastien Bouclet2019-11-05 06:09:04 +0100
commit886be5178e5a6281792cf94e21b716f6fa5a0606 (patch)
treeb95594422d2f768cd17232b6e80d12c678e79e10 /backends/platform/3ds/osystem-graphics.cpp
parent78de5724047f56bd3ecbfb9ab423bb6c943f6589 (diff)
downloadscummvm-rg350-886be5178e5a6281792cf94e21b716f6fa5a0606.tar.gz
scummvm-rg350-886be5178e5a6281792cf94e21b716f6fa5a0606.tar.bz2
scummvm-rg350-886be5178e5a6281792cf94e21b716f6fa5a0606.zip
3DS: Some changes to magnify mode
Diffstat (limited to 'backends/platform/3ds/osystem-graphics.cpp')
-rw-r--r--backends/platform/3ds/osystem-graphics.cpp31
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();