aboutsummaryrefslogtreecommitdiff
path: root/backends/platform/ds/arm9
diff options
context:
space:
mode:
authorsluicebox2019-11-15 01:38:21 -0800
committerEugene Sandulenko2019-11-19 00:20:40 +0100
commitb8390fa161c0c324af0e52a4f3a740cca9e9a479 (patch)
treee88f1e7cbb2c35c1b1c3319c9481c4edafca734d /backends/platform/ds/arm9
parent3238e523ee2ac442c7562830a85b347400b7da88 (diff)
downloadscummvm-rg350-b8390fa161c0c324af0e52a4f3a740cca9e9a479.tar.gz
scummvm-rg350-b8390fa161c0c324af0e52a4f3a740cca9e9a479.tar.bz2
scummvm-rg350-b8390fa161c0c324af0e52a4f3a740cca9e9a479.zip
GRAPHICS: Add interface for horizontal shake
Diffstat (limited to 'backends/platform/ds/arm9')
-rw-r--r--backends/platform/ds/arm9/source/dsmain.cpp14
-rw-r--r--backends/platform/ds/arm9/source/dsmain.h2
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.cpp4
-rw-r--r--backends/platform/ds/arm9/source/osystem_ds.h2
4 files changed, 12 insertions, 10 deletions
diff --git a/backends/platform/ds/arm9/source/dsmain.cpp b/backends/platform/ds/arm9/source/dsmain.cpp
index 041892aed6..b0f61322d5 100644
--- a/backends/platform/ds/arm9/source/dsmain.cpp
+++ b/backends/platform/ds/arm9/source/dsmain.cpp
@@ -260,7 +260,8 @@ static SpriteEntry spritesMain[128];
static int tweak;
// Shake
-static int s_shakePos = 0;
+static int s_shakeXOffset = 0;
+static int s_shakeYOffset = 0;
// Keyboard
static bool keyboardEnable = false;
@@ -1016,8 +1017,9 @@ void displayMode16BitFlipBuffer() {
#endif
}
-void setShakePos(int shakePos) {
- s_shakePos = shakePos;
+void setShakePos(int shakeXOffset, int shakeYOffset) {
+ s_shakeXOffset = shakeXOffset;
+ s_shakeYOffset = shakeYOffset;
}
@@ -2096,7 +2098,7 @@ void VBlankHandler(void) {
SUB_BG3_CX = subScX + 64;
}
- SUB_BG3_CY = subScY + (s_shakePos << 8);*/
+ SUB_BG3_CY = subScY + (s_shakeYOffset << 8);*/
/*SUB_BG3_XDX = (int) (subScreenWidth / 256.0f * 256);
SUB_BG3_XDY = 0;
@@ -2228,7 +2230,7 @@ void VBlankHandler(void) {
setZoomedScreenScale(subScreenWidth, ((subScreenHeight * (256 << 8)) / 192) >> 8);
- setMainScreenScroll(scX << 8, (scY << 8) + (s_shakePos << 8));
+ setMainScreenScroll(scX << 8, (scY << 8) + (s_shakeYOffset << 8));
setMainScreenScale(256, 256); // 1:1 scale
} else {
@@ -2244,7 +2246,7 @@ void VBlankHandler(void) {
setZoomedScreenScroll(subScX, subScY, (subScreenWidth != 256) && (subScreenWidth != 128));
setZoomedScreenScale(subScreenWidth, ((subScreenHeight * (256 << 8)) / 192) >> 8);
- setMainScreenScroll(64, (scY << 8) + (s_shakePos << 8));
+ setMainScreenScroll(64, (scY << 8) + (s_shakeYOffset << 8));
setMainScreenScale(320, 256); // 1:1 scale
}
diff --git a/backends/platform/ds/arm9/source/dsmain.h b/backends/platform/ds/arm9/source/dsmain.h
index 7345fc2ceb..b413c70763 100644
--- a/backends/platform/ds/arm9/source/dsmain.h
+++ b/backends/platform/ds/arm9/source/dsmain.h
@@ -112,7 +112,7 @@ void setShowCursor(bool enable);
void setMouseCursorVisible(bool visible);
// Shake
-void setShakePos(int shakePos);
+void setShakePos(int shakeXOffset, int shakeYOffset);
// Reports
void memoryReport();
diff --git a/backends/platform/ds/arm9/source/osystem_ds.cpp b/backends/platform/ds/arm9/source/osystem_ds.cpp
index 9abeb59474..c9a1f08758 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.cpp
+++ b/backends/platform/ds/arm9/source/osystem_ds.cpp
@@ -490,8 +490,8 @@ void OSystem_DS::updateScreen() {
}
}
-void OSystem_DS::setShakePos(int shakeOffset) {
- DS::setShakePos(shakeOffset);
+void OSystem_DS::setShakePos(int shakeXOffset, int shakeYOffset) {
+ DS::setShakePos(shakeXOffset, shakeYOffset);
}
void OSystem_DS::showOverlay() {
diff --git a/backends/platform/ds/arm9/source/osystem_ds.h b/backends/platform/ds/arm9/source/osystem_ds.h
index c2813d11e4..5db644bed5 100644
--- a/backends/platform/ds/arm9/source/osystem_ds.h
+++ b/backends/platform/ds/arm9/source/osystem_ds.h
@@ -103,7 +103,7 @@ public:
virtual void copyRectToScreen(const void *buf, int pitch, int x, int y, int w, int h);
virtual void updateScreen();
- virtual void setShakePos(int shakeOffset);
+ virtual void setShakePos(int shakeXOffset, int shakeYOffset);
virtual void showOverlay();
virtual void hideOverlay();