1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2024 by Artsoft Entertainment
7 // https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
10 // ============================================================================
15 struct GameInfo_BD game_bd;
16 struct LevelInfo_BD native_bd_level;
17 struct EngineSnapshotInfo_BD engine_snapshot_bd;
20 // ============================================================================
21 // level file functions
22 // ============================================================================
24 int map_action_RND_to_BD(int action)
26 GdDirection player_move = gd_direction_from_keypress(action & JOY_UP,
30 boolean player_fire = (action & (JOY_BUTTON_1 | JOY_BUTTON_2));
32 return (player_move | (player_fire ? GD_REPLAY_FIRE_MASK : 0));
35 int map_action_BD_to_RND(int action)
37 GdDirection player_move = action & GD_REPLAY_MOVE_MASK;
38 boolean player_fire = action & GD_REPLAY_FIRE_MASK;
40 int action_move = (player_move == GD_MV_UP ? JOY_UP :
41 player_move == GD_MV_UP_RIGHT ? JOY_UP | JOY_RIGHT :
42 player_move == GD_MV_RIGHT ? JOY_RIGHT :
43 player_move == GD_MV_DOWN_RIGHT ? JOY_DOWN | JOY_RIGHT :
44 player_move == GD_MV_DOWN ? JOY_DOWN :
45 player_move == GD_MV_DOWN_LEFT ? JOY_DOWN | JOY_LEFT :
46 player_move == GD_MV_LEFT ? JOY_LEFT :
47 player_move == GD_MV_UP_LEFT ? JOY_UP | JOY_LEFT : JOY_NO_ACTION);
48 int action_fire = (player_fire ? JOY_BUTTON_1 : JOY_NO_ACTION);
50 return (action_move | action_fire);
53 boolean checkGameRunning_BD(void)
55 return (game_bd.game != NULL && game_bd.game->state_counter == GAME_INT_CAVE_RUNNING);
58 void setLevelInfoToDefaults_BD_Ext(int width, int height)
63 void setLevelInfoToDefaults_BD(void)
65 setLevelInfoToDefaults_BD_Ext(0, 0);