aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-16 05:46:07 +0000
committerMartin Kiewitz2010-07-16 05:46:07 +0000
commit90763f6e24ae1c51f4c8a9d0486a5488ea200f61 (patch)
treec8f9b2b36b82020085c6abfade5a7c2cc6218139
parent9fafc859199f16a693ba40d18cd5e93f49d4b2fa (diff)
downloadscummvm-rg350-90763f6e24ae1c51f4c8a9d0486a5488ea200f61.tar.gz
scummvm-rg350-90763f6e24ae1c51f4c8a9d0486a5488ea200f61.tar.bz2
scummvm-rg350-90763f6e24ae1c51f4c8a9d0486a5488ea200f61.zip
SCI: kDoBresen - save last position of client inside mover - fixes lsl6 tram still shaking while gotten stopped due ego
svn-id: r50931
-rw-r--r--engines/sci/engine/kmovement.cpp6
-rw-r--r--engines/sci/engine/selector.cpp2
-rw-r--r--engines/sci/engine/selector.h1
3 files changed, 9 insertions, 0 deletions
diff --git a/engines/sci/engine/kmovement.cpp b/engines/sci/engine/kmovement.cpp
index 125d0b208b..71f9632ef3 100644
--- a/engines/sci/engine/kmovement.cpp
+++ b/engines/sci/engine/kmovement.cpp
@@ -267,6 +267,12 @@ reg_t kDoBresen(EngineState *s, int argc, reg_t *argv) {
bdelta = (int16)readSelectorValue(segMan, mover, SELECTOR(b_incr));
axis = (int16)readSelectorValue(segMan, mover, SELECTOR(b_xAxis));
+ if (SELECTOR(xLast) != -1) {
+ // Introduced SCI1MIDDLE (it seems) - save last position into mover
+ writeSelectorValue(segMan, mover, SELECTOR(xLast), x);
+ writeSelectorValue(segMan, mover, SELECTOR(yLast), y);
+ }
+
//printf("movecnt %d, move speed %d\n", movcnt, max_movcnt);
if (g_sci->_features->handleMoveCount()) {
diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp
index 00480743cc..431261eb7c 100644
--- a/engines/sci/engine/selector.cpp
+++ b/engines/sci/engine/selector.cpp
@@ -104,6 +104,8 @@ void Kernel::mapSelectors() {
FIND_SELECTOR2(b_incr, "b-incr");
FIND_SELECTOR(xStep);
FIND_SELECTOR(yStep);
+ FIND_SELECTOR(xLast);
+ FIND_SELECTOR(yLast);
FIND_SELECTOR(moveSpeed);
FIND_SELECTOR(canBeHere); // cantBeHere
FIND_SELECTOR(heading);
diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h
index acb7912d8d..c3428c1ed7 100644
--- a/engines/sci/engine/selector.h
+++ b/engines/sci/engine/selector.h
@@ -69,6 +69,7 @@ struct SelectorCache {
Selector dx, dy; ///< Deltas
Selector b_movCnt, b_i1, b_i2, b_di, b_xAxis, b_incr; ///< Various Bresenham vars
Selector xStep, yStep; ///< BR adjustments
+ Selector xLast, yLast; ///< BR last position of client
Selector moveSpeed; ///< Used for DoBresen
Selector canBeHere; ///< Funcselector: Checks for movement validity in SCI0
Selector heading, mover; ///< Used in DoAvoider