diff options
author | Strangerke | 2012-12-31 17:03:43 +0100 |
---|---|---|
committer | Strangerke | 2012-12-31 17:03:43 +0100 |
commit | a8bc62fc0fb2ea5df8c08175c232af05ed898e38 (patch) | |
tree | 78f32bd8082d08b0a3048d57720e20cb6d598a69 | |
parent | a57e859d14de78bc06e9b47804d9c2b59acb830c (diff) | |
download | scummvm-rg350-a8bc62fc0fb2ea5df8c08175c232af05ed898e38.tar.gz scummvm-rg350-a8bc62fc0fb2ea5df8c08175c232af05ed898e38.tar.bz2 scummvm-rg350-a8bc62fc0fb2ea5df8c08175c232af05ed898e38.zip |
HOPKINS: Some renaming in ObjectManager, fix animation speed
-rw-r--r-- | engines/hopkins/objects.cpp | 44 | ||||
-rw-r--r-- | engines/hopkins/objects.h | 2 |
2 files changed, 20 insertions, 26 deletions
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 5c2a27788b..b9034ee246 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -4952,38 +4952,33 @@ void ObjectsManager::SPACTION(byte *a1, const Common::String &animationSeq, int } while (spriteIndex != -1); } -void ObjectsManager::SPACTION1(byte *a1, const Common::String &a2, int a3, int a4, int a5) { - int v5; +void ObjectsManager::SPACTION1(byte *spriteData, const Common::String &animString, int a3, int a4, int a5) { int v6; char v7; - int v8; - int spriteIndex; - int v13; - int v14; - Common::String v15; - v14 = 0; - v5 = 0; - spriteIndex = 0; - v15 = " "; - v13 = a5; + int v14 = 0; + int v5 = 0; + int spriteIndex = 0; + Common::String tmpStr = " "; + int v13; if (_vm->_globals._speed == 2) v13 = a5 / 2; else if (_vm->_globals._speed == 3) v13 = a5 / 3; + else + v13 = a5; + for (;;) { v6 = 0; - v7 = a2[v14]; - if (v7 == 44) { - v8 = atoi(v15.c_str()); - spriteIndex = v8; + v7 = animString[v14]; + if (v7 == ',') { + spriteIndex = atoi(tmpStr.c_str()); v5 = 0; - v15 = " "; + tmpStr = " "; v6 = 1; } else { - v8 = v5; - v15.setChar(v7, v5); - v5 = v5 + 1; + tmpStr.setChar(v7, v5); + v5++; } ++v14; if (v6 == 1) { @@ -4994,14 +4989,13 @@ void ObjectsManager::SPACTION1(byte *a1, const Common::String &a2, int a3, int a _sprite[0].field14 -= a4; _sprite[0].fieldE = S_old_ret; } else { - _sprite[0]._spriteData = a1; + _sprite[0]._spriteData = spriteData; _sprite[0]._spriteIndex = spriteIndex; } - if (v13 > 0) { - for (int v9 = 0; v9 < v8; v9++) - _vm->_eventsManager.VBL(); - } + for (int v9 = 0; v9 < v13; v9++) + _vm->_eventsManager.VBL(); + if (spriteIndex == -1) break; } diff --git a/engines/hopkins/objects.h b/engines/hopkins/objects.h index 5f31b3a72a..a0b15a38ee 100644 --- a/engines/hopkins/objects.h +++ b/engines/hopkins/objects.h @@ -236,7 +236,7 @@ public: void ACTION(const byte *spriteData, 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 SPACTION1(byte *spriteData, const Common::String &animString, int a3, int a4, int a5); void TEST_FORET(int screenId, int minX, int maxX, int minY, int maxY, int idx); void lockAnimX(int idx, int a2); |