From: Holger Schemel Date: Fri, 8 Mar 2024 13:02:45 +0000 (+0100) Subject: added macros for some game elements X-Git-Tag: 4.4.0.0-test-1~236 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=9feb13e0d1d32ec2aa6e81666bab78353ae838c6;p=rocksndiamonds.git added macros for some game elements --- diff --git a/src/editor.c b/src/editor.c index 0c3ec36f..f02252c5 100644 --- a/src/editor.c +++ b/src/editor.c @@ -10608,14 +10608,12 @@ static boolean checkPropertiesConfig(int element) IS_MM_MCDUFFIN(element) || IS_DF_LASER(element) || IS_PLAYER_ELEMENT(element) || + IS_BD_PLAYER_ELEMENT(element) || + IS_SOKOBAN_OBJECT_OR_FIELD(element) || HAS_EDITOR_CONTENT(element) || CAN_GROW(element) || COULD_MOVE_INTO_ACID(element) || - MAYBE_DONT_COLLIDE_WITH(element) || - element == EL_BD_PLAYER || - element == EL_SOKOBAN_OBJECT || - element == EL_SOKOBAN_FIELD_EMPTY || - element == EL_SOKOBAN_FIELD_FULL) + MAYBE_DONT_COLLIDE_WITH(element)) return TRUE; else for (i = 0; elements_with_counter[i].element != -1; i++) @@ -10847,7 +10845,7 @@ static void DrawPropertiesConfig(void) } } - if (properties_element == EL_BD_PLAYER) + if (IS_BD_PLAYER_ELEMENT(properties_element)) MapCheckbuttonGadget(ED_CHECKBUTTON_ID_BD_DIAGONAL_MOVEMENTS); if (IS_GEM(properties_element)) diff --git a/src/main.h b/src/main.h index d1ee5b60..9a54263f 100644 --- a/src/main.h +++ b/src/main.h @@ -898,6 +898,17 @@ (e) == EL_PEARL ? EL_BOMB : \ (e) == EL_CRYSTAL ? EL_CRYSTAL : \ EL_ROCK) + +#define IS_BD_PLAYER_ELEMENT(e) ((e) == EL_BD_INBOX || \ + (e) == EL_BD_PLAYER || \ + (e) == EL_BD_PLAYER_WITH_BOMB || \ + (e) == EL_BD_PLAYER_GLUED || \ + (e) == EL_BD_PLAYER_STIRRING) + +#define IS_SOKOBAN_OBJECT_OR_FIELD(e) ((e) == EL_SOKOBAN_OBJECT || \ + (e) == EL_SOKOBAN_FIELD_EMPTY || \ + (e) == EL_SOKOBAN_FIELD_FULL) + #define IS_DRAWABLE(e) ((e) < EL_BLOCKED) #define IS_NOT_DRAWABLE(e) ((e) >= EL_BLOCKED) #define TAPE_IS_EMPTY(x) ((x).length == 0)