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 /backends/platform/ps2 | |
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 'backends/platform/ps2')
-rw-r--r-- | backends/platform/ps2/Gs2dScreen.cpp | 11 | ||||
-rw-r--r-- | backends/platform/ps2/Gs2dScreen.h | 5 | ||||
-rw-r--r-- | backends/platform/ps2/systemps2.cpp | 4 | ||||
-rw-r--r-- | backends/platform/ps2/systemps2.h | 2 |
4 files changed, 12 insertions, 10 deletions
diff --git a/backends/platform/ps2/Gs2dScreen.cpp b/backends/platform/ps2/Gs2dScreen.cpp index a11d70162e..da7d6aadfa 100644 --- a/backends/platform/ps2/Gs2dScreen.cpp +++ b/backends/platform/ps2/Gs2dScreen.cpp @@ -309,7 +309,8 @@ Gs2dScreen::Gs2dScreen(uint16 width, uint16 height) { _mouseScaleY = (_tvHeight << 8) / _height; setMouseXy(_width / 2, _height / 2); _mTraCol = 255; - _shakePos = 0; + _shakeXOffset = 0; + _shakeYOffset = 0; _overlayFormat.bytesPerPixel = 2; @@ -678,10 +679,10 @@ int16 Gs2dScreen::getOverlayHeight(void) { return _height; // _videoMode.overlayHeight; } -void Gs2dScreen::setShakePos(int shake) { - _shakePos = (shake * _mouseScaleY) >> 8; - _blitCoords[0].y = SCALE(_shakePos) + ORIGIN_Y; - _blitCoords[1].y = SCALE(_tvHeight + _shakePos) + ORIGIN_Y; +void Gs2dScreen::setShakePos(int shakeXOffset, int shakeYOffset) { + _shakeYOffset = (shakeYOffset * _mouseScaleY) >> 8; + _blitCoords[0].y = SCALE(_shakeYOffset) + ORIGIN_Y; + _blitCoords[1].y = SCALE(_tvHeight + _shakeYOffset) + ORIGIN_Y; } void Gs2dScreen::copyPrintfOverlay(const uint8 *buf) { diff --git a/backends/platform/ps2/Gs2dScreen.h b/backends/platform/ps2/Gs2dScreen.h index 9ed62da2d0..d8ad25e058 100644 --- a/backends/platform/ps2/Gs2dScreen.h +++ b/backends/platform/ps2/Gs2dScreen.h @@ -76,7 +76,7 @@ public: void setMouseOverlay(const uint8 *buf, uint16 width, uint16 height, uint16 hotSpotX, uint16 hotSpotY, uint8 transpCol); void showMouse(bool show); void setMouseXy(int16 x, int16 y); - void setShakePos(int shake); + void setShakePos(int shakeXOffset, int shakeYOffset); void playAnim(void); void wantAnim(bool runIt); @@ -123,7 +123,8 @@ private: uint32 _mouseScaleX, _mouseScaleY; uint8 _mTraCol; - int _shakePos; + int _shakeXOffset; + int _shakeYOffset; bool _showMouse, _showOverlay, _screenChanged, _overlayChanged, _clutChanged; uint16 *_overlayBuf; diff --git a/backends/platform/ps2/systemps2.cpp b/backends/platform/ps2/systemps2.cpp index a20ac6ada9..2a8f2d65d0 100644 --- a/backends/platform/ps2/systemps2.cpp +++ b/backends/platform/ps2/systemps2.cpp @@ -731,8 +731,8 @@ FilesystemFactory *OSystem_PS2::getFilesystemFactory() { return &Ps2FilesystemFactory::instance(); } -void OSystem_PS2::setShakePos(int shakeOffset) { - _screen->setShakePos(shakeOffset); +void OSystem_PS2::setShakePos(int shakeXOffset, int shakeYOffset) { + _screen->setShakePos(shakeXOffset, shakeYOffset); } bool OSystem_PS2::showMouse(bool visible) { diff --git a/backends/platform/ps2/systemps2.h b/backends/platform/ps2/systemps2.h index 019c3634a0..e11d320d78 100644 --- a/backends/platform/ps2/systemps2.h +++ b/backends/platform/ps2/systemps2.h @@ -65,7 +65,7 @@ protected: public: virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h); - virtual void setShakePos(int shakeOffset); + virtual void setShakePos(int shakeXOffset, int shakeYOffset); virtual Graphics::Surface *lockScreen(); virtual void unlockScreen(); virtual void updateScreen(); |