diff options
author | Paul Gilbert | 2012-09-29 09:33:42 +1000 |
---|---|---|
committer | Paul Gilbert | 2012-09-29 09:33:42 +1000 |
commit | 92313216dd0b9a42de528ccab02f87d1894dff2c (patch) | |
tree | b71dcc55f06d2e908d252377cd2050e8a5c96998 /engines | |
parent | 3594a691abbc678cf8c31dd94b54453ed0534335 (diff) | |
download | scummvm-rg350-92313216dd0b9a42de528ccab02f87d1894dff2c.tar.gz scummvm-rg350-92313216dd0b9a42de528ccab02f87d1894dff2c.tar.bz2 scummvm-rg350-92313216dd0b9a42de528ccab02f87d1894dff2c.zip |
HOPKINS: Implemented more graphics and object methods
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hopkins/globals.cpp | 21 | ||||
-rw-r--r-- | engines/hopkins/globals.h | 31 | ||||
-rw-r--r-- | engines/hopkins/graphics.cpp | 41 | ||||
-rw-r--r-- | engines/hopkins/graphics.h | 3 | ||||
-rw-r--r-- | engines/hopkins/objects.cpp | 556 | ||||
-rw-r--r-- | engines/hopkins/objects.h | 35 | ||||
-rw-r--r-- | engines/hopkins/talk.cpp | 9 | ||||
-rw-r--r-- | engines/hopkins/talk.h | 2 |
8 files changed, 659 insertions, 39 deletions
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp index 7caf57c7b6..6f6543d3d0 100644 --- a/engines/hopkins/globals.cpp +++ b/engines/hopkins/globals.cpp @@ -223,9 +223,9 @@ void Globals::clearAll() { OBJET_EN_COURS = 0; for (int idx = 0; idx < 105; ++idx) { - ZoneP[idx].field0 = 0; - ZoneP[idx].field2 = 0; - ZoneP[idx].field4 = 0; + ZONEP[idx].field0 = 0; + ZONEP[idx].field2 = 0; + ZONEP[idx].field4 = 0; } essai0 = PTRNUL; @@ -683,6 +683,19 @@ void Globals::INIT_VBOB() { } } +void Globals::CLEAR_VBOB() { + for (int idx = 0; idx < 30; ++idx) { + VBob[idx].field4 = 0; + VBob[idx].field6 = 0; + VBob[idx].field8 = 0; + VBob[idx].fieldA = 0; + VBob[idx].fieldC = 0; + VBob[idx].field10 = PTRNUL; + VBob[idx].field0 = PTRNUL; + VBob[idx].field1C = PTRNUL; + } +} + void Globals::CHARGE_OBJET() { FileManager::CONSTRUIT_SYSTEM("OBJET.DAT"); byte *data = FileManager::CHARGE_FICHIER(NFICHIER); @@ -762,7 +775,7 @@ void Globals::CACHE_ADD(int idx) { } void Globals::CHARGE_CACHE(const Common::String &file) { - byte *v2; + byte *v2 = PTRNUL; int v4; int v5; int v6; diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h index ffb80fd9a0..49a982b686 100644 --- a/engines/hopkins/globals.h +++ b/engines/hopkins/globals.h @@ -32,6 +32,18 @@ struct ZonePItem { int field0; int field2; int field4; + int field6; + int field7; + int field8; + int field9; + int fieldA; + int fieldB; + int fieldC; + int fieldD; + int fieldE; + int fieldF; + int field12; + int field16; }; struct LigneItem { @@ -183,7 +195,11 @@ struct CacheItem { // Note: Fields decimal based for now struct Sauvegarde { + int field1; + int field2; + int field3; int field4; + int field13; int field80; int field170; int field171; @@ -240,7 +256,7 @@ public: int lItCounter; int lOldItCounter; int g_old_anim; - int g_old_sens; + int g_old_sens, g_old_sens2; int HopkinsArr[140]; byte *police; int police_l; @@ -249,7 +265,7 @@ public: byte *ICONE; byte *BUF_ZONE; byte *CACHE_BANQUE[6]; - ZonePItem ZoneP[105]; + ZonePItem ZONEP[106]; LigneItem Ligne[400]; LigneZoneItem LigneZone[400]; CarreZoneItem CarreZone[100]; @@ -263,6 +279,8 @@ public: ObjetWItem ObjetW[300]; BlocItem BLOC[250]; CacheItem Cache[25]; + int BOBZONE[105]; + bool BOBZONE_FLAG[105]; byte *Winventaire; byte *texte_tmp; int texte_long; @@ -340,6 +358,14 @@ public: bool PLAN_FLAG; int GOACTION; int NECESSAIRE; + int Compteur; + int ACTION_SENS; + + int force_to_data_0; + int old_zone_68; + int old_x_69, old_y_70; + int compteur_71; + int zozo_73; Globals(); ~Globals(); @@ -350,6 +376,7 @@ public: void HOPKINS_DATA(); void INIT_ANIM(); void INIT_VBOB(); + void CLEAR_VBOB(); void CHARGE_OBJET(); byte *dos_malloc2(int count); byte *dos_free2(byte *p); diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index e1d360e731..dab66f1709 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -965,11 +965,44 @@ void GraphicsManager::setpal_vga256_linux(const byte *palette, const byte *surfa } } +void GraphicsManager::SETCOLOR(int palIndex, int r, int g, int b) { + _vm->_graphicsManager.Palette[palIndex * 3] = 255 * r / 100; + _vm->_graphicsManager.Palette[palIndex * 3 + 1] = 255 * g / 100; + _vm->_graphicsManager.Palette[palIndex * 3 + 2] = 255 * b / 100; + + setpal_vga256(Palette); +} + +void GraphicsManager::SETCOLOR2(int palIndex, int r, int g, int b) { + return SETCOLOR(palIndex, r, g, b); +} + void GraphicsManager::SETCOLOR3(int palIndex, int r, int g, int b) { - int offset = palIndex * 3; - Palette[offset] = 255 * r / 100; - Palette[offset + 1] = 255 * g / 100; - Palette[offset + 2] = 255 * b / 100; + Palette[palIndex * 3] = 255 * r / 100; + Palette[palIndex * 3 + 1] = 255 * g / 100; + Palette[palIndex * 3 + 2] = 255 * b / 100; +} + +void GraphicsManager::SETCOLOR4(int palIndex, int r, int g, int b) { + int rv, gv, bv; + int palOffset; + int v8; + + rv = 255 * r / 100; + gv = 255 * g / 100; + bv = 255 * b / 100; + palOffset = 3 * palIndex; + Palette[palOffset] = 255 * r / 100; + Palette[palOffset + 1] = gv; + Palette[palOffset + 2] = bv; + + v8 = 4 * palIndex; + cmap[v8] = rv; + cmap[v8 + 1] = gv; + cmap[v8 + 2] = bv; + + WRITE_LE_UINT16(&SD_PIXELS[2 * palIndex], MapRGB(rv, gv, bv)); + g_system->getPaletteManager()->setPalette(cmap, palIndex, 1); } void GraphicsManager::CHANGE_PALETTE(const byte *palette) { diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h index 8e64e44785..8cd6a7b10e 100644 --- a/engines/hopkins/graphics.h +++ b/engines/hopkins/graphics.h @@ -135,7 +135,10 @@ public: void FADE_INW_LINUX(const byte *surface); void setpal_vga256(const byte *palette); void setpal_vga256_linux(const byte *palette, const byte *surface); + void SETCOLOR(int palIndex, int r, int g, int b); + void SETCOLOR2(int palIndex, int r, int g, int b); void SETCOLOR3(int palIndex, int r, int g, int b); + void SETCOLOR4(int palIndex, int r, int g, int b); void CHANGE_PALETTE(const byte *palette); uint16 MapRGB(byte r, byte g, byte b); void DD_VBL(); diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index b943def1bd..edd700b577 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -57,9 +57,9 @@ void ObjectsManager::setParent(HopkinsEngine *vm) { byte *ObjectsManager::CHANGE_OBJET(int objIndex) { byte *result = ObjectsManager::CAPTURE_OBJET(objIndex, 1); - GLOBALS.Bufferobjet = result; - GLOBALS.Nouv_objet = 1; - GLOBALS.OBJET_EN_COURS = objIndex; + _vm->_globals.Bufferobjet = result; + _vm->_globals.Nouv_objet = 1; + _vm->_globals.OBJET_EN_COURS = objIndex; return result; } @@ -68,43 +68,43 @@ byte *ObjectsManager::CAPTURE_OBJET(int objIndex, int mode) { byte *dataP; dataP = 0; - int val1 = GLOBALS.ObjetW[objIndex].field0; - int val2 = GLOBALS.ObjetW[objIndex].field1; + int val1 = _vm->_globals.ObjetW[objIndex].field0; + int val2 = _vm->_globals.ObjetW[objIndex].field1; if (mode == 1) ++val2; - if (val1 != GLOBALS.NUM_FICHIER_OBJ) { - if (GLOBALS.ADR_FICHIER_OBJ != PTRNUL) + if (val1 != _vm->_globals.NUM_FICHIER_OBJ) { + if (_vm->_globals.ADR_FICHIER_OBJ != PTRNUL) ObjectsManager::DEL_FICHIER_OBJ(); if (val1 == 1) { FileManager::CONSTRUIT_SYSTEM("OBJET1.SPR"); - GLOBALS.ADR_FICHIER_OBJ = ObjectsManager::CHARGE_SPRITE(GLOBALS.NFICHIER); + _vm->_globals.ADR_FICHIER_OBJ = ObjectsManager::CHARGE_SPRITE(_vm->_globals.NFICHIER); } - GLOBALS.NUM_FICHIER_OBJ = val1; + _vm->_globals.NUM_FICHIER_OBJ = val1; } - int width = ObjectsManager::Get_Largeur(GLOBALS.ADR_FICHIER_OBJ, val2); - int height = ObjectsManager::Get_Hauteur(GLOBALS.ADR_FICHIER_OBJ, val2); - GLOBALS.OBJL = width; - GLOBALS.OBJH = height; + int width = ObjectsManager::Get_Largeur(_vm->_globals.ADR_FICHIER_OBJ, val2); + int height = ObjectsManager::Get_Hauteur(_vm->_globals.ADR_FICHIER_OBJ, val2); + _vm->_globals.OBJL = width; + _vm->_globals.OBJH = height; switch (mode) { case 0: - dataP = GLOBALS.dos_malloc2(height * width); + dataP = _vm->_globals.dos_malloc2(height * width); if (dataP == PTRNUL) error("CAPTURE_OBJET"); - ObjectsManager::capture_mem_sprite(GLOBALS.ADR_FICHIER_OBJ, dataP, val2); + ObjectsManager::capture_mem_sprite(_vm->_globals.ADR_FICHIER_OBJ, dataP, val2); break; case 1: - ObjectsManager::sprite_alone(GLOBALS.ADR_FICHIER_OBJ, GLOBALS.Bufferobjet, val2); - result = GLOBALS.Bufferobjet; + ObjectsManager::sprite_alone(_vm->_globals.ADR_FICHIER_OBJ, _vm->_globals.Bufferobjet, val2); + result = _vm->_globals.Bufferobjet; break; case 3: - ObjectsManager::capture_mem_sprite(GLOBALS.ADR_FICHIER_OBJ, GLOBALS.INVENTAIRE_OBJET, val2); - result = GLOBALS.INVENTAIRE_OBJET; + ObjectsManager::capture_mem_sprite(_vm->_globals.ADR_FICHIER_OBJ, _vm->_globals.INVENTAIRE_OBJET, val2); + result = _vm->_globals.INVENTAIRE_OBJET; break; default: @@ -189,12 +189,12 @@ int ObjectsManager::sprite_alone(const byte *objectData, byte *sprite, int objIn } byte *ObjectsManager::DEL_FICHIER_OBJ() { - GLOBALS.NUM_FICHIER_OBJ = 0; - if (GLOBALS.ADR_FICHIER_OBJ != PTRNUL) - GLOBALS.ADR_FICHIER_OBJ = FileManager::LIBERE_FICHIER(GLOBALS.ADR_FICHIER_OBJ); + _vm->_globals.NUM_FICHIER_OBJ = 0; + if (_vm->_globals.ADR_FICHIER_OBJ != PTRNUL) + _vm->_globals.ADR_FICHIER_OBJ = FileManager::LIBERE_FICHIER(_vm->_globals.ADR_FICHIER_OBJ); byte *result = PTRNUL; - GLOBALS.ADR_FICHIER_OBJ = PTRNUL; + _vm->_globals.ADR_FICHIER_OBJ = PTRNUL; return result; } @@ -221,13 +221,13 @@ int ObjectsManager::AJOUTE_OBJET(int objIndex) { int arrIndex = 0; do { ++arrIndex; - if (!GLOBALS.INVENTAIRE[arrIndex]) + if (!_vm->_globals.INVENTAIRE[arrIndex]) flag = true; if (arrIndex == 32) flag = true; } while (!flag); - GLOBALS.INVENTAIRE[arrIndex] = objIndex; + _vm->_globals.INVENTAIRE[arrIndex] = objIndex; return arrIndex; } @@ -1675,7 +1675,109 @@ void ObjectsManager::SETFLIPSPR(int idx, int a2) { } void ObjectsManager::VERIFZONE() { - warning("VERIFZONE"); + __int16 v0; + int v1; + __int16 v2; + unsigned __int16 v3; + __int16 v4; + + v0 = _vm->_eventsManager.XMOUSE(); + v1 = _vm->_eventsManager.YMOUSE(); + v2 = v1; + if (_vm->_globals.PLAN_FLAG + || _vm->_eventsManager.start_x >= v0 + || (v1 = _vm->_graphicsManager.ofscroll + 54, v0 >= v1) + || (v1 = v2 - 1, (unsigned __int16)(v2 - 1) > 0x3Bu)) { + if (FLAG_VISIBLE == 1) + FLAG_VISIBLE_EFFACE = 4; + FLAG_VISIBLE = 0; + } else { + FLAG_VISIBLE = 1; + } + if (FORCEZONE == 1) { + _vm->_globals.compteur_71 = 100; + _vm->_globals.old_zone_68 = -1; + _vm->_globals.old_x_69 = -200; + _vm->_globals.old_y_70 = -220; + FORCEZONE = 0; + } + v3 = _vm->_globals.compteur_71 + 1; + _vm->_globals.compteur_71 = v3; + if (v3 > 1u) { + if (_vm->_globals.NOMARCHE || (_vm->_globals.chemin == PTRNUL) || v3 > 4u) { + _vm->_globals.compteur_71 = 0; + if (_vm->_globals.old_x_69 != v0 || _vm->_globals.old_y_70 != v2) { + v4 = MZONE(); + } else { + v4 = _vm->_globals.old_zone_68; + } + if (_vm->_globals.old_zone_68 != v4) { + _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); + _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager.CHANGE_MOUSE(4); + if (_vm->_globals.zozo_73 == 1) { + _vm->_fontManager.TEXTE_OFF(5); + _vm->_globals.zozo_73 = 0; + return; + } + if (_vm->_globals.old_zone_68 != v4) + goto LABEL_54; + } + if (v4 != -1) { +LABEL_54: + if (v4 != -1 + && ((_vm->_globals.ZONEP[v4].field6) + || _vm->_globals.ZONEP[v4].field7 + || _vm->_globals.ZONEP[v4].field8 + || _vm->_globals.ZONEP[v4].field9 + || _vm->_globals.ZONEP[v4].fieldA + || _vm->_globals.ZONEP[v4].fieldB + || _vm->_globals.ZONEP[v4].fieldC + || _vm->_globals.ZONEP[v4].fieldD + || _vm->_globals.ZONEP[v4].fieldE + || _vm->_globals.ZONEP[v4].fieldF)) { + if (_vm->_globals.old_zone_68 != v4) { + _vm->_fontManager.DOS_TEXT(5, _vm->_globals.ZONEP[v4].field12, _vm->_globals.FICH_ZONE, 0, 430, 20, 25, 0, 0, 252); + _vm->_fontManager.TEXTE_ON(5); + _vm->_globals.zozo_73 = 1; + } + _vm->_globals.force_to_data_0 += 25; + if (_vm->_globals.force_to_data_0 > 100) + _vm->_globals.force_to_data_0 = 0; + _vm->_graphicsManager.SETCOLOR4(251, _vm->_globals.force_to_data_0, _vm->_globals.force_to_data_0, + _vm->_globals.force_to_data_0); + if (_vm->_eventsManager.btsouris == 4) { + v1 = 5 * v4; + if (_vm->_globals.ZONEP[v4].field6 == 2) { + _vm->_eventsManager.CHANGE_MOUSE(16); + _vm->_eventsManager.btsouris = 16; + verbe = 16; + } + } + } else { + _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); + _vm->_eventsManager.btsouris = 4; + _vm->_eventsManager.CHANGE_MOUSE(4); + } + } + _vm->_objectsManager.NUMZONE = v4; + _vm->_globals.old_x_69 = v0; + _vm->_globals.old_y_70 = v2; + _vm->_globals.old_zone_68 = v4; + if (_vm->_globals.NOMARCHE == 1) { + if (_vm->_eventsManager.btsouris == 4) { + v1 = v4 + 1; + if ((unsigned __int16)(v4 + 1) > 1u) + BTDROITE(); + } + } + if (_vm->_globals.PLAN_FLAG == 1 && v4 == -1 || !v4) { + verbe = 0; + _vm->_eventsManager.btsouris = 0; + _vm->_eventsManager.CHANGE_MOUSE(0); + } + } + } } void ObjectsManager::GOHOME2() { @@ -1817,15 +1919,411 @@ void ObjectsManager::PLAN_BETA() { } void ObjectsManager::BTGAUCHE() { - warning("TODO: BTGAUCHE"); + int v0; + __int16 v1; + __int16 v2; + byte *v3; + byte *v4; + byte *v5; + int v6; + __int16 v7; + __int16 v8; + byte *v9; + __int16 v10; + __int16 v11; + __int16 v12; + byte *v13; + __int16 v14; + __int16 v15; + byte *v16; + __int16 v17; + __int16 v18; + __int16 v19; + + _vm->_fontManager.TEXTE_OFF(9); + v19 = _vm->_eventsManager.XMOUSE(); + v0 = _vm->_eventsManager.YMOUSE(); + if (!INVENTFLAG && !_vm->_globals.PLAN_FLAG && v19 > _vm->_graphicsManager.ofscroll - 30 && v19 < _vm->_graphicsManager.ofscroll + 50 && (uint16)(v0 + 29) <= 0x4Eu) { + v1 = _vm->_eventsManager.btsouris; + INVENTFLAG = 1; + INVENT(); + INVENTFLAG = 0; + KEY_INVENT = 0; + if (!_vm->_globals.SORTIE) { + INVENTFLAG = 0; + _vm->_eventsManager.btsouris = v1; + } + return; + } + if (_vm->_globals.SAUVEGARDE->field354 == 1 + && !_vm->_globals.PLAN_FLAG + && (uint16)(v19 - 533) <= 0x1Au + && (uint16)(v0 - 26) <= 0x21u) { + CHANGE_TETE(1, 0); + return; + } + if (_vm->_globals.SAUVEGARDE->field356 == 1 + && !_vm->_globals.PLAN_FLAG + && (uint16)(v19 - 533) <= 0x1Au + && (uint16)(v0 - 26) <= 0x21u) { + CHANGE_TETE(2, 0); + return; + } + if (_vm->_globals.SAUVEGARDE->field357 == 1) { + if (_vm->_globals.SAUVEGARDE->field353 == 1 + && !_vm->_globals.PLAN_FLAG + && (uint16)(v19 - 533) <= 0x1Au + && (uint16)(v0 - 26) <= 0x21u) { + CHANGE_TETE(0, 1); + return; + } + if (_vm->_globals.SAUVEGARDE->field355 == 1 + && !_vm->_globals.PLAN_FLAG + && (uint16)(v19 - 567) <= 0x1Au + && (uint16)(v0 - 26) <= 0x21u) { + CHANGE_TETE(0, 2); + return; + } + } + if (_vm->_globals.PLAN_FLAG == 1) { + if (GOACTION != 1) + goto LABEL_38; + VERIFZONE(); + if (NUMZONE <= 0) + return; + v2 = 0; + v3 = _vm->_globals.essai2; + v4 = _vm->_globals.chemin; + do { + WRITE_LE_UINT16(v3 + 2 * v2, READ_LE_UINT16(v4 + 2 * v2)); + ++v2; + } while ((int16)READ_LE_UINT16(v4 + 2 * v2) != -1); + v5 = _vm->_globals.essai2; + WRITE_LE_UINT16(_vm->_globals.essai2 + 2 * v2, (uint16)-1); + WRITE_LE_UINT16(v5 + 2 * v2 + 2, (uint16)-1); + WRITE_LE_UINT16(v5 + 2 * v2 + 4, (uint16)-1); + WRITE_LE_UINT16(v5 + 2 * v2 + 6, (uint16)-1); + } + if (GOACTION == 1) { + VERIFZONE(); + GOACTION = 0; + _vm->_globals.SAUVEGARDE->field1 = 0; + _vm->_globals.SAUVEGARDE->field2 = 0; + } +LABEL_38: + if (_vm->_globals.PLAN_FLAG == 1 && (_vm->_eventsManager.btsouris != 4 || NUMZONE <= 0)) + return; + if ((uint16)(NUMZONE + 1) > 1u) { + v6 = NUMZONE; + v7 = _vm->_globals.ZONEP[v6].field0; + if (v7) { + v8 = _vm->_globals.ZONEP[v6].field2; + if (v8) { + if (v8 != 31) { + v19 = v7; + v0 = v8; + } + } + } + } + GOACTION = 0; + v9 = _vm->_globals.chemin; + _vm->_globals.chemin = PTRNUL; + if (_vm->_globals.FORET && ((uint16)(NUMZONE - 20) <= 1u || (uint16)(NUMZONE - 22) <= 1u)) { + if ((signed __int16)YSPR(0) <= 374 || (signed __int16)YSPR(0) > 410) { + v10 = XSPR(0); + v11 = YSPR(0); + v12 = XSPR(0); + v13 = PARCOURS2(v12, v11, v10, 390); + _vm->_globals.chemin = v13; + if (PTRNUL != v13) + PACOURS_PROPRE(v13); + g_old_x = XSPR(0); + g_old_y = YSPR(0); + _vm->_globals.Compteur = 0; + if (PTRNUL != _vm->_globals.chemin || v9 == _vm->_globals.chemin) { +LABEL_64: + _vm->_globals.g_old_sens = -1; + goto LABEL_65; + } + goto LABEL_63; + } + _vm->_globals.chemin = PTRNUL; + SETANISPR(0, _vm->_globals.g_old_sens2 + 59); + _vm->_globals.ACTION_SENS = 0; + _vm->_globals.chemin = PTRNUL; + VERIFTAILLE(); + SETFLIPSPR(0, 0); + _vm->_globals.Compteur = 0; + _vm->_globals.g_old_sens = -1; + goto LABEL_65; + } + if (!_vm->_globals.NOMARCHE) { + if (!_vm->_globals.PLAN_FLAG) { + v14 = YSPR(0); + v15 = XSPR(0); + v16 = PARCOURS2(v15, v14, v19, v0); + _vm->_globals.chemin = v16; + if (PTRNUL != v16) + PACOURS_PROPRE(v16); + g_old_x = XSPR(0); + g_old_y = YSPR(0); + _vm->_globals.Compteur = 0; + if (PTRNUL != _vm->_globals.chemin || v9 == _vm->_globals.chemin) + goto LABEL_64; +LABEL_63: + _vm->_globals.chemin = v9; + } +LABEL_65: + if (!_vm->_globals.NOMARCHE && _vm->_globals.PLAN_FLAG == 1) { + v17 = YSPR(0); + v18 = XSPR(0); + _vm->_globals.chemin = PARC_VOITURE(v18, v17, v19, v0); + } + } + if ((uint16)(NUMZONE + 1) > 1u) { + // TODO: Reformat the weird if statement generated by the decompiler + if (_vm->_eventsManager.btsouris == 23 || (_vm->_globals.SAUVEGARDE->field1 = _vm->_eventsManager.btsouris, _vm->_eventsManager.btsouris == 23)) + _vm->_globals.SAUVEGARDE->field1 = 5; + if (_vm->_globals.PLAN_FLAG == 1) + _vm->_globals.SAUVEGARDE->field1 = 6; + _vm->_globals.SAUVEGARDE->field2 = NUMZONE; + _vm->_globals.SAUVEGARDE->field3 = _vm->_globals.OBJET_EN_COURS; + GOACTION = 1; + } + _vm->_fontManager.TEXTE_OFF(5); + _vm->_graphicsManager.SETCOLOR4(251, 100, 100, 100); + ARRET_PERSO_FLAG = 0; + if (_vm->_eventsManager.btsouris == 21 && _vm->_globals.BOBZONE[NUMZONE]) { + ARRET_PERSO_FLAG = 1; + ARRET_PERSO_NUM = _vm->_globals.BOBZONE[NUMZONE]; + } + if (_vm->_globals.ECRAN == 20 && _vm->_globals.SAUVEGARDE->field13 == 1 && _vm->_globals.OBJET_EN_COURS == 20 && NUMZONE == 12 + && _vm->_eventsManager.btsouris == 23) { + _vm->_globals.chemin = PTRNUL; + XSPR(0); + YSPR(0); + } } void ObjectsManager::PARADISE() { - warning("TODO: PARADISE"); + signed int v1; // esi@1 + char result; // al@1 + int v3; // eax@11 + unsigned __int16 v4; // ax@19 + int v5; // eax@24 + unsigned __int16 v6; // ax@33 + + v1 = 0; + ARRET_PERSO_FLAG = 0; + ARRET_PERSO_NUM = 0; + result = _vm->_globals.SAUVEGARDE->field1; + if (result && _vm->_globals.SAUVEGARDE->field2 && result != 4 && result > 3) { + _vm->_fontManager.TEXTE_OFF(5); + if (_vm->_globals.FORET != 1 || (unsigned __int16)(NUMZONE - 20) > 1u && (unsigned __int16)(NUMZONE - 22) > 1u) { + if (_vm->_graphicsManager.DOUBLE_ECRAN == 1) { + _vm->_graphicsManager.no_scroll = 2; + if (_vm->_eventsManager.start_x >= (signed __int16)XSPR(0) - 320) + goto LABEL_64; + v3 = _vm->_eventsManager.start_x + 320 - (signed __int16)XSPR(0); + if (v3 < 0) + v3 = -v3; + if (v3 <= 160) { +LABEL_64: + if (_vm->_eventsManager.start_x > (signed __int16)XSPR(0) - 320) { + v5 = _vm->_eventsManager.start_x + 320 - (signed __int16)XSPR(0); + if (v5 < 0) + v5 = -v5; + if (v5 > 160) { + _vm->_graphicsManager.no_scroll = 2; + do { + _vm->_graphicsManager.SCROLL -= _vm->_graphicsManager.SPEED_SCROLL; + if (_vm->_graphicsManager.SCROLL < 0) { + _vm->_graphicsManager.SCROLL = 0; + v1 = 1; + } + if (_vm->_graphicsManager.SCROLL > 640) { + _vm->_graphicsManager.SCROLL = 640; + v1 = 1; + } + if ((signed __int16)_vm->_eventsManager.XMOUSE() > _vm->_graphicsManager.SCROLL + 620) { + v6 = _vm->_eventsManager.YMOUSE(); + _vm->_eventsManager.souris_xy(_vm->_eventsManager.souris_x - 4, v6); + } + _vm->_eventsManager.VBL(); + } while (v1 != 1 && _vm->_eventsManager.start_x > (signed __int16)XSPR(0) - 320); + } + } + } else { + do { + _vm->_graphicsManager.SCROLL += _vm->_graphicsManager.SPEED_SCROLL; + if (_vm->_graphicsManager.SCROLL < 0) { + _vm->_graphicsManager.SCROLL = 0; + v1 = 1; + } + if (_vm->_graphicsManager.SCROLL > 640) { + _vm->_graphicsManager.SCROLL = 640; + v1 = 1; + } + if ((signed __int16)_vm->_eventsManager.XMOUSE() < _vm->_graphicsManager.SCROLL + 10) { + v4 = _vm->_eventsManager.YMOUSE(); + _vm->_eventsManager.souris_xy(_vm->_eventsManager.souris_x + 4, v4); + } + _vm->_eventsManager.VBL(); + } while (v1 != 1 && _vm->_eventsManager.start_x < (signed __int16)XSPR(0) - 320); + } + if ((signed __int16)_vm->_eventsManager.XMOUSE() > _vm->_graphicsManager.SCROLL + 620) + _vm->_eventsManager.souris_xy(_vm->_graphicsManager.SCROLL + 610, 0); + if ((signed __int16)_vm->_eventsManager.XMOUSE() < _vm->_graphicsManager.SCROLL + 10) + _vm->_eventsManager.souris_xy(_vm->_graphicsManager.SCROLL + 10, 0); + _vm->_eventsManager.VBL(); + _vm->_graphicsManager.no_scroll = 0; + } + _vm->_talkManager.REPONSE(_vm->_globals.SAUVEGARDE->field2, _vm->_globals.SAUVEGARDE->field1); + } else { + _vm->_talkManager.REPONSE2(_vm->_globals.SAUVEGARDE->field2, _vm->_globals.SAUVEGARDE->field1); + } + _vm->_eventsManager.CHANGE_MOUSE(4); + if ((unsigned __int16)(NUMZONE + 1) > 1u && !_vm->_globals.ZONEP[NUMZONE].field16) { + NUMZONE = -1; + FORCEZONE = 1; + } + if (NUMZONE != _vm->_globals.SAUVEGARDE->field2 || (unsigned __int16)(NUMZONE + 1) <= 1u) { + _vm->_eventsManager.btsouris = 4; + CHANGEVERBE = 0; + } else { + _vm->_eventsManager.btsouris = _vm->_globals.SAUVEGARDE->field1; + if (CHANGEVERBE == 1) { + VERBEPLUS(); + CHANGEVERBE = 0; + } + if (_vm->_eventsManager.btsouris == 5) + _vm->_eventsManager.btsouris = 4; + } + if (_vm->_eventsManager.btsouris != 23) + _vm->_eventsManager.CHANGE_MOUSE(_vm->_eventsManager.btsouris); + NUMZONE = 0; + _vm->_globals.SAUVEGARDE->field1 = 0; + _vm->_globals.SAUVEGARDE->field2 = 0; + } + if (_vm->_globals.PLAN_FLAG == 1) { + _vm->_eventsManager.btsouris = 0; + _vm->_eventsManager.CHANGE_MOUSE(0); + } + if (_vm->_globals.NOMARCHE == 1) { + if (_vm->_eventsManager.btsouris == 4) { + result = NUMZONE + 1; + if ((unsigned __int16)(NUMZONE + 1) > 1u) + BTDROITE(); + } + } + GOACTION = 0; } void ObjectsManager::CLEAR_ECRAN() { - warning("TODO: CLEAR_ECRAN"); + __int16 v1; + int v2; + + CLEAR_SPR(); + _vm->_graphicsManager.FIN_VISU(); + _vm->_fontManager.TEXTE_OFF(5); + _vm->_fontManager.TEXTE_OFF(9); + _vm->_globals.CLEAR_VBOB(); + _vm->_animationManager.CLEAR_ANIM(); + CLEAR_ZONE(); + RESET_OBSTACLE(); + _vm->_globals.RESET_CACHE(); + + v1 = 0; + do { + v2 = v1; + _vm->_globals.BOBZONE[v2] = 0; + _vm->_globals.BOBZONE_FLAG[v2] = 0; + ++v1; + } while (v1 <= 48); + _vm->_eventsManager.btsouris = 4; + verbe = 4; + NUMZONE = 0; + Vold_taille = 0; + SPEED_FLAG = 0; + SPEED_PTR = PTRNUL; + SPEED_X = 0; + SPEED_Y = 0; + SPEED_IMAGE = 0; + FORCEZONE = 1; + TOTAL_LIGNES = 0; + DERLIGNE = 0; + _vm->_globals.chemin = PTRNUL; + if (_vm->_globals.COUCOU != (void *)PTRNUL) + _vm->_globals.COUCOU = FileManager::LIBERE_FICHIER(_vm->_globals.COUCOU); + if ((void *)PTRNUL != _vm->_globals.SPRITE_ECRAN) + _vm->_globals.SPRITE_ECRAN = FileManager::LIBERE_FICHIER(_vm->_globals.SPRITE_ECRAN); + _vm->_eventsManager.start_x = 0; + _vm->_eventsManager.souris_n = 0; + Vold_taille = 200; + _vm->_globals.SAUVEGARDE->field1 = 0; + _vm->_globals.SAUVEGARDE->field2 = 0; + GOACTION = 0; + FORCEZONE = 1; + CHANGEVERBE = 0; + _vm->_globals.NOSPRECRAN = 0; + _vm->_globals.chemin = PTRNUL; + g_old_sens = -1; + my_anim = 1; + A_ANIM = 0; + MA_ANIM = 0; + MA_ANIM1 = 0; + A_DEPA = 0; + MAX_DEPA = 0; + MAX_DEPA1 = 0; + _vm->_graphicsManager.RESET_SEGMENT_VESA(); +} + +void ObjectsManager::INVENT() { + warning("TODO: INVENT"); +} + +void ObjectsManager::CHANGE_TETE(int a1, int a2) { + warning("TODO: CHANGE_TETE"); +} + +byte *ObjectsManager::PARCOURS2(int a1, int a2, int a3, int a4) { + warning("TODO: PARCOURS2"); + return NULL; +} + +void ObjectsManager::VERIFTAILLE() { + warning("TODO: VERIFTAILLE"); +} + +void ObjectsManager::PACOURS_PROPRE(byte *a1) { + warning("TODO: PACOURS_PROPRE"); +} + +byte *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) { + warning("TODO: PARC_VOITURE"); + return NULL; +} + +void ObjectsManager::VERBEPLUS() { + warning("TODO: VERBEPLUS"); +} + +void ObjectsManager::BTDROITE() { + warning("TODO: BTDROITE"); +} + +int ObjectsManager::MZONE() { + warning("TODO: MZONE"); + return 0; +} + +void ObjectsManager::CLEAR_ZONE() { + warning("TODO: CLEAR_ZONE"); +} + +void ObjectsManager::RESET_OBSTACLE() { + warning("TODO: CLEAR_ZONE"); } } // End of namespace Hopkins diff --git a/engines/hopkins/objects.h b/engines/hopkins/objects.h index d17764881b..009be78fb8 100644 --- a/engines/hopkins/objects.h +++ b/engines/hopkins/objects.h @@ -68,6 +68,7 @@ public: int cadx, cady, cadi; int SL_X, SL_Y; int I_old_x, I_old_y; + int g_old_x, g_old_y; int FLAG_VISIBLE_EFFACE; byte *Winventaire; byte *inventaire2; @@ -84,6 +85,28 @@ public: bool INVENTFLAG; int KEY_INVENT; int my_anim; + int GOACTION; + int NUMZONE; + int ARRET_PERSO_FLAG; + int ARRET_PERSO_NUM; + int FORCEZONE; + int CHANGEVERBE; + int verbe; + int Vold_taille; + int TOTAL_LIGNES; + bool SPEED_FLAG; + int SPEED_X, SPEED_Y; + int SPEED_IMAGE; + byte *SPEED_PTR; + int DERLIGNE; + int g_old_sens; + int A_ANIM; + int MA_ANIM; + int MA_ANIM1; + int A_DEPA; + int MAX_DEPA; + int MAX_DEPA1; + public: ObjectsManager(); void setParent(HopkinsEngine *vm); @@ -151,6 +174,18 @@ public: void BTGAUCHE(); void PARADISE(); void CLEAR_ECRAN(); + + void INVENT(); + void CHANGE_TETE(int a1, int a2); + byte *PARCOURS2(int a1, int a2, int a3, int a4); + void VERIFTAILLE(); + void PACOURS_PROPRE(byte *a1); + byte *PARC_VOITURE(int a1, int a2, int a3, int a4); + void VERBEPLUS(); + void BTDROITE(); + int MZONE(); + void CLEAR_ZONE(); + void RESET_OBSTACLE(); }; } // End of namespace Hopkins diff --git a/engines/hopkins/talk.cpp b/engines/hopkins/talk.cpp index 12a8b83b76..49ad99971a 100644 --- a/engines/hopkins/talk.cpp +++ b/engines/hopkins/talk.cpp @@ -933,4 +933,13 @@ bool TalkManager::RECHERCHE_ANIM_PERSO(int a1, const byte *bufPerso, int a3, int return result; } +void TalkManager::REPONSE(int a1, int a2) { + warning("TODO: RESPONSE"); +} + +void TalkManager::REPONSE2(int a1, int a2) { + warning("TODO: RESPONSE2"); +} + + } // End of namespace Hopkins diff --git a/engines/hopkins/talk.h b/engines/hopkins/talk.h index cb97a02e0c..97795d8d1f 100644 --- a/engines/hopkins/talk.h +++ b/engines/hopkins/talk.h @@ -64,6 +64,8 @@ public: void ANIM_PERSO_INIT(); void CLEAR_ANIM_PERSO(); bool RECHERCHE_ANIM_PERSO(int a1, const byte *a2, int a3, int a4); + void REPONSE(int a1, int a2); + void REPONSE2(int a1, int a2); }; } // End of namespace Hopkins |