HOPKINS: Various renaming

This commit is contained in:
Strangerke 2013-01-11 01:50:29 +01:00
parent d1378dd594
commit b7b3e959e3
8 changed files with 166 additions and 174 deletions

View File

@ -620,12 +620,12 @@ void ComputerManager::newLevel() {
_breakoutLevel = (int16 *)_vm->_fileManager.loadFile(file);
displayBricks();
_vm->_objectsManager.SPRITE(_breakoutSpr, Common::Point(150, 192), 0, 13, 0, 0, 0, 0);
_vm->_objectsManager.SPRITE(_breakoutSpr, Common::Point(164, 187), 1, 14, 0, 0, 0, 0);
_vm->_objectsManager.addStaticSprite(_breakoutSpr, Common::Point(150, 192), 0, 13, 0, 0, 0, 0);
_vm->_objectsManager.addStaticSprite(_breakoutSpr, Common::Point(164, 187), 1, 14, 0, 0, 0, 0);
_ballPosition = Common::Point(164, 187);
_padPositionX = 150;
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.SPRITE_ON(1);
_vm->_objectsManager.animateSprite(0);
_vm->_objectsManager.animateSprite(1);
_vm->_eventsManager.mouseOn();
_vm->_soundManager.playSample(3, 5);
}

View File

@ -2856,12 +2856,12 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, in
break;
}
_objectsManager.SPRITE(_globals.PERSO, Common::Point(_objectsManager._characterPos.x, 110), 0, _objectsManager.PERI, 0, 0, 0, 0);
_objectsManager.addStaticSprite(_globals.PERSO, Common::Point(_objectsManager._characterPos.x, 110), 0, _objectsManager.PERI, 0, 0, 0, 0);
_graphicsManager.SETCOLOR3(252, 100, 100, 100);
_graphicsManager.SETCOLOR3(253, 100, 100, 100);
_graphicsManager.SETCOLOR3(251, 100, 100, 100);
_graphicsManager.SETCOLOR3(254, 0, 0, 0);
_objectsManager.SPRITE_ON(0);
_objectsManager.animateSprite(0);
_globals.chemin = (int16 *)g_PTRNUL;
_eventsManager.mouseOn();
_eventsManager.changeMouseCursor(4);
@ -2896,7 +2896,7 @@ void HopkinsEngine::OCEAN(int16 curExitId, Common::String backgroundFilename, in
_globals._exitId = exit4;
_graphicsManager.fadeOutLong();
_objectsManager.removeSprite(0);
_objectsManager.CLEAR_ECRAN();
_objectsManager.clearScreen();
_globals.PERSO = _fileManager.loadFile("PERSO.SPR");
_globals.PERSO_TYPE = 0;
}

View File

@ -37,7 +37,6 @@ LinesManager::LinesManager() {
Common::fill((byte *)&SMOOTH[i], (byte *)&SMOOTH[i] + sizeof(SmoothItem), 0);
}
next_ligne = 0;
_linesNumb = 0;
NV_LIGNEDEP = 0;
NV_LIGNEOFS = 0;
@ -52,11 +51,12 @@ void LinesManager::setParent(HopkinsEngine *vm) {
_vm = vm;
}
void LinesManager::CLEAR_ZONE() {
/**
* Clear all zones and reset nextLine
*/
void LinesManager::clearAllZones() {
for (int idx = 0; idx < MAX_LINES; ++idx)
removeZoneLine(idx);
next_ligne = 0;
}
/**
@ -200,8 +200,10 @@ void LinesManager::removeLine(int idx) {
Ligne[idx]._lineData = (int16 *)_vm->_globals.freeMemory((byte *)Ligne[idx]._lineData);
}
// Add Line
void LinesManager::AJOUTE_LIGNE(int idx, int a2, int a3, int a4, int a5, int a6, int a7) {
/**
* Add Line
*/
void LinesManager::addLine(int idx, int a2, int a3, int a4, int a5, int a6, int a7) {
int v7;
int v8;
int v9;
@ -648,7 +650,7 @@ int LinesManager::CONTOURNE1(int a1, int a2, int a3, int a4, int a5, int16 *a6,
return v40;
}
int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) {
bool LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) {
int v5;
int v6;
int v7;
@ -857,7 +859,7 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) {
&& _vm->_objectsManager._lastLine < v46) {
v23 = GENIAL(v46, v47, v41, v40 - v22, v41, v40 - v39, v7, &_vm->_globals.super_parcours[0], 4);
if (v23 == -1)
return 0;
return false;
v7 = v23;
if (NVPY != -1)
v22 = NVPY - v40;
@ -873,7 +875,7 @@ LABEL_186:
NV_LIGNEDEP = v36;
NV_LIGNEOFS = v35;
NV_POSI = v7;
return 1;
return true;
}
if (v21 == 5) {
for (int v25 = 0; v25 < v37; v25++) {
@ -881,7 +883,7 @@ LABEL_186:
&& _vm->_objectsManager._lastLine < v46) {
v26 = GENIAL(v46, v47, v41, v25 + v40, v41, v37 + v40, v7, &_vm->_globals.super_parcours[0], 4);
if (v26 == -1)
return 0;
return false;
v7 = v26;
if (NVPY != -1)
v25 = v40 - NVPY;
@ -901,7 +903,7 @@ LABEL_186:
&& _vm->_objectsManager._lastLine < v46) {
v29 = GENIAL(v46, v47, v41 - v28, v40, v41 - v18, v40, v7, &_vm->_globals.super_parcours[0], 4);
if (v29 == -1)
return 0;
return false;
v7 = v29;
if (NVPX != -1)
v28 = v41 - NVPX;
@ -921,7 +923,7 @@ LABEL_186:
&& _vm->_objectsManager._lastLine < v46) {
v32 = GENIAL(v46, v47, v31 + v41, v40, v38 + v41, v40, v7, &_vm->_globals.super_parcours[0], 4);
if (v32 == -1)
return 0;
return false;
v7 = v32;
if (NVPX != -1)
v31 = NVPX - v41;
@ -937,7 +939,7 @@ LABEL_186:
}
}
}
return 0;
return false;
}
int LinesManager::GENIAL(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int16 *a8, int a9) {
@ -947,7 +949,6 @@ int LinesManager::GENIAL(int a1, int a2, int a3, int a4, int a5, int a6, int a7,
++_vm->_globals.STOP_BUG;
if (_vm->_globals.STOP_BUG > 10) {
v9 = a7;
LABEL_112:
a8[v9] = -1;
a8[v9 + 1] = -1;
a8[v9 + 2] = -1;
@ -1038,18 +1039,14 @@ LABEL_17:
Common::fill(&_vm->_globals.BufLig[0], &_vm->_globals.BufLig[1000], 0);
int v23 = 0;
if (v85 + 1 > 0) {
int16 *v51 = _vm->_globals.BufLig;
for (int v88 = 0; v88 < v85 + 1; v88++) {
int v24 = v23;
v51[v24] = v82;
v51[v24 + 1] = v81;
v21 += v84;
v22 += v83;
v82 = v21 / 1000;
v81 = v22 / 1000;
v23 += 2;
}
for (int v88 = 0; v88 < v85 + 1; v88++) {
_vm->_globals.BufLig[v23] = v82;
_vm->_globals.BufLig[v23 + 1] = v81;
v21 += v84;
v22 += v83;
v82 = v21 / 1000;
v81 = v22 / 1000;
v23 += 2;
}
int v25 = v23 - 2;
bool loopCond = false;
@ -1168,7 +1165,10 @@ LABEL_17:
} while (!loopCond);
if (v74 != -1 && v38 != -1 && v76 != -1 && v75 != -1) {
v9 = a7;
goto LABEL_112;
a8[v9] = -1;
a8[v9 + 1] = -1;
a8[v9 + 2] = -1;
return -1;
}
}
if (v78 < a3 - 1 || v78 > a3 + 1 || v79 < a4 - 1 || v79 > a4 + 1) {
@ -1847,7 +1847,7 @@ LABEL_234:
return &_vm->_globals.super_parcours[0];
if (v78 == 2)
goto LABEL_200;
if (MIRACLE(v119, v118, v110, v121, v112) == 1)
if (MIRACLE(v119, v118, v110, v121, v112))
goto LABEL_201;
}
}
@ -1864,7 +1864,7 @@ LABEL_200:
v112 = NV_POSI;
goto LABEL_234;
}
if (MIRACLE(v119, v118, v116, v121, v112) == 1)
if (MIRACLE(v119, v118, v116, v121, v112))
goto LABEL_201;
++v116;
} while (v116 < v121);
@ -1915,7 +1915,7 @@ LABEL_200:
return &_vm->_globals.super_parcours[0];
if (v88 == 2)
goto LABEL_200;
if (MIRACLE(v119, v118, v117, v121, v112) == 1)
if (MIRACLE(v119, v118, v117, v121, v112))
goto LABEL_201;
}
}
@ -1927,7 +1927,7 @@ LABEL_200:
return &_vm->_globals.super_parcours[0];
if (v89 == 2)
goto LABEL_200;
if (MIRACLE(v119, v118, v117, v121, v112) == 1)
if (MIRACLE(v119, v118, v117, v121, v112))
goto LABEL_201;
--v117;
} while (v117 > v121);
@ -3092,7 +3092,7 @@ LABEL_85:
return -1;
}
int LinesManager::PLAN_TEST(int a1, int a2, int a3, int a4, int a5, int a6) {
bool LinesManager::PLAN_TEST(int a1, int a2, int a3, int a4, int a5, int a6) {
int v6;
int v7;
int v8;
@ -3148,7 +3148,7 @@ int LinesManager::PLAN_TEST(int a1, int a2, int a3, int a4, int a5, int a6) {
v6 = TEST_LIGNE(a1 + 2, a2, &v45, &v53, &v49);
v37 = v6;
if (v40 == -1 && v39 == -1 && v38 == -1 && v6 == -1)
return -1;
return false;
if (a4 == -1 || a5 == -1) {
v8 = 0;
if (v40 != -1)
@ -3206,7 +3206,7 @@ int LinesManager::PLAN_TEST(int a1, int a2, int a3, int a4, int a5, int a6) {
LABEL_59:
if (v8)
goto LABEL_60;
return -1;
return false;
}
v8 = 4;
LABEL_60:
@ -3290,7 +3290,7 @@ LABEL_60:
}
}
NV_POSI = v41;
return 1;
return true;
}
// Test line
@ -3316,11 +3316,10 @@ int LinesManager::TEST_LIGNE(int a1, int a2, int *a3, int *a4, int *a5) {
int v23;
int v24 = 0;
int v25;
int v26;
int v27;
int v28;
v26 = 0;
bool v26 = false;
v25 = _vm->_objectsManager._lastLine + 1;
for (i = (int)(_vm->_objectsManager._lastLine + 1); i < _vm->_linesManager._linesNumb + 1; i = v25) {
v6 = i;
@ -3330,19 +3329,19 @@ int LinesManager::TEST_LIGNE(int a1, int a2, int *a3, int *a4, int *a5) {
v9 = v7[2 * v8 - 1];
if (v7[0] == a1 && a2 == v7[1]) {
v24 = v25;
v26 = 1;
v26 = true;
*a3 = 1;
}
if (v23 == a1 && a2 == v9) {
v24 = v25;
v26 = 1;
v26 = true;
*a3 = 2;
}
if (v26 == 1)
if (v26)
goto LABEL_12;
++v25;
}
if (v26 != 1)
if (!v26)
goto LABEL_33;
LABEL_12:
if (*a3 == 1) {
@ -3358,11 +3357,11 @@ LABEL_12:
if (Ligne[v16].field6 == 3 || Ligne[v16].field8 == 7)
v13 += 2;
if (!checkCollisionLine(v13, v14, &v28, &v27, 0, _vm->_objectsManager._lastLine))
error("error");
error("Error in test line");
*a4 = v27;
*a5 = v28;
}
if (v26 == 1 && *a3 == 2) {
if (v26 && *a3 == 2) {
v17 = Ligne[v25]._lineData;
v18 = v17[0];
v19 = v17[1];
@ -3373,7 +3372,7 @@ LABEL_12:
if (Ligne[v21].field6 == 3 || Ligne[v21].field8 == 7)
v18 -= 2;
if (!checkCollisionLine(v18, v19, &v28, &v27, 0, _vm->_objectsManager._lastLine))
error("erreure");
error("Error in test line");
*a4 = v27;
*a5 = v28;
}

View File

@ -57,7 +57,6 @@ public:
LigneZoneItem _zoneLine[401];
LigneItem Ligne[400];
SmoothItem SMOOTH[4000];
int next_ligne;
int _linesNumb;
int NV_LIGNEDEP;
int NV_LIGNEOFS;
@ -70,25 +69,25 @@ public:
LinesManager();
void setParent(HopkinsEngine *vm);
void CLEAR_ZONE();
void clearAllZones();
int checkInventoryHotspots(int posX, int posY);
int checkInventoryHostpotsRow(int posX, int minZoneNum, bool lastRow);
void removeZoneLine(int idx);
void addZoneLine(int idx, int a2, int a3, int a4, int a5, int bobZoneIdx);
void resetLines();
void removeLine(int idx);
void AJOUTE_LIGNE(int idx, int a2, int a3, int a4, int a5, int a6, int a7);
void addLine(int idx, int a2, int a3, int a4, int a5, int a6, int a7);
bool checkCollisionLine(int xp, int yp, int *foundDataIdx, int *foundLineIdx, int startLineIdx, int endLineIdx);
void initRoute();
int CONTOURNE1(int a1, int a2, int a3, int a4, int a5, int16 *a6, int a7, int a8, int a9);
int CONTOURNE(int a1, int a2, int a3, int a4, int a5, int16 *a6, int a7);
int MIRACLE(int a1, int a2, int a3, int a4, int a5);
bool MIRACLE(int a1, int a2, int a3, int a4, int a5);
int GENIAL(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int16 *a8, int a9);
int16 *PARCOURS2(int srcX, int srcY, int destX, int destY);
int PARC_PERS(int a1, int a2, int a3, int a4, int a5, int a6, int a7);
int VERIF_SMOOTH(int a1, int a2, int a3, int a4);
int SMOOTH_MOVE(int a3, int a4, int a5, int a6);
int PLAN_TEST(int a1, int a2, int a3, int a4, int a5, int a6);
bool PLAN_TEST(int a1, int a2, int a3, int a4, int a5, int a6);
int TEST_LIGNE(int a1, int a2, int *a3, int *a4, int *a5);
};

View File

@ -1289,12 +1289,12 @@ void ObjectsManager::clearSprite() {
}
}
void ObjectsManager::SPRITE_ON(int idx) {
void ObjectsManager::animateSprite(int idx) {
assert (idx <= MAX_SPRITE);
_sprite[idx]._animationType = 1;
}
void ObjectsManager::SPRITE(const byte *spriteData, Common::Point pos, int idx, int spriteIndex, int a6, int a7, int a8, int a9) {
void ObjectsManager::addStaticSprite(const byte *spriteData, Common::Point pos, int idx, int spriteIndex, int a6, int a7, int a8, int a9) {
assert (idx <= MAX_SPRITE);
_sprite[idx]._spriteData = spriteData;
_sprite[idx]._spritePos = pos;
@ -1310,15 +1310,17 @@ void ObjectsManager::SPRITE(const byte *spriteData, Common::Point pos, int idx,
_sprite[idx].field22 = 0;
_sprite[idx]._animationType = 0;
_sprite[idx]._rleFl = false;
if (spriteData[0] == 'R' && spriteData[1] == 'L' && spriteData[2] == 'E') {
_sprite[idx]._rleFl = true;
_sprite[idx].fieldC = 0;
_sprite[idx].fieldE = 0;
}
} else
_sprite[idx]._rleFl = false;
}
void ObjectsManager::SPRITE2(const byte *spriteData, int idx, byte *a3, int a4, int a5) {
void ObjectsManager::addAnimatedSprite(const byte *spriteData, int idx, byte *a3, int a4, int a5) {
assert (idx <= MAX_SPRITE);
_sprite[idx]._spriteData = spriteData;
_sprite[idx].field1C = a3;
_sprite[idx].field20 = a4;
@ -1330,10 +1332,10 @@ void ObjectsManager::SPRITE2(const byte *spriteData, int idx, byte *a3, int a4,
_sprite[idx].field22 = 0;
_sprite[idx].field14 = a5;
_sprite[idx]._rleFl = false;
if (spriteData[0] == 'R' && spriteData[1] == 'L' && spriteData[2] == 'E')
_sprite[idx]._rleFl = true;
else
_sprite[idx]._rleFl = false;
}
/**
@ -1370,10 +1372,10 @@ void ObjectsManager::setSpriteIndex(int idx, int spriteIndex) {
}
// Set Sprite Size
void ObjectsManager::SETTAILLESPR(int idx, int a2) {
void ObjectsManager::setSpriteSize(int idx, int size) {
assert (idx <= MAX_SPRITE);
if (!_sprite[idx]._rleFl)
_sprite[idx].fieldC = a2;
_sprite[idx].fieldC = size;
}
void ObjectsManager::setFlipSprite(int idx, bool flip) {
@ -1552,7 +1554,7 @@ void ObjectsManager::GOHOME() {
_vm->_globals.Compteur = 0;
if (_vm->_globals.g_old_sens == -1) {
VERIFTAILLE();
computeAndSetSpriteSize();
nouveau_x = *_vm->_globals.chemin;
_vm->_globals.chemin++;
@ -1579,7 +1581,7 @@ void ObjectsManager::GOHOME() {
else
v54 = NUMZONE;
_vm->_globals.chemin = (int16 *)g_PTRNUL;
VERIFTAILLE();
computeAndSetSpriteSize();
setFlipSprite(0, false);
_vm->_globals.Compteur = 0;
_vm->_globals.chemin = (int16 *)g_PTRNUL;
@ -1920,7 +1922,7 @@ LABEL_153:
setSpriteIndex(0, _vm->_globals.g_old_sens + 59);
_vm->_globals._actionDirection = 0;
_vm->_globals.chemin = (int16 *)g_PTRNUL;
VERIFTAILLE();
computeAndSetSpriteSize();
setFlipSprite(0, false);
_vm->_globals.Compteur = 0;
_vm->_globals.g_old_sens = -1;
@ -1957,7 +1959,7 @@ LABEL_153:
v47 = 1;
} while (v47 != 1);
if (v47 == 1) {
VERIFTAILLE();
computeAndSetSpriteSize();
if ((_vm->_globals.g_old_sens == 6) || (_vm->_globals.g_old_sens == 7) || (_vm->_globals.g_old_sens == 8))
setFlipSprite(0, true);
@ -2047,14 +2049,16 @@ void ObjectsManager::GOHOME2() {
A_DEPA = 0;
}
// Load Obstacle
void ObjectsManager::CHARGE_OBSTACLE(const Common::String &file) {
/**
* Load lines
*/
void ObjectsManager::loadLines(const Common::String &file) {
_vm->_linesManager.resetLines();
_vm->_linesManager._linesNumb = 0;
_lastLine = 0;
byte *ptr = _vm->_fileManager.loadFile(file);
for (int idx = 0; (int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5)) != -1; idx++) {
_vm->_linesManager.AJOUTE_LIGNE(
_vm->_linesManager.addLine(
idx,
(int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5)),
(int16)READ_LE_UINT16((uint16 *)ptr + (idx * 5) + 1),
@ -2219,11 +2223,6 @@ void ObjectsManager::CARRE_ZONE() {
}
void ObjectsManager::PLAN_BETA() {
int v1;
int v3;
int v5;
v1 = 0;
_vm->_dialogsManager._inventFl = false;
_vm->_eventsManager._gameKey = KEY_NONE;
_vm->_globals.Max_Propre = 1;
@ -2238,15 +2237,15 @@ void ObjectsManager::PLAN_BETA() {
_vm->_soundManager.WSOUND(31);
_vm->_globals.iRegul = 1;
_vm->_graphicsManager.loadImage("PLAN");
CHARGE_OBSTACLE("PLAN.OB2");
loadLines("PLAN.OB2");
_vm->_globals.loadCache("PLAN.CA2");
loadZone("PLAN.ZO2");
_spritePtr = _vm->_fileManager.loadFile("VOITURE.SPR");
_vm->_animationManager.loadAnim("PLAN");
_vm->_graphicsManager.VISU_ALL();
_vm->_graphicsManager.INI_ECRAN2("PLAN", false);
for (int v2 = 0; v2 <= 15; v2++)
_vm->_globals.CACHE_OFF(v2);
for (int i = 0; i <= 15; i++)
_vm->_globals.CACHE_OFF(i);
_vm->_globals.CACHE_OFF(19);
_vm->_globals.CACHE_OFF(20);
_vm->_globals.CACHE_ON();
@ -2256,21 +2255,20 @@ void ObjectsManager::PLAN_BETA() {
_vm->_globals.PLANY = 319;
_vm->_globals.PLANI = 1;
}
SPRITE(_spritePtr, Common::Point(_vm->_globals.PLANX, _vm->_globals.PLANY), 0, _vm->_globals.PLANI, 0, 0, 5, 5);
addStaticSprite(_spritePtr, Common::Point(_vm->_globals.PLANX, _vm->_globals.PLANY), 0, _vm->_globals.PLANI, 0, 0, 5, 5);
_vm->_eventsManager.setMouseXY(_vm->_globals.PLANX, _vm->_globals.PLANY);
my_anim = 0;
_vm->_eventsManager.mouseOn();
v3 = getSpriteX(0);
_vm->_graphicsManager.scrollScreen(v3 - 320);
_vm->_graphicsManager.scrollScreen(getSpriteX(0) - 320);
_vm->_graphicsManager._scrollOffset = getSpriteX(0) - 320;
SPRITE_ON(0);
animateSprite(0);
_vm->_globals.chemin = (int16 *)g_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);
for (int v4 = 0; v4 <= 4; v4++)
for (int i = 0; i <= 4; i++)
_vm->_eventsManager.VBL();
_vm->_globals.iRegul = 1;
@ -2278,25 +2276,26 @@ void ObjectsManager::PLAN_BETA() {
_vm->_eventsManager.changeMouseCursor(4);
_vm->_graphicsManager._noFadingFl = false;
bool v1 = false;
do {
v5 = _vm->_eventsManager.getMouseButton();
if (v5) {
int mouseButton = _vm->_eventsManager.getMouseButton();
if (mouseButton) {
if (_vm->_globals._saveData->data[svField170] == 1 && !_vm->_globals._saveData->data[svField171]) {
_vm->_globals._saveData->data[svField171] = 1;
_vm->_globals.NOPARLE = true;
_vm->_talkManager.PARLER_PERSO("APPEL1.pe2");
_vm->_globals.NOPARLE = false;
v5 = 0;
mouseButton = 0;
}
if (_vm->_globals._saveData->data[svField80] == 1 && !_vm->_globals._saveData->data[svField172]) {
_vm->_globals._saveData->data[svField172] = 1;
_vm->_globals.NOPARLE = true;
_vm->_talkManager.PARLER_PERSO("APPEL2.pe2");
_vm->_globals.NOPARLE = false;
v5 = 0;
mouseButton = 0;
_vm->_eventsManager._curMouseButton = 0;
}
if (v5 == 1)
if (mouseButton == 1)
handleLeftButton();
}
@ -2308,8 +2307,8 @@ void ObjectsManager::PLAN_BETA() {
_vm->_eventsManager.VBL();
if (_vm->_globals._exitId)
v1 = 1;
} while (!_vm->shouldQuit() && v1 != 1);
v1 = true;
} while (!_vm->shouldQuit() && !v1);
if (!_vm->_graphicsManager._noFadingFl)
_vm->_graphicsManager.fadeOutLong();
@ -2320,7 +2319,7 @@ void ObjectsManager::PLAN_BETA() {
_vm->_globals.PLANI = 1;
removeSprite(0);
_spritePtr = _vm->_globals.freeMemory(_spritePtr);
CLEAR_ECRAN();
clearScreen();
_vm->_globals.PLAN_FLAG = false;
}
@ -2452,7 +2451,7 @@ LABEL_38:
setSpriteIndex(0, _vm->_globals.g_old_sens2 + 59);
_vm->_globals._actionDirection = 0;
_vm->_globals.chemin = (int16 *)g_PTRNUL;
VERIFTAILLE();
computeAndSetSpriteSize();
setFlipSprite(0, false);
_vm->_globals.Compteur = 0;
_vm->_globals.g_old_sens = -1;
@ -2611,21 +2610,23 @@ LABEL_64:
_vm->_globals.GOACTION = false;
}
// Clear Screen
void ObjectsManager::CLEAR_ECRAN() {
/**
* Clear Screen
*/
void ObjectsManager::clearScreen() {
clearSprite();
_vm->_graphicsManager.FIN_VISU();
_vm->_fontManager.hideText(5);
_vm->_fontManager.hideText(9);
_vm->_globals.CLEAR_VBOB();
_vm->_animationManager.clearAnim();
_vm->_linesManager.CLEAR_ZONE();
_vm->_linesManager.clearAllZones();
_vm->_linesManager.resetLines();
_vm->_globals.resetCache();
for (int v1 = 0; v1 <= 48; v1++) {
_vm->_globals.BOBZONE[v1] = 0;
_vm->_globals.BOBZONE_FLAG[v1] = false;
for (int i = 0; i <= 48; i++) {
_vm->_globals.BOBZONE[i] = 0;
_vm->_globals.BOBZONE_FLAG[i] = false;
}
_vm->_eventsManager._mouseCursorId = 4;
_verb = 4;
@ -2684,8 +2685,8 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
loc->field4 = _sprite[0]._animationType;
removeSprite(1);
SPRITE(_vm->_globals.TETE, loc->_pos, 1, 3, loc->field4, 0, 20, 127);
SPRITE_ON(1);
addStaticSprite(_vm->_globals.TETE, loc->_pos, 1, 3, loc->field4, 0, 20, 127);
animateSprite(1);
removeSprite(0);
_vm->_globals._saveData->data[svField354] = 0;
@ -2696,8 +2697,8 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
loc = &_vm->_globals._saveData->_realHopkins;
_vm->_globals.PERSO = _vm->_fileManager.loadFile("PERSO.SPR");
_vm->_globals.PERSO_TYPE = 0;
SPRITE(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->field4, 0, 34, 190);
SPRITE_ON(0);
addStaticSprite(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->field4, 0, 34, 190);
animateSprite(0);
_vm->_globals.loadCharacterData();
} else if (oldCharacter == CHARACTER_HOPKINS && newCharacter == CHARACTER_SAMANTHA
&& _vm->_globals._saveData->_samantha._location == _vm->_globals._screenId) {
@ -2710,8 +2711,8 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
loc->field4 = _sprite[0].fieldC;
removeSprite(1);
SPRITE(_vm->_globals.TETE, loc->_pos, 1, 2, loc->field4, 0, 34, 190);
SPRITE_ON(1);
addStaticSprite(_vm->_globals.TETE, loc->_pos, 1, 2, loc->field4, 0, 34, 190);
animateSprite(1);
removeSprite(0);
_vm->_globals._saveData->data[svField354] = 0;
@ -2721,8 +2722,8 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
loc = &_vm->_globals._saveData->_samantha;
_vm->_globals.PERSO = _vm->_fileManager.loadFile("PSAMAN.SPR");
_vm->_globals.PERSO_TYPE = 2;
SPRITE(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->field4, 0, 20, 127);
SPRITE_ON(0);
addStaticSprite(_vm->_globals.PERSO, loc->_pos, 0, 64, loc->field4, 0, 20, 127);
animateSprite(0);
_vm->_globals.loadCharacterData();
} else {
switch (oldCharacter) {
@ -2781,18 +2782,14 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
}
// Check Size
void ObjectsManager::VERIFTAILLE() {
int v0 = _vm->_globals.STAILLE[getSpriteY(0)];
void ObjectsManager::computeAndSetSpriteSize() {
int size = _vm->_globals.STAILLE[getSpriteY(0)];
if (_vm->_globals.PERSO_TYPE == 1) {
if (v0 < 0)
v0 = -v0;
v0 = 20 * (5 * v0 - 100) / -80;
size = 20 * (5 * abs(size) - 100) / -80;
} else if (_vm->_globals.PERSO_TYPE == 2) {
if (v0 < 0)
v0 = -v0;
v0 = 20 * (5 * v0 - 165) / -67;
size = 20 * (5 * abs(size) - 165) / -67;
}
SETTAILLESPR(0, v0);
setSpriteSize(0, size);
}
void ObjectsManager::PACOURS_PROPRE(int16 *a1) {
@ -3041,11 +3038,7 @@ LABEL_90:
if (_vm->_linesManager.PLAN_TEST(
_vm->_linesManager.Ligne[j]._lineData[0],
_vm->_linesManager.Ligne[j]._lineData[1],
v67,
j,
v73,
0) == 1) {
LABEL_88:
v67, j, v73, 0)) {
v69 = _vm->_linesManager.NV_LIGNEDEP;
v68 = _vm->_linesManager.NV_LIGNEOFS;
v67 = _vm->_linesManager.NV_POSI;
@ -3080,12 +3073,13 @@ LABEL_88:
if (_vm->_linesManager.PLAN_TEST(
_vm->_linesManager.Ligne[l]._lineData[2 * _vm->_linesManager.Ligne[v48]._lineDataEndIdx - 2],
_vm->_linesManager.Ligne[l]._lineData[2 * _vm->_linesManager.Ligne[v48]._lineDataEndIdx - 1],
v67,
l,
v73,
0) == 1)
goto LABEL_88;
v67, l, v73, 0)) {
v69 = _vm->_linesManager.NV_LIGNEDEP;
v68 = _vm->_linesManager.NV_LIGNEOFS;
v67 = _vm->_linesManager.NV_POSI;
goto LABEL_90;
}
for (int v49 = _vm->_linesManager.Ligne[v48]._lineDataEndIdx - 2; v49 > 0; v49 --) {
v50 = _vm->_linesManager.Ligne[l]._lineData;
v52 = v67;
@ -4141,7 +4135,7 @@ void ObjectsManager::INILINK(const Common::String &file) {
do {
v27 = (int16)READ_LE_UINT16(v16 + 2 * v32);
if (v27 != -1) {
_vm->_linesManager.AJOUTE_LIGNE(
_vm->_linesManager.addLine(
v34,
v27,
(int16)READ_LE_UINT16(v16 + 2 * v32 + 2),
@ -4243,7 +4237,7 @@ void ObjectsManager::SPECIAL_INI() {
for (int i = 0; i <= 4; i++)
_vm->_eventsManager.VBL();
_vm->_graphicsManager.fadeInLong();
SPRITE_ON(0);
animateSprite(0);
for (int i = 0; i <= 4; i++)
_vm->_eventsManager.VBL();
VBOB(_vm->_globals.SPRITE_ECRAN, 5, 15, 28, 1);
@ -4813,10 +4807,10 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo
}
_vm->_eventsManager.mouseOn();
if (_vm->_globals._screenId == 61) {
SPRITE(_vm->_globals.PERSO, Common::Point(330, 418), 0, 60, 0, 0, 34, 190);
SPRITE_ON(0);
addStaticSprite(_vm->_globals.PERSO, Common::Point(330, 418), 0, 60, 0, 0, 34, 190);
animateSprite(0);
_vm->_globals.chemin = (int16 *)g_PTRNUL;
VERIFTAILLE();
computeAndSetSpriteSize();
}
_vm->_graphicsManager.SETCOLOR3(252, 100, 100, 100);
_vm->_graphicsManager.SETCOLOR3(253, 100, 100, 100);
@ -4871,7 +4865,7 @@ void ObjectsManager::PERSONAGE(const Common::String &backgroundFile, const Commo
_vm->_graphicsManager.FIN_VISU();
if (_vm->_globals._screenId == 61)
removeSprite(0);
CLEAR_ECRAN();
clearScreen();
_vm->_globals.iRegul = 0;
}
@ -4932,23 +4926,23 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm
_vm->_globals.loadCharacterData();
switch (_vm->_globals.PERSO_TYPE) {
case 0:
SPRITE(_vm->_globals.PERSO, _characterPos, 0, PERI, 0, 0, 34, 190);
addStaticSprite(_vm->_globals.PERSO, _characterPos, 0, PERI, 0, 0, 34, 190);
break;
case 1:
SPRITE(_vm->_globals.PERSO, _characterPos, 0, PERI, 0, 0, 28, 155);
addStaticSprite(_vm->_globals.PERSO, _characterPos, 0, PERI, 0, 0, 28, 155);
break;
case 2:
SPRITE(_vm->_globals.PERSO, _characterPos, 0, PERI, 0, 0, 20, 127);
addStaticSprite(_vm->_globals.PERSO, _characterPos, 0, PERI, 0, 0, 20, 127);
break;
}
_vm->_eventsManager.setMouseXY(_characterPos);
if (_vm->_graphicsManager._largeScreenFl)
_vm->_graphicsManager.SCROLL = (int16)getSpriteX(0) - 320;
VERIFTAILLE();
SPRITE_ON(0);
computeAndSetSpriteSize();
animateSprite(0);
_vm->_globals.CACHE_ON();
_vm->_globals.chemin = (int16 *)g_PTRNUL;
VERIFTAILLE();
computeAndSetSpriteSize();
SPECIAL_INI();
_vm->_eventsManager._mouseSpriteId = 4;
g_old_x = _characterPos.x;
@ -5018,7 +5012,7 @@ void ObjectsManager::PERSONAGE2(const Common::String &backgroundFile, const Comm
}
if (!animFile.empty())
_vm->_graphicsManager.FIN_VISU();
CLEAR_ECRAN();
clearScreen();
} else {
_vm->_globals._helicopterFl = false;
}

View File

@ -159,26 +159,26 @@ public:
int getSpriteX(int idx);
int getSpriteY(int idx);
void clearSprite();
void SPRITE_ON(int idx);
void SPRITE(const byte *spriteData, Common::Point pos, int idx, int spriteIndex, int a6, int a7, int a8, int a9);
void SPRITE2(const byte *spriteData, int idx, byte *a3, int a4, int a5);
void animateSprite(int idx);
void addStaticSprite(const byte *spriteData, Common::Point pos, int idx, int spriteIndex, int a6, int a7, int a8, int a9);
void addAnimatedSprite(const byte *spriteData, int idx, byte *a3, int a4, int a5);
void removeSprite(int idx);
void setSpriteX(int idx, int xp);
void setSpriteIndex(int idx, int spriteIndex);
void setSpriteY(int idx, int yp);
void SETTAILLESPR(int idx, int a2);
void setSpriteSize(int idx, int size);
void setFlipSprite(int idx, bool flip);
void checkZone();
void GOHOME();
void GOHOME2();
void CHARGE_OBSTACLE(const Common::String &file);
void loadLines(const Common::String &file);
void loadZone(const Common::String &file);
void CARRE_ZONE();
void PLAN_BETA();
void handleLeftButton();
void PARADISE();
void CLEAR_ECRAN();
void clearScreen();
/**
* Change the currently active player
@ -187,7 +187,7 @@ public:
*/
void changeCharacterHead(PlayerCharacter oldCharacter, PlayerCharacter newCharacter);
void VERIFTAILLE();
void computeAndSetSpriteSize();
void PACOURS_PROPRE(int16 *a1);
int16 *PARC_VOITURE(int x1, int y1, int x2, int y2);
void nextVerbIcon();

View File

@ -224,7 +224,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
}
if (_vm->_globals._saveData->data[svField356] == 1
&& _vm->_globals._saveData->_realHopkins._location == _vm->_globals._screenId) {
_vm->_objectsManager.SPRITE(
_vm->_objectsManager.addStaticSprite(
_vm->_globals.TETE,
_vm->_globals._saveData->_realHopkins._pos,
1,
@ -233,13 +233,13 @@ int ScriptManager::handleOpcode(byte *dataP) {
0,
34,
190);
_vm->_objectsManager.SPRITE_ON(1);
_vm->_objectsManager.animateSprite(1);
_vm->_objectsManager._twoCharactersFl = true;
}
if (_vm->_globals._saveData->data[svField357] == 1
&& _vm->_globals._saveData->data[svField355] == 1
&& _vm->_globals._saveData->_samantha._location == _vm->_globals._screenId) {
_vm->_objectsManager.SPRITE(
_vm->_objectsManager.addStaticSprite(
_vm->_globals.TETE,
_vm->_globals._saveData->_samantha._pos,
1,
@ -248,7 +248,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
0,
20,
127);
_vm->_objectsManager.SPRITE_ON(1);
_vm->_objectsManager.animateSprite(1);
_vm->_objectsManager._twoCharactersFl = true;
}
}
@ -535,7 +535,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_fontManager.hideText(5);
_vm->_fontManager.hideText(9);
_vm->_graphicsManager.FIN_VISU();
_vm->_objectsManager.CLEAR_ECRAN();
_vm->_objectsManager.clearScreen();
if ((_vm->getPlatform() == Common::kPlatformWindows) && _vm->getIsDemo()) {
_vm->_graphicsManager.fadeOutLong();
@ -802,7 +802,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 513, 249, 3);
_vm->_eventsManager.VBL();
} while (_vm->_objectsManager.BOBPOSI(9) != 36);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
_vm->_objectsManager.stopBobAnimation(9);
_vm->_objectsManager.stopBobAnimation(10);
_vm->_soundManager.DEL_SAMPLE(1);
@ -851,7 +851,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_eventsManager.VBL();
} while (_vm->_objectsManager.BOBPOSI(9) != v19);
if (v19 == 12) {
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
_vm->_objectsManager.stopBobAnimation(9);
}
_vm->_globals.CACHE_ON();
@ -924,7 +924,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_globals.loadCharacterData();
_vm->_objectsManager._sprite[0].field12 = 28;
_vm->_objectsManager._sprite[0].field14 = 155;
_vm->_objectsManager.VERIFTAILLE();
_vm->_objectsManager.computeAndSetSpriteSize();
break;
case 57:
@ -934,7 +934,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_globals.loadCharacterData();
_vm->_objectsManager._sprite[0].field12 = 34;
_vm->_objectsManager._sprite[0].field14 = 190;
_vm->_objectsManager.VERIFTAILLE();
_vm->_objectsManager.computeAndSetSpriteSize();
break;
case 58:
@ -989,7 +989,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
} while (_vm->_objectsManager.BOBPOSI(3) != 48);
_vm->_soundManager.DEL_SAMPLE(1);
_vm->_objectsManager.setSpriteIndex(0, 62);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
_vm->_objectsManager.setBobAnimation(6);
_vm->_objectsManager.stopBobAnimation(7);
_vm->_objectsManager.stopBobAnimation(3);
@ -1040,7 +1040,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
} while (_vm->_objectsManager.BOBPOSI(4) != 16);
_vm->_objectsManager.stopBobAnimation(12);
_vm->_objectsManager.stopBobAnimation(4);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
_vm->_objectsManager.OBSSEUL = 1;
_vm->_objectsManager.INILINK("IM27a");
_vm->_objectsManager.OBSSEUL = 0;
@ -1092,7 +1092,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_eventsManager.VBL();
} while (_vm->_objectsManager.BOBPOSI(8) != 32);
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 201, 14, 1);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
_vm->_objectsManager.stopBobAnimation(11);
_vm->_objectsManager.stopBobAnimation(8);
_vm->_objectsManager.setBobAnimation(5);
@ -1318,7 +1318,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_eventsManager.VBL();
} while (_vm->_objectsManager.BOBPOSI(9) != 15);
_vm->_objectsManager.stopBobAnimation(9);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
_vm->_soundManager.playSound("SOUND50.WAV");
do {
if (_vm->shouldQuit())
@ -1484,7 +1484,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
} while (_vm->_objectsManager.BOBPOSI(5) != 72);
_vm->_objectsManager.stopBobAnimation(5);
}
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
_vm->_objectsManager.ACTION_DOS(1);
_vm->_soundManager.DEL_SAMPLE(1);
break;
@ -1524,7 +1524,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_eventsManager.VBL();
} while (_vm->_objectsManager.BOBPOSI(4) != 77);
_vm->_objectsManager.stopBobAnimation(4);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
break;
case 107:
@ -1562,7 +1562,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_eventsManager.VBL();
} while (_vm->_objectsManager.BOBPOSI(5) != 53);
_vm->_objectsManager.stopBobAnimation(5);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
break;
case 108:
@ -1719,7 +1719,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_objectsManager.stopBobAnimation(8);
_vm->_objectsManager.stopBobAnimation(9);
_vm->_objectsManager.stopBobAnimation(10);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
break;
case 176:
@ -1770,7 +1770,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 18, 334, 0, false);
} while (_vm->_objectsManager.BOBPOSI(4) != 26);
_vm->_objectsManager.stopBobAnimation(4);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
break;
case 204: {
@ -1791,7 +1791,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_eventsManager.VBL();
} while (_vm->_objectsManager.BOBPOSI(3) != 50);
_vm->_objectsManager.stopBobAnimation(3);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
break;
}
@ -1813,7 +1813,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_eventsManager.VBL();
} while (_vm->_objectsManager.BOBPOSI(4) != 24);
_vm->_objectsManager.stopBobAnimation(4);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
break;
}
@ -1992,7 +1992,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_objectsManager.stopBobAnimation(7);
_vm->_objectsManager.setSpriteX(0, 476);
_vm->_objectsManager.setSpriteY(0, 278);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 337, 154, 3);
_vm->_objectsManager.OBSSEUL = 1;
_vm->_objectsManager.INILINK("IM93c");
@ -2020,7 +2020,7 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_eventsManager.VBL();
} while (_vm->_objectsManager.BOBPOSI(12) != 12);
_vm->_objectsManager.SPRITE_ON(0);
_vm->_objectsManager.animateSprite(0);
_vm->_objectsManager.stopBobAnimation(12);
_vm->_globals.CACHE_ON();
break;
@ -2226,8 +2226,8 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_globals._saveData->data[svField355] = 1;
_vm->_objectsManager._twoCharactersFl = true;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 373, 191, 3);
_vm->_objectsManager.SPRITE(_vm->_globals.TETE, v53->_pos, 1, 3, v53->field4, 0, 20, 127);
_vm->_objectsManager.SPRITE_ON(1);
_vm->_objectsManager.addStaticSprite(_vm->_globals.TETE, v53->_pos, 1, 3, v53->field4, 0, 20, 127);
_vm->_objectsManager.animateSprite(1);
break;
}

View File

@ -1069,7 +1069,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) {
_vm->_fontManager.hideText(9);
_vm->_eventsManager.VBL();
_vm->_graphicsManager.no_scroll = 1;
_vm->_linesManager.CLEAR_ZONE();
_vm->_linesManager.clearAllZones();
_vm->_linesManager.resetLines();
_vm->_globals.resetCache();
@ -1145,7 +1145,7 @@ void TalkManager::OBJET_VIVANT(const Common::String &a2) {
_characterBuffer = _vm->_globals.freeMemory(_characterBuffer);
_characterSprite = _vm->_globals.freeMemory(_characterSprite);
_vm->_graphicsManager.NB_SCREEN(false);
_vm->_linesManager.CLEAR_ZONE();
_vm->_linesManager.clearAllZones();
_vm->_linesManager.resetLines();
_vm->_globals.resetCache();
for (int i = 0; i <= 44; i++)