added random number initialization function for native BD engine
[rocksndiamonds.git] / src / game_bd / export_bd.h
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 // export_bd.h
10 // ============================================================================
11
12 #ifndef EXPORT_BD_H
13 #define EXPORT_BD_H
14
15 // ============================================================================
16 // functions and definitions exported from game_bd to main program
17 // ============================================================================
18
19 #include "bd_cave.h"
20 #include "bd_elements.h"
21 #include "bd_gameplay.h"
22
23
24 // ----------------------------------------------------------------------------
25 // constant definitions
26 // ----------------------------------------------------------------------------
27
28 #define BD_MAX_CAVE_WIDTH               MAX_PLAYFIELD_WIDTH
29 #define BD_MAX_CAVE_HEIGHT              MAX_PLAYFIELD_HEIGHT
30
31
32 // ----------------------------------------------------------------------------
33 // data structure definitions
34 // ----------------------------------------------------------------------------
35
36 struct GameInfo_BD
37 {
38   GdGame *game;
39
40   unsigned int random_seed;
41
42   boolean level_solved;
43   boolean game_over;
44   boolean cover_screen;
45
46   // needed for updating panel
47   int time_played;
48   int gems_still_needed;
49   int score;
50 };
51
52 struct LevelInfo_BD
53 {
54   GdCave *cave;
55   GdReplay *replay;
56
57   int cave_nr;
58   int level_nr;
59
60   boolean loaded_from_caveset;
61 };
62
63 struct GraphicInfo_BD
64 {
65   Bitmap *bitmap;
66   int src_x, src_y;
67   int width, height;
68 };
69
70 struct EngineSnapshotInfo_BD
71 {
72 };
73
74
75 // ----------------------------------------------------------------------------
76 // exported functions
77 // ----------------------------------------------------------------------------
78
79 extern struct GameInfo_BD game_bd;
80 extern struct LevelInfo_BD native_bd_level;
81 extern struct GraphicInfo_BD graphic_info_bd_object[O_MAX_ALL][8];
82 extern struct EngineSnapshotInfo_BD engine_snapshot_bd;
83
84 void bd_open_all(void);
85 void bd_close_all(void);
86
87 int map_action_RND_to_BD(int);
88 int map_action_BD_to_RND(int);
89
90 boolean checkGameRunning_BD(void);
91
92 void InitGfxBuffers_BD(void);
93
94 void setLevelInfoToDefaults_BD_Ext(int, int);
95 void setLevelInfoToDefaults_BD(void);
96 boolean LoadNativeLevel_BD(char *, int, boolean);
97
98 unsigned int InitEngineRandom_BD(int);
99
100 #endif  // EXPORT_BD_H