diff options
author | sluicebox | 2019-11-15 01:38:21 -0800 |
---|---|---|
committer | Eugene Sandulenko | 2019-11-19 00:20:40 +0100 |
commit | b8390fa161c0c324af0e52a4f3a740cca9e9a479 (patch) | |
tree | e88f1e7cbb2c35c1b1c3319c9481c4edafca734d /engines/sci/graphics | |
parent | 3238e523ee2ac442c7562830a85b347400b7da88 (diff) | |
download | scummvm-rg350-b8390fa161c0c324af0e52a4f3a740cca9e9a479.tar.gz scummvm-rg350-b8390fa161c0c324af0e52a4f3a740cca9e9a479.tar.bz2 scummvm-rg350-b8390fa161c0c324af0e52a4f3a740cca9e9a479.zip |
GRAPHICS: Add interface for horizontal shake
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 10 | ||||
-rw-r--r-- | engines/sci/graphics/screen.h | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index d299f8ea73..f7464d460c 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -1201,14 +1201,14 @@ void GfxFrameout::shakeScreen(int16 numShakes, const ShakeDirection direction) { } if (direction & kShakeVertical) { - g_system->setShakePos(_isHiRes ? 8 : 4); + g_system->setShakePos(0, _isHiRes ? 8 : 4); } updateScreen(); g_sci->getEngineState()->sleep(3); if (direction & kShakeVertical) { - g_system->setShakePos(0); + g_system->setShakePos(0, 0); } updateScreen(); diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index c6f6c4043d..cd81fdf36f 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -595,23 +595,23 @@ void GfxScreen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr) { } } -void GfxScreen::setVerticalShakePos(uint16 shakePos) { +void GfxScreen::setShakePos(uint16 shakeXOffset, uint16 shakeYOffset) { if (!_upscaledHires) - g_system->setShakePos(shakePos); + g_system->setShakePos(shakeXOffset, shakeYOffset); else - g_system->setShakePos(_upscaledHeightMapping[shakePos]); + g_system->setShakePos(_upscaledWidthMapping[shakeXOffset], _upscaledHeightMapping[shakeYOffset]); } void GfxScreen::kernelShakeScreen(uint16 shakeCount, uint16 directions) { while (shakeCount--) { if (directions & kShakeVertical) - setVerticalShakePos(10); + setShakePos(0, 10); // TODO: horizontal shakes g_system->updateScreen(); g_sci->getEngineState()->sleep(3); if (directions & kShakeVertical) - setVerticalShakePos(0); + setShakePos(0, 0); g_system->updateScreen(); g_sci->getEngineState()->sleep(3); diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index 8bdf64719c..a9baf2bc10 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -157,7 +157,7 @@ private: void bitsSaveScreen(Common::Rect rect, byte *screen, uint16 screenWidth, byte *&memoryPtr); void bitsSaveDisplayScreen(Common::Rect rect, byte *&memoryPtr); - void setVerticalShakePos(uint16 shakePos); + void setShakePos(uint16 shakeXOffset, uint16 shakeYOffset); /** * If this flag is true, undithering is enabled, otherwise disabled. |