aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-11 00:34:16 +0200
committerJohannes Schickel2011-04-11 00:34:16 +0200
commit93f591580a31b0a4553994be40a2eb0b227e3a56 (patch)
tree2ab315b30c029da182267fa12f0b0524234ec7e6 /engines
parent8fe9f8e73a0ac0a4f0a18a94db705f934f58ad34 (diff)
downloadscummvm-rg350-93f591580a31b0a4553994be40a2eb0b227e3a56.tar.gz
scummvm-rg350-93f591580a31b0a4553994be40a2eb0b227e3a56.tar.bz2
scummvm-rg350-93f591580a31b0a4553994be40a2eb0b227e3a56.zip
KYRA: Get rid of non-const static variable in Kyra2 code.
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/kyra_v2.cpp3
-rw-r--r--engines/kyra/kyra_v2.h1
-rw-r--r--engines/kyra/scene_v2.cpp11
3 files changed, 10 insertions, 5 deletions
diff --git a/engines/kyra/kyra_v2.cpp b/engines/kyra/kyra_v2.cpp
index 6477b68c84..804097c81d 100644
--- a/engines/kyra/kyra_v2.cpp
+++ b/engines/kyra/kyra_v2.cpp
@@ -74,6 +74,9 @@ KyraEngine_v2::KyraEngine_v2(OSystem *system, const GameFlags &flags, const Engi
_pauseStart = 0;
+ _pathfinderFlag = 0;
+ _smoothingPath = false;
+
_lang = 0;
Common::Language lang = Common::parseLanguage(ConfMan.get("language"));
if (lang == _flags.fanLang && _flags.replacedLang != Common::UNK_LANG)
diff --git a/engines/kyra/kyra_v2.h b/engines/kyra/kyra_v2.h
index bce11c898b..9f0aecd78c 100644
--- a/engines/kyra/kyra_v2.h
+++ b/engines/kyra/kyra_v2.h
@@ -269,6 +269,7 @@ protected:
// pathfinder
int _movFacingTable[600];
int _pathfinderFlag;
+ bool _smoothingPath;
int findWay(int curX, int curY, int dstX, int dstY, int *moveTable, int moveTableSize);
diff --git a/engines/kyra/scene_v2.cpp b/engines/kyra/scene_v2.cpp
index f0c26acd54..fdfbceb521 100644
--- a/engines/kyra/scene_v2.cpp
+++ b/engines/kyra/scene_v2.cpp
@@ -86,15 +86,16 @@ int KyraEngine_v2::findWay(int x, int y, int toX, int toY, int *moveTable, int m
x &= ~3; toX &= ~3;
y &= ~1; toY &= ~1;
int size = KyraEngine_v1::findWay(x, y, toX, toY, moveTable, moveTableSize);
- static bool usePostProcess = false;
- if (size && !usePostProcess) {
- usePostProcess = true;
+
+ if (size && !_smoothingPath) {
+ _smoothingPath = true;
int temp = pathfinderInitPositionTable(moveTable);
temp = pathfinderInitPositionIndexTable(temp, x, y);
pathfinderFinializePath(moveTable, temp, x, y, moveTableSize);
- usePostProcess = false;
+ _smoothingPath = false;
}
- return usePostProcess ? size : getMoveTableSize(moveTable);
+
+ return _smoothingPath ? size : getMoveTableSize(moveTable);
}
bool KyraEngine_v2::directLinePassable(int x, int y, int toX, int toY) {