minor changes (no functional changes)
authorHolger Schemel <holger.schemel@virtion.de>
Tue, 3 Dec 2024 18:48:38 +0000 (19:48 +0100)
committerHolger Schemel <holger.schemel@virtion.de>
Tue, 3 Dec 2024 13:49:54 +0000 (14:49 +0100)
src/game_bd/bd_gameplay.c
src/game_bd/main_bd.c

index 1f098877b86d49c2b18d995cad3eaa55ed3bd416..94bdca2b6a2cf828b9c5a521cafeccf158e54277 100644 (file)
@@ -659,7 +659,7 @@ void play_game_func(GdGame *game, int action)
   boolean move_down  = ((action & JOY_DOWN)    != 0);
   boolean move_left  = ((action & JOY_LEFT)    != 0);
   boolean move_right = ((action & JOY_RIGHT)   != 0);
-  boolean fire       = ((action & (JOY_BUTTON_1 | JOY_BUTTON_2)) != 0);
+  boolean fire       = ((action & JOY_BUTTON)  != 0);
 
   if (game->player_move_stick || move_up || move_down || move_left || move_right) // no "fire"!
   {
index de01f2922bc6f2baf871a566675cd6164ad19fb5..fdf7afafc9579916994eab8bae9c744e964798a0 100644 (file)
@@ -202,15 +202,15 @@ int map_action_RND_to_BD(int action)
                                                       action & JOY_DOWN,
                                                       action & JOY_LEFT,
                                                       action & JOY_RIGHT);
-  boolean player_fire    = (action & (JOY_BUTTON_1 | JOY_BUTTON_2));
+  int player_fire    = ((action & JOY_BUTTON)  != 0 ? GD_REPLAY_FIRE_MASK    : 0);
 
-  return (player_move | (player_fire ? GD_REPLAY_FIRE_MASK : 0));
+  return (player_move | player_fire);
 }
 
 int map_action_BD_to_RND(int action)
 {
-  GdDirection player_move    = action & GD_REPLAY_MOVE_MASK;
-  boolean     player_fire    = action & GD_REPLAY_FIRE_MASK;
+  GdDirection player_move    = ((action & GD_REPLAY_MOVE_MASK));
+  boolean     player_fire    = ((action & GD_REPLAY_FIRE_MASK)    != 0);
 
   int action_move = (player_move == GD_MV_UP           ? JOY_UP                :
                     player_move == GD_MV_UP_RIGHT      ? JOY_UP   | JOY_RIGHT  :