From cc12c878b7faba373ac23aecf798f979122e5bd8 Mon Sep 17 00:00:00 2001 From: Colin Snover Date: Sun, 10 Sep 2017 23:02:18 -0500 Subject: BBVS: Fix UB shifting negative signed integers These shifted values are replaced with their literal equivalents as would be calculated on an x86. --- engines/bbvs/minigames/bbant.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'engines/bbvs') 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; -- cgit v1.2.3