aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/hopkins/font.cpp25
-rw-r--r--engines/hopkins/graphics.cpp148
-rw-r--r--engines/hopkins/graphics.h6
-rw-r--r--engines/hopkins/lines.cpp51
-rw-r--r--engines/hopkins/menu.cpp2
-rw-r--r--engines/hopkins/objects.cpp33
6 files changed, 100 insertions, 165 deletions
diff --git a/engines/hopkins/font.cpp b/engines/hopkins/font.cpp
index 92d0c72263..c7d48d3717 100644
--- a/engines/hopkins/font.cpp
+++ b/engines/hopkins/font.cpp
@@ -166,10 +166,9 @@ void FontManager::box(int idx, int messageId, const Common::String &filename, in
}
} else {
int lineCount = 0;
- int v62 = 0;
- do {
- _textSortArray[v62++] = 0;
- } while (v62 <= 19);
+ for (int v62 = 0; v62 <= 19; v62++)
+ _textSortArray[v62] = 0;
+
_text[idx]._textLoadedFl = true;
_vm->_fileManager.constructFilename(_vm->_globals.HOPLINK, filename);
@@ -285,7 +284,7 @@ LABEL_43:
lineSize = v19;
do
v11 = *(v61 + v65 + v19++);
- while (v11 != 32 && v11 != 37);
+ while (v11 != ' ' && v11 != '%');
if (v19 >= ptrb / _vm->_globals.police_l)
break;
if (v11 == '%') {
@@ -296,7 +295,7 @@ LABEL_43:
}
if (v11 != '%')
goto LABEL_57;
- v11 = 32;
+ v11 = ' ';
LABEL_55:
if (v11 == '%')
lineSize = v19;
@@ -316,7 +315,7 @@ LABEL_57:
v65 += lineSize;
v11 = v21;
- } while (v21 != 37);
+ } while (v21 != '%');
for (int i = 0; i <= 19; i++) {
int v22 = _textSortArray[i];
@@ -328,8 +327,8 @@ LABEL_57:
for (int v23 = 0; v23 < _textSortArray[i] - 1; v23++) {
Common::String &line = _text[idx]._lines[i];
byte v24 = (v23 >= (int)line.size()) ? '\0' : line.c_str()[v23];
- if ((byte)v24 <= 0x1Fu)
- v24 = 32;
+ if (v24 <= 32)
+ v24 = ' ';
ptrc += _vm->_objectsManager.getWidth(_vm->_globals.police, (byte)v24 - 32);
}
}
@@ -399,10 +398,10 @@ LABEL_57:
_vm->_graphicsManager.Restore_Mem(_vm->_graphicsManager.VESA_BUFFER, ptrd, v56, v55, v53, v51);
_vm->_globals.freeMemory(ptrd);
- _vm->_graphicsManager.Plot_Hline(_vm->_graphicsManager.VESA_BUFFER, v56, v55, v53, (byte)-2);
- _vm->_graphicsManager.Plot_Hline(_vm->_graphicsManager.VESA_BUFFER, v56, v51 + v55, v53, (byte)-2);
- _vm->_graphicsManager.Plot_Vline(_vm->_graphicsManager.VESA_BUFFER, v56, v70, v51, (byte)-2);
- _vm->_graphicsManager.Plot_Vline(_vm->_graphicsManager.VESA_BUFFER, v53 + v56, v70, v51, (byte)-2);
+ _vm->_graphicsManager.drawHorizontalLine(_vm->_graphicsManager.VESA_BUFFER, v56, v55, v53, (byte)-2);
+ _vm->_graphicsManager.drawHorizontalLine(_vm->_graphicsManager.VESA_BUFFER, v56, v51 + v55, v53, (byte)-2);
+ _vm->_graphicsManager.drawVerticalLine(_vm->_graphicsManager.VESA_BUFFER, v56, v70, v51, (byte)-2);
+ _vm->_graphicsManager.drawVerticalLine(_vm->_graphicsManager.VESA_BUFFER, v53 + v56, v70, v51, (byte)-2);
}
_text[idx]._lineCount = lineCount;
int v75 = v73 + 5;
diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp
index cb11b4ddb1..7c630dcf42 100644
--- a/engines/hopkins/graphics.cpp
+++ b/engines/hopkins/graphics.cpp
@@ -66,7 +66,7 @@ GraphicsManager::GraphicsManager() {
SDL_NBLOCS = 0;
Red_x = Red_y = 0;
Red = 0;
- Largeur = 0;
+ _width = 0;
Compteur_y = 0;
spec_largeur = 0;
@@ -274,17 +274,13 @@ void GraphicsManager::Trans_bloc(byte *destP, const byte *srcP, int count, int m
}
void GraphicsManager::Trans_bloc2(byte *surface, byte *col, int size) {
- byte *dataP;
- int count;
byte dataVal;
- dataP = surface;
- count = size - 1;
- do {
+ byte *dataP = surface;
+ for (int count = size - 1; count; count--){
dataVal = *dataP++;
*(dataP - 1) = *(dataVal + col);
- --count;
- } while (count);
+ }
}
// TODO: See if it's feasible and/or desirable to change this to use the Common PCX decoder
@@ -332,12 +328,9 @@ void GraphicsManager::A_PCX320(byte *surface, const Common::String &file, byte *
size_t filesize;
int v4;
size_t v5;
- int v6;
size_t v7;
- int v8;
byte v9;
int v10;
- int v11;
char v12;
int v15;
int v16;
@@ -367,18 +360,17 @@ void GraphicsManager::A_PCX320(byte *surface, const Common::String &file, byte *
v5 = v4;
}
v16 = v15 - 1;
- v6 = 0;
v7 = 0;
- do {
+ for (int i = 0; i < 64000; i++) {
if (v7 == v5) {
v7 = 0;
--v16;
v5 = 64000;
if (!v16)
v5 = v17;
- v8 = v6;
+// v8 = i;
f.read(ptr, v5);
- v6 = v8;
+// i = v8;
}
v9 = *(ptr + v7++);
if (v9 > 0xC0u) {
@@ -389,22 +381,22 @@ void GraphicsManager::A_PCX320(byte *surface, const Common::String &file, byte *
v5 = 64000;
if (v16 == 1)
v5 = v17;
- v11 = v6;
+// v11 = i;
f.read(ptr, v5);
- v6 = v11;
+// i = v11;
}
v12 = *(ptr + v7++);
do {
- *(surface + v6++) = v12;
+ *(surface + i++) = v12;
--v10;
} while (v10);
} else {
- *(surface + v6++) = v9;
+ *(surface + i++) = v9;
}
- } while (v6 <= 0xF9FF);
+ }
f.seek(filesize - 768);
- f.read(palette, 0x300u);
+ f.read(palette, 768);
f.close();
_vm->_globals.freeMemory(ptr);
@@ -643,36 +635,31 @@ void GraphicsManager::fade_out(const byte *palette, int step, const byte *surfac
palMax = palByte = FADESPD;
if (palette) {
- int palIndex = 0;
- do {
+ for (int palIndex = 0; palIndex < PALETTE_BLOCK_SIZE; palIndex++) {
int palDataIndex = palIndex;
- palByte = *(palIndex + palette);
+ palByte = palette[palIndex];
palByte <<= 8;
tempPalette[palDataIndex] = palByte;
- palData[palDataIndex] = *(palIndex++ + palette);
- } while (palIndex < PALETTE_BLOCK_SIZE);
+ palData[palDataIndex] = palette[palIndex];
+ }
setpal_vga256(palData);
m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
DD_VBL();
- int palCtr3 = 0;
if (palMax > 0) {
- do {
- int palCtr4 = 0;
- do {
+ for (int palCtr3 = 0; palCtr3 < palMax; palCtr3++) {
+ for (int palCtr4 = 0; palCtr4 < PALETTE_BLOCK_SIZE; palCtr4++) {
int palCtr5 = palCtr4;
- int palValue = tempPalette[palCtr4] - (*(palCtr4 + palette) << 8) / palMax;
+ int palValue = tempPalette[palCtr4] - (palette[palCtr4] << 8) / palMax;
tempPalette[palCtr5] = palValue;
palData[palCtr5] = (palValue >> 8) & 0xff;
- ++palCtr4;
- } while (palCtr4 < (PALETTE_BLOCK_SIZE));
+ }
setpal_vga256(palData);
m_scroll16(surface, _vm->_eventsManager._startPos.x, 0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, 0);
DD_VBL();
- ++palCtr3;
- } while (palMax > palCtr3);
+ }
}
for (int i = 0; i < PALETTE_BLOCK_SIZE; i++)
@@ -1349,8 +1336,6 @@ void GraphicsManager::CopyAsm(const byte *surface) {
const byte *srcP;
byte srcByte;
byte *destP;
- int yCtr;
- int xCtr;
byte *dest1P;
byte *dest2P;
byte *dest3P;
@@ -1361,13 +1346,10 @@ void GraphicsManager::CopyAsm(const byte *surface) {
srcP = surface;
srcByte = 30 * WinScan;
destP = (byte *)VideoPtr->pixels + 30 * WinScan;
- yCtr = 200;
- do {
+ for (int yCtr = 200; yCtr != 0; yCtr--) {
srcPitch = srcP;
destPitch = destP;
- xCtr = 320;
-
- do {
+ for (int xCtr = 320; xCtr != 0; xCtr--) {
srcByte = *srcP;
*destP = *srcP;
dest1P = WinScan + destP;
@@ -1378,20 +1360,17 @@ void GraphicsManager::CopyAsm(const byte *surface) {
*dest3P = srcByte;
destP = dest3P - WinScan + 1;
++srcP;
- --xCtr;
- } while (xCtr);
+ }
srcP = srcPitch + 320;
destP = WinScan + WinScan + destPitch;
- --yCtr;
- } while (yCtr);
+ }
}
void GraphicsManager::CopyAsm16(const byte *surface) {
const byte *v1;
byte *v2;
int v3;
- signed int v4;
byte *v5;
uint16 *v6;
int v;
@@ -1407,10 +1386,9 @@ void GraphicsManager::CopyAsm16(const byte *surface) {
do {
v11 = v1;
v10 = v2;
- v4 = 320;
v9 = v3;
v5 = PAL_PIXELS;
- do {
+ for (int v4 = 320; v4; v4--) {
v = 2 * *v1;
v6 = (uint16 *)(v5 + 2 * *v1);
v = *v6;
@@ -1421,8 +1399,7 @@ void GraphicsManager::CopyAsm16(const byte *surface) {
*(v8 + 1) = v;
++v1;
v2 = (byte *)v8 - WinScan + 4;
- --v4;
- } while (v4);
+ }
v1 = v11 + 320;
v2 = WinScan * 2 + v10;
v3 = v9 - 1;
@@ -1525,7 +1502,7 @@ void GraphicsManager::Affiche_Perfect(byte *surface, const byte *srcData, int xp
Agr_y = 0;
Agr_Flag_y = 0;
Agr_Flag_x = 0;
- Largeur = spriteWidth;
+ _width = spriteWidth;
int v20 = zoomIn(spriteWidth, zoom2);
int v22 = zoomIn(spriteHeight1, zoom2);
if (modeFlag) {
@@ -1540,7 +1517,7 @@ void GraphicsManager::Affiche_Perfect(byte *surface, const byte *srcData, int xp
while (zoomIn(v30 + 1, zoom2) < v31)
;
v20 = v52;
- spritePixelsP += Largeur * v30;
+ spritePixelsP += _width * v30;
v29 += nbrligne2 * (uint16)clip_y;
v22 = v61 - (uint16)clip_y;
}
@@ -1571,8 +1548,7 @@ void GraphicsManager::Affiche_Perfect(byte *surface, const byte *srcData, int xp
v46 = spritePixelsP;
Agr_Flag_x = 0;
Agr_x = 0;
- int v35 = v20;
- do {
+ for (int v35 = v20; v35; v35--) {
for (;;) {
if (*spritePixelsP)
*v29 = *spritePixelsP;
@@ -1590,10 +1566,9 @@ void GraphicsManager::Affiche_Perfect(byte *surface, const byte *srcData, int xp
goto R_Aff_Zoom_Larg_Cont1;
}
Agr_Flag_x = 0;
- --v35;
- } while (v35);
+ }
R_Aff_Zoom_Larg_Cont1:
- spritePixelsP = Largeur + v46;
+ spritePixelsP = _width + v46;
v29 = nbrligne2 + v53;
++Compteur_y;
if (!Agr_Flag_y)
@@ -1621,7 +1596,7 @@ R_Aff_Zoom_Larg_Cont1:
while (zoomIn(v23 + 1, zoom2) < v24)
;
v20 = v49;
- spritePixelsP += Largeur * v23;
+ spritePixelsP += _width * v23;
dest1P += nbrligne2 * (uint16)clip_y;
v22 = v58 - (uint16)clip_y;
}
@@ -1675,7 +1650,7 @@ R_Aff_Zoom_Larg_Cont1:
--v28;
} while (v28);
Aff_Zoom_Larg_Cont1:
- spritePixelsP = Largeur + v45;
+ spritePixelsP = _width + v45;
dest1P = nbrligne2 + v51;
if (!Agr_Flag_y)
Agr_y = zoom2 + Agr_y;
@@ -1696,7 +1671,7 @@ Aff_Zoom_Larg_Cont1:
Compteur_y = 0;
Red_x = 0;
Red_y = 0;
- Largeur = spriteWidth;
+ _width = spriteWidth;
Red = zoom1;
if (zoom1 < 100) {
int v37 = zoomOut(spriteWidth, Red);
@@ -1708,9 +1683,8 @@ Aff_Zoom_Larg_Cont1:
Red_y = Red + Red_y;
if ((uint16)Red_y < 0x64u) {
Red_x = 0;
- int v41 = Largeur;
int v42 = v37;
- do {
+ for (int v41 = _width; v41; v41--) {
Red_x = Red + Red_x;
if ((uint16)Red_x < 0x64u) {
if (v42 >= clip_x && v42 < clip_x1 && *spritePixelsP)
@@ -1722,13 +1696,12 @@ Aff_Zoom_Larg_Cont1:
Red_x = Red_x - 100;
++spritePixelsP;
}
- --v41;
- } while (v41);
+ }
spriteHeight2 = v65;
v40 = nbrligne2 + v55;
} else {
Red_y = Red_y - 100;
- spritePixelsP += Largeur;
+ spritePixelsP += _width;
}
--spriteHeight2;
} while (spriteHeight2);
@@ -1739,9 +1712,8 @@ Aff_Zoom_Larg_Cont1:
Red_y = Red + Red_y;
if ((uint16)Red_y < 0x64u) {
Red_x = 0;
- int v38 = Largeur;
int v39 = 0;
- do {
+ for (int v38 = _width; v38; v38--) {
Red_x = Red + Red_x;
if ((uint16)Red_x < 0x64u) {
if (v39 >= clip_x && v39 < clip_x1 && *spritePixelsP)
@@ -1753,20 +1725,19 @@ Aff_Zoom_Larg_Cont1:
Red_x = Red_x - 100;
++spritePixelsP;
}
- --v38;
- } while (v38);
+ }
spriteHeight2 = v64;
dest1P = nbrligne2 + v54;
} else {
Red_y = Red_y - 100;
- spritePixelsP += Largeur;
+ spritePixelsP += _width;
}
--spriteHeight2;
} while (spriteHeight2);
}
}
} else {
- Largeur = spriteWidth;
+ _width = spriteWidth;
Compteur_y = 0;
if (modeFlag) {
dest2P = spriteWidth + dest1P;
@@ -1938,7 +1909,6 @@ void GraphicsManager::Affiche_Fonte(byte *surface, const byte *spriteData, int x
int spriteHeight;
const byte *spritePixelsP;
byte *destP;
- int xCtr;
byte destByte;
byte *destLineP;
int yCtr;
@@ -1955,13 +1925,12 @@ void GraphicsManager::Affiche_Fonte(byte *surface, const byte *spriteData, int x
spriteHeight = (int16)READ_LE_UINT16(spriteSizeP);
spritePixelsP = spriteSizeP + 10;
destP = surface + xp + nbrligne2 * yp;
- Largeur = spriteWidth;
+ _width = spriteWidth;
do {
yCtr = spriteHeight;
destLineP = destP;
- xCtr = spriteWidth;
- do {
+ for (int xCtr = spriteWidth; xCtr; xCtr--) {
destByte = *spritePixelsP;
if (*spritePixelsP) {
if (destByte == (byte)-4)
@@ -1971,8 +1940,7 @@ void GraphicsManager::Affiche_Fonte(byte *surface, const byte *spriteData, int x
++destP;
++spritePixelsP;
- --xCtr;
- } while (xCtr);
+ }
destP = nbrligne2 + destLineP;
spriteHeight = yCtr - 1;
} while (yCtr != 1);
@@ -2161,7 +2129,7 @@ void GraphicsManager::Reduc_Ecran(const byte *srcSurface, byte *destSurface, int
srcP = xp + nbrligne2 * yp + srcSurface;
destP = destSurface;
Red = zoom;
- Largeur = width;
+ _width = width;
Red_x = 0;
Red_y = 0;
if (zoom < 100) {
@@ -2174,7 +2142,7 @@ void GraphicsManager::Reduc_Ecran(const byte *srcSurface, byte *destSurface, int
Red_x = 0;
const byte *lineSrcP = srcP;
- for (int xCtr = 0; xCtr < Largeur; ++xCtr) {
+ for (int xCtr = 0; xCtr < _width; ++xCtr) {
Red_x += Red;
if (Red_x < 100) {
*destP++ = *lineSrcP++;
@@ -2190,21 +2158,23 @@ void GraphicsManager::Reduc_Ecran(const byte *srcSurface, byte *destSurface, int
}
}
-void GraphicsManager::Plot_Hline(byte *surface, int xp, int yp, unsigned int width, byte col) {
+/**
+ * Draw horizontal line
+ */
+void GraphicsManager::drawHorizontalLine(byte *surface, int xp, int yp, unsigned int width, byte col) {
memset(surface + xp + nbrligne2 * yp, col, width);
}
-void GraphicsManager::Plot_Vline(byte *surface, int xp, int yp, int height, byte col) {
- byte *destP;
- int yCtr;
+/**
+ * Draw vertical line
+ */
+void GraphicsManager::drawVerticalLine(byte *surface, int xp, int yp, int height, byte col) {
+ byte *destP = surface + xp + nbrligne2 * yp;
- destP = surface + xp + nbrligne2 * yp;
- yCtr = height;
- do {
+ for (int yCtr = height; yCtr; yCtr--) {
*destP = col;
destP += nbrligne2;
- --yCtr;
- } while (yCtr);
+ }
}
void GraphicsManager::MODE_VESA() {
diff --git a/engines/hopkins/graphics.h b/engines/hopkins/graphics.h
index deb396b0db..24ea17083a 100644
--- a/engines/hopkins/graphics.h
+++ b/engines/hopkins/graphics.h
@@ -95,7 +95,7 @@ public:
int SDL_NBLOCS;
int Red_x, Red_y;
int Red;
- int Largeur;
+ int _width;
int Compteur_y;
int spec_largeur;
bool NOFADE;
@@ -185,8 +185,8 @@ public:
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);
- void Plot_Hline(byte *surface, int xp, int yp, unsigned int width, byte col);
- void Plot_Vline(byte *surface, int xp, int yp, int height, byte col);
+ void drawHorizontalLine(byte *surface, int xp, int yp, unsigned int width, byte col);
+ void drawVerticalLine(byte *surface, int xp, int yp, int height, byte col);
void MODE_VESA();
};
diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp
index 99ed0d9440..63ea1ef8e5 100644
--- a/engines/hopkins/lines.cpp
+++ b/engines/hopkins/lines.cpp
@@ -226,7 +226,6 @@ void LinesManager::AJOUTE_LIGNE(int idx, int a2, int a3, int a4, int a5, int a6,
int v13;
int v24;
int v25;
- int v26;
int16 *v27;
int v30;
int v31;
@@ -342,9 +341,8 @@ void LinesManager::AJOUTE_LIGNE(int idx, int a2, int a3, int a4, int a5, int a6,
v31 = 1000 * a3 / 1000;
v30 = 1000 * a4 / 1000;
v35 = v34 - 1;
- v26 = 0;
if (v35 > 0) {
- do {
+ for (int v26 = 0; v26 < v35; v26++) {
v32[0] = v31;
v32[1] = v30;
v32 += 2;
@@ -353,8 +351,7 @@ void LinesManager::AJOUTE_LIGNE(int idx, int a2, int a3, int a4, int a5, int a6,
v25 += v38;
v31 = v24 / 1000;
v30 = v25 / 1000;
- ++v26;
- } while (v35 > v26);
+ }
}
v32[0] = a5;
v32[1] = a6;
@@ -556,9 +553,7 @@ void LinesManager::INIPARCOURS() {
int16 *v3;
int v4;
int v5;
- int v6;
int16 *v7;
- int v8;
int v9;
int v11;
int v12;
@@ -583,9 +578,9 @@ void LinesManager::INIPARCOURS() {
if (v15 == v4 && v14 == v5)
v1 = 1;
if (v0 == 400) {
- v6 = v1;
+// v6 = v1;
error("ERROR - LAST LINE NOT FOUND");
- v1 = v6;
+// v1 = v6;
}
v7 = Ligne[v0 + 1].lineData;
if (v7[0] != v4 && v7[1] != v5)
@@ -595,10 +590,9 @@ void LinesManager::INIPARCOURS() {
} while (v1 != 1);
_vm->_objectsManager.DERLIGNE = v0;
- v8 = 1;
v13 = _vm->_globals.Max_Ligne_Long;
v9 = _vm->_objectsManager.DERLIGNE + 1;
- do {
+ for (int v8 = 1; v8 != 400; v8++) {
v11 = v8;
if (Ligne[v11].field0 < v13) {
if (v8 != v9) {
@@ -607,8 +601,7 @@ void LinesManager::INIPARCOURS() {
Ligne[v11].field8 = Ligne[v12].field8;
}
}
- ++v8;
- } while (v8 != 400);
+ }
}
// Avoid
@@ -732,7 +725,7 @@ int LinesManager::CONTOURNE1(int a1, int a2, int a3, int a4, int a5, int16 *a6,
v40 += a7;
}
int v15 = a1 + 1;
- if ((int)(a1 + 1) == a9 + 1)
+ if (a1 + 1 == a9 + 1)
v15 = a8;
while (a4 != v15) {
if (Ligne[v15].field0 > 0) {
@@ -842,16 +835,12 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) {
int v19;
int l;
int v21;
- int v22;
int v23;
int v24;
- int v25;
int v26;
int v27;
- int v28;
int v29;
int v30;
- int v31;
int v32;
int v33;
int v35 = 0;
@@ -1032,9 +1021,8 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) {
v35 = v43;
}
if (v21 == 1) {
- v22 = 0;
if (v39 > 0) {
- do {
+ for (int v22 = 0; v22 < v39; v22++) {
if (colision2_ligne(v41, v40 - v22, &v47, &v46, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) == 1
&& _vm->_objectsManager.DERLIGNE < v46) {
v23 = GENIAL(v46, v47, v41, v40 - v22, v41, v40 - v39, v7, &_vm->_globals.super_parcours[0], 4);
@@ -1050,8 +1038,7 @@ int LinesManager::MIRACLE(int a1, int a2, int a3, int a4, int a5) {
_vm->_globals.super_parcours[v24 + 2] = 1;
_vm->_globals.super_parcours[v24 + 3] = 0;
v7 += 4;
- ++v22;
- } while (v39 > v22);
+ }
}
LABEL_186:
NV_LIGNEDEP = v36;
@@ -1060,9 +1047,8 @@ LABEL_186:
return 1;
}
if (v21 == 5) {
- v25 = 0;
if (v37 > 0) {
- do {
+ for (int v25 = 0; v25 < v37; v25++) {
if (colision2_ligne(v41, v25 + v40, &v47, &v46, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) == 1
&& _vm->_objectsManager.DERLIGNE < v46) {
v26 = GENIAL(v46, v47, v41, v25 + v40, v41, v37 + v40, v7, &_vm->_globals.super_parcours[0], 4);
@@ -1078,15 +1064,13 @@ LABEL_186:
_vm->_globals.super_parcours[v27 + 2] = 5;
_vm->_globals.super_parcours[v27 + 3] = 0;
v7 += 4;
- ++v25;
- } while (v37 > v25);
+ }
}
goto LABEL_186;
}
if (v21 == 7) {
- v28 = 0;
if (v18 > 0) {
- do {
+ for (int v28 = 0; v28 < v18; v28++) {
if (colision2_ligne(v41 - v28, v40, &v47, &v46, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) == 1
&& _vm->_objectsManager.DERLIGNE < v46) {
v29 = GENIAL(v46, v47, v41 - v28, v40, v41 - v18, v40, v7, &_vm->_globals.super_parcours[0], 4);
@@ -1102,15 +1086,13 @@ LABEL_186:
_vm->_globals.super_parcours[v30 + 2] = 7;
_vm->_globals.super_parcours[v30 + 3] = 0;
v7 += 4;
- ++v28;
- } while (v18 > v28);
+ }
}
goto LABEL_186;
}
if (v21 == 3) {
- v31 = 0;
if (v38 > 0) {
- do {
+ for (int v31 = 0; v31 < v38; v31++) {
if (colision2_ligne(v31 + v41, v40, &v47, &v46, _vm->_objectsManager.DERLIGNE + 1, TOTAL_LIGNES) == 1
&& _vm->_objectsManager.DERLIGNE < v46) {
v32 = GENIAL(v46, v47, v31 + v41, v40, v38 + v41, v40, v7, &_vm->_globals.super_parcours[0], 4);
@@ -1126,8 +1108,7 @@ LABEL_186:
_vm->_globals.super_parcours[v33 + 2] = 3;
_vm->_globals.super_parcours[v33 + 3] = 0;
v7 += 4;
- ++v31;
- } while (v38 > v31);
+ }
}
goto LABEL_186;
}
@@ -1381,9 +1362,9 @@ LABEL_17:
if (v40 < 0)
v40 = -v40;
int v41 = v40;
- int v42 = a1;
int v43 = 0;
int v52 = v92 - 1;
+ int v42 = a1;
do {
if (v52 == v42)
v42 = v91;
diff --git a/engines/hopkins/menu.cpp b/engines/hopkins/menu.cpp
index 6f17879cba..6cb5c2e9b3 100644
--- a/engines/hopkins/menu.cpp
+++ b/engines/hopkins/menu.cpp
@@ -175,7 +175,7 @@ int MenuManager::MENU() {
_vm->_eventsManager.VBL();
if (_vm->_eventsManager.getMouseButton() == 1 && menuIndex != MENU_NONE)
- selectionMade = 1;
+ selectionMade = true;
} while (!selectionMade);
if (menuIndex == PLAY_GAME) {
diff --git a/engines/hopkins/objects.cpp b/engines/hopkins/objects.cpp
index 1f38b74582..5dac113550 100644
--- a/engines/hopkins/objects.cpp
+++ b/engines/hopkins/objects.cpp
@@ -327,9 +327,6 @@ void ObjectsManager::displaySprite() {
int v27;
int x1_1;
int x1_2;
- int v33;
- int v34;
- int v35;
uint16 arr[50];
// Handle copying any background areas that text are going to be drawn on
@@ -406,20 +403,16 @@ void ObjectsManager::displaySprite() {
}
if (_priorityFl && _vm->_globals.NBTRI) {
- v33 = 1;
- do {
+ for (int v33 = 1; v33 <= 48; v33++)
arr[v33] = v33;
- ++v33;
- } while (v33 <= 48);
v25 = _vm->_globals.NBTRI;
do {
v27 = 0;
- v34 = 1;
if (v25 > 1) {
v26 = _vm->_globals.NBTRI;
- do {
+ for (int v34 = 1; v34 < v26; v34++) {
v11 = arr[v34];
v12 = &arr[v34 + 1];
if (_vm->_globals.Tri[arr[v34]]._priority > _vm->_globals.Tri[*v12]._priority) {
@@ -427,14 +420,12 @@ void ObjectsManager::displaySprite() {
*v12 = v11;
++v27;
}
- ++v34;
- } while (v34 < v26);
+ }
}
} while (v27);
- v35 = 1;
if (_vm->_globals.NBTRI + 1 > 1) {
- do {
+ for (int v35 = 1; v35 < _vm->_globals.NBTRI + 1; v35++) {
v13 = arr[v35];
switch (_vm->_globals.Tri[v13]._triMode) {
case TRI_BOB:
@@ -450,8 +441,7 @@ void ObjectsManager::displaySprite() {
break;
}
_vm->_globals.Tri[v13]._triMode = TRI_NONE;
- ++v35;
- } while (v35 < _vm->_globals.NBTRI + 1);
+ }
}
} else {
if (_vm->_globals.NBTRI + 1 > 1) {
@@ -1161,7 +1151,6 @@ void ObjectsManager::AFF_BOB_ANIM() {
int v10;
int v11;
int v12;
- int v13;
int v14;
int v18;
int v19;
@@ -1169,7 +1158,6 @@ void ObjectsManager::AFF_BOB_ANIM() {
byte *v21;
int v22;
int v24;
- int v26;
int v27;
int v28;
@@ -1272,13 +1260,10 @@ LABEL_38:
} while (idx != 35);
if (!PERSO_ON && BOBTOUS == true) {
- v26 = 0;
- do {
- v13 = v26;
- if (_vm->_globals.Bob[v13].field0 == 10 && !_vm->_globals.Bob[v13].field16)
- _vm->_globals.Bob[v13].field1C = 1;
- ++v26;
- } while (v26 != 35);
+ for (int v26 = 0; v26 != 35; v26++) {
+ if (_vm->_globals.Bob[v26].field0 == 10 && !_vm->_globals.Bob[v26].field16)
+ _vm->_globals.Bob[v26].field1C = 1;
+ }
}
BOBTOUS = false;