added some preprocessor macros for empty space elements
authorHolger Schemel <info@artsoft.org>
Fri, 26 Nov 2021 15:19:23 +0000 (16:19 +0100)
committerHolger Schemel <info@artsoft.org>
Sat, 22 Jan 2022 16:58:28 +0000 (17:58 +0100)
src/main.h

index 0a2ff1f6a8f1238f80a12358af7ae833d26e4b23..72c164416c948c9cb3353addb9416b926c8a100e 100644 (file)
 
 #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)
 
 #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)
 #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 -----------------------------