cleanup of setup value fonts on setup screens
[rocksndiamonds.git] / src / game_mm / mm_init.c
1 // ============================================================================
2 // Mirror Magic -- McDuffin's Revenge
3 // ----------------------------------------------------------------------------
4 // (c) 1994-2017 by Artsoft Entertainment
5 //                  Holger Schemel
6 //                  info@artsoft.org
7 //                  https://www.artsoft.org/
8 // ----------------------------------------------------------------------------
9 // mm_init.c
10 // ============================================================================
11
12 #include "main_mm.h"
13
14 #include "mm_main.h"
15
16
17 Bitmap *drawto_mm;
18
19 struct EngineSnapshotInfo_MM engine_snapshot_mm;
20
21
22 void InitGfxBuffers_MM(void)
23 {
24   ReCreateBitmap(&drawto_mm, video.width, video.height);
25 }
26
27 unsigned int InitEngineRandom_MM(int seed)
28 {
29   return InitEngineRandom(seed);
30 }
31
32 void InitElementProperties_MM(void)
33 {
34   int i, j;
35
36   static int ep_grid[] =
37   {
38     EL_GRID_STEEL_00,
39     EL_GRID_STEEL_01,
40     EL_GRID_STEEL_02,
41     EL_GRID_STEEL_03,
42     EL_GRID_WOOD_00,
43     EL_GRID_WOOD_01,
44     EL_GRID_WOOD_02,
45     EL_GRID_WOOD_03,
46   };
47   static int ep_grid_num = sizeof(ep_grid) / sizeof(int);
48
49   static int ep_mcduffin[] =
50   {
51     EL_MCDUFFIN_RIGHT,
52     EL_MCDUFFIN_UP,
53     EL_MCDUFFIN_LEFT,
54     EL_MCDUFFIN_DOWN,
55   };
56   static int ep_mcduffin_num = sizeof(ep_mcduffin) / sizeof(int);
57
58   static int ep_rectangle[] =
59   {
60     EL_EXIT_CLOSED,
61     EL_EXIT_OPENING_1,
62     EL_EXIT_OPENING_2,
63     EL_EXIT_OPEN,
64     EL_BLOCK_STONE,
65     EL_BLOCK_WOOD,
66     EL_GATE_STONE,
67     EL_GATE_WOOD
68   };
69   static int ep_rectangle_num = sizeof(ep_rectangle) / sizeof(int);
70
71   static int ep_mirror[] =
72   {
73     EL_MIRROR_00,
74     EL_MIRROR_01,
75     EL_MIRROR_02,
76     EL_MIRROR_03,
77     EL_MIRROR_04,
78     EL_MIRROR_05,
79     EL_MIRROR_06,
80     EL_MIRROR_07,
81     EL_MIRROR_08,
82     EL_MIRROR_09,
83     EL_MIRROR_10,
84     EL_MIRROR_11,
85     EL_MIRROR_12,
86     EL_MIRROR_13,
87     EL_MIRROR_14,
88     EL_MIRROR_15,
89   };
90   static int ep_mirror_num = sizeof(ep_mirror) / sizeof(int);
91
92   static int ep_mirror_fixed[] =
93   {
94     EL_MIRROR_FIXED_00,
95     EL_MIRROR_FIXED_01,
96     EL_MIRROR_FIXED_02,
97     EL_MIRROR_FIXED_03,
98   };
99   static int ep_mirror_fixed_num = sizeof(ep_mirror_fixed) / sizeof(int);
100
101   static int ep_polar[] =
102   {
103     EL_POLAR_00,
104     EL_POLAR_01,
105     EL_POLAR_02,
106     EL_POLAR_03,
107     EL_POLAR_04,
108     EL_POLAR_05,
109     EL_POLAR_06,
110     EL_POLAR_07,
111     EL_POLAR_08,
112     EL_POLAR_09,
113     EL_POLAR_10,
114     EL_POLAR_11,
115     EL_POLAR_12,
116     EL_POLAR_13,
117     EL_POLAR_14,
118     EL_POLAR_15,
119   };
120   static int ep_polar_num = sizeof(ep_polar) / sizeof(int);
121
122   static int ep_polar_cross[] =
123   {
124     EL_POLAR_CROSS_00,
125     EL_POLAR_CROSS_01,
126     EL_POLAR_CROSS_02,
127     EL_POLAR_CROSS_03,
128   };
129   static int ep_polar_cross_num = sizeof(ep_polar_cross) / sizeof(int);
130
131   static int ep_beamer[] =
132   {
133     EL_BEAMER_00,
134     EL_BEAMER_01,
135     EL_BEAMER_02,
136     EL_BEAMER_03,
137     EL_BEAMER_04,
138     EL_BEAMER_05,
139     EL_BEAMER_06,
140     EL_BEAMER_07,
141     EL_BEAMER_08,
142     EL_BEAMER_09,
143     EL_BEAMER_10,
144     EL_BEAMER_11,
145     EL_BEAMER_12,
146     EL_BEAMER_13,
147     EL_BEAMER_14,
148     EL_BEAMER_15,
149   };
150   static int ep_beamer_num = sizeof(ep_beamer) / sizeof(int);
151
152   static int ep_reflecting[] =
153   {
154   };
155   static int ep_reflecting_num = sizeof(ep_reflecting) / sizeof(int);
156
157   static int ep_absorbing[] =
158   {
159   };
160   static int ep_absorbing_num = sizeof(ep_absorbing) / sizeof(int);
161
162   static int ep_inactive[] =
163   {
164   };
165   static int ep_inactive_num = sizeof(ep_inactive) / sizeof(int);
166
167   static int ep_wall[] =
168   {
169   };
170   static int ep_wall_num = sizeof(ep_wall) / sizeof(int);
171
172   static int ep_pacman[] =
173   {
174     EL_PACMAN_RIGHT,
175     EL_PACMAN_UP,
176     EL_PACMAN_LEFT,
177     EL_PACMAN_DOWN,
178   };
179   static int ep_pacman_num = sizeof(ep_pacman) / sizeof(int);
180
181   static int ep_envelope[] =
182   {
183     EL_ENVELOPE_1,
184     EL_ENVELOPE_2,
185     EL_ENVELOPE_3,
186     EL_ENVELOPE_4,
187   };
188   static int ep_envelope_num = sizeof(ep_envelope) / sizeof(int);
189
190   static long ep_bit[] =
191   {
192     EP_BIT_GRID,
193     EP_BIT_MCDUFFIN,
194     EP_BIT_RECTANGLE,
195     EP_BIT_MIRROR,
196     EP_BIT_MIRROR_FIXED,
197     EP_BIT_POLAR,
198     EP_BIT_POLAR_CROSS,
199     EP_BIT_BEAMER,
200     EP_BIT_REFLECTING,
201     EP_BIT_ABSORBING,
202     EP_BIT_INACTIVE,
203     EP_BIT_WALL,
204     EP_BIT_PACMAN,
205     EP_BIT_ENVELOPE,
206   };
207   static int *ep_array[] =
208   {
209     ep_grid,
210     ep_mcduffin,
211     ep_rectangle,
212     ep_mirror,
213     ep_mirror_fixed,
214     ep_polar,
215     ep_polar_cross,
216     ep_beamer,
217     ep_reflecting,
218     ep_absorbing,
219     ep_inactive,
220     ep_wall,
221     ep_pacman,
222     ep_envelope,
223   };
224   static int *ep_num[] =
225   {
226     &ep_grid_num,
227     &ep_mcduffin_num,
228     &ep_rectangle_num,
229     &ep_mirror_num,
230     &ep_mirror_fixed_num,
231     &ep_polar_num,
232     &ep_polar_cross_num,
233     &ep_beamer_num,
234     &ep_reflecting_num,
235     &ep_absorbing_num,
236     &ep_inactive_num,
237     &ep_wall_num,
238     &ep_pacman_num,
239     &ep_envelope_num,
240   };
241   static int num_properties = sizeof(ep_num) / sizeof(int *);
242
243   for (i = 0; i < MAX_ELEMENTS; i++)
244     Elementeigenschaften[i] = 0;
245
246   for (i = 0; i < num_properties; i++)
247     for (j = 0; j < *(ep_num[i]); j++)
248       Elementeigenschaften[(ep_array[i])[j]] |= ep_bit[i];
249
250   for (i = EL_CHAR_START; i <= EL_CHAR_END; i++)
251     Elementeigenschaften[i] |= (EP_BIT_CHAR | EP_BIT_INACTIVE);
252
253   for (i = EL_WALL_START; i <= EL_WALL_END; i++)
254     Elementeigenschaften[i] |= EP_BIT_WALL;
255 }
256
257 void mm_open_all(void)
258 {
259   InitElementProperties_MM();
260 }