[Scummvm-git-logs] scummvm master -> ad432613b05747de5830bd722c3d344a163d7f03

dreammaster noreply at scummvm.org
Sat Jan 13 18:12:51 UTC 2024


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
ad432613b0 M4: Don't use bit shifts with -1


Commit: ad432613b05747de5830bd722c3d344a163d7f03
    https://github.com/scummvm/scummvm/commit/ad432613b05747de5830bd722c3d344a163d7f03
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2024-01-13T10:12:44-08:00

Commit Message:
M4: Don't use bit shifts with -1

Changed paths:
    engines/m4/adv_r/adv_walk.cpp


diff --git a/engines/m4/adv_r/adv_walk.cpp b/engines/m4/adv_r/adv_walk.cpp
index fe991d455ed..f0b77e89d88 100644
--- a/engines/m4/adv_r/adv_walk.cpp
+++ b/engines/m4/adv_r/adv_walk.cpp
@@ -167,7 +167,7 @@ void ws_walk(machine *myWalker, int32 x, int32 y, GrBuff **, int16 trigger, int3
 		if (finalFacing > 0 && finalFacing < 13) {
 			_G(globals)[GLB_TEMP_4] = directions[finalFacing] << 16;
 		} else {
-			_G(globals)[GLB_TEMP_4] = (frac16)-1 << 16;
+			_G(globals)[GLB_TEMP_4] = (frac16)-1 & ~0xffff;
 		}
 
 		// Set the trigger to be returned when the walk is finished
@@ -237,7 +237,7 @@ void ws_custom_walk(machine *myWalker, int32 finalFacing, int32 trigger, bool co
 	if (finalFacing > 0 && finalFacing < 13) {
 		_G(globals)[GLB_TEMP_4] = directions[finalFacing] << 16;
 	} else {
-		_G(globals)[GLB_TEMP_4] = (frac16)-1 << 16;
+		_G(globals)[GLB_TEMP_4] = (frac16)-1 & ~0xffff;
 	}
 
 	// Set the trigger to be returned when the walk is finished
@@ -318,7 +318,7 @@ void ws_turn_to_face(machine *myWalker, int32 facing, int32 trigger) {
 	if (facing > 0 && facing < 13) {
 		_G(globals)[GLB_TEMP_4] = directions[facing] << 16;
 	} else {
-		_G(globals)[GLB_TEMP_4] = (frac16)-1 << 16;
+		_G(globals)[GLB_TEMP_4] = (frac16)-1 & ~0xffff;
 	}
 
 	// Set the trigger to be returned when the walk is finished




More information about the Scummvm-git-logs mailing list