aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/3ds/osystem-graphics.cpp
diff options
context:
space:
mode:
authorMichael Ball2019-10-27 11:59:25 -0700
committerBastien Bouclet2019-11-05 05:51:45 +0100
commit78de5724047f56bd3ecbfb9ab423bb6c943f6589 (patch)
tree907d06ec001443f28c97d2d39d0acaf4c2b6aee2 /backends/platform/3ds/osystem-graphics.cpp
parentb342d42ff9b881aa4a719a7079d94fff37705dd6 (diff)
downloadscummvm-rg350-78de5724047f56bd3ecbfb9ab423bb6c943f6589.tar.gz
scummvm-rg350-78de5724047f56bd3ecbfb9ab423bb6c943f6589.tar.bz2
scummvm-rg350-78de5724047f56bd3ecbfb9ab423bb6c943f6589.zip
3DS: Implement magnify mode toggle on L and move keyboard to Y/DRIGHT
Diffstat (limited to 'backends/platform/3ds/osystem-graphics.cpp')
-rw-r--r--backends/platform/3ds/osystem-graphics.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp
index 1a86be4402..7204a9fb05 100644
--- a/backends/platform/3ds/osystem-graphics.cpp
+++ b/backends/platform/3ds/osystem-graphics.cpp
@@ -151,6 +151,8 @@ void OSystem_3DS::initSize(uint width, uint height,
_gameHeight = height;
_gameTopTexture.create(width, height, _pfGameTexture);
_overlay.create(getOverlayWidth(), getOverlayHeight(), _pfGameTexture);
+ _topHalfWidth = _topWidth / 2;
+ _topHalfHeight = _topHeight / 2;
if (format) {
debug("pixelformat: %d %d %d %d %d", format->bytesPerPixel, format->rBits(), format->gBits(), format->bBits(), format->aBits());
@@ -198,6 +200,8 @@ void OSystem_3DS::updateSize() {
}
_gameTopTexture.setPosition(_gameTopX, _gameTopY);
_gameBottomTexture.setPosition(_gameBottomX, _gameBottomY);
+ _gameTopTexture.setOffset(0, 0);
+ _gameBottomTexture.setOffset(0, 0);
if (_overlayVisible)
_cursorTexture.setScale(1.f, 1.f);
else if (config.screen == kScreenTop)
@@ -275,6 +279,17 @@ void OSystem_3DS::updateScreen() {
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();
}