diff options
-rw-r--r-- | engines/hopkins/globals.h | 31 | ||||
-rw-r--r-- | engines/hopkins/graphics.cpp | 26 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 104 | ||||
-rw-r--r-- | engines/hopkins/objects.h | 8 |
4 files changed, 167 insertions, 2 deletions
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index c1209d01fb..5b9c683867 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -84,11 +84,41 @@ struct BankItem { }; struct BobItem { + int field0; + byte *field4; + int field8; + int fieldA; int fieldC; + int fieldE; int field10; int field12; int field14; int field16; + byte *field18; + int field1A; + int field1C; + int field1E; + int field20; + int field22; + int field24; + int field26; + int field28; + int field2A; + int field2C; + byte *field30; + int field34; + int field36; + int field38; + int field3A; + int field46; +}; + +struct Liste2Item { + int field0; + int field2; + int field4; + int field6; + int field8; }; struct BlAnimItem { @@ -181,6 +211,7 @@ public: BqeAnimItem Bqe_Anim[35]; BankItem Bank[8]; BobItem Bob[36]; + Liste2Item Liste2[35]; BlAnimItem BL_ANIM[30]; VBobItem VBob[35]; ObjetWItem ObjetW[300]; diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index 23ea17813e..a537ea1db9 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -1297,11 +1297,33 @@ void GraphicsManager::Sprite_Vesa(byte *a1, byte *a2, int a3, int a4, int a5) { } void GraphicsManager::FIN_VISU() { - warning("TODO: FIN_VISU"); + for (int idx = 1; idx <= 20; ++idx) { + if (_vm->_globals.Bqe_Anim[idx].field4 == 1) + _vm->_objectsManager.BOB_OFF(idx); + } + + _vm->_eventsManager.VBL(); + _vm->_eventsManager.VBL(); + + for (int idx = 1; idx <= 20; ++idx) { + if (_vm->_globals.Bqe_Anim[idx].field4 == 1) + _vm->_objectsManager.BOB_ZERO(idx); + } + + for (int idx = 1; idx <= 29; ++idx) { + _vm->_globals.BL_ANIM[idx].v1 = 0; + } + + for (int idx = 1; idx <= 20; ++idx) { + _vm->_globals.Bqe_Anim[idx].field4 = 0; + } } void GraphicsManager::VISU_ALL() { - warning("TODO: VISU_ALL"); + for (int idx = 1; idx <= 20; ++idx) { + if (_vm->_globals.Bqe_Anim[idx].field4 == 1) + _vm->_objectsManager.BOB_VISU(idx); + } } void GraphicsManager::RESET_SEGMENT_VESA() { diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 938099f083..fbc131e0f0 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -31,6 +31,10 @@ namespace Hopkins { +ObjectsManager::ObjectsManager() { + PRIORITY = 0; +} + void ObjectsManager::setParent(HopkinsEngine *vm) { _vm = vm; } @@ -185,4 +189,104 @@ int ObjectsManager::AJOUTE_OBJET(int objIndex) { return arrIndex; } +void ObjectsManager::INIT_BOB() { + for (int idx = 0; idx < 35; ++idx) { + BOB_ZERO(idx); + } +} + +void ObjectsManager::BOB_ZERO(int idx) { + BobItem &bob = _vm->_globals.Bob[idx]; + Liste2Item &item = _vm->_globals.Liste2[idx]; + + bob.field0 = 0; + bob.field4 = PTRNUL; + bob.field8 = 0; + bob.fieldA = 0; + bob.fieldC = 0; + bob.fieldE = 0; + bob.field10 = 0; + bob.field12 = 0; + bob.field14 = 0; + bob.field16 = 0; + bob.field18 = PTRNUL; + bob.field1A = 0; + bob.field1C = 0; + bob.field1E = 0; + bob.field20 = 0; + bob.field22 = 0; + bob.field24 = 0; + bob.field26 = 0; + bob.field28 = 0; + bob.field2A = 0; + bob.field2C = 0; + bob.field30 = PTRNUL; + bob.field34 = 0; + bob.field36 = 0; + bob.field38 = 0; + bob.field46 = 0; + + item.field0 = 0; + item.field2 = 0; + item.field4 = 0; + item.field6 = 0; + item.field8 = 0; +} + +void ObjectsManager::BOB_VISU(int idx) { + int v1; + const byte *data; + int16 v6; + int16 v7; + int16 v8; + int16 v9; + + PRIORITY = 1; + + if (!_vm->_globals.Bob[idx].field0) { + BOB_ZERO(idx); + + data = _vm->_globals.Bqe_Anim[idx].data; + v1 = READ_LE_UINT16(data); + v9 = READ_LE_UINT16(data + 2); + v8 = READ_LE_UINT16(data + 4); + v7 = READ_LE_UINT16(data + 6); + v6 = READ_LE_UINT16(data + 8); + if (READ_LE_UINT16(data)) { + if (_vm->_globals.Bank[idx].field4) { + if (!v9) + v9 = 1; + if (!v6) + v6 = -1; + + if (READ_LE_UINT16(data + 24)) { + _vm->_globals.Bob[idx].field3A = 0; + + if (_vm->_globals.Bank[idx].fileHeader == 1) { + _vm->_globals.Bob[idx].field3A = 1; + _vm->_globals.Bob[idx].field36 = 0; + _vm->_globals.Bob[idx].field38 = 0; + } + + _vm->_globals.Bob[idx].field18 = _vm->_globals.Bqe_Anim[idx].data; + _vm->_globals.Bob[idx].field0 = 10; + _vm->_globals.Bob[idx].field4 = _vm->_globals.Bank[idx].data; + + _vm->_globals.Bob[idx].field1E = v9; + _vm->_globals.Bob[idx].field20 = v6; + _vm->_globals.Bob[idx].field22 = v8; + _vm->_globals.Bob[idx].field24 = v7; + } + } + } + } +} + +void ObjectsManager::BOB_OFF(int idx) { + if (_vm->_globals.Bob[idx].field0 == 3) + _vm->_globals.Bob[idx].field0 = 4; + else if (_vm->_globals.Bob[idx].field0 == 10) + _vm->_globals.Bob[idx].field0 = 11; +} + } // End of namespace Hopkins diff --git a/engines/hopkins/objects.h b/engines/hopkins/objects.h index 845c4077a3..f9017cc63f 100644 --- a/engines/hopkins/objects.h +++ b/engines/hopkins/objects.h @@ -34,7 +34,10 @@ class HopkinsEngine; class ObjectsManager { private: HopkinsEngine *_vm; + + int PRIORITY; public: + ObjectsManager(); void setParent(HopkinsEngine *vm); byte *CHANGE_OBJET(int objIndex); @@ -50,6 +53,11 @@ public: int capture_mem_sprite(const byte *objectData, byte *sprite, int objIndex); int AJOUTE_OBJET(int objIndex); + + void INIT_BOB(); + void BOB_ZERO(int idx); + void BOB_VISU(int idx); + void BOB_OFF(int idx); }; } // End of namespace Hopkins |