From 009c5cf7cf504775f90e2223241fe19131182e96 Mon Sep 17 00:00:00 2001 From: Holger Schemel Date: Fri, 11 Jun 2021 17:25:41 +0200 Subject: [PATCH] changed name of preprocessor macro --- src/editor.c | 24 ++++++++++++------------ src/files.c | 2 +- src/game.c | 20 ++++++++++---------- src/init.c | 2 +- src/main.h | 4 ++-- src/tools.c | 2 +- 6 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/editor.c b/src/editor.c index 9fb3157e..282c5300 100644 --- a/src/editor.c +++ b/src/editor.c @@ -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 && diff --git a/src/files.c b/src/files.c index aaafe68a..a1901cae 100644 --- a/src/files.c +++ b/src/files.c @@ -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]); diff --git a/src/game.c b/src/game.c index 3d99a113..574d394f 100644 --- a/src/game.c +++ b/src/game.c @@ -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); diff --git a/src/init.c b/src/init.c index d266989d..6ccc8822 100644 --- a/src/init.c +++ b/src/init.c @@ -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))); diff --git a/src/main.h b/src/main.h index a77d6eee..f0f2c530 100644 --- a/src/main.h +++ b/src/main.h @@ -596,7 +596,7 @@ #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) @@ -850,7 +850,7 @@ (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) diff --git a/src/tools.c b/src/tools.c index 60d1072c..d032f988 100644 --- a/src/tools.c +++ b/src/tools.c @@ -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); -- 2.34.1