{ "mm_pacman.eating.down.ypos", "4" },
{ "mm_pacman.eating.down.frames", "1" },
- { "mm_mask_mcduffin.right", "RocksMM.png" },
- { "mm_mask_mcduffin.right.xpos", "8" },
- { "mm_mask_mcduffin.right.ypos", "8" },
- { "mm_mask_mcduffin.right.frames", "1" },
- { "mm_mask_mcduffin.up", "RocksMM.png" },
- { "mm_mask_mcduffin.up.xpos", "9" },
- { "mm_mask_mcduffin.up.ypos", "8" },
- { "mm_mask_mcduffin.up.frames", "1" },
- { "mm_mask_mcduffin.left", "RocksMM.png" },
- { "mm_mask_mcduffin.left.xpos", "10" },
- { "mm_mask_mcduffin.left.ypos", "8" },
- { "mm_mask_mcduffin.left.frames", "1" },
- { "mm_mask_mcduffin.down", "RocksMM.png" },
- { "mm_mask_mcduffin.down.xpos", "11" },
- { "mm_mask_mcduffin.down.ypos", "8" },
- { "mm_mask_mcduffin.down.frames", "1" },
-
- { "mm_mask_grid_1", "RocksMM.png" },
- { "mm_mask_grid_1.xpos", "4" },
- { "mm_mask_grid_1.ypos", "8" },
- { "mm_mask_grid_1.frames", "1" },
- { "mm_mask_grid_2", "RocksMM.png" },
- { "mm_mask_grid_2.xpos", "5" },
- { "mm_mask_grid_2.ypos", "8" },
- { "mm_mask_grid_2.frames", "1" },
- { "mm_mask_grid_3", "RocksMM.png" },
- { "mm_mask_grid_3.xpos", "6" },
- { "mm_mask_grid_3.ypos", "8" },
- { "mm_mask_grid_3.frames", "1" },
- { "mm_mask_grid_4", "RocksMM.png" },
- { "mm_mask_grid_4.xpos", "7" },
- { "mm_mask_grid_4.ypos", "8" },
- { "mm_mask_grid_4.frames", "1" },
-
- { "mm_mask_rectangle", "RocksMM.png" },
- { "mm_mask_rectangle.xpos", "1" },
- { "mm_mask_rectangle.ypos", "8" },
- { "mm_mask_rectangle.frames", "1" },
-
- { "mm_mask_circle", "RocksMM.png" },
- { "mm_mask_circle.xpos", "0" },
- { "mm_mask_circle.ypos", "8" },
- { "mm_mask_circle.frames", "1" },
-
{ "[mm_default].exploding", "RocksMM.png" },
{ "[mm_default].exploding.xpos", "8" },
{ "[mm_default].exploding.ypos", "4" },
#define EL_MM_RUNTIME_START_NATIVE 500
#define EL_MM_RUNTIME_END_NATIVE 504
-#define EL_MM_DUMMY_START_NATIVE 700
-#define EL_MM_DUMMY_END_NATIVE 709
-
// elements to be specially mapped
#define EL_MM_EMPTY_NATIVE 0
#define EL_DF_EMPTY_NATIVE 304
static DelayCounter energy_delay = { ENERGY_DELAY };
static DelayCounter overload_delay = { 0 };
+// element mask positions for scanning pixels of MM elements
+#define MM_MASK_MCDUFFIN_RIGHT 0
+#define MM_MASK_MCDUFFIN_UP 1
+#define MM_MASK_MCDUFFIN_LEFT 2
+#define MM_MASK_MCDUFFIN_DOWN 3
+#define MM_MASK_GRID_1 4
+#define MM_MASK_GRID_2 5
+#define MM_MASK_GRID_3 6
+#define MM_MASK_GRID_4 7
+#define MM_MASK_RECTANGLE 8
+#define MM_MASK_CIRCLE 9
+
+#define NUM_MM_MASKS 10
+
// element masks for scanning pixels of MM elements
-static const char mm_masks[10][16][16 + 1] =
+static const char mm_masks[NUM_MM_MASKS][16][16 + 1] =
{
{
" ",
static int getMaskFromElement(int element)
{
if (IS_GRID(element))
- return IMG_MM_MASK_GRID_1 + get_element_phase(element);
+ return MM_MASK_GRID_1 + get_element_phase(element);
else if (IS_MCDUFFIN(element))
- return IMG_MM_MASK_MCDUFFIN_RIGHT + get_element_phase(element);
+ return MM_MASK_MCDUFFIN_RIGHT + get_element_phase(element);
else if (IS_RECTANGLE(element) || IS_DF_GRID(element))
- return IMG_MM_MASK_RECTANGLE;
+ return MM_MASK_RECTANGLE;
else
- return IMG_MM_MASK_CIRCLE;
+ return MM_MASK_CIRCLE;
}
static int ScanPixel(void)
}
else
{
- int pos = getMaskFromElement(element) - IMG_MM_MASK_MCDUFFIN_RIGHT;
+ int pos = getMaskFromElement(element);
pixel = (mm_masks[pos][dy / 2][dx / 2] == 'X' ? 1 : 0);
}
#define EL_EXPLODING_OPAQUE 601
#define EL_EXPLODING_TRANSP 602
-// dummy elements (never used as game elements, only used as graphics)
-#define EL_MM_MASK_MCDUFFIN_RIGHT 700
-#define EL_MM_MASK_MCDUFFIN_UP 701
-#define EL_MM_MASK_MCDUFFIN_LEFT 702
-#define EL_MM_MASK_MCDUFFIN_DOWN 703
-#define EL_MM_MASK_GRID_1 704
-#define EL_MM_MASK_GRID_2 705
-#define EL_MM_MASK_GRID_3 706
-#define EL_MM_MASK_GRID_4 707
-#define EL_MM_MASK_RECTANGE 708
-#define EL_MM_MASK_CIRCLE 709
-
// game graphics:
// 0 - 191: graphics from "MirrorScreen"
"-",
"-"
},
- {
- "mm_mask_mcduffin.right",
- "-",
- "-"
- },
- {
- "mm_mask_mcduffin.up",
- "-",
- "-"
- },
- {
- "mm_mask_mcduffin.left",
- "-",
- "-"
- },
- {
- "mm_mask_mcduffin.down",
- "-",
- "-"
- },
- {
- "mm_mask_grid_1",
- "-",
- "-"
- },
- {
- "mm_mask_grid_2",
- "-",
- "-"
- },
- {
- "mm_mask_grid_3",
- "-",
- "-"
- },
- {
- "mm_mask_grid_4",
- "-",
- "-"
- },
- {
- "mm_mask_rectangle",
- "-",
- "-"
- },
- {
- "mm_mask_circle",
- "-",
- "-"
- },
{
"[default]",
"default",
#define EL_MM_LIGHTBALL_RED (EL_FIRST_DUMMY + 21)
#define EL_MM_LIGHTBALL_BLUE (EL_FIRST_DUMMY + 22)
#define EL_MM_LIGHTBALL_YELLOW (EL_FIRST_DUMMY + 23)
-#define EL_MM_MASK_MCDUFFIN_RIGHT (EL_FIRST_DUMMY + 24)
-#define EL_MM_MASK_MCDUFFIN_UP (EL_FIRST_DUMMY + 25)
-#define EL_MM_MASK_MCDUFFIN_LEFT (EL_FIRST_DUMMY + 26)
-#define EL_MM_MASK_MCDUFFIN_DOWN (EL_FIRST_DUMMY + 27)
-#define EL_MM_MASK_GRID_1 (EL_FIRST_DUMMY + 28)
-#define EL_MM_MASK_GRID_2 (EL_FIRST_DUMMY + 29)
-#define EL_MM_MASK_GRID_3 (EL_FIRST_DUMMY + 30)
-#define EL_MM_MASK_GRID_4 (EL_FIRST_DUMMY + 31)
-#define EL_MM_MASK_RECTANGLE (EL_FIRST_DUMMY + 32)
-#define EL_MM_MASK_CIRCLE (EL_FIRST_DUMMY + 33)
-#define EL_DEFAULT (EL_FIRST_DUMMY + 34)
-#define EL_BD_DEFAULT (EL_FIRST_DUMMY + 35)
-#define EL_SP_DEFAULT (EL_FIRST_DUMMY + 36)
-#define EL_SB_DEFAULT (EL_FIRST_DUMMY + 37)
-#define EL_MM_DEFAULT (EL_FIRST_DUMMY + 38)
-#define EL_GRAPHIC_1 (EL_FIRST_DUMMY + 39)
-#define EL_GRAPHIC_2 (EL_FIRST_DUMMY + 40)
-#define EL_GRAPHIC_3 (EL_FIRST_DUMMY + 41)
-#define EL_GRAPHIC_4 (EL_FIRST_DUMMY + 42)
-#define EL_GRAPHIC_5 (EL_FIRST_DUMMY + 43)
-#define EL_GRAPHIC_6 (EL_FIRST_DUMMY + 44)
-#define EL_GRAPHIC_7 (EL_FIRST_DUMMY + 45)
-#define EL_GRAPHIC_8 (EL_FIRST_DUMMY + 46)
-
-#define EL_MM_DUMMY_START EL_MM_MASK_MCDUFFIN_RIGHT
-#define EL_MM_DUMMY_END EL_MM_MASK_CIRCLE
+#define EL_DEFAULT (EL_FIRST_DUMMY + 24)
+#define EL_BD_DEFAULT (EL_FIRST_DUMMY + 25)
+#define EL_SP_DEFAULT (EL_FIRST_DUMMY + 26)
+#define EL_SB_DEFAULT (EL_FIRST_DUMMY + 27)
+#define EL_MM_DEFAULT (EL_FIRST_DUMMY + 28)
+#define EL_GRAPHIC_1 (EL_FIRST_DUMMY + 29)
+#define EL_GRAPHIC_2 (EL_FIRST_DUMMY + 30)
+#define EL_GRAPHIC_3 (EL_FIRST_DUMMY + 31)
+#define EL_GRAPHIC_4 (EL_FIRST_DUMMY + 32)
+#define EL_GRAPHIC_5 (EL_FIRST_DUMMY + 33)
+#define EL_GRAPHIC_6 (EL_FIRST_DUMMY + 34)
+#define EL_GRAPHIC_7 (EL_FIRST_DUMMY + 35)
+#define EL_GRAPHIC_8 (EL_FIRST_DUMMY + 36)
// internal elements (only used for internal purposes like copying)
-#define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 47)
+#define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 37)
#define EL_INTERNAL_CLIPBOARD_CUSTOM (EL_FIRST_INTERNAL + 0)
#define EL_INTERNAL_CLIPBOARD_CHANGE (EL_FIRST_INTERNAL + 1)
element_rnd <= EL_MM_RUNTIME_END ?
EL_MM_RUNTIME_START_NATIVE + element_rnd - EL_MM_RUNTIME_START :
- element_rnd >= EL_MM_DUMMY_START &&
- element_rnd <= EL_MM_DUMMY_END ?
- EL_MM_DUMMY_START_NATIVE + element_rnd - EL_MM_DUMMY_START :
-
EL_MM_EMPTY_NATIVE);
}
element_mm <= EL_MM_RUNTIME_END_NATIVE ?
EL_MM_RUNTIME_START + element_mm - EL_MM_RUNTIME_START_NATIVE :
- element_mm >= EL_MM_DUMMY_START_NATIVE &&
- element_mm <= EL_MM_DUMMY_END_NATIVE ?
- EL_MM_DUMMY_START + element_mm - EL_MM_DUMMY_START_NATIVE :
-
EL_EMPTY);
}