changed name of preprocessor macro
authorHolger Schemel <info@artsoft.org>
Fri, 11 Jun 2021 15:25:41 +0000 (17:25 +0200)
committerHolger Schemel <info@artsoft.org>
Fri, 11 Jun 2021 15:25:41 +0000 (17:25 +0200)
src/editor.c
src/files.c
src/game.c
src/init.c
src/main.h
src/tools.c

index 9fb3157e1f0bc922e6a0c0eee212335fdfca4d82..282c530025ca3a893370b3080e65f4392f798d89 100644 (file)
@@ -8265,7 +8265,7 @@ static void CopyGroupElementPropertiesToEditor(int element)
 
 static void CopyClassicElementPropertiesToEditor(int element)
 {
-  if (ELEM_IS_PLAYER(element) || COULD_MOVE_INTO_ACID(element))
+  if (IS_PLAYER_ELEMENT(element) || COULD_MOVE_INTO_ACID(element))
     custom_element_properties[EP_CAN_MOVE_INTO_ACID] =
       getMoveIntoAcidProperty(&level, element);
 
@@ -8451,7 +8451,7 @@ static void CopyGroupElementPropertiesToGame(int element)
 
 static void CopyClassicElementPropertiesToGame(int element)
 {
-  if (ELEM_IS_PLAYER(element) || COULD_MOVE_INTO_ACID(element))
+  if (IS_PLAYER_ELEMENT(element) || COULD_MOVE_INTO_ACID(element))
     setMoveIntoAcidProperty(&level, element,
                            custom_element_properties[EP_CAN_MOVE_INTO_ACID]);
 
@@ -9121,7 +9121,7 @@ static void DrawPropertiesTabulatorGadgets(void)
   int i;
 
   // draw two config tabulators for player elements
-  if (ELEM_IS_PLAYER(properties_element))
+  if (IS_PLAYER_ELEMENT(properties_element))
     id_last = ED_TEXTBUTTON_ID_PROPERTIES_CONFIG_2;
 
   // draw two config and one "change" tabulator for custom elements
@@ -9136,7 +9136,7 @@ static void DrawPropertiesTabulatorGadgets(void)
 
     // use "config 1" and "config 2" instead of "config" for players and CEs
     if (i == ED_TEXTBUTTON_ID_PROPERTIES_CONFIG &&
-       (ELEM_IS_PLAYER(properties_element) ||
+       (IS_PLAYER_ELEMENT(properties_element) ||
         IS_CUSTOM_ELEMENT(properties_element)))
       continue;
 
@@ -9833,7 +9833,7 @@ static boolean checkPropertiesConfig(int element)
       IS_ENVELOPE(element) ||
       IS_MM_MCDUFFIN(element) ||
       IS_DF_LASER(element) ||
-      ELEM_IS_PLAYER(element) ||
+      IS_PLAYER_ELEMENT(element) ||
       HAS_EDITOR_CONTENT(element) ||
       CAN_GROW(element) ||
       COULD_MOVE_INTO_ACID(element) ||
@@ -9990,7 +9990,7 @@ static void DrawPropertiesConfig(void)
       DrawAndroidElementArea(properties_element);
   }
 
-  if (ELEM_IS_PLAYER(properties_element))
+  if (IS_PLAYER_ELEMENT(properties_element))
   {
     int player_nr = GET_PLAYER_NR(properties_element);
 
@@ -10070,7 +10070,7 @@ static void DrawPropertiesConfig(void)
     MapCheckbuttonGadget(ED_CHECKBUTTON_ID_EM_EXPLODES_BY_FIRE);
 
   if (COULD_MOVE_INTO_ACID(properties_element) &&
-      !ELEM_IS_PLAYER(properties_element) &&
+      !IS_PLAYER_ELEMENT(properties_element) &&
       (!IS_CUSTOM_ELEMENT(properties_element) ||
        edit_mode_properties == ED_MODE_PROPERTIES_CONFIG_2))
   {
@@ -10408,12 +10408,12 @@ static void DrawPropertiesWindow(void)
     edit_mode_properties = ED_MODE_PROPERTIES_CONFIG_2;
 
   if (edit_mode_properties > ED_MODE_PROPERTIES_CONFIG &&
-      !ELEM_IS_PLAYER(properties_element) &&
+      !IS_PLAYER_ELEMENT(properties_element) &&
       !IS_CUSTOM_ELEMENT(properties_element))
     edit_mode_properties = ED_MODE_PROPERTIES_CONFIG;
 
   if (edit_mode_properties == ED_MODE_PROPERTIES_CONFIG &&
-      (ELEM_IS_PLAYER(properties_element) ||
+      (IS_PLAYER_ELEMENT(properties_element) ||
        IS_CUSTOM_ELEMENT(properties_element)))
     edit_mode_properties = ED_MODE_PROPERTIES_CONFIG_1;
 
@@ -12321,7 +12321,7 @@ static void CopyBrushExt(int from_x, int from_y, int to_x, int to_y,
        {
          int element = Tile[x][y];
 
-         if (!IS_EM_ELEMENT(element) && !ELEM_IS_PLAYER(element))
+         if (!IS_EM_ELEMENT(element) && !IS_PLAYER_ELEMENT(element))
            use_em_engine = FALSE;
 
          if (!IS_SP_ELEMENT(element))
@@ -13004,7 +13004,7 @@ static void HandleDrawingAreas(struct GadgetInfo *gi)
        {
          SetDrawModeHiRes(new_element);
 
-         if (ELEM_IS_PLAYER(new_element))
+         if (IS_PLAYER_ELEMENT(new_element))
          {
            // remove player at old position
            for (y = 0; y < lev_fieldy; y++)
@@ -13013,7 +13013,7 @@ static void HandleDrawingAreas(struct GadgetInfo *gi)
              {
                int old_element = Tile[x][y];
 
-               if (ELEM_IS_PLAYER(old_element))
+               if (IS_PLAYER_ELEMENT(old_element))
                {
                  int replaced_with_element =
                    (old_element == EL_SOKOBAN_FIELD_PLAYER &&
index aaafe68a64aba2ef4db5d69a4354e371b6fdb4ff..a1901caea52d996c7fb7a5cd58f975d35f102165 100644 (file)
@@ -3642,7 +3642,7 @@ static void CopyNativeLevel_RND_to_EM(struct LevelInfo *level)
   // initialize player positions and delete players from the playfield
   for (y = 0; y < cav->height; y++) for (x = 0; x < cav->width; x++)
   {
-    if (ELEM_IS_PLAYER(level->field[x][y]))
+    if (IS_PLAYER_ELEMENT(level->field[x][y]))
     {
       int player_nr = GET_PLAYER_NR(level->field[x][y]);
 
index 3d99a11322b18df7d8daf4c8501b405f18633b2c..574d394f12dbce661af48c7ac3dad1762bac55b8 100644 (file)
@@ -4310,7 +4310,7 @@ void InitGame(void)
        {
          // check for player created from custom element as single target
          content = element_info[element].change_page[i].target_element;
-         is_player = ELEM_IS_PLAYER(content);
+         is_player = IS_PLAYER_ELEMENT(content);
 
          if (is_player && (found_rating < 3 ||
                            (found_rating == 3 && element < found_element)))
@@ -4328,7 +4328,7 @@ void InitGame(void)
       {
        // check for player created from custom element as explosion content
        content = element_info[element].content.e[xx][yy];
-       is_player = ELEM_IS_PLAYER(content);
+       is_player = IS_PLAYER_ELEMENT(content);
 
        if (is_player && (found_rating < 2 ||
                          (found_rating == 2 && element < found_element)))
@@ -4349,7 +4349,7 @@ void InitGame(void)
          content =
            element_info[element].change_page[i].target_content.e[xx][yy];
 
-         is_player = ELEM_IS_PLAYER(content);
+         is_player = IS_PLAYER_ELEMENT(content);
 
          if (is_player && (found_rating < 1 ||
                            (found_rating == 1 && element < found_element)))
@@ -5688,7 +5688,7 @@ static void RelocatePlayer(int jx, int jy, int el_player_raw)
      possible that the relocation target field did not contain a player element,
      but a walkable element, to which the new player was relocated -- in this
      case, restore that (already initialized!) element on the player field */
-  if (!ELEM_IS_PLAYER(element))        // player may be set on walkable element
+  if (!IS_PLAYER_ELEMENT(element))     // player may be set on walkable element
   {
     Tile[jx][jy] = element;    // restore previously existing element
   }
@@ -5858,7 +5858,7 @@ static void Explode(int ex, int ey, int phase, int mode)
 
       // !!! check this case -- currently needed for rnd_rado_negundo_v,
       // !!! levels 015 018 019 020 021 022 023 026 027 028 !!!
-      else if (ELEM_IS_PLAYER(center_element))
+      else if (IS_PLAYER_ELEMENT(center_element))
        Store[x][y] = EL_EMPTY;
       else if (center_element == EL_YAMYAM)
        Store[x][y] = level.yamyam_content[game.yamyam_content_nr].e[xx][yy];
@@ -5998,7 +5998,7 @@ static void Explode(int ex, int ey, int phase, int mode)
     if (IS_PLAYER(x, y) && !PLAYERINFO(x, y)->present)
       StorePlayer[x][y] = 0;
 
-    if (ELEM_IS_PLAYER(element))
+    if (IS_PLAYER_ELEMENT(element))
       RelocatePlayer(x, y, element);
   }
   else if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
@@ -8784,7 +8784,7 @@ void ContinueMoving(int x, int y)
     if (GFX_CRUMBLED(Tile[x][y]))
       TEST_DrawLevelFieldCrumbledNeighbours(x, y);
 
-    if (ELEM_IS_PLAYER(move_leave_element))
+    if (IS_PLAYER_ELEMENT(move_leave_element))
       RelocatePlayer(x, y, move_leave_element);
   }
 
@@ -10594,7 +10594,7 @@ static void CreateFieldExt(int x, int y, int element, boolean is_change)
   int previous_move_direction = MovDir[x][y];
   int last_ce_value = CustomValue[x][y];
   boolean player_explosion_protected = PLAYER_EXPLOSION_PROTECTED(x, y);
-  boolean new_element_is_player = ELEM_IS_PLAYER(new_element);
+  boolean new_element_is_player = IS_PLAYER_ELEMENT(new_element);
   boolean add_player_onto_element = (new_element_is_player &&
                                     new_element != EL_SOKOBAN_FIELD_PLAYER &&
                                     IS_WALKABLE(old_element));
@@ -10770,7 +10770,7 @@ static boolean ChangeElement(int x, int y, int element, int page)
          (change->replace_when == CP_WHEN_COLLECTIBLE  && is_collectible) ||
          (change->replace_when == CP_WHEN_REMOVABLE    && is_removable) ||
          (change->replace_when == CP_WHEN_DESTRUCTIBLE && is_destructible)) &&
-        !(IS_PLAYER(ex, ey) && ELEM_IS_PLAYER(content_element)));
+        !(IS_PLAYER(ex, ey) && IS_PLAYER_ELEMENT(content_element)));
 
       if (!can_replace[xx][yy])
        complete_replace = FALSE;
@@ -10833,7 +10833,7 @@ static boolean ChangeElement(int x, int y, int element, int page)
     }
 
     // special case: element changes to player (and may be kept if walkable)
-    if (ELEM_IS_PLAYER(target_element) && !level.keep_walkable_ce)
+    if (IS_PLAYER_ELEMENT(target_element) && !level.keep_walkable_ce)
       CreateElementFromChange(x, y, EL_EMPTY);
 
     CreateElementFromChange(x, y, target_element);
index d266989d445b0497adffca419ef0b0b0c4fb1e29..6ccc8822c02361fb4c4d51c5e74206857ee1e3c3 100644 (file)
@@ -4664,7 +4664,7 @@ void InitElementPropertiesEngine(int engine_version)
                                                  i == EL_BLACK_ORB));
 
     // ---------- COULD_MOVE_INTO_ACID ----------------------------------------
-    SET_PROPERTY(i, EP_COULD_MOVE_INTO_ACID, (ELEM_IS_PLAYER(i) ||
+    SET_PROPERTY(i, EP_COULD_MOVE_INTO_ACID, (IS_PLAYER_ELEMENT(i) ||
                                              CAN_MOVE(i) ||
                                              IS_CUSTOM_ELEMENT(i)));
 
index a77d6eeedcafb0b0310ca097295aebda0f6cdffd..f0f2c530fded66300de7110ba145281fa49bdb03 100644 (file)
 #define GFX_CRUMBLED(e)                HAS_PROPERTY(GFX_ELEMENT(e), EP_GFX_CRUMBLED)
 
 // macros for pre-defined properties
-#define ELEM_IS_PLAYER(e)      HAS_PROPERTY(e, EP_PLAYER)
+#define IS_PLAYER_ELEMENT(e)   HAS_PROPERTY(e, EP_PLAYER)
 #define CAN_PASS_MAGIC_WALL(e) HAS_PROPERTY(e, EP_CAN_PASS_MAGIC_WALL)
 #define CAN_PASS_DC_MAGIC_WALL(e) HAS_PROPERTY(e, EP_CAN_PASS_DC_MAGIC_WALL)
 #define IS_SWITCHABLE(e)       HAS_PROPERTY(e, EP_SWITCHABLE)
        (ge == EL_ANY_ELEMENT ? TRUE :                                  \
         IS_GROUP_ELEMENT(ge) ? IS_IN_GROUP(e, GROUP_NR(ge)) : (e) == (ge))
 
-#define IS_PLAYER(x, y)                (ELEM_IS_PLAYER(StorePlayer[x][y]))
+#define IS_PLAYER(x, y)                (IS_PLAYER_ELEMENT(StorePlayer[x][y]))
 
 #define IS_FREE(x, y)          (Tile[x][y] == EL_EMPTY && !IS_PLAYER(x, y))
 #define IS_FREE_OR_PLAYER(x, y)        (Tile[x][y] == EL_EMPTY)
index 60d1072cb852046864b5ff0597785ce84ae1756e..d032f9884d56fb0a4bbf28397a1a4c3b77bb0114 100644 (file)
@@ -3675,7 +3675,7 @@ void DrawPreviewPlayers(void)
     {
       int element = level.field[x][y];
 
-      if (ELEM_IS_PLAYER(element))
+      if (IS_PLAYER_ELEMENT(element))
       {
        int player_nr = GET_PLAYER_NR(element);