Skip to content

Commit

Permalink
HOPKINS: Silence some warnings reported by GCC. Thanks Eriktorbjorn f…
Browse files Browse the repository at this point in the history
…or reporting those
  • Loading branch information
Strangerke committed Jan 2, 2013
1 parent 3eae64c commit a4b7b29
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 24 deletions.
2 changes: 1 addition & 1 deletion engines/hopkins/anim.cpp
Expand Up @@ -219,7 +219,7 @@ void AnimationManager::playAnim2(const Common::String &filename, uint32 a2, uint
int v5;
int v8;
byte *ptr = NULL;
int oldScrollVal;
int oldScrollVal = 0;
byte *v12 = NULL;
byte *v13 = NULL;
int v15;
Expand Down
10 changes: 2 additions & 8 deletions engines/hopkins/graphics.cpp
Expand Up @@ -705,7 +705,7 @@ void GraphicsManager::SETCOLOR4(int palIndex, int r, int g, int b) {
void GraphicsManager::changePalette(const byte *palette) {
const byte *srcP = &palette[0];
for (int idx = 0; idx < PALETTE_SIZE; ++idx, srcP += 3) {
*(uint16 *)&SD_PIXELS[2 * idx] = mapRGB(*srcP, *(srcP + 1), *(srcP + 2));
WRITE_LE_UINT16(&SD_PIXELS[2 * idx], mapRGB(*srcP, *(srcP + 1), *(srcP + 2)));
}
}

Expand Down Expand Up @@ -791,7 +791,7 @@ void GraphicsManager::Copy_WinScan_Vbe3(const byte *srcData, byte *destSurface)
}
Video_Cont3_wVbe:
if (srcByte > 210) {
if (srcByte == -45) {
if (srcByte == 211) {
destLen1 = srcP[1];
rleValue = srcP[2];
destSlice1P = destOffset + destSurface;
Expand Down Expand Up @@ -1113,7 +1113,6 @@ void GraphicsManager::RESET_SEGMENT_VESA() {
// Add VESA Segment
void GraphicsManager::addVesaSegment(int x1, int y1, int x2, int y2) {
int tempX;
int blocCount;
bool addFlag;

tempX = x1;
Expand All @@ -1127,9 +1126,7 @@ void GraphicsManager::addVesaSegment(int x1, int y1, int x2, int y2) {
if (y1 < min_y)
y1 = min_y;

blocCount = _vm->_globals.NBBLOC;
if (_vm->_globals.NBBLOC > 1) {

int16 blocIndex = 0;
do {
BlocItem &bloc = _vm->_globals.BLOC[blocIndex];
Expand All @@ -1138,7 +1135,6 @@ void GraphicsManager::addVesaSegment(int x1, int y1, int x2, int y2) {
&& y1 >= bloc._y1 && y2 <= bloc._y2)
addFlag = false;
++blocIndex;
blocCount = blocIndex;
} while (_vm->_globals.NBBLOC + 1 != blocIndex);
}

Expand Down Expand Up @@ -1910,12 +1906,10 @@ void GraphicsManager::SHOW_PALETTE() {
}

void GraphicsManager::Copy_WinScan_Vbe(const byte *src, byte *dest) {
int result;
int destOffset;
const byte *srcPtr;
byte byteVal;

result = 0;
destOffset = 0;
srcPtr = src;
for (;;) {
Expand Down
4 changes: 2 additions & 2 deletions engines/hopkins/lines.cpp
Expand Up @@ -1437,8 +1437,8 @@ int16 *LinesManager::PARCOURS2(int srcX, int srcY, int destX, int destY) {
int v115;
int v116;
int v117;
int v118;
int v119;
int v118 = 0;
int v119 = 0;
int v120;
int v121;
int v122;
Expand Down
25 changes: 12 additions & 13 deletions engines/hopkins/objects.cpp
Expand Up @@ -2939,11 +2939,9 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) {
int16 *v33;
int v34;
int v35;
int i;
int16 *v37;
int v39;
int16 *v41;
int k;
int16 *v45;
int v47;
int v48;
Expand All @@ -2957,12 +2955,11 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) {
int v65;
int v66;
int v67;
int v68;
int v69;
int v68 = 0;
int v69 = 0;
int j;
int l;
int v72;
int v73;
int v72 = 0;
int v73 = 0;
int v74;
int v75;
int v77[10];
Expand Down Expand Up @@ -3123,10 +3120,12 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) {
v33[v32 + 3] = 0;
v67 += 4;
if (v28 == -1)
goto LABEL_90;
break;;
}
if (v28 != -1) {
v69 = v87[1];
v68 = v82[1];
}
v69 = v87[1];
v68 = v82[1];
} else {
v69 = 1;
v68 = 1;
Expand All @@ -3136,7 +3135,7 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) {
if (v69 < v73) {
v34 = v68;
v35 = v68;
for (i = _vm->_linesManager.Ligne[v69].field0; v35 < i - 2; i = _vm->_linesManager.Ligne[v69].field0) {
for (int i = _vm->_linesManager.Ligne[v69].field0; v35 < i - 2; i = _vm->_linesManager.Ligne[v69].field0) {
v37 = _vm->_linesManager.Ligne[v69].lineData;
v39 = v67;
_vm->_globals.super_parcours[v39] = v37[2 * v35];
Expand Down Expand Up @@ -3176,7 +3175,7 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) {
v69 = v73;
}
if (v69 > v73) {
for (k = v68; k > 0; --k) {
for (int k = v68; k > 0; --k) {
v45 = _vm->_linesManager.Ligne[v69].lineData;
v47 = v67;
_vm->_globals.super_parcours[v47] = v45[2 * k];
Expand All @@ -3185,7 +3184,7 @@ int16 *ObjectsManager::PARC_VOITURE(int a1, int a2, int a3, int a4) {
_vm->_globals.super_parcours[v47 + 3] = 0;
v67 += 4;
}
for (l = v69 - 1; l > v73; --l) {
for (int l = v69 - 1; l > v73; --l) {
v48 = l;
if (_vm->_linesManager.PLAN_TEST(
_vm->_linesManager.Ligne[l].lineData[2 * _vm->_linesManager.Ligne[v48].field0 - 2],
Expand Down

0 comments on commit a4b7b29

Please sign in to comment.