aboutsummaryrefslogtreecommitdiff
path: root/engines/hopkins
diff options
context:
space:
mode:
authorStrangerke2012-12-29 14:20:34 +0100
committerStrangerke2012-12-29 14:20:34 +0100
commitb284338d6778775ab755af487dfd52d05b953e45 (patch)
tree084fe31586a767f3cc8fa3f841b9963fc266bdd5 /engines/hopkins
parent0adb2a31da83003038531b2a7b14448af7736fc5 (diff)
downloadscummvm-rg350-b284338d6778775ab755af487dfd52d05b953e45.tar.gz
scummvm-rg350-b284338d6778775ab755af487dfd52d05b953e45.tar.bz2
scummvm-rg350-b284338d6778775ab755af487dfd52d05b953e45.zip
HOPKINS: Some refactoring in ObjectManager, some renaming
Diffstat (limited to 'engines/hopkins')
-rw-r--r--engines/hopkins/anim.cpp6
-rw-r--r--engines/hopkins/globals.cpp4
-rw-r--r--engines/hopkins/globals.h10
-rw-r--r--engines/hopkins/graphics.cpp10
-rw-r--r--engines/hopkins/objects.cpp227
-rw-r--r--engines/hopkins/objects.h8
-rw-r--r--engines/hopkins/talk.cpp72
-rw-r--r--engines/hopkins/talk.h2
8 files changed, 164 insertions, 175 deletions
diff --git a/engines/hopkins/anim.cpp b/engines/hopkins/anim.cpp
index e0e64b4b72..c2027a777d 100644
--- a/engines/hopkins/anim.cpp
+++ b/engines/hopkins/anim.cpp
@@ -603,7 +603,7 @@ void AnimationManager::loadAnim(const Common::String &animName) {
void AnimationManager::clearAnim() {
for (int idx = 0; idx < 35; ++idx) {
_vm->_globals.Bqe_Anim[idx]._data = _vm->_globals.freeMemory(_vm->_globals.Bqe_Anim[idx]._data);
- _vm->_globals.Bqe_Anim[idx].field4 = 0;
+ _vm->_globals.Bqe_Anim[idx]._enabledFl = false;
}
for (int idx = 0; idx < 8; ++idx) {
@@ -736,7 +736,7 @@ void AnimationManager::searchAnim(const byte *data, int animIndex, int count) {
(data[v6] == 'F' && data[v6 + 1] == 'I' && data[v6 + 2] == 'N'))
innerLoopCond = true;
if (count < v6) {
- _vm->_globals.Bqe_Anim[animIndex].field4 = 0;
+ _vm->_globals.Bqe_Anim[animIndex]._enabledFl = false;
_vm->_globals.Bqe_Anim[animIndex]._data = g_PTRNUL;
return;
}
@@ -744,7 +744,7 @@ void AnimationManager::searchAnim(const byte *data, int animIndex, int count) {
++v7;
} while (!innerLoopCond);
_vm->_globals.Bqe_Anim[animIndex]._data = _vm->_globals.allocMemory(v7 + 50);
- _vm->_globals.Bqe_Anim[animIndex].field4 = 1;
+ _vm->_globals.Bqe_Anim[animIndex]._enabledFl = true;
memcpy(_vm->_globals.Bqe_Anim[animIndex]._data, v21 + data + 5, 20);
byte *dataP = _vm->_globals.Bqe_Anim[animIndex]._data;
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index 99eaadee28..c97277ce61 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -83,7 +83,7 @@ Globals::Globals() {
for (int i = 0; i < 35; ++i)
Common::fill((byte *)&Liste2[i], (byte *)&Liste2[i] + sizeof(Liste2Item), 0);
for (int i = 0; i < 30; ++i)
- Common::fill((byte *)&BL_ANIM[i], (byte *)&BL_ANIM[i] + sizeof(BlAnimItem), 0);
+ Common::fill((byte *)&_lockedAnims[i], (byte *)&_lockedAnims[i] + sizeof(LockAnimItem), 0);
for (int i = 0; i < 30; ++i)
Common::fill((byte *)&VBob[i], (byte *)&VBob[i] + sizeof(VBobItem), 0);
for (int i = 0; i < 300; ++i)
@@ -433,7 +433,7 @@ void Globals::HOPKINS_DATA() {
void Globals::INIT_ANIM() {
for (int idx = 0; idx < 35; ++idx) {
Bqe_Anim[idx]._data = g_PTRNUL;
- Bqe_Anim[idx].field4 = 0;
+ Bqe_Anim[idx]._enabledFl = false;
}
for (int idx = 0; idx < 8; ++idx) {
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h
index c524cf616f..1a613b8958 100644
--- a/engines/hopkins/globals.h
+++ b/engines/hopkins/globals.h
@@ -61,7 +61,7 @@ struct CarreZoneItem {
struct BqeAnimItem {
byte *_data;
- int field4;
+ bool _enabledFl;
};
struct BankItem {
@@ -121,9 +121,9 @@ struct BobItem {
int field4A;
};
-struct BlAnimItem {
- uint32 v1;
- uint32 v2;
+struct LockAnimItem {
+ bool _enableFl;
+ int _posX;
};
struct VBobItem {
@@ -314,7 +314,7 @@ public:
BobItem _bob[36];
ListeItem Liste[6];
Liste2Item Liste2[35];
- BlAnimItem BL_ANIM[30];
+ LockAnimItem _lockedAnims[30];
VBobItem VBob[30];
ObjetWItem ObjetW[300];
BlocItem BLOC[250];
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index 0facdf85d4..455c3c41b9 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -1107,7 +1107,7 @@ void GraphicsManager::Sprite_Vesa(byte *surface, const byte *spriteData, int xp,
void GraphicsManager::FIN_VISU() {
for (int idx = 1; idx <= 20; ++idx) {
- if (_vm->_globals.Bqe_Anim[idx].field4 == 1)
+ if (_vm->_globals.Bqe_Anim[idx]._enabledFl)
_vm->_objectsManager.BOB_OFF(idx);
}
@@ -1115,22 +1115,22 @@ void GraphicsManager::FIN_VISU() {
_vm->_eventsManager.VBL();
for (int idx = 1; idx <= 20; ++idx) {
- if (_vm->_globals.Bqe_Anim[idx].field4 == 1)
+ if (_vm->_globals.Bqe_Anim[idx]._enabledFl)
_vm->_objectsManager.BOB_ZERO(idx);
}
for (int idx = 1; idx <= 29; ++idx) {
- _vm->_globals.BL_ANIM[idx].v1 = 0;
+ _vm->_globals._lockedAnims[idx]._enableFl = false;
}
for (int idx = 1; idx <= 20; ++idx) {
- _vm->_globals.Bqe_Anim[idx].field4 = 0;
+ _vm->_globals.Bqe_Anim[idx]._enabledFl = false;
}
}
void GraphicsManager::VISU_ALL() {
for (int idx = 1; idx <= 20; ++idx) {
- if (_vm->_globals.Bqe_Anim[idx].field4 == 1)
+ if (_vm->_globals.Bqe_Anim[idx]._enabledFl)
_vm->_objectsManager.BOB_VISU(idx);
}
}
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index c3d564600d..690bfdc8eb 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -1171,8 +1171,8 @@ void ObjectsManager::AFF_BOB_ANIM() {
v20 = _vm->_globals._bob[idx]._animData + 20;
v24 = _vm->_globals._bob[idx].field10;
_vm->_globals._bob[idx]._xp = (int16)READ_LE_UINT16(v20 + 2 * v24);
- if (_vm->_globals.BL_ANIM[idx].v1 == 1)
- _vm->_globals._bob[idx]._xp = _vm->_globals.BL_ANIM[idx].v2;
+ if (_vm->_globals._lockedAnims[idx]._enableFl)
+ _vm->_globals._bob[idx]._xp = _vm->_globals._lockedAnims[idx]._posX;
if ( PERSO_ON && idx > 20 )
_vm->_globals._bob[idx]._xp += _vm->_eventsManager._startPos.x;
@@ -1210,8 +1210,8 @@ LABEL_38:
v21 = _vm->_globals._bob[idx]._animData + 20;
_vm->_globals._bob[idx]._xp = (int16)READ_LE_UINT16(v21);
- if (_vm->_globals.BL_ANIM[idx].v1 == 1)
- _vm->_globals._bob[idx]._xp = _vm->_globals.BL_ANIM[idx].v2;
+ if (_vm->_globals._lockedAnims[idx]._enableFl)
+ _vm->_globals._bob[idx]._xp = _vm->_globals._lockedAnims[idx]._posX;
if (PERSO_ON && idx > 20)
_vm->_globals._bob[idx]._xp += _vm->_eventsManager._startPos.x;
@@ -4712,39 +4712,39 @@ void ObjectsManager::SPECIAL_INI(const Common::String &a1) {
}
}
-void ObjectsManager::OPTI_BOBON(int a1, int a2, int a3, int a4, int a5, int a6, int a7) {
- if (a1 != -1)
- setBobAnimation(a1);
- if (a2 != -1)
- setBobAnimation(a2);
- if (a3 != -1)
- setBobAnimation(a3);
+void ObjectsManager::OPTI_BOBON(int idx1, int idx2, int idx3, int a4, int a5, int a6, int a7) {
+ if (idx1 != -1)
+ setBobAnimation(idx1);
+ if (idx2 != -1)
+ setBobAnimation(idx2);
+ if (idx3 != -1)
+ setBobAnimation(idx3);
if (!a7) {
- if (a1 != -1)
- SET_BOBPOSI(a1, a4);
- if (a2 != -1)
- SET_BOBPOSI(a2, a5);
- if (a3 != -1)
- SET_BOBPOSI(a3, a6);
+ if (idx1 != -1)
+ SET_BOBPOSI(idx1, a4);
+ if (idx2 != -1)
+ SET_BOBPOSI(idx2, a5);
+ if (idx3 != -1)
+ SET_BOBPOSI(idx3, a6);
}
}
-void ObjectsManager::SCI_OPTI_ONE(int a1, int a2, int a3, int a4) {
+void ObjectsManager::SCI_OPTI_ONE(int idx, int a2, int a3, int a4) {
_vm->_eventsManager._curMouseButton = 0;
_vm->_eventsManager._mouseButton = 0;
if (a4 != 3) {
- setBobAnimation(a1);
- SET_BOBPOSI(a1, a2);
+ setBobAnimation(idx);
+ SET_BOBPOSI(idx, a2);
}
do {
_vm->_eventsManager.VBL();
if (_vm->_eventsManager._curMouseButton)
break;
- } while (a3 != BOBPOSI(a1));
+ } while (a3 != BOBPOSI(idx));
if (!a4)
- stopBobAnimation(a1);
+ stopBobAnimation(idx);
}
void ObjectsManager::VERBE_OFF(int idx, int a2) {
@@ -5121,107 +5121,102 @@ void ObjectsManager::SPACTION1(byte *a1, const Common::String &a2, int a3, int a
}
}
-void ObjectsManager::TEST_FORET(int a1, int a2, int a3, int a4, int a5, int a6) {
- signed int v6;
- char v7;
+void ObjectsManager::TEST_FORET(int screenId, int minX, int maxX, int minY, int maxY, int a6) {
+ int v6 = screenId;
+ if (_vm->_globals._screenId != screenId)
+ return;
- v6 = a1;
- if (_vm->_globals._screenId == a1) {
- if (a1 == 35) {
- if (a6 > 2 || (v6 = 200, a6 > 2))
- v6 = 201;
- }
- if (_vm->_globals._screenId == 36) {
- if (a6 > 2 || (v6 = 202, a6 > 2))
- v6 = 203;
- }
- if (_vm->_globals._screenId == 37) {
- if (a6 > 2 || (v6 = 204, a6 > 2))
- v6 = 205;
- }
- if (_vm->_globals._screenId == 38) {
- if (a6 > 2 || (v6 = 206, a6 > 2))
- v6 = 207;
- }
- if (_vm->_globals._screenId == 39) {
- if (a6 > 2 || (v6 = 208, a6 > 2))
- v6 = 209;
- }
- if (_vm->_globals._screenId == 40) {
- if (a6 > 2 || (v6 = 210, a6 > 2))
- v6 = 211;
+ switch (_vm->_globals._screenId) {
+ case 35:
+ if (a6 > 2)
+ v6 = 201;
+ else
+ v6 = 200;
+ break;
+ case 36:
+ if (a6 > 2)
+ v6 = 203;
+ else
+ v6 = 202;
+ break;
+ case 37:
+ if (a6 > 2)
+ v6 = 205;
+ else
+ v6 = 204;
+ break;
+ case 38:
+ if (a6 > 2)
+ v6 = 207;
+ else
+ v6 = 206;
+ break;
+ case 39:
+ if (a6 > 2)
+ v6 = 209;
+ else
+ v6 = 208;
+ break;
+ case 40:
+ if (a6 > 2)
+ v6 = 211;
+ else
+ v6 = 210;
+ break;
+ case 41:
+ if (a6 > 2)
+ v6 = 213;
+ else
+ v6 = 212;
+ break;
+ }
+
+ if (_vm->_globals._saveData->data[v6] == 2)
+ return;
+
+ if (_vm->_globals._saveData->data[v6]) {
+ if (_vm->_globals._saveData->data[v6] == 1) {
+ if ((a6 == 1 && BOBPOSI(1) == 26) || (a6 == 2 && BOBPOSI(2) == 26) ||
+ (a6 == 3 && BOBPOSI(3) == 27) || (a6 == 4 && BOBPOSI(4) == 27)) {
+ _vm->_dialogsManager._removeInventFl = true;
+ _vm->_soundManager.PLAY_SAMPLE2(1);
+ _vm->_globals._saveData->data[v6] = 4;
+ }
}
- if (_vm->_globals._screenId == 41) {
- if (a6 > 2 || (v6 = 212, a6 > 2))
- v6 = 213;
+ if (_vm->_globals._saveData->data[v6] == 4) {
+ if ((a6 == 1 && BOBPOSI(1) > 30) || (a6 == 2 && BOBPOSI(2) > 30) ||
+ (a6 == 3 && BOBPOSI(3) > 30) || (a6 == 4 && BOBPOSI(4) > 30))
+ _vm->_globals._saveData->data[v6] = 3;
}
- v7 = _vm->_globals._saveData->data[v6];
- if (v7 != 2) {
- if (v7) {
- if (v7 == 1) {
- if (a6 == 1 && BOBPOSI(1) == 26) {
- _vm->_dialogsManager._removeInventFl = true;
- _vm->_soundManager.PLAY_SAMPLE2(1);
- _vm->_globals._saveData->data[v6] = 4;
- }
- if (a6 == 2 && BOBPOSI(2) == 26) {
- _vm->_dialogsManager._removeInventFl = true;
- _vm->_soundManager.PLAY_SAMPLE2(1);
- _vm->_globals._saveData->data[v6] = 4;
- }
- if (a6 == 3 && BOBPOSI(3) == 27) {
- _vm->_dialogsManager._removeInventFl = true;
- _vm->_soundManager.PLAY_SAMPLE2(1);
- _vm->_globals._saveData->data[v6] = 4;
- }
- if (a6 == 4 && BOBPOSI(4) == 27) {
- _vm->_dialogsManager._removeInventFl = true;
- _vm->_soundManager.PLAY_SAMPLE2(1);
- _vm->_dialogsManager._removeInventFl = true;
- _vm->_globals._saveData->data[v6] = 4;
- }
- }
- if (_vm->_globals._saveData->data[v6] == 4) {
- if (a6 == 1 && (signed int)BOBPOSI(1) > 30)
- _vm->_globals._saveData->data[v6] = 3;
- if (a6 == 2 && (signed int)BOBPOSI(2) > 30)
- _vm->_globals._saveData->data[v6] = 3;
- if (a6 == 3 && (signed int)BOBPOSI(3) > 30)
- _vm->_globals._saveData->data[v6] = 3;
- if (a6 == 4 && (signed int)BOBPOSI(4) > 30)
- _vm->_globals._saveData->data[v6] = 3;
- }
- if (_vm->_globals._saveData->data[v6] == 3) {
- _vm->_graphicsManager.FADE_LINUX = 2;
- _vm->_animationManager.playAnim("CREVE2.ANM", 100, 24, 500);
- _vm->_globals._exitId = 150;
- _vm->_graphicsManager._noFadingFl = true;
- BOB_OFF(1);
- BOB_OFF(2);
- BOB_OFF(3);
- BOB_OFF(4);
- }
- } else if (a2 < getSpriteX(0)
- && a3 > getSpriteX(0)
- && a4 < getSpriteY(0)
- && a5 > getSpriteY(0)) {
- if (a6 == 1)
- setBobAnimation(1);
- if (a6 == 2)
- setBobAnimation(2);
- if (a6 == 3)
- setBobAnimation(3);
- if (a6 == 4)
- setBobAnimation(4);
- _vm->_globals._saveData->data[v6] = 1;
- }
+ if (_vm->_globals._saveData->data[v6] == 3) {
+ _vm->_graphicsManager.FADE_LINUX = 2;
+ _vm->_animationManager.playAnim("CREVE2.ANM", 100, 24, 500);
+ _vm->_globals._exitId = 150;
+ _vm->_graphicsManager._noFadingFl = true;
+ BOB_OFF(1);
+ BOB_OFF(2);
+ BOB_OFF(3);
+ BOB_OFF(4);
}
+ } else if (minX < getSpriteX(0)
+ && maxX > getSpriteX(0)
+ && minY < getSpriteY(0)
+ && maxY > getSpriteY(0)) {
+ if (a6 == 1)
+ setBobAnimation(1);
+ else if (a6 == 2)
+ setBobAnimation(2);
+ else if (a6 == 3)
+ setBobAnimation(3);
+ else if (a6 == 4)
+ setBobAnimation(4);
+ _vm->_globals._saveData->data[v6] = 1;
}
}
-void ObjectsManager::BLOQUE_ANIMX(int idx, int a2) {
- _vm->_globals.BL_ANIM[idx].v1 = 1;
- _vm->_globals.BL_ANIM[idx].v2 = a2;
+void ObjectsManager::lockAnimX(int idx, int a2) {
+ _vm->_globals._lockedAnims[idx]._enableFl;
+ _vm->_globals._lockedAnims[idx]._posX = a2;
}
void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Common::String &linkFile,
diff --git a/engines/hopkins/objects.h b/engines/hopkins/objects.h
index e4081d7eac..98037067d9 100644
--- a/engines/hopkins/objects.h
+++ b/engines/hopkins/objects.h
@@ -227,8 +227,8 @@ public:
void INILINK(const Common::String &file);
void SPECIAL_INI(const Common::String &a1);
- void OPTI_BOBON(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
- void SCI_OPTI_ONE(int a1, int a2, int a3, int a4);
+ void OPTI_BOBON(int idx1, int idx2, int idx3, int a4, int a5, int a6, int a7);
+ void SCI_OPTI_ONE(int idx, int a2, int a3, int a4);
void VERBE_OFF(int idx, int a2);
void VERBE_ON(int idx, int a2);
int CALC_PROPRE(int idx);
@@ -237,8 +237,8 @@ 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 TEST_FORET(int a1, int a2, int a3, int a4, int a5, int a6);
- void BLOQUE_ANIMX(int idx, int a2);
+ void TEST_FORET(int screenId, int minX, int maxX, int minY, int maxY, int a6);
+ void lockAnimX(int idx, int a2);
/**
* Game scene control method
diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp
index 9a28adbd8f..f21abe03f8 100644
--- a/engines/hopkins/talk.cpp
+++ b/engines/hopkins/talk.cpp
@@ -542,26 +542,26 @@ void TalkManager::searchCharacterPalette(int startIdx, bool dark) {
void TalkManager::dialogWait() {
for (int idx = 26; idx <= 30; ++idx) {
- if (_vm->_globals.Bqe_Anim[idx].field4 == 1)
+ if (_vm->_globals.Bqe_Anim[idx]._enabledFl)
BOB_VISU_PARLE(idx);
}
}
void TalkManager::dialogTalk() {
for (int idx = 26; idx <= 30; ++idx) {
- if (_vm->_globals.Bqe_Anim[idx].field4 == 1)
+ if (_vm->_globals.Bqe_Anim[idx]._enabledFl)
_vm->_objectsManager.BOB_OFF(idx);
}
for (int idx = 26; idx <= 30; ++idx) {
- if (_vm->_globals.Bqe_Anim[idx].field4 == 1)
+ if (_vm->_globals.Bqe_Anim[idx]._enabledFl)
_vm->_objectsManager.BOB_ZERO(idx);
}
}
void TalkManager::dialogEndTalk() {
for (int idx = 21; idx <= 25; ++idx) {
- if (_vm->_globals.Bqe_Anim[idx].field4 == 1)
+ if (_vm->_globals.Bqe_Anim[idx]._enabledFl)
_vm->_objectsManager.BOB_OFF(idx);
}
@@ -569,7 +569,7 @@ void TalkManager::dialogEndTalk() {
_vm->_eventsManager.VBL();
for (int idx = 21; idx <= 25; ++idx) {
- if (_vm->_globals.Bqe_Anim[idx].field4 == 1)
+ if (_vm->_globals.Bqe_Anim[idx]._enabledFl)
_vm->_objectsManager.BOB_ZERO(idx);
}
}
@@ -680,7 +680,7 @@ LABEL_33:
void TalkManager::VISU_PARLE() {
for (int idx = 21; idx <= 25; ++idx) {
- if (_vm->_globals.Bqe_Anim[idx].field4 == 1)
+ if (_vm->_globals.Bqe_Anim[idx]._enabledFl)
BOB_VISU_PARLE(idx);
}
}
@@ -792,11 +792,11 @@ void TalkManager::initCharacterAnim() {
void TalkManager::clearCharacterAnim() {
for (int idx = 21; idx <= 34; ++idx) {
_vm->_globals.Bqe_Anim[idx]._data = _vm->_globals.freeMemory(_vm->_globals.Bqe_Anim[idx]._data);
- _vm->_globals.Bqe_Anim[idx].field4 = 0;
+ _vm->_globals.Bqe_Anim[idx]._enabledFl = false;
}
}
-bool TalkManager::searchCharacterAnim(int a1, const byte *bufPerso, int a3, int a4) {
+bool TalkManager::searchCharacterAnim(int idx, const byte *bufPerso, int a3, int a4) {
bool result;
const byte *v5;
int v6;
@@ -812,7 +812,6 @@ bool TalkManager::searchCharacterAnim(int a1, const byte *bufPerso, int a3, int
int v16;
char v17;
int v18;
- int v20;
int v22;
int v23;
const byte *v24;
@@ -820,32 +819,29 @@ bool TalkManager::searchCharacterAnim(int a1, const byte *bufPerso, int a3, int
v22 = 0;
result = false;
- v20 = a1;
do {
- if (*(v22 + bufPerso) == 'A' && *(bufPerso + v22 + 1) == 'N' && *(bufPerso + v22 + 2) == 'I' && *(bufPerso + v22 + 3) == 'M'
- && *(bufPerso + v22 + 4) == a3) {
+ if (bufPerso[v22] == 'A' && bufPerso[v22 + 1] == 'N' && bufPerso[v22 + 2] == 'I' && bufPerso[v22 + 3] == 'M' && bufPerso[v22 + 4] == a3) {
v5 = v22 + bufPerso + 5;
v18 = v22 + 5;
v6 = 0;
v7 = 0;
do {
- if (*v5 == 'A' && *(v5 + 1) == 'N' && *(v5 + 2) == 'I' && *(v5 + 3) == 'M')
- v7 = 1;
- if (*v5 == 'F' && *(v5 + 1) == 'I' && *(v5 + 2) == 'N')
+ if ((v5[0] == 'A' && v5[1] == 'N' && v5[2] == 'I' && v5[3] == 'M') ||
+ (v5[0] == 'F' && v5[1] == 'I' && v5[2] == 'N'))
v7 = 1;
if (v18 > a4) {
- _vm->_globals.Bqe_Anim[a1].field4 = 0;
- result = g_PTRNUL;
- _vm->_globals.Bqe_Anim[v20]._data = g_PTRNUL;
+ _vm->_globals.Bqe_Anim[idx]._enabledFl = false;
+ result = false;
+ _vm->_globals.Bqe_Anim[idx]._data = g_PTRNUL;
}
++v18;
++v6;
++v5;
} while (v7 != 1);
- _vm->_globals.Bqe_Anim[v20]._data = _vm->_globals.allocMemory(v6 + 50);
- _vm->_globals.Bqe_Anim[a1].field4 = 1;
- memcpy(_vm->_globals.Bqe_Anim[v20]._data, (const byte *)(v22 + bufPerso + 5), 20);
- v8 = _vm->_globals.Bqe_Anim[v20]._data;
+ _vm->_globals.Bqe_Anim[idx]._data = _vm->_globals.allocMemory(v6 + 50);
+ _vm->_globals.Bqe_Anim[idx]._enabledFl = true;
+ memcpy(_vm->_globals.Bqe_Anim[idx]._data, (const byte *)(v22 + bufPerso + 5), 20);
+ v8 = _vm->_globals.Bqe_Anim[idx]._data;
v9 = v8 + 20;
v24 = v22 + bufPerso + 25;
@@ -853,13 +849,12 @@ bool TalkManager::searchCharacterAnim(int a1, const byte *bufPerso, int a3, int
v11 = (int16)READ_LE_UINT16(v22 + bufPerso + 27);
v23 = (int16)READ_LE_UINT16(v22 + bufPerso + 29);
v12 = (int16)READ_LE_UINT16(v22 + bufPerso + 31);
- v13 = *(v22 + bufPerso + 33);
- *(v8 + 29) = *(v22 + bufPerso + 34);
+ v8[28] = bufPerso[v22 + 33];
+ v8[29] = bufPerso[v22 + 34];
WRITE_LE_UINT16(v8 + 20, v10);
WRITE_LE_UINT16(v8 + 22, v11);
WRITE_LE_UINT16(v8 + 24, v23);
WRITE_LE_UINT16(v8 + 26, v12);
- *(v8 + 28) = v13;
for (int i = 1; i < 5000; i++) {
v9 += 10;
v24 += 10;
@@ -869,20 +864,19 @@ bool TalkManager::searchCharacterAnim(int a1, const byte *bufPerso, int a3, int
v15 = (int16)READ_LE_UINT16(v24 + 2);
v23 = (int16)READ_LE_UINT16(v24 + 4);
v16 = (int16)READ_LE_UINT16(v24 + 6);
- v17 = *(v24 + 8);
- *(v9 + 9) = *(v24 + 9);
+ v9[8] = v24[8];
+ v9[9] = v24[9];
WRITE_LE_UINT16(v9, v14);
WRITE_LE_UINT16(v9 + 2, v15);
WRITE_LE_UINT16(v9 + 4, v23);
WRITE_LE_UINT16(v9 + 6, v16);
- *(v9 + 8) = v17;
}
- result = 1;
+ result = true;
}
- if (*(bufPerso + v22) == 'F' && *(bufPerso + v22 + 1) == 'I' && *(bufPerso + v22 + 2) == 'N')
+ if (bufPerso[v22] == 'F' && bufPerso[v22 + 1] == 'I' && bufPerso[v22 + 2] == 'N')
result = true;
++v22;
- } while (v22 <= a4 && result != 1);
+ } while (v22 <= a4 && !result);
return result;
}
@@ -997,11 +991,11 @@ void TalkManager::REPONSE2(int a1, int a2) {
_vm->_objectsManager.setSpriteIndex(0, 62);
_vm->_objectsManager.SPACTION(_vm->_globals._forestSprite, "2,3,4,5,6,7,8,9,10,11,12,-1,", 0, 0, 4, 0);
if (a1 == 22) {
- _vm->_objectsManager.BLOQUE_ANIMX(6, _vm->_objectsManager.getBobPosX(3));
- _vm->_objectsManager.BLOQUE_ANIMX(8, _vm->_objectsManager.getBobPosX(3));
+ _vm->_objectsManager.lockAnimX(6, _vm->_objectsManager.getBobPosX(3));
+ _vm->_objectsManager.lockAnimX(8, _vm->_objectsManager.getBobPosX(3));
} else { // a1 == 23
- _vm->_objectsManager.BLOQUE_ANIMX(6, _vm->_objectsManager.getBobPosX(4));
- _vm->_objectsManager.BLOQUE_ANIMX(8, _vm->_objectsManager.getBobPosX(4));
+ _vm->_objectsManager.lockAnimX(6, _vm->_objectsManager.getBobPosX(4));
+ _vm->_objectsManager.lockAnimX(8, _vm->_objectsManager.getBobPosX(4));
}
_vm->_objectsManager.stopBobAnimation(3);
_vm->_objectsManager.stopBobAnimation(4);
@@ -1045,11 +1039,11 @@ void TalkManager::REPONSE2(int a1, int a2) {
_vm->_objectsManager.setSpriteIndex(0, 62);
_vm->_objectsManager.SPACTION(_vm->_globals._forestSprite, "2,3,4,5,6,7,8,9,10,11,12,-1,", 0, 0, 4, 1);
if (a1 == 20) {
- _vm->_objectsManager.BLOQUE_ANIMX(5, _vm->_objectsManager.getBobPosX(1));
- _vm->_objectsManager.BLOQUE_ANIMX(7, _vm->_objectsManager.getBobPosX(1));
+ _vm->_objectsManager.lockAnimX(5, _vm->_objectsManager.getBobPosX(1));
+ _vm->_objectsManager.lockAnimX(7, _vm->_objectsManager.getBobPosX(1));
} else { // a1 == 21
- _vm->_objectsManager.BLOQUE_ANIMX(5, _vm->_objectsManager.getBobPosX(2));
- _vm->_objectsManager.BLOQUE_ANIMX(7, _vm->_objectsManager.getBobPosX(2));
+ _vm->_objectsManager.lockAnimX(5, _vm->_objectsManager.getBobPosX(2));
+ _vm->_objectsManager.lockAnimX(7, _vm->_objectsManager.getBobPosX(2));
}
_vm->_objectsManager.stopBobAnimation(1);
_vm->_objectsManager.stopBobAnimation(2);
diff --git a/engines/hopkins/talk.h b/engines/hopkins/talk.h
index 0cf3e07292..88fb11ed08 100644
--- a/engines/hopkins/talk.h
+++ b/engines/hopkins/talk.h
@@ -64,7 +64,7 @@ public:
void startCharacterAnim0(int startIndedx, bool readOnlyFl);
void initCharacterAnim();
void clearCharacterAnim();
- bool searchCharacterAnim(int a1, const byte *a2, int a3, int a4);
+ bool searchCharacterAnim(int idx, const byte *bufPerso, int a3, int a4);
void REPONSE(int a1, int a2);
void REPONSE2(int a1, int a2);
void OBJET_VIVANT(const Common::String &a2);