[Scummvm-git-logs] scummvm master -> 148a9b70583168be0ea52549868bd79f7a23b58d
bluegr
bluegr at gmail.com
Fri Jun 28 07:30:23 CEST 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
148a9b7058 SCI32: Fix kShakeScreen32 parameter count check
Commit: 148a9b70583168be0ea52549868bd79f7a23b58d
https://github.com/scummvm/scummvm/commit/148a9b70583168be0ea52549868bd79f7a23b58d
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2019-06-28T08:30:19+03:00
Commit Message:
SCI32: Fix kShakeScreen32 parameter count check
Changed paths:
engines/sci/engine/kgraphics32.cpp
diff --git a/engines/sci/engine/kgraphics32.cpp b/engines/sci/engine/kgraphics32.cpp
index f9c1ede..c28f0cd 100644
--- a/engines/sci/engine/kgraphics32.cpp
+++ b/engines/sci/engine/kgraphics32.cpp
@@ -155,7 +155,17 @@ reg_t kSetCursor32(EngineState *s, int argc, reg_t *argv) {
}
reg_t kShakeScreen32(EngineState *s, int argc, reg_t *argv) {
- g_sci->_gfxFrameout->shakeScreen(argv[0].toSint16(), (ShakeDirection)argv[1].toSint16());
+ int16 shakeCount = argv[0].toSint16();
+
+ // SSCI didn't check the parameter count and assumed a direction parameter
+ // was always passed. This parameter was optional in SCI16 and at least GK1
+ // and QFG4 scripts continued to not pass it. This would shake in a random
+ // direction depending on whatever happened to be in memory, or not at all.
+ // We treat direction as optional with a a vertical default as in SCI16 as
+ // that's what the scripts expect.
+ ShakeDirection directions = (argc > 1) ? (ShakeDirection)argv[1].toSint16() : kShakeVertical;
+
+ g_sci->_gfxFrameout->shakeScreen(shakeCount, directions);
return s->r_acc;
}
More information about the Scummvm-git-logs
mailing list