#define MM_MAX_PLAYFIELD_SIZE (MM_MAX_PLAYFIELD_WIDTH * \
MM_MAX_PLAYFIELD_HEIGHT)
-#define MAX_NUM_AMOEBA 100
-#define MAX_NUM_BEAMERS 8
+#define MAX_NUM_AMOEBA 100
+#define MAX_NUM_BEAMERS 8
-#define MAX_LASER_LEN 256
-#define MAX_LASER_ENERGY 100
-#define MAX_LASER_OVERLOAD 100
+#define MAX_LASER_LEN 256
+#define MAX_LASER_ENERGY 100
+#define MAX_LASER_OVERLOAD 100
-#define MM_LEVEL_SCORE_ELEMENTS 16
+#define MM_LEVEL_SCORE_ELEMENTS 16
-#define MM_MAX_LEVEL_NAME_LEN 32
-#define MM_MAX_LEVEL_AUTHOR_LEN 32
+#define MM_MAX_LEVEL_NAME_LEN 32
+#define MM_MAX_LEVEL_AUTHOR_LEN 32
+
+
+#define EL_EMPTY_NATIVE_MM 0
+#define EL_DF_EMPTY_NATIVE_MM 304
+
+#define EL_MM_START_NATIVE_MM 0
+#define EL_MM_END_NATIVE_MM 430
+
+#define EL_CHAR_START_NATIVE_MM 160
+#define EL_CHAR_END_NATIVE_MM 239
+
+#define EL_DF_START_NATIVE_MM 240
+#define EL_DF_END_NATIVE_MM 355
+
+#define EL_MM_RUNTIME_START_NATIVE_MM 500
+#define EL_MM_RUNTIME_END_NATIVE_MM 504
+
+#define EL_MM_DUMMY_START_NATIVE_MM 700
+#define EL_MM_DUMMY_END_NATIVE_MM 709
/* ------------------------------------------------------------------------- */
int map_element_RND_to_MM(int element_rnd)
{
- return (element_rnd > 1000 ? element_rnd - 1000 : 0);
+ return (element_rnd >= EL_CHAR_START &&
+ element_rnd <= EL_CHAR_END ?
+ EL_CHAR_START_NATIVE_MM + element_rnd - EL_CHAR_START :
+
+ element_rnd >= EL_DF_START &&
+ element_rnd <= EL_DF_END ?
+ EL_DF_START_NATIVE_MM + element_rnd - EL_DF_START :
+
+ element_rnd >= EL_MM_START &&
+ element_rnd <= EL_MM_END ?
+ EL_MM_START_NATIVE_MM + element_rnd - EL_MM_START :
+
+ element_rnd >= EL_MM_RUNTIME_START &&
+ element_rnd <= EL_MM_RUNTIME_END ?
+ EL_MM_RUNTIME_START_NATIVE_MM + element_rnd - EL_MM_RUNTIME_START :
+
+ element_rnd >= EL_MM_DUMMY_START &&
+ element_rnd <= EL_MM_DUMMY_END ?
+ EL_MM_DUMMY_START_NATIVE_MM + element_rnd - EL_MM_DUMMY_START :
+
+ EL_EMPTY_NATIVE_MM);
}
int map_element_MM_to_RND(int element_mm)
{
- return 1000 + element_mm;
+ return (element_mm == EL_EMPTY_NATIVE_MM ||
+ element_mm == EL_DF_EMPTY_NATIVE_MM ?
+ EL_EMPTY :
+
+ element_mm >= EL_CHAR_START_NATIVE_MM &&
+ element_mm <= EL_CHAR_END_NATIVE_MM ?
+ EL_CHAR_START + element_mm - EL_CHAR_START_NATIVE_MM :
+
+ element_mm >= EL_DF_START_NATIVE_MM &&
+ element_mm <= EL_DF_END_NATIVE_MM ?
+ EL_DF_START + element_mm - EL_DF_START_NATIVE_MM :
+
+ element_mm >= EL_MM_START_NATIVE_MM &&
+ element_mm <= EL_MM_END_NATIVE_MM ?
+ EL_MM_START + element_mm - EL_MM_START_NATIVE_MM :
+
+ element_mm >= EL_MM_RUNTIME_START_NATIVE_MM &&
+ element_mm <= EL_MM_RUNTIME_END_NATIVE_MM ?
+ EL_MM_RUNTIME_START + element_mm - EL_MM_RUNTIME_START_NATIVE_MM :
+
+ element_mm >= EL_MM_DUMMY_START_NATIVE_MM &&
+ element_mm <= EL_MM_DUMMY_END_NATIVE_MM ?
+ EL_MM_DUMMY_START + element_mm - EL_MM_DUMMY_START_NATIVE_MM :
+
+ EL_EMPTY);
}
int get_next_element(int element)