From: Holger Schemel Date: Fri, 26 Nov 2021 15:19:23 +0000 (+0100) Subject: added some preprocessor macros for empty space elements X-Git-Tag: 4.3.1.0~15 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=ed7ea5975dead823d5119729e7851411c5c8089a;p=rocksndiamonds.git added some preprocessor macros for empty space elements --- diff --git a/src/main.h b/src/main.h index 0a2ff1f6..72c16441 100644 --- a/src/main.h +++ b/src/main.h @@ -669,6 +669,9 @@ #define IS_OBSOLETE(e) HAS_PROPERTY(e, EP_OBSOLETE) +#define IS_EMPTY(e) IS_EMPTY_SPACE(e) +#define IS_EMPTY_ELEMENT(e) IS_EMPTY_SPACE(e) + // special macros used in game engine #define IS_FILE_ELEMENT(e) ((e) >= 0 && \ (e) <= NUM_FILE_ELEMENTS) @@ -914,6 +917,9 @@ #define GET_PLAYER_NR(e) (GET_PLAYER_ELEMENT(e) - EL_PLAYER_1) +#define GET_EMPTY_ELEMENT(i) ((i) == 0 ? EL_EMPTY_SPACE : \ + EL_EMPTY_SPACE_1 + (i) - 1) + #define ANIM_FRAMES(g) (graphic_info[g].anim_frames) #define ANIM_DELAY(g) (graphic_info[g].anim_delay) #define ANIM_MODE(g) (graphic_info[g].anim_mode) @@ -1920,6 +1926,7 @@ #include "conf_emp.h" // include auto-generated data structure definitions #define NUM_EMPTY_SPACE_ELEMENTS 16 +#define NUM_EMPTY_ELEMENTS_ALL (NUM_EMPTY_SPACE_ELEMENTS + 1) #define EL_EMPTY_SPACE_END 1232 // ---------- end of empty space elements section -----------------------------