aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/hopkins/dialogs.cpp12
-rw-r--r--engines/hopkins/globals.cpp8
-rw-r--r--engines/hopkins/globals.h5
-rw-r--r--engines/hopkins/graphics.cpp6
-rw-r--r--engines/hopkins/graphics.h3
-rw-r--r--engines/hopkins/hopkins.cpp8
-rw-r--r--engines/hopkins/hopkins.h2
-rw-r--r--engines/hopkins/lines.cpp27
-rw-r--r--engines/hopkins/lines.h6
-rw-r--r--engines/hopkins/objects.cpp46
-rw-r--r--engines/hopkins/objects.h6
-rw-r--r--engines/hopkins/script.cpp20
12 files changed, 61 insertions, 88 deletions
diff --git a/engines/hopkins/dialogs.cpp b/engines/hopkins/dialogs.cpp
index 70b94088f1..e67301b25f 100644
--- a/engines/hopkins/dialogs.cpp
+++ b/engines/hopkins/dialogs.cpp
@@ -286,7 +286,7 @@ void DialogsManager::showOptionsDialog() {
_vm->_eventsManager.VBL();
} while (!doneFlag);
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _vm->_graphicsManager._scrollOffset + 164,
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, _vm->_graphicsManager._scrollOffset + 164,
107, 335, 215, _vm->_graphicsManager._vesaBuffer, _vm->_graphicsManager._scrollOffset + 164, 107);
_vm->_graphicsManager.addVesaSegment(_vm->_graphicsManager._scrollOffset + 164, 107,
_vm->_graphicsManager._scrollOffset + 498, 320);
@@ -433,7 +433,7 @@ LABEL_7:
_vm->_fontManager.hideText(9);
if (_inventDisplayedFl) {
_inventDisplayedFl = false;
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _inventX, 114, v18, v17, _vm->_graphicsManager._vesaBuffer, _inventX, 114);
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, _inventX, 114, v18, v17, _vm->_graphicsManager._vesaBuffer, _inventX, 114);
_vm->_graphicsManager.addVesaSegment(_inventX, 114, _inventX + v18, v18 + 114);
_vm->_objectsManager.BOBTOUS = true;
}
@@ -464,7 +464,7 @@ void DialogsManager::inventAnim() {
return;
if (_vm->_objectsManager.FLAG_VISIBLE_EFFACE && !_vm->_objectsManager._visibleFl) {
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _vm->_objectsManager.I_old_x, 27, 48, 38,
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, _vm->_objectsManager.I_old_x, 27, 48, 38,
_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager.I_old_x, 27);
_vm->_graphicsManager.addVesaSegment(_vm->_objectsManager.I_old_x, 27, _vm->_objectsManager.I_old_x + 48, 65);
--_vm->_objectsManager.FLAG_VISIBLE_EFFACE;
@@ -473,7 +473,7 @@ void DialogsManager::inventAnim() {
if (_vm->_objectsManager._visibleFl) {
if (_vm->_objectsManager.I_old_x <= 1)
_vm->_objectsManager.I_old_x = 2;
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _vm->_objectsManager.I_old_x, 27, 48, 38,
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, _vm->_objectsManager.I_old_x, 27, 48, 38,
_vm->_graphicsManager._vesaBuffer, _vm->_objectsManager.I_old_x, 27);
_vm->_graphicsManager.addVesaSegment(_vm->_objectsManager.I_old_x, 27, _vm->_objectsManager.I_old_x + 48, 65);
@@ -556,7 +556,7 @@ void DialogsManager::showLoadGame() {
_vm->_eventsManager.VBL();
} while (!_vm->shouldQuit() && (!slotNumber || _vm->_eventsManager.getMouseButton() != 1));
_vm->_objectsManager._saveLoadFl = false;
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x + 183, 60, 274, 353, _vm->_graphicsManager._vesaBuffer, _vm->_eventsManager._startPos.x + 183, 60);
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x + 183, 60, 274, 353, _vm->_graphicsManager._vesaBuffer, _vm->_eventsManager._startPos.x + 183, 60);
_vm->_graphicsManager.addVesaSegment(_vm->_eventsManager._startPos.x + 183, 60, 457, 413);
_vm->_objectsManager.BOBTOUS = true;
_vm->_objectsManager._saveLoadSprite = _vm->_globals.freeMemory(_vm->_objectsManager._saveLoadSprite);
@@ -587,7 +587,7 @@ void DialogsManager::showSaveGame() {
} while (!_vm->shouldQuit() && (!slotNumber || _vm->_eventsManager.getMouseButton() != 1));
_vm->_objectsManager._saveLoadFl = false;
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x + 183, 60, 274, 353, _vm->_graphicsManager._vesaBuffer, _vm->_eventsManager._startPos.x + 183, 60);
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x + 183, 60, 274, 353, _vm->_graphicsManager._vesaBuffer, _vm->_eventsManager._startPos.x + 183, 60);
_vm->_graphicsManager.addVesaSegment(_vm->_eventsManager._startPos.x + 183, 60, _vm->_eventsManager._startPos.x + 457, 413);
_vm->_objectsManager.BOBTOUS = true;
_vm->_objectsManager._saveLoadSprite = _vm->_globals.freeMemory(_vm->_objectsManager._saveLoadSprite);
diff --git a/engines/hopkins/globals.cpp b/engines/hopkins/globals.cpp
index c13e559b4f..af942b94d0 100644
--- a/engines/hopkins/globals.cpp
+++ b/engines/hopkins/globals.cpp
@@ -100,11 +100,9 @@ Globals::Globals() {
BOBZONE_FLAG[i] = false;
}
for (int i = 0; i < 500; ++i)
- STAILLE[i] = 0;
+ _spriteSize[i] = 0;
for (int i = 0; i < 32002; ++i)
super_parcours[i] = 0;
- for (int i = 0; i < 2100; ++i)
- Param[i] = 0;
for (int i = 0; i < 70; ++i)
Common::fill((byte *)&Hopkins[i], (byte *)&Hopkins[i] + sizeof(HopkinsItem), 0);
@@ -331,9 +329,9 @@ void Globals::clearAll() {
_vm->_linesManager.Ligne[idx].field8 = 0;
_vm->_linesManager.Ligne[idx]._lineData = (int16 *)g_PTRNUL;
- _vm->_linesManager._zoneLine[idx].count = 0;
+ _vm->_linesManager._zoneLine[idx]._count = 0;
_vm->_linesManager._zoneLine[idx].field2 = 0;
- _vm->_linesManager._zoneLine[idx].zoneData = (int16 *)g_PTRNUL;
+ _vm->_linesManager._zoneLine[idx]._zoneData = (int16 *)g_PTRNUL;
}
for (int idx = 0; idx < 100; ++idx) {
diff --git a/engines/hopkins/globals.h b/engines/hopkins/globals.h
index 3fdf1d0930..7879a71e53 100644
--- a/engines/hopkins/globals.h
+++ b/engines/hopkins/globals.h
@@ -173,7 +173,7 @@ struct CacheItem {
};
struct SegmentItem {
- int field0;
+ int field0; // Useless variable
int field2;
int field4;
};
@@ -312,9 +312,8 @@ public:
SegmentItem Segment[101];
int BOBZONE[105];
bool BOBZONE_FLAG[105];
- int STAILLE[500];
+ int _spriteSize[500];
int16 super_parcours[32002];
- int Param[2100];
HopkinsItem Hopkins[70];
int _inventory[36];
SortItem _sortedDisplay[51];
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index bca38038c4..69ea5b2190 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -1632,7 +1632,7 @@ void GraphicsManager::fastDisplay(const byte *spriteData, int xp, int yp, int sp
addVesaSegment(xp, yp, xp + width, yp + height);
}
-void GraphicsManager::SCOPY(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY) {
+void GraphicsManager::copySurface(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY) {
int top;
int croppedWidth;
int croppedHeight;
@@ -1824,10 +1824,6 @@ void GraphicsManager::NB_SCREEN(bool initPalette) {
DD_VBL();
}
-void GraphicsManager::SHOW_PALETTE() {
- setPaletteVGA256(_palette);
-}
-
void GraphicsManager::Copy_WinScan_Vbe(const byte *src, byte *dest) {
int destOffset;
const byte *srcPtr;
diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h
index f43e35f710..86ee8197c6 100644
--- a/engines/hopkins/graphics.h
+++ b/engines/hopkins/graphics.h
@@ -158,14 +158,13 @@ public:
int zoomOut(int v, int percentage);
void Affiche_Perfect(byte *surface, const byte *srcData, int xp300, int yp300, int frameIndex, int zoom1, int zoom2, bool flipFl);
void fastDisplay(const byte *spriteData, int xp, int yp, int spriteIndex, bool addSegment = true);
- void SCOPY(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY);
+ void copySurface(const byte *surface, int x1, int y1, int width, int height, byte *destSurface, int destX, int destY);
void Copy_Mem(const byte *srcSurface, int x1, int y1, unsigned int width, int height, byte *destSurface, int destX, int destY);
void displayFont(byte *surface, const byte *spriteData, int xp, int yp, int characterIndex, int colour);
void INI_ECRAN(const Common::String &file, bool initializeScreen);
void INI_ECRAN2(const Common::String &file, bool initializeScreen);
void OPTI_INI(const Common::String &file, int mode, bool initializeScreen);
void NB_SCREEN(bool initPalette);
- void SHOW_PALETTE();
void Copy_WinScan_Vbe(const byte *srcP, byte *destP);
void Copy_Video_Vbe(const byte *src);
void Reduc_Ecran(const byte *srcSruface, byte *destSurface, int xp, int yp, int width, int height, int zoom);
diff --git a/engines/hopkins/hopkins.cpp b/engines/hopkins/hopkins.cpp
index 45039ede8f..aa93289cc0 100644
--- a/engines/hopkins/hopkins.cpp
+++ b/engines/hopkins/hopkins.cpp
@@ -157,7 +157,7 @@ bool HopkinsEngine::runWin95Demo() {
_globals._speed = 1;
for (int i = 1; i < 50; i++) {
- _graphicsManager.SCOPY(_graphicsManager._vesaScreen, 0, 0, 640, 440, _graphicsManager._vesaBuffer, 0, 0);
+ _graphicsManager.copySurface(_graphicsManager._vesaScreen, 0, 0, 640, 440, _graphicsManager._vesaBuffer, 0, 0);
_eventsManager.VBL();
}
@@ -487,7 +487,7 @@ bool HopkinsEngine::runLinuxDemo() {
_globals._exitId = _menuManager.menu();
if (_globals._exitId == -1) {
if (!g_system->getEventManager()->shouldQuit())
- PUBQUIT();
+ endLinuxDemo();
_globals.PERSO = _globals.freeMemory(_globals.PERSO);
restoreSystem();
}
@@ -2029,7 +2029,7 @@ void HopkinsEngine::restoreSystem() {
_eventsManager.refreshEvents();
}
-void HopkinsEngine::PUBQUIT() {
+void HopkinsEngine::endLinuxDemo() {
_globals.PUBEXIT = true;
_graphicsManager.RESET_SEGMENT_VESA();
_globals._forestFl = false;
@@ -2583,7 +2583,7 @@ void HopkinsEngine::displayCredits() {
--_globals.Credit_y;
if (_globals.Credit_bx != -1 || _globals.Credit_bx1 != -1 || _globals.Credit_by != -1 || _globals.Credit_by1 != -1) {
_eventsManager.VBL();
- _graphicsManager.SCOPY(_graphicsManager._vesaScreen, 60, 50, 520, 380, _graphicsManager._vesaBuffer, 60, 50);
+ _graphicsManager.copySurface(_graphicsManager._vesaScreen, 60, 50, 520, 380, _graphicsManager._vesaBuffer, 60, 50);
} else {
_eventsManager.VBL();
}
diff --git a/engines/hopkins/hopkins.h b/engines/hopkins/hopkins.h
index 8ae9093872..4ab356be9a 100644
--- a/engines/hopkins/hopkins.h
+++ b/engines/hopkins/hopkins.h
@@ -86,7 +86,7 @@ private:
void displayNotAvailable();
void restoreSystem();
- void PUBQUIT();
+ void endLinuxDemo();
void displayEndDemo();
void bombExplosion();
void handleConflagration();
diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp
index 07fbc16d64..6fc9436a7a 100644
--- a/engines/hopkins/lines.cpp
+++ b/engines/hopkins/lines.cpp
@@ -129,7 +129,7 @@ void LinesManager::removeZoneLine(int idx) {
if (idx > MAX_LINES)
error("Attempting to remove a line obstacle > MAX_LIGNE.");
- _vm->_linesManager._zoneLine[idx].zoneData = (int16 *)_vm->_globals.freeMemory((byte *)_vm->_linesManager._zoneLine[idx].zoneData);
+ _vm->_linesManager._zoneLine[idx]._zoneData = (int16 *)_vm->_globals.freeMemory((byte *)_vm->_linesManager._zoneLine[idx]._zoneData);
}
/**
@@ -145,7 +145,7 @@ void LinesManager::addZoneLine(int idx, int a2, int a3, int a4, int a5, int bobZ
if (idx > MAX_LINES)
error("Attempting to add a line obstacle > MAX_LIGNE.");
- _zoneLine[idx].zoneData = (int16 *)_vm->_globals.freeMemory((byte *)_zoneLine[idx].zoneData);
+ _zoneLine[idx]._zoneData = (int16 *)_vm->_globals.freeMemory((byte *)_zoneLine[idx]._zoneData);
int v8 = abs(a2 - a4);
int v9 = abs(a3 - a5);
@@ -157,7 +157,7 @@ void LinesManager::addZoneLine(int idx, int a2, int a3, int a4, int a5, int bobZ
zoneData = (int16 *)_vm->_globals.allocMemory(2 * sizeof(int16) * v20 + (4 * sizeof(int16)));
int v11 = idx;
- _zoneLine[v11].zoneData = zoneData;
+ _zoneLine[v11]._zoneData = zoneData;
if (zoneData == (int16 *)g_PTRNUL)
error("AJOUTE LIGNE ZONE");
@@ -180,7 +180,7 @@ void LinesManager::addZoneLine(int idx, int a2, int a3, int a4, int a5, int bobZ
*dataP++ = -1;
*dataP++ = -1;
- _zoneLine[idx].count = v20;
+ _zoneLine[idx]._count = v20;
_zoneLine[idx].field2 = bobZoneIdx;
}
}
@@ -2066,7 +2066,6 @@ int LinesManager::PARC_PERS(int a1, int a2, int a3, int a4, int a5, int a6, int
int v109;
int v110;
int v111;
- int v112;
int v113;
int v114;
int v115;
@@ -2348,10 +2347,9 @@ LABEL_72:
v14 = 0;
int v16;
for (;;) {
- int v15 = SMOOTH[v14].field0;
- v112 = v15;
+ int v112 = SMOOTH[v14].field0;
v110 = SMOOTH[v14].field2;
- if (v15 == -1 || SMOOTH[v14].field2 == -1) {
+ if (v112 == -1 || SMOOTH[v14].field2 == -1) {
v126 = 1;
if (v126 == 1) {
v18 = v14 - 1;
@@ -2360,7 +2358,7 @@ LABEL_72:
goto LABEL_72;
}
}
- if (checkCollisionLine(v15, v110, &v143, &v142, 0, _linesNumb))
+ if (checkCollisionLine(v112, v110, &v143, &v142, 0, _linesNumb))
break;
v16 = v115;
@@ -2860,7 +2858,6 @@ int LinesManager::VERIF_SMOOTH(int a1, int a2, int a3, int a4) {
int LinesManager::SMOOTH_MOVE(int a3, int a4, int a5, int a6) {
int v6;
int v7;
- int v10;
int v11;
int v14;
int v22;
@@ -2872,7 +2869,6 @@ int LinesManager::SMOOTH_MOVE(int a3, int a4, int a5, int a6) {
int v40;
int v41;
int v42;
- int v47;
int v50;
int v51;
int v52;
@@ -2888,7 +2884,7 @@ int LinesManager::SMOOTH_MOVE(int a3, int a4, int a5, int a6) {
while (v62 > a5 && a6 > v63) {
v25 = _vm->_globals.Hopkins[hopkinsIdx].field0;
v40 = _vm->_globals.Hopkins[hopkinsIdx].field2;
- int spriteSize = _vm->_globals.STAILLE[v63];
+ int spriteSize = _vm->_globals._spriteSize[v63];
if (spriteSize < 0) {
v25 = _vm->_graphicsManager.zoomOut(v25, -spriteSize);
v40 = _vm->_graphicsManager.zoomOut(v40, -spriteSize);
@@ -2925,12 +2921,10 @@ int LinesManager::SMOOTH_MOVE(int a3, int a4, int a5, int a6) {
while (v62 < a5 && a6 > v63) {
v14 = _vm->_globals.Hopkins[v52].field0;
v39 = _vm->_globals.Hopkins[v52].field2;
- int spriteSize = _vm->_globals.STAILLE[v63];
+ int spriteSize = _vm->_globals._spriteSize[v63];
if (spriteSize < 0) {
- v47 = _vm->_globals.STAILLE[v63];
v14 = _vm->_graphicsManager.zoomOut(v14, -spriteSize);
v39 = _vm->_graphicsManager.zoomOut(v39, -spriteSize);
- spriteSize = v47;
}
if (spriteSize > 0) {
v14 = _vm->_graphicsManager.zoomIn(v14, spriteSize);
@@ -2963,10 +2957,9 @@ int LinesManager::SMOOTH_MOVE(int a3, int a4, int a5, int a6) {
smoothIdx = 0;
int loopCount = 0;
while (v62 > a5 && a6 < v63) {
- v10 = _vm->_globals.Hopkins[v51].field2;
v42 = v63;
v11 = _vm->_graphicsManager.zoomOut(_vm->_globals.Hopkins[v51].field0, 25);
- v38 = _vm->_graphicsManager.zoomOut(v10, 25);
+ v38 = _vm->_graphicsManager.zoomOut(_vm->_globals.Hopkins[v51].field2, 25);
v63 = v42;
for (int v12 = 0; v12 < v11; v12++) {
--v62;
diff --git a/engines/hopkins/lines.h b/engines/hopkins/lines.h
index 19f245ee65..f2a62eb900 100644
--- a/engines/hopkins/lines.h
+++ b/engines/hopkins/lines.h
@@ -31,14 +31,14 @@ namespace Hopkins {
class HopkinsEngine;
struct LigneZoneItem {
- int count;
+ int _count;
int field2;
- int16 *zoneData;
+ int16 *_zoneData;
};
struct LigneItem {
int _lineDataEndIdx;
- int field2;
+ int field2; // Useless variable
int field4;
int field6;
int field8;
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 26b0214535..2dc7db0f38 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -50,7 +50,7 @@ ObjectsManager::ObjectsManager() {
_saveLoadSprite = g_PTRNUL;
_saveLoadSprite2 = g_PTRNUL;
_spritePtr = g_PTRNUL;
- S_old_spr = g_PTRNUL;
+ _oldSpriteData = g_PTRNUL;
PERSO_ON = false;
_saveLoadFl = false;
_visibleFl = false;
@@ -283,7 +283,7 @@ void ObjectsManager::displaySprite() {
if (clipY < _vm->_graphicsManager._minY)
clipY = _vm->_graphicsManager._minY;
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, clipX, clipY,
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, clipX, clipY,
_vm->_fontManager._textList[idx]._width + 4, _vm->_fontManager._textList[idx]._height + 4,
_vm->_graphicsManager._vesaBuffer, clipX, clipY);
_vm->_fontManager._textList[idx]._enabledFl = false;
@@ -301,7 +301,7 @@ void ObjectsManager::displaySprite() {
if (clipY < _vm->_graphicsManager._minY)
clipY = _vm->_graphicsManager._minY;
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, clipX, clipY,
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, clipX, clipY,
_vm->_globals.Liste[idx]._width + 4, _vm->_globals.Liste[idx]._height + 4,
_vm->_graphicsManager._vesaBuffer, clipX, clipY);
_vm->_globals.Liste[idx]._visibleFl = false;
@@ -605,14 +605,6 @@ void ObjectsManager::BOB_OFFSET(int idx, int v) {
_vm->_globals._bob[idx]._oldX2 = v;
}
-void ObjectsManager::BOB_ADJUST(int idx, int v) {
- _vm->_globals._bob[idx]._oldX2 = v;
-}
-
-void ObjectsManager::BOB_OFFSETY(int idx, int v) {
- _vm->_globals._bob[idx]._offsetY = v;
-}
-
void ObjectsManager::SCBOB(int idx) {
if (_vm->_globals.Cache[idx].fieldA <= 0)
return;
@@ -1030,7 +1022,7 @@ void ObjectsManager::displayBobAnim() {
if ((v14 != 2) && (v14 != 4)) {
if (_vm->_globals.Liste2[i]._visibleFl) {
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen,
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen,
_vm->_globals.Liste2[i]._posX, _vm->_globals.Liste2[i]._posY,
_vm->_globals.Liste2[i]._width, _vm->_globals.Liste2[i]._height,
_vm->_graphicsManager._vesaBuffer, _vm->_globals.Liste2[i]._posX,
@@ -1042,7 +1034,7 @@ void ObjectsManager::displayBobAnim() {
if (_vm->_globals._bob[i].field0 == 11) {
if (_vm->_globals.Liste2[i]._visibleFl) {
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen,
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen,
_vm->_globals.Liste2[i]._posX, _vm->_globals.Liste2[i]._posY,
_vm->_globals.Liste2[i]._width, _vm->_globals.Liste2[i]._height,
_vm->_graphicsManager._vesaBuffer,
@@ -1888,7 +1880,7 @@ void ObjectsManager::CARRE_ZONE() {
}
for (int idx = 0; idx < MAX_LINES; ++idx) {
- int16 *dataP = _vm->_linesManager._zoneLine[idx].zoneData;
+ int16 *dataP = _vm->_linesManager._zoneLine[idx]._zoneData;
if (dataP == (int16 *)g_PTRNUL)
continue;
@@ -1899,7 +1891,7 @@ void ObjectsManager::CARRE_ZONE() {
if (_vm->_globals.CarreZone[v4]._minZoneLineIdx > idx)
_vm->_globals.CarreZone[v4]._minZoneLineIdx = idx;
- for (int i = 0; i < _vm->_linesManager._zoneLine[idx].count; i++) {
+ for (int i = 0; i < _vm->_linesManager._zoneLine[idx]._count; i++) {
int zoneX = *dataP++;
int zoneY = *dataP++;
@@ -2299,7 +2291,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
CharacterLocation *loc;
_changeHeadFl = true;
- _vm->_graphicsManager.SCOPY(_vm->_graphicsManager._vesaScreen, 532, 25, 65, 40, _vm->_graphicsManager._vesaBuffer, 532, 25);
+ _vm->_graphicsManager.copySurface(_vm->_graphicsManager._vesaScreen, 532, 25, 65, 40, _vm->_graphicsManager._vesaBuffer, 532, 25);
_vm->_graphicsManager.addVesaSegment(532, 25, 597, 65);
_vm->_globals.NOT_VERIF = true;
_vm->_globals.chemin = (int16 *)g_PTRNUL;
@@ -2412,7 +2404,7 @@ void ObjectsManager::changeCharacterHead(PlayerCharacter oldCharacter, PlayerCha
// Check Size
void ObjectsManager::computeAndSetSpriteSize() {
- int size = _vm->_globals.STAILLE[getSpriteY(0)];
+ int size = _vm->_globals._spriteSize[getSpriteY(0)];
if (_vm->_globals.PERSO_TYPE == 1) {
size = 20 * (5 * abs(size) - 100) / -80;
} else if (_vm->_globals.PERSO_TYPE == 2) {
@@ -3208,7 +3200,7 @@ void ObjectsManager::handleSpecialGames() {
PERSO_ON = false;
memcpy(_vm->_graphicsManager._palette, oldPalette, 769);
- _vm->_graphicsManager.SHOW_PALETTE();
+ _vm->_graphicsManager.setPaletteVGA256(_vm->_graphicsManager._palette);
_vm->_globals.freeMemory(oldPalette);
_vm->_graphicsManager.lockScreen();
_vm->_graphicsManager.m_scroll16(_vm->_graphicsManager._vesaScreen, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
@@ -3627,7 +3619,7 @@ void ObjectsManager::INILINK(const Common::String &file) {
}
if (!OBSSEUL) {
for (int idx = 0; idx < 500; ++idx)
- _vm->_globals.STAILLE[idx] = (int16)READ_LE_UINT16((uint16 *)ptr + idx);
+ _vm->_globals._spriteSize[idx] = (int16)READ_LE_UINT16((uint16 *)ptr + idx);
_vm->_globals.resetCache();
@@ -4017,7 +4009,7 @@ void ObjectsManager::enableVerb(int idx, int a2) {
int ObjectsManager::CALC_PROPRE(int idx) {
int retVal = 25;
- int size = _vm->_globals.STAILLE[idx];
+ int size = _vm->_globals._spriteSize[idx];
if (_vm->_globals.PERSO_TYPE == 1) {
if (size < 0)
size = -size;
@@ -4052,9 +4044,9 @@ int ObjectsManager::colision(int xp, int yp) {
int yMin = yp - 4;
do {
- int16 *dataP = _vm->_linesManager._zoneLine[field2].zoneData;
+ int16 *dataP = _vm->_linesManager._zoneLine[field2]._zoneData;
if (dataP != (int16 *)g_PTRNUL) {
- int count = _vm->_linesManager._zoneLine[field2].count;
+ int count = _vm->_linesManager._zoneLine[field2]._count;
int v1 = dataP[0];
int v2 = dataP[1];
int v3 = dataP[count * 2 - 2];
@@ -4070,7 +4062,7 @@ int ObjectsManager::colision(int xp, int yp) {
if (v2 >= v4 && (yMin > v2 || yMax < v4))
flag = false;
- if (flag && _vm->_linesManager._zoneLine[field2].count > 0) {
+ if (flag && _vm->_linesManager._zoneLine[field2]._count > 0) {
for (int i = 0; i < count; ++i) {
int xCheck = *dataP++;
int yCheck = *dataP++;
@@ -4137,7 +4129,7 @@ void ObjectsManager::ACTION(const byte *spriteData, const Common::String &a2, in
}
}
-void ObjectsManager::SPACTION(byte *a1, const Common::String &animationSeq, int a3, int a4, int speed, bool flipFl) {
+void ObjectsManager::SPACTION(byte *spriteData, const Common::String &animationSeq, int a3, int a4, int speed, bool flipFl) {
int spriteIndex = 0;
Common::String tmpStr = "";
@@ -4147,7 +4139,7 @@ void ObjectsManager::SPACTION(byte *a1, const Common::String &animationSeq, int
else if (_vm->_globals._speed == 3)
realSpeed = speed / 3;
- S_old_spr = _sprite[0]._spriteData;
+ _oldSpriteData = _sprite[0]._spriteData;
_oldSpriteIndex = _sprite[0]._spriteIndex;
_oldFlipFl = _sprite[0]._flipFl;
_sprite[0].field12 += a3;
@@ -4174,7 +4166,7 @@ void ObjectsManager::SPACTION(byte *a1, const Common::String &animationSeq, int
} while (!completeTokenFl);
if (spriteIndex != -1) {
- _sprite[0]._spriteData = a1;
+ _sprite[0]._spriteData = spriteData;
_sprite[0]._spriteIndex = spriteIndex;
}
for (int i = 0; i < realSpeed; i++)
@@ -4211,7 +4203,7 @@ void ObjectsManager::SPACTION1(byte *spriteData, const Common::String &animStrin
if (completeTokenFl) {
if (spriteIndex == -1) {
- _sprite[0]._spriteData = S_old_spr;
+ _sprite[0]._spriteData = _oldSpriteData;
_sprite[0]._spriteIndex = _oldSpriteIndex;
_sprite[0].field12 -= a3;
_sprite[0].field14 -= a4;
diff --git a/engines/hopkins/objects.h b/engines/hopkins/objects.h
index 61e87bca88..3c3db8687b 100644
--- a/engines/hopkins/objects.h
+++ b/engines/hopkins/objects.h
@@ -70,7 +70,7 @@ public:
byte *_saveLoadSprite;
byte *_saveLoadSprite2;
byte *_spritePtr;
- const byte *S_old_spr;
+ const byte *_oldSpriteData;
bool PERSO_ON;
bool _saveLoadFl;
bool _visibleFl;
@@ -119,8 +119,6 @@ public:
void BOB_VISU(int idx);
void BOB_OFF(int idx);
void BOB_OFFSET(int idx, int v);
- void BOB_ADJUST(int idx, int v);
- void BOB_OFFSETY(int idx, int v);
void SCBOB(int idx);
void CALCUL_BOB(int idx);
@@ -204,7 +202,7 @@ public:
int colision(int xp, int yp);
void ACTION(const byte *spriteData, const Common::String &a2, int a3, int a4, int speed, bool flipFl);
- void SPACTION(byte *a1, const Common::String &animationSeq, int a3, int a4, int speed, bool flipFl);
+ void SPACTION(byte *spriteData, const Common::String &animationSeq, int a3, int a4, int speed, bool flipFl);
void SPACTION1(byte *spriteData, const Common::String &animString, int a3, int a4, int speed);
void handleForest(int screenId, int minX, int maxX, int minY, int maxY, int idx);
void lockAnimX(int idx, int a2);
diff --git a/engines/hopkins/script.cpp b/engines/hopkins/script.cpp
index cd871b59a8..7bca24714a 100644
--- a/engines/hopkins/script.cpp
+++ b/engines/hopkins/script.cpp
@@ -2198,23 +2198,21 @@ int ScriptManager::handleOpcode(byte *dataP) {
_vm->_animationManager.NO_SEQ = true;
_vm->_animationManager.playSequence("RESUF.SEQ", 1, 24, 1);
_vm->_animationManager.NO_SEQ = false;
- CharacterLocation *v53 = &_vm->_globals._saveData->_samantha;
- v53->_pos.x = 404;
- v53->_pos.y = 395;
- v53->_startSpriteIndex = 64;
- v53->_location = _vm->_globals._screenId;
-
- int v54 = _vm->_globals.STAILLE[790 / 2];
- if (_vm->_globals.STAILLE[790 / 2] < 0)
- v54 = -_vm->_globals.STAILLE[790 / 2];
- v53->_zoomFactor = -(100 * (67 - (100 - v54)) / 67);
+
+ CharacterLocation *samantha = &_vm->_globals._saveData->_samantha;
+ samantha->_pos.x = 404;
+ samantha->_pos.y = 395;
+ samantha->_startSpriteIndex = 64;
+ samantha->_location = _vm->_globals._screenId;
+ samantha->_zoomFactor = -(100 * (67 - (100 - abs(_vm->_globals._spriteSize[790 / 2]))) / 67);
+
_vm->_globals._saveData->_data[svField357] = 1;
_vm->_globals._saveData->_data[svField354] = 0;
_vm->_globals._saveData->_data[svField356] = 0;
_vm->_globals._saveData->_data[svField355] = 1;
_vm->_objectsManager._twoCharactersFl = true;
_vm->_graphicsManager.fastDisplay(_vm->_globals.SPRITE_ECRAN, 373, 191, 3);
- _vm->_objectsManager.addStaticSprite(_vm->_globals.TETE, v53->_pos, 1, 3, v53->_zoomFactor, false, 20, 127);
+ _vm->_objectsManager.addStaticSprite(_vm->_globals.TETE, samantha->_pos, 1, 3, samantha->_zoomFactor, false, 20, 127);
_vm->_objectsManager.animateSprite(1);
break;
}