diff options
author | Strangerke | 2013-01-31 07:48:44 +0100 |
---|---|---|
committer | Strangerke | 2013-01-31 07:48:44 +0100 |
commit | 9dd09f6c6eff178e6c996f59d95fd9014d9653c8 (patch) | |
tree | 53f329cadd8f3003b2b42f60cdb40ad3abb8fc39 /engines | |
parent | 15de07ff74e610510f724cca9c6d155ef376d68a (diff) | |
download | scummvm-rg350-9dd09f6c6eff178e6c996f59d95fd9014d9653c8.tar.gz scummvm-rg350-9dd09f6c6eff178e6c996f59d95fd9014d9653c8.tar.bz2 scummvm-rg350-9dd09f6c6eff178e6c996f59d95fd9014d9653c8.zip |
HOPKINS: Remove some more casts to unsigned int
Diffstat (limited to 'engines')
-rw-r--r-- | engines/hopkins/events.cpp | 2 | ||||
-rw-r--r-- | engines/hopkins/graphics.cpp | 2 | ||||
-rw-r--r-- | engines/hopkins/lines.cpp | 55 |
3 files changed, 24 insertions, 35 deletions
diff --git a/engines/hopkins/events.cpp b/engines/hopkins/events.cpp index 448838bc2c..dd929ac214 100644 --- a/engines/hopkins/events.cpp +++ b/engines/hopkins/events.cpp @@ -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; diff --git a/engines/hopkins/graphics.cpp b/engines/hopkins/graphics.cpp index a81ce9db41..0aa9d3ff15 100644 --- a/engines/hopkins/graphics.cpp +++ b/engines/hopkins/graphics.cpp @@ -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; diff --git a/engines/hopkins/lines.cpp b/engines/hopkins/lines.cpp index 1ed1841077..5b6631c77f 100644 --- a/engines/hopkins/lines.cpp +++ b/engines/hopkins/lines.cpp @@ -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; |