diff options
Diffstat (limited to 'engines/hopkins/objects.cpp')
-rw-r--r-- | engines/hopkins/objects.cpp | 608 |
1 files changed, 462 insertions, 146 deletions
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp index 170692d9e4..b943def1bd 100644 --- a/engines/hopkins/objects.cpp +++ b/engines/hopkins/objects.cpp @@ -233,17 +233,17 @@ int ObjectsManager::AJOUTE_OBJET(int objIndex) { void ObjectsManager::AFF_SPRITES() { int v0; - __int16 v1; - __int16 v2; - __int16 destX; - __int16 destY; + int v1; + int v2; + int destX; + int destY; int v5; - __int16 v6; - __int16 v7; - __int16 v8; - __int16 v9; + int v6; + int v7; + int v8; + int v9; int v10; - __int16 v11; + int v11; uint16 *v12; int v13; int v14; @@ -252,24 +252,24 @@ void ObjectsManager::AFF_SPRITES() { int v17; int v18; int v19; - __int16 v20; - __int16 v21; - __int16 v23; - __int16 v24; - __int16 v25; - __int16 v26; - __int16 v27; - __int16 v28; - __int16 v29; - __int16 v30; - __int16 v31; - __int16 v32; - __int16 v33; - signed __int16 v34; - signed __int16 v35; - signed __int16 v36; - __int16 v37; - __int16 v38; + int v20; + int v21; + int v23; + int v24; + int v25; + int v26; + int v27; + int v28; + int v29; + int v30; + int v31; + int v32; + int v33; + signed int v34; + signed int v35; + signed int v36; + int v37; + int v38; uint16 arr[50]; _vm->_globals.NBTRI = 0; @@ -323,8 +323,9 @@ void ObjectsManager::AFF_SPRITES() { if (v9 < _vm->_graphicsManager.min_y) v9 = _vm->_graphicsManager.min_y; - _vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, v29, v24, _vm->_globals.Liste[v31].x2 + 4, - _vm->_globals.Liste[v31].y2 + 4, _vm->_graphicsManager.VESA_BUFFER, v8, v9); + _vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, v29, v24, + _vm->_globals.Liste[v31].width + 4, _vm->_globals.Liste[v31].height + 4, + _vm->_graphicsManager.VESA_BUFFER, v8, v9); _vm->_globals.Liste[v5].field0 = 0; } ++v31; @@ -544,23 +545,23 @@ void ObjectsManager::BOB_ZERO(int idx) { item.field0 = 0; item.field2 = 0; item.field4 = 0; - item.field6 = 0; - item.field8 = 0; + item.width = 0; + item.height = 0; } void ObjectsManager::DEF_BOB(int idx) { int v2; int v3; int v4; - __int16 v5; - __int16 v6; - __int16 v7; - __int16 v8; - __int16 v9; - __int16 v10; + int v5; + int v6; + int v7; + int v8; + int v9; + int v10; int v11; - __int16 v12; - __int16 v13; + int v12; + int v13; v2 = idx; if (_vm->_globals.Bob[v2].field40) { @@ -582,31 +583,31 @@ void ObjectsManager::DEF_BOB(int idx) { _vm->_globals.Liste2[v3].field4 = v13; v4 = idx; - _vm->_globals.Liste2[v3].field6 = _vm->_globals.Bob[v4].field46; - _vm->_globals.Liste2[v3].field8 = _vm->_globals.Bob[v4].field48; + _vm->_globals.Liste2[v3].width = _vm->_globals.Bob[v4].field46; + _vm->_globals.Liste2[v3].height = _vm->_globals.Bob[v4].field48; v5 = _vm->_globals.Liste2[v3].field2; v6 = _vm->_graphicsManager.min_x; if (v5 < _vm->_graphicsManager.min_x) { - _vm->_globals.Liste2[v3].field6 -= _vm->_graphicsManager.min_x - v5; + _vm->_globals.Liste2[v3].width -= _vm->_graphicsManager.min_x - v5; _vm->_globals.Liste2[v3].field2 = v6; } v7 = _vm->_globals.Liste2[v3].field4; v8 = _vm->_graphicsManager.min_y; if (v7 < _vm->_graphicsManager.min_y) { - _vm->_globals.Liste2[v3].field8 -= _vm->_graphicsManager.min_y - v7; + _vm->_globals.Liste2[v3].height -= _vm->_graphicsManager.min_y - v7; _vm->_globals.Liste2[v3].field4 = v8; } v9 = _vm->_globals.Liste2[v3].field2; - if (_vm->_globals.Liste2[v3].field6 + v9 > _vm->_graphicsManager.max_x) - _vm->_globals.Liste2[v3].field6 = _vm->_graphicsManager.max_x - v9; + if (_vm->_globals.Liste2[v3].width + v9 > _vm->_graphicsManager.max_x) + _vm->_globals.Liste2[v3].width = _vm->_graphicsManager.max_x - v9; v10 = _vm->_globals.Liste2[v3].field4; - if (_vm->_globals.Liste2[v3].field8 + v10 > _vm->_graphicsManager.max_y) - _vm->_globals.Liste2[v3].field8 = _vm->_graphicsManager.max_y - v10; + if (_vm->_globals.Liste2[v3].height + v10 > _vm->_graphicsManager.max_y) + _vm->_globals.Liste2[v3].height = _vm->_graphicsManager.max_y - v10; - if (_vm->_globals.Liste2[v3].field6 <= 0 || _vm->_globals.Liste2[v3].field8 <= 0) + if (_vm->_globals.Liste2[v3].width <= 0 || _vm->_globals.Liste2[v3].height <= 0) _vm->_globals.Liste2[v3].field0 = 0; v11 = idx; @@ -614,8 +615,8 @@ void ObjectsManager::DEF_BOB(int idx) { _vm->_graphicsManager.Ajoute_Segment_Vesa( _vm->_globals.Liste2[v11].field2, _vm->_globals.Liste2[v11].field4, - _vm->_globals.Liste2[v11].field2 + _vm->_globals.Liste2[v11].field6, - _vm->_globals.Liste2[v11].field4 + _vm->_globals.Liste2[v11].field8); + _vm->_globals.Liste2[v11].field2 + _vm->_globals.Liste2[v11].width, + _vm->_globals.Liste2[v11].field4 + _vm->_globals.Liste2[v11].height); } } @@ -677,13 +678,13 @@ void ObjectsManager::BOB_OFF(int idx) { void ObjectsManager::SCBOB(int idx) { int v1; - signed __int16 v2; - signed __int16 v3; - signed __int16 v4; - signed __int16 v6; - signed __int16 v7; - __int16 v8; - signed __int16 v9; + signed int v2; + signed int v3; + signed int v4; + signed int v6; + signed int v7; + int v8; + signed int v9; v1 = idx; if (_vm->_globals.Cache[idx].fieldA > 0) { @@ -703,9 +704,9 @@ void ObjectsManager::SCBOB(int idx) { v1 =_vm->_globals.Cache[idx].field14 +_vm->_globals.Cache[idx].field8 + v4; if (v6 > v4) { - if (v6 < (signed __int16)v1) { + if (v6 < (signed int)v1) { v1 = 0; - if (v9 >= v3 && v9 <= (signed __int16)(_vm->_globals.Cache[idx].field6 + v3)) { + if (v9 >= v3 && v9 <= (signed int)(_vm->_globals.Cache[idx].field6 + v3)) { ++_vm->_globals.Cache[idx].fieldA; v1 = 1; } @@ -742,23 +743,23 @@ void ObjectsManager::SCBOB(int idx) { } void ObjectsManager::CALCUL_BOB(int idx) { - __int16 result; - __int16 v3; - __int16 v4; - __int16 v5; - __int16 v6; + int result; + int v3; + int v4; + int v5; + int v6; int v7; int v8; int v9; int v10; int v11; - __int16 v13; - __int16 v14; - __int16 v15; - __int16 v17; - signed __int16 v20; - __int16 v21; - __int16 v22; + int v13; + int v14; + int v15; + int v17; + signed int v20; + int v21; + int v22; _vm->_globals.Bob[idx].field3C = 0; if (_vm->_globals.Bob[idx].field3A == 1) { @@ -786,12 +787,12 @@ void ObjectsManager::CALCUL_BOB(int idx) { v20 = 0; v7 = _vm->_globals.Bob[idx].field36; - if ((signed __int16)v7 < 0) { - v7 = (signed __int16)v7; - if ((signed __int16)v7 < 0) + if ((signed int)v7 < 0) { + v7 = (signed int)v7; + if ((signed int)v7 < 0) v7 = -v7; v20 = v7; - if ((signed __int16)v7 > 95) + if ((signed int)v7 > 95) v20 = 95; } if (_vm->_globals.Bob[idx].field36 > 0) @@ -804,7 +805,7 @@ void ObjectsManager::CALCUL_BOB(int idx) { if (v15 < 0) v8 = -v15; v15 = v8; - v22 = -(signed __int16)_vm->_graphicsManager.Reel_Zoom((signed __int16)v8, v21); + v22 = -(signed int)_vm->_graphicsManager.Reel_Zoom((signed int)v8, v21); } if (v6 >= 0) { v17 = _vm->_graphicsManager.Reel_Zoom(v6, v21); @@ -813,7 +814,7 @@ void ObjectsManager::CALCUL_BOB(int idx) { if (v15 < 0) v9 = -v15; v6 = v9; - v17 = -(signed __int16)_vm->_graphicsManager.Reel_Zoom((signed __int16)v9, v21); + v17 = -(signed int)_vm->_graphicsManager.Reel_Zoom((signed int)v9, v21); } } @@ -825,7 +826,7 @@ void ObjectsManager::CALCUL_BOB(int idx) { if (v15 < 0) v10 = -v15; v15 = v10; - v22 = -(signed __int16)_vm->_graphicsManager.Reel_Reduc((signed __int16)v10, v20); + v22 = -(signed int)_vm->_graphicsManager.Reel_Reduc((signed int)v10, v20); } if (v6 >= 0) { v17 = _vm->_graphicsManager.Reel_Reduc(v6, v20); @@ -833,7 +834,7 @@ void ObjectsManager::CALCUL_BOB(int idx) { v11 = v15; if (v15 < 0) v11 = -v15; - v17 = -(signed __int16)_vm->_graphicsManager.Reel_Reduc((signed __int16)v11, v20); + v17 = -(signed int)_vm->_graphicsManager.Reel_Reduc((signed int)v11, v20); } } @@ -862,25 +863,25 @@ void ObjectsManager::CALCUL_BOB(int idx) { width = _vm->_graphicsManager.Reel_Reduc(width, v20); } - _vm->_globals.Liste2[idx].field6 = width; - _vm->_globals.Liste2[idx].field8 = height; + _vm->_globals.Liste2[idx].width = width; + _vm->_globals.Liste2[idx].height = height; _vm->_globals.Bob[idx].field42 = width; _vm->_globals.Bob[idx].field44 = height; } } void ObjectsManager::VERIFCACHE() { - __int16 v1; - signed __int16 v2; - signed __int16 v3; - signed __int16 v4; - __int16 v5; - __int16 v6; - __int16 v7; - __int16 v8; - __int16 v9; - __int16 v10; - __int16 v11; + int v1; + signed int v2; + signed int v3; + signed int v4; + int v5; + int v6; + int v7; + int v8; + int v9; + int v10; + int v11; v8 = 0; do { @@ -954,7 +955,7 @@ void ObjectsManager::VERIFCACHE() { } void ObjectsManager::INVENT_ANIM() { - __int16 v0; + int v0; signed int v1; if (!DESACTIVE_INVENT) { @@ -1001,16 +1002,16 @@ void ObjectsManager::INVENT_ANIM() { void ObjectsManager::DEF_SPRITE(int idx) { int v2; - __int16 v3; - __int16 v4; + int v3; + int v4; int v5; int v6; - __int16 v7; - __int16 v8; - __int16 v9; - __int16 v10; - __int16 v11; - __int16 v12; + int v7; + int v8; + int v9; + int v10; + int v11; + int v12; int v13; v2 = idx; @@ -1026,29 +1027,29 @@ void ObjectsManager::DEF_SPRITE(int idx) { v5 = idx; v6 = idx; - _vm->_globals.Liste[v5].x2 = Sprite[v6].field30; - _vm->_globals.Liste[v5].y2 = Sprite[v6].field32; + _vm->_globals.Liste[v5].width = Sprite[v6].field30; + _vm->_globals.Liste[v5].height = Sprite[v6].field32; v7 = _vm->_globals.Liste[v5].field2; v8 = _vm->_graphicsManager.min_x; if (v7 < _vm->_graphicsManager.min_x) { - _vm->_globals.Liste[v5].x2 -= _vm->_graphicsManager.min_x - v7; + _vm->_globals.Liste[v5].width -= _vm->_graphicsManager.min_x - v7; _vm->_globals.Liste[v5].field2 = v8; } v9 = _vm->_globals.Liste[v5].field4; v10 = _vm->_graphicsManager.min_y; if (v9 < _vm->_graphicsManager.min_y) { - _vm->_globals.Liste[v5].y2 -= _vm->_graphicsManager.min_y - v9; + _vm->_globals.Liste[v5].height -= _vm->_graphicsManager.min_y - v9; _vm->_globals.Liste[v5].field4 = v10; } v11 = _vm->_globals.Liste[v5].field2; - if (_vm->_globals.Liste[v5].x2 + v11 > _vm->_graphicsManager.max_x) - _vm->_globals.Liste[v5].x2 = _vm->_graphicsManager.max_x - v11; + if (_vm->_globals.Liste[v5].width + v11 > _vm->_graphicsManager.max_x) + _vm->_globals.Liste[v5].width = _vm->_graphicsManager.max_x - v11; v12 = _vm->_globals.Liste[v5].field4; - if ( _vm->_globals.Liste[v5].y2 + v12 > _vm->_graphicsManager.max_y) - _vm->_globals.Liste[v5].y2 = _vm->_graphicsManager.max_y - v12; - if ( _vm->_globals.Liste[v5].x2 <= 0 || _vm->_globals.Liste[v5].y2 <= 0) + if ( _vm->_globals.Liste[v5].height + v12 > _vm->_graphicsManager.max_y) + _vm->_globals.Liste[v5].height = _vm->_graphicsManager.max_y - v12; + if ( _vm->_globals.Liste[v5].width <= 0 || _vm->_globals.Liste[v5].height <= 0) _vm->_globals.Liste[v5].field0 = 0; v13 = idx; @@ -1056,8 +1057,8 @@ void ObjectsManager::DEF_SPRITE(int idx) { _vm->_graphicsManager.Ajoute_Segment_Vesa( _vm->_globals.Liste[v13].field2, _vm->_globals.Liste[v13].field4, - _vm->_globals.Liste[v13].field2 + _vm->_globals.Liste[v13].x2, - _vm->_globals.Liste[v13].field4 + _vm->_globals.Liste[v13].y2); + _vm->_globals.Liste[v13].field2 + _vm->_globals.Liste[v13].width, + _vm->_globals.Liste[v13].field4 + _vm->_globals.Liste[v13].height); } } @@ -1074,21 +1075,21 @@ void ObjectsManager::DEF_CACHE(int idx) { void ObjectsManager::CALCUL_SPRITE(int idx) { int width, height; - __int16 v3; - __int16 v4; - __int16 v5; - __int16 v6; - __int16 v7; - __int16 v8; + int v3; + int v4; + int v5; + int v6; + int v7; + int v8; int v9; int v10; int v11; int v12; int v13; - __int16 v15; - __int16 v16; + int v15; + int v16; int v17; - __int16 v22; + int v22; Sprite[idx + 42].field2A = 0; int v0 = Sprite[idx].field10; @@ -1112,12 +1113,12 @@ void ObjectsManager::CALCUL_SPRITE(int idx) { int reducePercent = 0; v9 = Sprite[idx].fieldC; - if ((signed __int16)v9 < 0) { - v9 = (signed __int16)v9; - if ((signed __int16)v9 < 0) + if ((signed int)v9 < 0) { + v9 = (signed int)v9; + if ((signed int)v9 < 0) v9 = -v9; reducePercent = v9; - if ((signed __int16)v9 > 95) + if ((signed int)v9 > 95) reducePercent = 95; } if (Sprite[idx].fieldC > 0) @@ -1132,7 +1133,7 @@ void ObjectsManager::CALCUL_SPRITE(int idx) { if (v4 < 0) v10 = -v4; v4 = v10; - v22 = -_vm->_graphicsManager.Reel_Zoom((signed __int16)v10, zoomPercent); + v22 = -_vm->_graphicsManager.Reel_Zoom((signed int)v10, zoomPercent); } if (v8 >= 0) { @@ -1142,7 +1143,7 @@ void ObjectsManager::CALCUL_SPRITE(int idx) { if (v4 < 0) v11 = -v4; v8 = v11; - v7 = -_vm->_graphicsManager.Reel_Zoom((signed __int16)v11, zoomPercent); + v7 = -_vm->_graphicsManager.Reel_Zoom((signed int)v11, zoomPercent); } } if (reducePercent) { @@ -1153,7 +1154,7 @@ void ObjectsManager::CALCUL_SPRITE(int idx) { if (v4 < 0) v12 = -v4; v4 = v12; - v22 = -_vm->_graphicsManager.Reel_Reduc((signed __int16)v12, reducePercent); + v22 = -_vm->_graphicsManager.Reel_Reduc((signed int)v12, reducePercent); } if (v8 >= 0) { v7 = _vm->_graphicsManager.Reel_Reduc(v8, reducePercent); @@ -1161,7 +1162,7 @@ void ObjectsManager::CALCUL_SPRITE(int idx) { v13 = v4; if (v4 < 0) v13 = -v4; - v7 = -_vm->_graphicsManager.Reel_Reduc((signed __int16)v13, reducePercent); + v7 = -_vm->_graphicsManager.Reel_Reduc((signed int)v13, reducePercent); } } @@ -1212,25 +1213,25 @@ int ObjectsManager::AvantTri(int a1, int a2, int a3) { void ObjectsManager::AFF_BOB_ANIM() { signed int v1; - __int16 v2; - signed __int16 v5; - __int16 v6; - __int16 v7; - __int16 v8; - signed __int16 v10; - __int16 v11; + int v2; + signed int v5; + int v6; + int v7; + int v8; + signed int v10; + int v11; int v12; int v13; - __int16 v14; + int v14; int v18; int v19; byte *v20; byte *v21; int v22; - __int16 v24; - __int16 v26; - __int16 v27; - __int16 v28; + int v24; + int v26; + int v27; + int v28; int idx = 0; do { @@ -1265,7 +1266,7 @@ void ObjectsManager::AFF_BOB_ANIM() { if (_vm->_globals.BL_ANIM[idx].v1 == 1) _vm->_globals.Bob[idx].field8 = _vm->_globals.BL_ANIM[idx].v2; if ( PERSO_ON == 1 && idx > 20 ) - _vm->_globals.Bob[idx].field8 += _vm->_graphicsManager.start_x; + _vm->_globals.Bob[idx].field8 += _vm->_eventsManager.start_x; _vm->_globals.Bob[idx].fieldA = READ_LE_UINT16(v20 + 2 * v24 + 2); _vm->_globals.Bob[idx].field12 = READ_LE_UINT16(v20 + 2 * v24 + 4); @@ -1284,7 +1285,7 @@ LABEL_37: LABEL_38: v12 = idx; - if ((unsigned __int16)(_vm->_globals.Bob[v12].field1E - 1) <= 1u) + if ((unsigned int)(_vm->_globals.Bob[v12].field1E - 1) <= 1u) _vm->_globals.Bob[v12].field1C = 1; continue; } @@ -1306,7 +1307,7 @@ LABEL_38: if (_vm->_globals.BL_ANIM[idx].v1 == 1) _vm->_globals.Bob[idx].field8 = _vm->_globals.BL_ANIM[idx].v2; if (PERSO_ON == 1 && idx > 20) - _vm->_globals.Bob[idx].field8 += _vm->_graphicsManager.start_x; + _vm->_globals.Bob[idx].field8 += _vm->_eventsManager.start_x; _vm->_globals.Bob[idx].fieldA = READ_LE_UINT16(v21 + 2); _vm->_globals.Bob[idx].field12 = READ_LE_UINT16(v21 + 4); @@ -1354,7 +1355,7 @@ LABEL_38: if (_vm->_globals.Liste2[v27].field0) { _vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, _vm->_globals.Liste2[v27].field2, _vm->_globals.Liste2[v27].field4, - _vm->_globals.Liste2[v27].field6, _vm->_globals.Liste2[v27].field8, + _vm->_globals.Liste2[v27].width, _vm->_globals.Liste2[v27].height, _vm->_graphicsManager.VESA_BUFFER, _vm->_globals.Liste2[v27].field2, _vm->_globals.Liste2[v27].field4); _vm->_globals.Liste2[v27].field0 = 0; @@ -1369,7 +1370,7 @@ LABEL_38: if (_vm->_globals.Liste2[v27].field0) { _vm->_graphicsManager.SCOPY(_vm->_graphicsManager.VESA_SCREEN, _vm->_globals.Liste2[v27].field2, _vm->_globals.Liste2[v27].field4, - _vm->_globals.Liste2[v27].field6, _vm->_globals.Liste2[v27].field8, + _vm->_globals.Liste2[v27].width, _vm->_globals.Liste2[v27].height, _vm->_graphicsManager.VESA_BUFFER, _vm->_globals.Liste2[v27].field2, _vm->_globals.Liste2[v27].field4); _vm->_globals.Liste2[v27].field0 = 0; @@ -1512,4 +1513,319 @@ void ObjectsManager::AFF_VBOB() { } while ( idx <= 29 ); } +int ObjectsManager::XSPR(int idx) { + if (idx > 5) + error("request of the Coord. x a sprite > MAX_SPRITE."); + return Sprite[idx].field8; +} + +int ObjectsManager::YSPR(int idx) { + if (idx > 5) + error("request of the Coord. y a sprite > MAX_SPRITE."); + return Sprite[idx].fieldA; +} + +void ObjectsManager::SPRITE_NOW(const byte *spriteData, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { + _vm->_graphicsManager.Affiche_Perfect(_vm->_graphicsManager.VESA_BUFFER, spriteData, a2, a3, a5, a6, a7, a8); +} + +void ObjectsManager::CLEAR_SPR() { + int idx; + + idx = 0; + do { + Sprite[idx].field1C = PTRNUL; + Sprite[idx].spriteData = PTRNUL; + Sprite[idx].field0 = 0; + ++idx; + } while (idx <= 4); + + idx = 0; + do { + _vm->_globals.Liste[idx].field0 = 0; + _vm->_globals.Liste[idx].field2 = 0; + _vm->_globals.Liste[idx].field4 = 0; + _vm->_globals.Liste[idx].width = 0; + _vm->_globals.Liste[idx].height = 0; + _vm->_globals.Liste[idx].fieldA = 0; + ++idx; + } while (idx <= 4); +} + +void ObjectsManager::SPRITE_ON(int idx) { + if (idx > 5) + error("Tentative d'affichage d'un sprite > MAX_SPRITE."); + + Sprite[idx].field0 = 1; +} + +void ObjectsManager::SPRITE(const byte *spriteData, int a2, int a3, int idx, int a5, int a6, int a7, int a8, int a9) { + if (idx > 5 ) + (8, (int)"Tentative d'affichage d'un sprite > MAX_SPRITE."); + Sprite[idx].spriteData = spriteData; + Sprite[idx].field8 = a2; + Sprite[idx].fieldA = a3; + Sprite[idx].field10 = a5; + Sprite[idx].fieldC = a6; + Sprite[idx].field12 = a8; + Sprite[idx].field14 = a9; + Sprite[idx].field1C = PTRNUL; + Sprite[idx].field20 = 0; + Sprite[idx].field24 = 0; + Sprite[idx].field26 = 0; + Sprite[idx].field22 = 0; + Sprite[idx].field0 = 0; + Sprite[idx].field28 = 0; + Sprite[idx].fieldE = a7; + if (*spriteData == 'R' && *(spriteData + 1) == 'L' && *(spriteData + 2) == 'E') + Sprite[idx].field28 = 1; + + if (Sprite[idx].field28 == 1) { + Sprite[idx].fieldC = 0; + Sprite[idx].fieldE = 0; + } +} + +void ObjectsManager::SPRITE2(const byte *spriteData, int idx, byte *a3, int a4, int a5) { + Sprite[idx].spriteData = spriteData; + Sprite[idx].field1C = a3; + Sprite[idx].field20 = a4; + Sprite[idx].field24 = 0; + Sprite[idx].field26 = 0; + Sprite[idx].fieldC = 0; + Sprite[idx].fieldE = 0; + Sprite[idx].field0 = 1; + Sprite[idx].field22 = 0; + Sprite[idx].field14 = a5; + if (*spriteData == 'R' && *(spriteData + 1) == 'L' && *(spriteData + 2) == 'E') + Sprite[idx].field28 = 1; + + if (Sprite[idx].field28 == 1) { + Sprite[idx].fieldC = 0; + Sprite[idx].fieldE = 0; + } +} + +void ObjectsManager::SPRITE_OFF(int idx) { + Sprite[idx].field0 = 3; + if (Sprite[idx].field1C != PTRNUL) + _vm->_globals.dos_free2(Sprite[idx].field1C); + Sprite[idx].field1C = PTRNUL; +} + +void ObjectsManager::SPRITE_GEL(int idx) { + Sprite[idx].field0 = 3; +} + +int ObjectsManager::SXSPR(int idx) { + if (idx > 5) + error("request of the size of a sprite x > MAX_SPRITE."); + return Get_Largeur(Sprite[idx].spriteData, Sprite[idx].field10); +} + +int ObjectsManager::SYSPR(int idx) { + if (idx > 5) + error("request of the size of a sprite y > MAX_SPRITE."); + return Get_Hauteur(Sprite[idx].spriteData, Sprite[idx].field10); +} + +int ObjectsManager::POSISPR(int idx) { + return Sprite[idx].field22 / 6; +} + +void ObjectsManager::SETPOSISPR(int idx, int a2) { + Sprite[idx].field22 = 6 * a2; + Sprite[idx].field24 = 0; + Sprite[idx].field26 = 0; +} + +void ObjectsManager::SETXSPR(int idx, int xp) { + if (idx > 5) + error("Set the Coord. x a sprite> MAX_SPRITE."); + Sprite[idx].field8 = xp; +} + +void ObjectsManager::SETANISPR(int idx, int a2) { + if (idx > 5) + error("Set the Coord. x a sprite> MAX_SPRITE."); + + Sprite[idx].field10 = a2; +} + +void ObjectsManager::SETYSPR(int idx, int yp) { + if ( idx > 5 ) + error("Set the Coord. y a sprite> MAX_SPRITE."); + Sprite[idx].fieldA = yp; +} + +void ObjectsManager::SETTAILLESPR(int idx, int a2) { + if (idx > 5) + error("Set the Coord. there a sprite> MAX_SPRITE."); + + if (Sprite[idx].field28 != 1) + Sprite[idx].fieldC = a2; +} + +void ObjectsManager::SETFLIPSPR(int idx, int a2) { + if (Sprite[idx].field28 != 1) { + if (idx > 5) + error("Set the Coord. there a sprite> MAX_SPRITE."); + Sprite[idx].fieldE = a2; + } +} + +void ObjectsManager::VERIFZONE() { + warning("VERIFZONE"); +} + +void ObjectsManager::GOHOME2() { + warning("GOHOME2"); +} + +void ObjectsManager::CHARGE_OBSTACLE(const Common::String &file) { + warning("CHARGE_OBSTACLE"); +} + +void ObjectsManager::CHARGE_CACHE(const Common::String &file) { + warning("CHARGE_CACHE"); +} + +void ObjectsManager::CHARGE_ZONE(const Common::String &file) { + warning("CHARGE_ZONE"); +} + +void ObjectsManager::PLAN_BETA() { + int v1; + int v2; + int v3; + int v4; + int v5; + + v1 = 0; + INVENTFLAG = false; + KEY_INVENT = 0; + _vm->_globals.Max_Propre = 1; + _vm->_globals.Max_Ligne_Long = 1; + _vm->_globals.Max_Propre_Gen = 1; + _vm->_globals.Max_Perso_Y = 440; + _vm->_globals.NOSPRECRAN = 1; + _vm->_globals.PLAN_FLAG = 1; + _vm->_graphicsManager.NOFADE = false; + _vm->_globals.NOMARCHE = 0; + sprite_ptr = PTRNUL; + _vm->_globals.SORTIE = 0; + _vm->_globals.AFFLI = 0; + _vm->_globals.AFFIVBL = 0; + _vm->_globals.NOT_VERIF = 1; + _vm->_soundManager.WSOUND(31); + _vm->_globals.iRegul = 1; + _vm->_graphicsManager.LOAD_IMAGE("PLAN"); + CHARGE_OBSTACLE("PLAN.OB2"); + CHARGE_CACHE("PLAN.CA2"); + CHARGE_ZONE("PLAN.ZO2"); + FileManager::CONSTRUIT_SYSTEM("VOITURE.SPR"); + sprite_ptr = FileManager::CHARGE_FICHIER(_vm->_globals.NFICHIER); + _vm->_animationManager.CHARGE_ANIM("PLAN"); + _vm->_graphicsManager.VISU_ALL(); + _vm->_graphicsManager.INI_ECRAN2("PLAN"); + v2 = 0; + do { + _vm->_globals.B_CACHE_OFF(v2++); + } while (v2 <= 15); + _vm->_globals.B_CACHE_OFF(19); + _vm->_globals.B_CACHE_OFF(20); + _vm->_globals.CACHE_ON(); + + if (!_vm->_globals.PLANX && !_vm->_globals.PLANY) { + _vm->_globals.PLANX = 900; + _vm->_globals.PLANY = 319; + _vm->_globals.PLANI = 1; + } + SPRITE(sprite_ptr, _vm->_globals.PLANX, _vm->_globals.PLANY, 0, _vm->_globals.PLANI, 0, 0, 5, 5); + _vm->_eventsManager.souris_xy(_vm->_globals.PLANX, _vm->_globals.PLANY); + my_anim = 0; + _vm->_eventsManager.MOUSE_ON(); + v3 = XSPR(0); + _vm->_graphicsManager.SCROLL_ECRAN(v3 - 320); + _vm->_graphicsManager.ofscroll = XSPR(0) - 320; + SPRITE_ON(0); + _vm->_globals.chemin = PTRNUL; + _vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100); + _vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100); + _vm->_graphicsManager.SETCOLOR3(251, 100, 100, 100); + _vm->_graphicsManager.SETCOLOR3(254, 0, 0, 0); + _vm->_globals.BPP_NOAFF = 1; + + v4 = 0; + do { + _vm->_eventsManager.VBL(); + ++v4; + } while (v4 <= 4); + + _vm->_globals.BPP_NOAFF = 0; + _vm->_globals.iRegul = 1; + _vm->_graphicsManager.FADE_INW(); + _vm->_eventsManager.CHANGE_MOUSE(4); + _vm->_graphicsManager.NOFADE = false; + + do { + v5 = _vm->_eventsManager.BMOUSE(); + if (v5) { + if (_vm->_globals.SAUVEGARDE->field170 == 1 && !_vm->_globals.SAUVEGARDE->field171) { + _vm->_globals.SAUVEGARDE->field171 = 1; + _vm->_globals.NOPARLE = true; + _vm->_talkManager.PARLER_PERSO("APPEL1.pe2"); + _vm->_globals.NOPARLE = false; + v5 = 0; + } + if (_vm->_globals.SAUVEGARDE->field80 == 1 && !_vm->_globals.SAUVEGARDE->field172) { + _vm->_globals.SAUVEGARDE->field172 = 1; + _vm->_globals.NOPARLE = 1; + _vm->_talkManager.PARLER_PERSO("APPEL2.pe2"); + _vm->_globals.NOPARLE = 0; + v5 = 0; + _vm->_eventsManager.souris_bb = false; + } + if (v5 == 1) + BTGAUCHE(); + } + + VERIFZONE(); + GOHOME2(); + + if (_vm->_globals.chemin == PTRNUL && _vm->_globals.GOACTION == 1) + PARADISE(); + _vm->_eventsManager.VBL(); + + if (_vm->_globals.SORTIE) + v1 = 1; + } while (v1 != 1); + + if (!_vm->_graphicsManager.NOFADE) + _vm->_graphicsManager.FADE_OUTW(); + _vm->_globals.iRegul = 0; + _vm->_graphicsManager.NOFADE = false; + _vm->_globals.PLANX = XSPR(0); + _vm->_globals.PLANY = YSPR(0); + _vm->_globals.PLANI = 1; + SPRITE_OFF(0); + _vm->_globals.AFFLI = 0; + sprite_ptr = _vm->_globals.LIBERE_FICHIER(sprite_ptr); + CLEAR_ECRAN(); + _vm->_globals.NOSPRECRAN = 0; + _vm->_globals.PLAN_FLAG = 0; +} + +void ObjectsManager::BTGAUCHE() { + warning("TODO: BTGAUCHE"); +} + +void ObjectsManager::PARADISE() { + warning("TODO: PARADISE"); +} + +void ObjectsManager::CLEAR_ECRAN() { + warning("TODO: CLEAR_ECRAN"); +} + } // End of namespace Hopkins |