HOPKINS: Remove some more casts to unsigned int

This commit is contained in:
Strangerke 2013-01-31 07:48:44 +01:00
parent 15de07ff74
commit 9dd09f6c6e
3 changed files with 24 additions and 35 deletions

View File

@ -319,7 +319,7 @@ void EventsManager::VBL() {
signed int v11 = 0;
signed int v12 = 0;
int v13 = 0;
unsigned int v14 = 0;
uint v14 = 0;
int v15 = 0;
int yp = 0;

View File

@ -485,7 +485,7 @@ void GraphicsManager::m_scroll16A(const byte *surface, int xs, int ys, int width
if (Agr_Flag_y)
break;
if ((unsigned int)Agr_y < 100)
if (Agr_y >= 0 && Agr_y < 100)
break;
Agr_y -= 100;

View File

@ -1807,28 +1807,17 @@ LABEL_150:
v13 = (int16)v101 / 1000;
v94 = (int16)v99 / 1000;
newDirection = -1;
if ((int16)v99 / 1000 == -1 && (unsigned int)v101 <= 150)
if (v94 == -1 && (v101 >= 0 && v101 <= 150))
newDirection = 1;
if (v13 == 1) {
if ((unsigned int)(v99 + 1) <= 151)
newDirection = 3;
if ((unsigned int)v99 <= 150)
newDirection = 3;
}
if (v94 == 1) {
if ((unsigned int)v101 <= 150)
newDirection = 5;
if ((unsigned int)(v101 + 150) <= 150)
newDirection = 5;
}
if (v13 == -1) {
if ((unsigned int)v99 <= 150)
newDirection = 7;
if ((unsigned int)(v99 + 150) <= 150)
newDirection = 7;
}
if (v94 == -1 && (unsigned int)(v101 + 150) <= 150)
if (v13 == 1 && (v99 >= -1 && v99 <= 150))
newDirection = 3;
if (v94 == 1 && (v101 >= -150 && v101 <= 150))
newDirection = 5;
if (v13 == -1 && (v99 >= -150 && v99 <= 150))
newDirection = 7;
if (v94 == -1 && (v101 >= -150 && v101 <= 0))
newDirection = 1;
if (newDirection == -1 && !checkSmoothMove(curX, v109, destX, destY) && !makeSmoothMove(curX, v109, destX, destY))
break;
LABEL_72:
@ -1885,40 +1874,40 @@ LABEL_72:
}
}
if (v22 == 1) {
if ((unsigned int)(v100 + 1) <= 511)
if (v100 >= -1 && v100 <= 510)
newDirection = 2;
if ((unsigned int)(v100 + 510) <= 510)
if (v100 >= -510 && v100 <= 0)
newDirection = 3;
if ((unsigned int)v100 <= 510)
if (v100 >= 0 && v100 <= 510)
newDirection = 3;
if ((unsigned int)(v100 - 510) <= 490)
if (v100 >= 510 && v100 <= 1000)
newDirection = 4;
}
if (v96 == 1) {
if ((unsigned int)(v102 - 510) <= 490)
if (v102 >= 510 && v102 <= 1000)
newDirection = 4;
if ((unsigned int)v102 <= 510)
if (v102 >= 0 && v102 <= 510)
newDirection = 5;
// CHECKME: The two conditions on v102 are not compatible!
if (v102 >= -1 && v102 <= -510)
newDirection = 6;
if ((unsigned int)(v102 + 510) <= 510)
if (v102 >= -510 && v102 <= 0)
newDirection = 5;
}
if (v22 == -1) {
if ((unsigned int)(v100 - 510) <= 490)
if (v100 >= 510 && v100 <= 1000)
newDirection = 6;
if ((unsigned int)v100 <= 510)
if (v100 >= 0 && v100 <= 510)
newDirection = 7;
if ((unsigned int)(v100 + 1000) <= 490)
if (v100 >= -1000 && v100 <= -510)
newDirection = 8;
if ((unsigned int)(v100 + 510) <= 510)
if (v100 >= -510 && v100 <= 0)
newDirection = 7;
}
if (v96 == -1) {
if ((unsigned int)(v102 + 1000) <= 490)
if (v102 >= -1000 && v102 <= -510)
newDirection = 8;
if ((unsigned int)(v102 + 510) <= 510)
if (v102 >= -510 && v102 <= 0)
newDirection = 1;
}
v23 = 0;