added missing and fixed wrong file headers
[rocksndiamonds.git] / src / game_bd / main_bd.c
1 // ============================================================================
2 // Rocks'n'Diamonds - McDuffin Strikes Back!
3 // ----------------------------------------------------------------------------
4 // (c) 1995-2024 by Artsoft Entertainment
5 //                  Holger Schemel
6 //                  info@artsoft.org
7 //                  https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
9 // main_bd.c
10 // ============================================================================
11
12 #include "main_bd.h"
13
14
15 struct GameInfo_BD game_bd;
16 struct LevelInfo_BD native_bd_level;
17 struct EngineSnapshotInfo_BD engine_snapshot_bd;
18
19
20 // ============================================================================
21 // level file functions
22 // ============================================================================
23
24 int map_action_BD_to_RND(int action)
25 {
26   GdDirection player_move = action & GD_REPLAY_MOVE_MASK;
27   boolean     player_fire = action & GD_REPLAY_FIRE_MASK;
28
29   int action_move = (player_move == GD_MV_UP            ? JOY_UP                :
30                      player_move == GD_MV_UP_RIGHT      ? JOY_UP   | JOY_RIGHT  :
31                      player_move == GD_MV_RIGHT         ?            JOY_RIGHT  :
32                      player_move == GD_MV_DOWN_RIGHT    ? JOY_DOWN | JOY_RIGHT  :
33                      player_move == GD_MV_DOWN          ? JOY_DOWN              :
34                      player_move == GD_MV_DOWN_LEFT     ? JOY_DOWN | JOY_LEFT   :
35                      player_move == GD_MV_LEFT          ?            JOY_LEFT   :
36                      player_move == GD_MV_UP_LEFT       ? JOY_UP   | JOY_LEFT   : JOY_NO_ACTION);
37   int action_fire = (player_fire ? JOY_BUTTON_1 : JOY_NO_ACTION);
38
39   return (action_move | action_fire);
40 }
41
42 void setLevelInfoToDefaults_BD_Ext(int width, int height)
43 {
44   // ...
45 }
46
47 void setLevelInfoToDefaults_BD(void)
48 {
49   setLevelInfoToDefaults_BD_Ext(0, 0);
50 }