aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Snover2017-09-10 23:02:18 -0500
committerEugene Sandulenko2017-09-11 08:13:58 +0200
commitcc12c878b7faba373ac23aecf798f979122e5bd8 (patch)
tree57d523094e6bb5f42a07f42a590c60c4fa885028
parente9aa47f55ce60bce599b4db35d69261ac8932eba (diff)
downloadscummvm-rg350-cc12c878b7faba373ac23aecf798f979122e5bd8.tar.gz
scummvm-rg350-cc12c878b7faba373ac23aecf798f979122e5bd8.tar.bz2
scummvm-rg350-cc12c878b7faba373ac23aecf798f979122e5bd8.zip
BBVS: Fix UB shifting negative signed integers
These shifted values are replaced with their literal equivalents as would be calculated on an x86.
-rw-r--r--engines/bbvs/minigames/bbant.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/engines/bbvs/minigames/bbant.cpp b/engines/bbvs/minigames/bbant.cpp
index 3c13ee5426..72c2d62b13 100644
--- a/engines/bbvs/minigames/bbant.cpp
+++ b/engines/bbvs/minigames/bbant.cpp
@@ -588,7 +588,7 @@ void MinigameBbAnt::insertBugSmokeObj(int x, int y, int bugObjIndex) {
obj->priority = 950;
if (bugObj->status >= 4 && (bugObj->status <= 6 || bugObj->status == 8)) {
obj->xIncr = 0;
- obj->yIncr = (-1 << 16);
+ obj->yIncr = -0x10000;
} else {
obj->xIncr = bugObj->xIncr / 8;
obj->yIncr = bugObj->yIncr / 8;
@@ -730,8 +730,8 @@ bool MinigameBbAnt::isBugOutOfScreen(int objIndex) {
Obj *obj = &_objects[objIndex];
return
- obj->x < (-10 << 16) || obj->x > (330 << 16) ||
- obj->y < (-10 << 16) || obj->y > (250 << 16);
+ obj->x < -0xa0000 || obj->x > (330 << 16) ||
+ obj->y < -0xa0000 || obj->y > (250 << 16);
}
void MinigameBbAnt::updateObjAnim3(int objIndex) {
@@ -931,7 +931,7 @@ void MinigameBbAnt::updateFootObj(int objIndex) {
case 1:
obj->xIncr = -0x8000;
- obj->yIncr = (-4 << 16);
+ obj->yIncr = -0x40000;
obj->status = 2;
_stompCounter1 += 5;
_stompCounter2 = 100;