renamed preprocessor constants for wall elements in MM engine
authorHolger Schemel <info@artsoft.org>
Thu, 23 Feb 2023 15:18:10 +0000 (16:18 +0100)
committerHolger Schemel <info@artsoft.org>
Thu, 23 Feb 2023 15:33:55 +0000 (16:33 +0100)
src/game_mm/mm_game.c
src/game_mm/mm_main.h
src/game_mm/mm_tools.c

index bd957ee37952a2a59d22c566956d730bbac12e55..4b221d0adc0b1b78b5b14076f94094a0851df511 100644 (file)
@@ -2458,7 +2458,7 @@ static boolean HitAbsorbingWalls(int element, int hit_mask)
     if (IS_90_ANGLE(laser.current_angle))
       mask += mask * (2 + IS_HORIZ_ANGLE(laser.current_angle) * 2);
 
-    laser.dest_element = element2 | EL_WALL_AMOEBA;
+    laser.dest_element = element2 | EL_WALL_AMOEBA_BASE;
 
     laser.wall_mask = mask;
   }
@@ -2605,7 +2605,7 @@ static void MeltIce(int x, int y)
   {
     int phase;
     int wall_mask = Store2[x][y];
-    int real_element = Tile[x][y] - EL_WALL_CHANGING + EL_WALL_ICE;
+    int real_element = Tile[x][y] - EL_WALL_CHANGING_BASE + EL_WALL_ICE_BASE;
 
     MovDelay[x][y]--;
     phase = frames - MovDelay[x][y] / delay - 1;
@@ -2617,7 +2617,7 @@ static void MeltIce(int x, int y)
 
       DrawWalls_MM(x, y, Tile[x][y]);
 
-      if (Tile[x][y] == EL_WALL_ICE)
+      if (Tile[x][y] == EL_WALL_ICE_BASE)
        Tile[x][y] = EL_EMPTY;
 
       ScanLaser_FromLastMirror();
@@ -2643,7 +2643,7 @@ static void GrowAmoeba(int x, int y)
   {
     int phase;
     int wall_mask = Store2[x][y];
-    int real_element = Tile[x][y] - EL_WALL_CHANGING + EL_WALL_AMOEBA;
+    int real_element = Tile[x][y] - EL_WALL_CHANGING_BASE + EL_WALL_AMOEBA_BASE;
 
     MovDelay[x][y]--;
     phase = MovDelay[x][y] / delay;
@@ -3296,9 +3296,9 @@ static void GameActions_MM_Ext(void)
       OpenGrayBall(x, y);
     else if (IS_ENVELOPE_OPENING(element))
       OpenEnvelope(x, y);
-    else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_ICE)
+    else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_ICE_BASE)
       MeltIce(x, y);
-    else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_AMOEBA)
+    else if (IS_WALL_CHANGING(element) && Store[x][y] == EL_WALL_AMOEBA_BASE)
       GrowAmoeba(x, y);
     else if (IS_MIRROR(element) ||
             IS_MIRROR_FIXED(element) ||
@@ -3503,8 +3503,8 @@ static void GameActions_MM_Ext(void)
   {
     PlayLevelSound_MM(ELX, ELY, element, MM_ACTION_SHRINKING);
 
-    Tile[ELX][ELY] = Tile[ELX][ELY] - EL_WALL_ICE + EL_WALL_CHANGING;
-    Store[ELX][ELY] = EL_WALL_ICE;
+    Tile[ELX][ELY] = Tile[ELX][ELY] - EL_WALL_ICE_BASE + EL_WALL_CHANGING_BASE;
+    Store[ELX][ELY] = EL_WALL_ICE_BASE;
     Store2[ELX][ELY] = laser.wall_mask;
 
     laser.dest_element = Tile[ELX][ELY];
@@ -3593,8 +3593,8 @@ static void GameActions_MM_Ext(void)
 
     PlayLevelSound_MM(x, y, element, MM_ACTION_GROWING);
 
-    Tile[x][y] = Tile[x][y] - EL_WALL_AMOEBA + EL_WALL_CHANGING;
-    Store[x][y] = EL_WALL_AMOEBA;
+    Tile[x][y] = Tile[x][y] - EL_WALL_AMOEBA_BASE + EL_WALL_CHANGING_BASE;
+    Store[x][y] = EL_WALL_AMOEBA_BASE;
     Store2[x][y] = wall_mask;
 
     return;
index fb0b029f470cb655576722de0b50bc581aea74d4..cf99e635d1e6076fb58420daa52f1880a895661e 100644 (file)
@@ -296,29 +296,20 @@ extern int                num_element_info;
 #define EL_KETTLE              29
 #define EL_BOMB                        30
 #define EL_PRISM               31
-#define EL_WALL_START          32
-#define EL_WALL_EMPTY          EL_WALL_START
-#define EL_WALL_00             EL_WALL_START
-#define EL_WALL_STEEL          EL_WALL_00
-#define EL_WALL_STEEL_START    EL_WALL_00
-#define EL_WALL_15             47
-#define EL_WALL_STEEL_END      EL_WALL_15
-#define EL_WALL_16             48
-#define EL_WALL_WOOD           EL_WALL_16
-#define EL_WALL_WOOD_START     EL_WALL_16
-#define EL_WALL_31             63
-#define EL_WALL_WOOD_END       EL_WALL_31
-#define EL_WALL_32             64
-#define EL_WALL_ICE            EL_WALL_32
-#define EL_WALL_ICE_START      EL_WALL_32
-#define EL_WALL_47             79
-#define EL_WALL_ICE_END                EL_WALL_47
-#define EL_WALL_48             80
-#define EL_WALL_AMOEBA         EL_WALL_48
-#define EL_WALL_AMOEBA_START   EL_WALL_48
-#define EL_WALL_63             95
-#define EL_WALL_AMOEBA_END     EL_WALL_63
-#define EL_WALL_END            EL_WALL_63
+#define EL_WALL_START          EL_WALL_STEEL_START
+#define EL_WALL_STEEL_BASE     32
+#define EL_WALL_STEEL_START    (EL_WALL_STEEL_BASE + 0)
+#define EL_WALL_STEEL_END      (EL_WALL_STEEL_BASE + 15)
+#define EL_WALL_WOOD_BASE      48
+#define EL_WALL_WOOD_START     (EL_WALL_WOOD_BASE + 0)
+#define EL_WALL_WOOD_END       (EL_WALL_WOOD_BASE + 15)
+#define EL_WALL_ICE_BASE       64
+#define EL_WALL_ICE_START      (EL_WALL_ICE_BASE + 0)
+#define EL_WALL_ICE_END                (EL_WALL_ICE_BASE + 15)
+#define EL_WALL_AMOEBA_BASE    80
+#define EL_WALL_AMOEBA_START   (EL_WALL_AMOEBA_BASE + 0)
+#define EL_WALL_AMOEBA_END     (EL_WALL_AMOEBA_BASE + 15)
+#define EL_WALL_END            EL_WALL_AMOEBA_END
 #define EL_BLOCK_WOOD          96
 #define EL_GRAY_BALL           97
 #define EL_BEAMER_START                98
@@ -483,14 +474,15 @@ extern int                num_element_info;
 #define EL_GRID_STEEL_FIXED_07 (EL_GRID_STEEL_FIXED_START + 7) // 157.5°
 #define EL_GRID_STEEL_FIXED_END        EL_GRID_STEEL_FIXED_07
 
-#define EL_DF_WALL_WOOD                272
-#define EL_DF_WALL_START       EL_DF_WALL_WOOD_START
-#define EL_DF_WALL_WOOD_START  (EL_DF_WALL_WOOD + 0)
-#define EL_DF_WALL_WOOD_END    (EL_DF_WALL_WOOD + 15)
+#define EL_DF_WALL_WOOD_BASE   272
+#define EL_DF_WALL_WOOD_START  (EL_DF_WALL_WOOD_BASE + 0)
+#define EL_DF_WALL_WOOD_END    (EL_DF_WALL_WOOD_BASE + 15)
+
+#define EL_DF_WALL_STEEL_BASE  288
+#define EL_DF_WALL_STEEL_START (EL_DF_WALL_STEEL_BASE + 0)
+#define EL_DF_WALL_STEEL_END   (EL_DF_WALL_STEEL_BASE + 15)
 
-#define EL_DF_WALL_STEEL       288
-#define EL_DF_WALL_STEEL_START (EL_DF_WALL_STEEL + 0)
-#define EL_DF_WALL_STEEL_END   (EL_DF_WALL_STEEL + 15)
+#define EL_DF_WALL_START       EL_DF_WALL_WOOD_START
 #define EL_DF_WALL_END         EL_DF_WALL_STEEL_END
 
 #define EL_DF_EMPTY            304
@@ -579,14 +571,14 @@ extern int                num_element_info;
 #define EL_MCDUFFIN            420
 #define EL_PACMAN              421
 #define EL_FUSE_OFF            422
-#define EL_STEEL_WALL          423
-#define EL_WOODEN_WALL         424
-#define EL_ICE_WALL            425
-#define EL_AMOEBA_WALL         426
+#define EL_WALL_STEEL          423
+#define EL_WALL_WOOD           424
+#define EL_WALL_ICE            425
+#define EL_WALL_AMOEBA         426
 #define EL_LASER               427
 #define EL_RECEIVER            428
-#define EL_DF_STEEL_WALL       429
-#define EL_DF_WOODEN_WALL      430
+#define EL_DF_WALL_STEEL       429
+#define EL_DF_WALL_WOOD                430
 
 #define EL_MM_END_2            430
 #define EL_MM_END              EL_MM_END_2
@@ -596,8 +588,8 @@ extern int          num_element_info;
 #define EL_EXIT_CLOSING                501
 #define EL_GRAY_BALL_ACTIVE    502
 #define EL_GRAY_BALL_OPENING   503
-#define EL_ICE_WALL_SHRINKING  504
-#define EL_AMOEBA_WALL_GROWING 505
+#define EL_WALL_ICE_SHRINKING  504
+#define EL_WALL_AMOEBA_GROWING 505
 #define EL_BOMB_ACTIVE         506
 #define EL_MINE_ACTIVE         507
 #define EL_ENVELOPE_1_OPENING  508
@@ -608,9 +600,9 @@ extern int          num_element_info;
 #define EL_ENVELOPE_OPENING_START      EL_ENVELOPE_1_OPENING
 #define EL_ENVELOPE_OPENING_END                EL_ENVELOPE_4_OPENING
 
-#define EL_WALL_CHANGING       512
-#define EL_WALL_CHANGING_START (EL_WALL_CHANGING + 0)
-#define EL_WALL_CHANGING_END   (EL_WALL_CHANGING + 15)
+#define EL_WALL_CHANGING_BASE  512
+#define EL_WALL_CHANGING_START (EL_WALL_CHANGING_BASE + 0)
+#define EL_WALL_CHANGING_END   (EL_WALL_CHANGING_BASE + 15)
 
 #define EL_FIRST_RUNTIME_EL    EL_EXIT_OPENING
 
index 02eb5dfbee8825fe9f9b9b82425866ef6c3879b3..95e8e21af83fe406692332ff109d72be60d97916 100644 (file)
@@ -1199,12 +1199,12 @@ static int map_element(int element)
 {
   switch (element)
   {
-    case EL_WALL_STEEL:                return EL_STEEL_WALL;
-    case EL_WALL_WOOD:         return EL_WOODEN_WALL;
-    case EL_WALL_ICE:          return EL_ICE_WALL;
-    case EL_WALL_AMOEBA:       return EL_AMOEBA_WALL;
-    case EL_DF_WALL_STEEL:     return EL_DF_STEEL_WALL;
-    case EL_DF_WALL_WOOD:      return EL_DF_WOODEN_WALL;
+    case EL_WALL_STEEL_BASE:   return EL_WALL_STEEL;
+    case EL_WALL_WOOD_BASE:    return EL_WALL_WOOD;
+    case EL_WALL_ICE_BASE:     return EL_WALL_ICE;
+    case EL_WALL_AMOEBA_BASE:  return EL_WALL_AMOEBA;
+    case EL_DF_WALL_STEEL_BASE:        return EL_DF_WALL_STEEL;
+    case EL_DF_WALL_WOOD_BASE: return EL_DF_WALL_WOOD;
 
     default:                   return element;
   }
@@ -1214,12 +1214,12 @@ int unmap_element(int element)
 {
   switch (element)
   {
-    case EL_STEEL_WALL:                return EL_WALL_STEEL;
-    case EL_WOODEN_WALL:       return EL_WALL_WOOD;
-    case EL_ICE_WALL:          return EL_WALL_ICE;
-    case EL_AMOEBA_WALL:       return EL_WALL_AMOEBA;
-    case EL_DF_STEEL_WALL:     return EL_DF_WALL_STEEL;
-    case EL_DF_WOODEN_WALL:    return EL_DF_WALL_WOOD;
+    case EL_WALL_STEEL:                return EL_WALL_STEEL_BASE;
+    case EL_WALL_WOOD:         return EL_WALL_WOOD_BASE;
+    case EL_WALL_ICE:          return EL_WALL_ICE_BASE;
+    case EL_WALL_AMOEBA:       return EL_WALL_AMOEBA_BASE;
+    case EL_DF_WALL_STEEL:     return EL_DF_WALL_STEEL_BASE;
+    case EL_DF_WALL_WOOD:      return EL_DF_WALL_WOOD_BASE;
 
     default:                   return element;
   }