diff options
author | Paul Gilbert | 2012-11-17 22:01:39 +1100 |
---|---|---|
committer | Paul Gilbert | 2012-11-17 22:01:39 +1100 |
commit | 6f95d311f2843f4f000829a91f9bf5614ffe1e2c (patch) | |
tree | c04df94439e88954fcb7f9951735d2d8c5cb35cf | |
parent | 5ae26a1910fef2163e8b1aad3cad2a0df5b02421 (diff) | |
parent | 2f116e01c76bf8c208451b670d29e6ef3f05b9a8 (diff) | |
download | scummvm-rg350-6f95d311f2843f4f000829a91f9bf5614ffe1e2c.tar.gz scummvm-rg350-6f95d311f2843f4f000829a91f9bf5614ffe1e2c.tar.bz2 scummvm-rg350-6f95d311f2843f4f000829a91f9bf5614ffe1e2c.zip |
Merge branch 'hopkins' of github.com:dreammaster/scummvm into hopkins
-rw-r--r-- | engines/hopkins/objects.cpp | 24 | ||||
-rw-r--r-- | engines/hopkins/objects.h | 2 |
2 files changed, 14 insertions, 12 deletions
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index e0b41a9978..a553f02fae 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -4555,7 +4555,7 @@ void ObjectsManager::Q_GAUCHE(int idx) { if (idx == 6) SPACTION1(_vm->_globals.GESTE, "17,16,15,-1,", 0, 0, 8); if (idx == 7) - SPACTION(_vm->_globals.GESTE, "15,16,17,18,19,20-1,", 0, 0, 8, 1); + SPACTION(_vm->_globals.GESTE, "15,16,17,18,19,20,-1,", 0, 0, 8, 1); if (idx == 8) SPACTION1(_vm->_globals.GESTE, "19,18,17,16,15,-1,", 0, 0, 8); if (idx == 9) @@ -5331,19 +5331,16 @@ void ObjectsManager::ACTION(const byte *spriteData, const Common::String &a2, in } } -void ObjectsManager::SPACTION(byte *a1, const Common::String &a2, int a3, int a4, int a5, int a6) { +void ObjectsManager::SPACTION(byte *a1, const Common::String &animationSeq, int a3, int a4, int a5, int a6) { int v6; - int16 v7; char v8; int v9; int16 v10; int v11; int spriteIndex; char v14; - int16 v15; Common::String v16; - v15 = 0; v6 = 0; spriteIndex = 0; v16 = " "; @@ -5358,23 +5355,28 @@ void ObjectsManager::SPACTION(byte *a1, const Common::String &a2, int a3, int a4 Sprite[0].field12 += a3; Sprite[0].field14 += a4; Sprite[0].fieldE = a6; + + uint strPos = 0; do { + bool loopCond = false; do { - v7 = 0; - v8 = a2[v15]; - if (v8 == ',') { + v8 = animationSeq[strPos]; + if ((animationSeq[strPos] == ',') || (strPos == animationSeq.size() - 1)) { + // Safeguard: if the sequence doesn't end with a coma, simulate it's present. + if (animationSeq[strPos] != ',') + v16.setChar(v8, v6); v9 = atoi(v16.c_str()); spriteIndex = v9; v6 = 0; v16 = " "; - v7 = 1; + loopCond = true; } else { v9 = v6; v16.setChar(v8, v6); v6 = v6 + 1; } - ++v15; - } while (v7 != 1); + ++strPos; + } while (!loopCond); if (spriteIndex != -1) { Sprite[0].spriteData = a1; Sprite[0].spriteIndex = spriteIndex; diff --git a/engines/hopkins/objects.h b/engines/hopkins/objects.h index 9fbc06c15b..f8d959c7fa 100644 --- a/engines/hopkins/objects.h +++ b/engines/hopkins/objects.h @@ -233,7 +233,7 @@ public: int colision(int xp, int yp); void ACTION(const byte *spriteData, const Common::String &a2, int a3, int a4, int a5, int a6); - void SPACTION(byte *a1, const Common::String &a2, int a3, int a4, int a5, int a6); + void SPACTION(byte *a1, const Common::String &animationSeq, int a3, int a4, int a5, int a6); void SPACTION1(byte *a1, const Common::String &a2, int a3, int a4, int a5); void TEST_FORET(int a1, int a2, int a3, int a4, int a5, int a6); void BLOQUE_ANIMX(int idx, int a2); |