/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* (c) 1995-2002 Artsoft Entertainment *
+* (c) 1995-2006 Artsoft Entertainment *
* Holger Schemel *
* Detmolder Strasse 189 *
* 33604 Bielefeld *
#include "libgame/libgame.h"
#include "game_em/game_em.h"
+#include "game_sp/game_sp.h"
#include "conf_gfx.h" /* include auto-generated data structure definitions */
#include "conf_snd.h" /* include auto-generated data structure definitions */
#include "conf_mus.h" /* include auto-generated data structure definitions */
+
+#define NEW_TILESIZE 1
+#define NEW_SCROLL 1
+
#define IMG_UNDEFINED (-1)
#define IMG_EMPTY IMG_EMPTY_SPACE
-#define IMG_SP_EMPTY IMG_SP_EMPTY_SPACE
+#define IMG_SP_EMPTY IMG_EMPTY_SPACE
+#define IMG_SP_EMPTY_SPACE IMG_EMPTY_SPACE
#define IMG_EXPLOSION IMG_DEFAULT_EXPLODING
#define IMG_CHAR_START IMG_CHAR_SPACE
+#define IMG_STEEL_CHAR_START IMG_STEEL_CHAR_SPACE
#define IMG_CUSTOM_START IMG_CUSTOM_1
#define SND_UNDEFINED (-1)
#define MUS_UNDEFINED (-1)
+#if 0
#define WIN_XSIZE 672
#define WIN_YSIZE 560
+#endif
#define DEFAULT_FULLSCREEN_MODE "800x600"
+#if 0
#define SCR_FIELDX 17
#define SCR_FIELDY 17
+#endif
#define MAX_BUF_XSIZE (SCR_FIELDX + 2)
#define MAX_BUF_YSIZE (SCR_FIELDY + 2)
#define MIN_LEV_FIELDX 3
#define MAX_LEV_FIELDX MAX_PLAYFIELD_WIDTH
#define MAX_LEV_FIELDY MAX_PLAYFIELD_HEIGHT
+#define MIN_SCROLL_DELAY 0
+#define STD_SCROLL_DELAY 3
+#define MAX_SCROLL_DELAY 8
+
#define SCREENX(a) ((a) - scroll_x)
#define SCREENY(a) ((a) - scroll_y)
#define LEVELX(a) ((a) + scroll_x)
#define LEVELY(a) ((a) + scroll_y)
-#define IN_VIS_FIELD(x,y) ((x)>=0 && (x)<SCR_FIELDX && (y)>=0 &&(y)<SCR_FIELDY)
-#define IN_SCR_FIELD(x,y) ((x)>=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2)
-#define IN_LEV_FIELD(x,y) ((x)>=0 && (x)<lev_fieldx && (y)>=0 &&(y)<lev_fieldy)
+
+#define IN_FIELD(x, y, xsize, ysize) ((x) >= 0 && (x) < (xsize) && \
+ (y) >= 0 && (y) < (ysize))
+#define IN_FIELD_MINMAX(x, y, xmin, ymin, xmax, ymax) \
+ ((x) >= (xmin) && (x) <= (xmax) && \
+ (y) >= (ymin) && (y) <= (ymax))
+
+#define IN_VIS_FIELD(x, y) IN_FIELD(x, y, SCR_FIELDX, SCR_FIELDY)
+#define IN_LEV_FIELD(x, y) IN_FIELD(x, y, lev_fieldx, lev_fieldy)
+#define IN_SCR_FIELD(x, y) IN_FIELD_MINMAX(x,y, BX1,BY1, BX2,BY2)
/* values for configurable properties (custom elem's only, else pre-defined) */
+/* (never change these values, as they are stored in level files!) */
#define EP_DIGGABLE 0
#define EP_COLLECTIBLE_ONLY 1
#define EP_DONT_RUN_INTO 2
#define EP_THROWABLE 28
#define EP_CAN_EXPLODE 29
#define EP_GRAVITY_REACHABLE 30
+#define EP_DONT_GET_HIT_BY 31
/* values for pre-defined properties */
+/* (from here on, values can be changed by inserting new values) */
#define EP_PLAYER 32
#define EP_CAN_PASS_MAGIC_WALL 33
-#define EP_SWITCHABLE 34
-#define EP_BD_ELEMENT 35
-#define EP_SP_ELEMENT 36
-#define EP_SB_ELEMENT 37
-#define EP_GEM 38
-#define EP_FOOD_DARK_YAMYAM 39
-#define EP_FOOD_PENGUIN 40
-#define EP_FOOD_PIG 41
-#define EP_HISTORIC_WALL 42
-#define EP_HISTORIC_SOLID 43
-#define EP_CLASSIC_ENEMY 44
-#define EP_BELT 45
-#define EP_BELT_ACTIVE 46
-#define EP_BELT_SWITCH 47
-#define EP_TUBE 48
-#define EP_KEYGATE 49
-#define EP_AMOEBOID 50
-#define EP_AMOEBALIVE 51
-#define EP_HAS_EDITOR_CONTENT 52
-#define EP_CAN_TURN_EACH_MOVE 53
-#define EP_CAN_GROW 54
-#define EP_ACTIVE_BOMB 55
-#define EP_INACTIVE 56
+#define EP_CAN_PASS_DC_MAGIC_WALL 34
+#define EP_SWITCHABLE 35
+#define EP_BD_ELEMENT 36
+#define EP_SP_ELEMENT 37
+#define EP_SB_ELEMENT 38
+#define EP_GEM 39
+#define EP_FOOD_DARK_YAMYAM 40
+#define EP_FOOD_PENGUIN 41
+#define EP_FOOD_PIG 42
+#define EP_HISTORIC_WALL 43
+#define EP_HISTORIC_SOLID 44
+#define EP_CLASSIC_ENEMY 45
+#define EP_BELT 46
+#define EP_BELT_ACTIVE 47
+#define EP_BELT_SWITCH 48
+#define EP_TUBE 49
+#define EP_ACID_POOL 50
+#define EP_KEYGATE 51
+#define EP_AMOEBOID 52
+#define EP_AMOEBALIVE 53
+#define EP_HAS_EDITOR_CONTENT 54
+#define EP_CAN_TURN_EACH_MOVE 55
+#define EP_CAN_GROW 56
+#define EP_ACTIVE_BOMB 57
+#define EP_INACTIVE 58
/* values for special configurable properties (depending on level settings) */
-#define EP_EM_SLIPPERY_WALL 57
+#define EP_EM_SLIPPERY_WALL 59
/* values for special graphics properties (no effect on game engine) */
-#define EP_GFX_CRUMBLED 58
+#define EP_GFX_CRUMBLED 60
/* values for derived properties (determined from properties above) */
-#define EP_ACCESSIBLE_OVER 59
-#define EP_ACCESSIBLE_INSIDE 60
-#define EP_ACCESSIBLE_UNDER 61
-#define EP_WALKABLE 62
-#define EP_PASSABLE 63
-#define EP_ACCESSIBLE 64
-#define EP_COLLECTIBLE 65
-#define EP_SNAPPABLE 66
-#define EP_WALL 67
-#define EP_SOLID_FOR_PUSHING 68
-#define EP_DRAGONFIRE_PROOF 69
-#define EP_EXPLOSION_PROOF 70
-#define EP_CAN_SMASH 71
-#define EP_EXPLODES_3X3_OLD 72
-#define EP_CAN_EXPLODE_BY_FIRE 73
-#define EP_CAN_EXPLODE_SMASHED 74
-#define EP_CAN_EXPLODE_IMPACT 75
-#define EP_SP_PORT 76
-#define EP_CAN_EXPLODE_BY_DRAGONFIRE 77
-#define EP_CAN_EXPLODE_BY_EXPLOSION 78
-#define EP_COULD_MOVE_INTO_ACID 79
-#define EP_MAYBE_DONT_COLLIDE_WITH 80
-#define EP_CAN_BE_CLONED_BY_ANDROID 81
+#define EP_ACCESSIBLE_OVER 61
+#define EP_ACCESSIBLE_INSIDE 62
+#define EP_ACCESSIBLE_UNDER 63
+#define EP_WALKABLE 64
+#define EP_PASSABLE 65
+#define EP_ACCESSIBLE 66
+#define EP_COLLECTIBLE 67
+#define EP_SNAPPABLE 68
+#define EP_WALL 69
+#define EP_SOLID_FOR_PUSHING 70
+#define EP_DRAGONFIRE_PROOF 71
+#define EP_EXPLOSION_PROOF 72
+#define EP_CAN_SMASH 73
+#define EP_EXPLODES_3X3_OLD 74
+#define EP_CAN_EXPLODE_BY_FIRE 75
+#define EP_CAN_EXPLODE_SMASHED 76
+#define EP_CAN_EXPLODE_IMPACT 77
+#define EP_SP_PORT 78
+#define EP_CAN_EXPLODE_BY_DRAGONFIRE 79
+#define EP_CAN_EXPLODE_BY_EXPLOSION 80
+#define EP_COULD_MOVE_INTO_ACID 81
+#define EP_MAYBE_DONT_COLLIDE_WITH 82
+#define EP_CAN_BE_CLONED_BY_ANDROID 83
/* values for internal purpose only (level editor) */
-#define EP_WALK_TO_OBJECT 82
-#define EP_DEADLY 83
-#define EP_EDITOR_CASCADE 84
-#define EP_EDITOR_CASCADE_ACTIVE 85
-#define EP_EDITOR_CASCADE_INACTIVE 86
+#define EP_WALK_TO_OBJECT 84
+#define EP_DEADLY 85
+#define EP_EDITOR_CASCADE 86
+#define EP_EDITOR_CASCADE_ACTIVE 87
+#define EP_EDITOR_CASCADE_INACTIVE 88
/* values for internal purpose only (game engine) */
-#define EP_HAS_ACTION 87
-#define EP_CAN_CHANGE_OR_HAS_ACTION 88
+#define EP_HAS_ACTION 89
+#define EP_CAN_CHANGE_OR_HAS_ACTION 90
/* values for internal purpose only (other) */
-#define EP_OBSOLETE 89
+#define EP_OBSOLETE 91
-#define NUM_ELEMENT_PROPERTIES 90
+#define NUM_ELEMENT_PROPERTIES 92
#define NUM_EP_BITFIELDS ((NUM_ELEMENT_PROPERTIES + 31) / 32)
#define EP_BITFIELD_BASE_NR 0
#define EP_BITMASK_DEFAULT 0
#define PROPERTY_BIT(p) (1 << ((p) % 32))
-#if 1
#define PROPERTY_VAR(e,p) (element_info[e].properties[(p) / 32])
-#else
-#define PROPERTY_VAR(e,p) (Properties[e][(p) / 32])
-#endif
#define HAS_PROPERTY(e,p) ((PROPERTY_VAR(e, p) & PROPERTY_BIT(p)) != 0)
#define SET_PROPERTY(e,p,v) ((v) ? \
(PROPERTY_VAR(e,p) |= PROPERTY_BIT(p)) : \
PLAYER_BITS_3 | \
PLAYER_BITS_4)
#define PLAYER_BITS_TRIGGER (1 << 4)
+#define PLAYER_BITS_ACTION (1 << 5)
/* values for move directions (bits 0 - 3: basic move directions) */
#define MV_BIT_PREVIOUS 4
#define CP_WHEN_REMOVABLE 4
#define CP_WHEN_WALKABLE 5
-/* values for change actions for custom elements */
+/* values for change actions for custom elements (stored in level file) */
#define CA_NO_ACTION 0
#define CA_EXIT_PLAYER 1
#define CA_KILL_PLAYER 2
#define CA_SET_CE_SCORE 15
#define CA_SET_CE_VALUE 16
#define CA_SET_ENGINE_SCAN_MODE 17
+#define CA_SET_PLAYER_INVENTORY 18
+#define CA_SET_CE_ARTWORK 19
+#define CA_SET_LEVEL_RANDOM_SEED 20
#define CA_HEADLINE_LEVEL_ACTIONS 250
#define CA_HEADLINE_PLAYER_ACTIONS 251
#define CA_ARG_PLAYER_4 (CA_ARG_PLAYER + PLAYER_BITS_4)
#define CA_ARG_PLAYER_ANY (CA_ARG_PLAYER + PLAYER_BITS_ANY)
#define CA_ARG_PLAYER_TRIGGER (CA_ARG_PLAYER + PLAYER_BITS_TRIGGER)
+#define CA_ARG_PLAYER_ACTION (CA_ARG_PLAYER + PLAYER_BITS_ACTION)
#define CA_ARG_PLAYER_HEADLINE (CA_ARG_PLAYER + 999)
#define CA_ARG_NUMBER 11000
#define CA_ARG_NUMBER_MIN (CA_ARG_NUMBER + 0)
#define CA_ARG_ELEMENT_RESET (CA_ARG_ELEMENT + 0)
#define CA_ARG_ELEMENT_TARGET (CA_ARG_ELEMENT + 1)
#define CA_ARG_ELEMENT_TRIGGER (CA_ARG_ELEMENT + 2)
+#define CA_ARG_ELEMENT_ACTION (CA_ARG_ELEMENT + 7)
#define CA_ARG_ELEMENT_HEADLINE (CA_ARG_ELEMENT + 997)
#define CA_ARG_ELEMENT_CV_TARGET (CA_ARG_ELEMENT_TARGET)
#define CA_ARG_ELEMENT_CV_TRIGGER (CA_ARG_ELEMENT_TRIGGER)
+#define CA_ARG_ELEMENT_CV_ACTION (CA_ARG_ELEMENT_ACTION)
#define CA_ARG_ELEMENT_CV_HEADLINE (CA_ARG_ELEMENT_HEADLINE)
#define CA_ARG_ELEMENT_NR_TARGET (CA_ARG_ELEMENT + 3)
#define CA_ARG_ELEMENT_NR_TRIGGER (CA_ARG_ELEMENT + 4)
+#define CA_ARG_ELEMENT_NR_ACTION (CA_ARG_ELEMENT + 8)
#define CA_ARG_ELEMENT_NR_HEADLINE (CA_ARG_ELEMENT + 998)
#define CA_ARG_ELEMENT_CS_TARGET (CA_ARG_ELEMENT + 5)
#define CA_ARG_ELEMENT_CS_TRIGGER (CA_ARG_ELEMENT + 6)
+#define CA_ARG_ELEMENT_CS_ACTION (CA_ARG_ELEMENT + 9)
#define CA_ARG_ELEMENT_CS_HEADLINE (CA_ARG_ELEMENT + 999)
#define CA_ARG_SPEED 13000
#define CA_ARG_SPEED_NOT_MOVING (CA_ARG_SPEED + STEPSIZE_NOT_MOVING)
#define CA_ARG_SCAN_MODE_NORMAL (CA_ARG_SCAN_MODE + MV_NORMAL)
#define CA_ARG_SCAN_MODE_REVERSE (CA_ARG_SCAN_MODE + MV_REVERSE)
#define CA_ARG_SCAN_MODE_HEADLINE (CA_ARG_SCAN_MODE + 999)
+#define CA_ARG_INVENTORY 18000
+#define CA_ARG_INVENTORY_RESET (CA_ARG_INVENTORY + 0)
+#define CA_ARG_INVENTORY_RM_TARGET (CA_ARG_INVENTORY + 1)
+#define CA_ARG_INVENTORY_RM_TRIGGER (CA_ARG_INVENTORY + 2)
+#define CA_ARG_INVENTORY_RM_ACTION (CA_ARG_INVENTORY + 3)
+#define CA_ARG_INVENTORY_RM_FIRST (CA_ARG_INVENTORY + 4)
+#define CA_ARG_INVENTORY_RM_LAST (CA_ARG_INVENTORY + 5)
+#define CA_ARG_INVENTORY_RM_ALL (CA_ARG_INVENTORY + 6)
+#define CA_ARG_INVENTORY_HEADLINE (CA_ARG_INVENTORY + 998)
+#define CA_ARG_INVENTORY_RM_HEADLINE (CA_ARG_INVENTORY + 999)
#define CA_ARG_UNDEFINED 65535
/* values for custom move patterns (bits 0 - 3: basic move directions) */
#define IS_THROWABLE(e) HAS_PROPERTY(e, EP_THROWABLE)
#define CAN_EXPLODE(e) HAS_PROPERTY(e, EP_CAN_EXPLODE)
#define IS_GRAVITY_REACHABLE(e) HAS_PROPERTY(e, EP_GRAVITY_REACHABLE)
+#define DONT_GET_HIT_BY(e) HAS_PROPERTY(e, EP_DONT_GET_HIT_BY)
/* macros for special configurable properties */
#define IS_EM_SLIPPERY_WALL(e) HAS_PROPERTY(e, EP_EM_SLIPPERY_WALL)
/* macros for pre-defined properties */
#define ELEM_IS_PLAYER(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)
#define IS_BD_ELEMENT(e) HAS_PROPERTY(e, EP_BD_ELEMENT)
#define IS_SP_ELEMENT(e) HAS_PROPERTY(e, EP_SP_ELEMENT)
#define IS_BELT_ACTIVE(e) HAS_PROPERTY(e, EP_BELT_ACTIVE)
#define IS_BELT_SWITCH(e) HAS_PROPERTY(e, EP_BELT_SWITCH)
#define IS_TUBE(e) HAS_PROPERTY(e, EP_TUBE)
+#define IS_ACID_POOL(e) HAS_PROPERTY(e, EP_ACID_POOL)
#define IS_KEYGATE(e) HAS_PROPERTY(e, EP_KEYGATE)
#define IS_AMOEBOID(e) HAS_PROPERTY(e, EP_AMOEBOID)
#define IS_AMOEBALIVE(e) HAS_PROPERTY(e, EP_AMOEBALIVE)
#define IS_OBSOLETE(e) HAS_PROPERTY(e, EP_OBSOLETE)
/* special macros used in game engine */
+#define IS_FILE_ELEMENT(e) ((e) >= 0 && \
+ (e) <= NUM_FILE_ELEMENTS)
+
+#define IS_DRAWABLE_ELEMENT(e) ((e) >= 0 && \
+ (e) <= NUM_DRAWABLE_ELEMENTS)
+
+#define IS_RUNTIME_ELEMENT(e) ((e) >= 0 && \
+ (e) <= NUM_RUNTIME_ELEMENTS)
+
+#define IS_VALID_ELEMENT(e) ((e) >= 0 && \
+ (e) <= MAX_NUM_ELEMENTS)
+
#define IS_CUSTOM_ELEMENT(e) ((e) >= EL_CUSTOM_START && \
(e) <= EL_CUSTOM_END)
#define EM_KEY_NR(e) ((e) - EL_EM_KEY_1)
#define EMC_KEY_NR(e) ((e) - EL_EMC_KEY_5 + 4)
#define KEY_NR(e) (IS_RND_KEY(e) ? RND_KEY_NR(e) : \
- IS_EM_KEY(e) ? EM_KEY_NR(e) : \
+ IS_EM_KEY(e) ? EM_KEY_NR(e) : \
IS_EMC_KEY(e) ? EMC_KEY_NR(e) : 0)
#define IS_RND_GATE(e) ((e) >= EL_GATE_1 && \
(e) <= EL_EM_GATE_4)
#define IS_EMC_GATE(e) ((e) >= EL_EMC_GATE_5 && \
(e) <= EL_EMC_GATE_8)
+#define IS_DC_GATE(e) ((e) == EL_DC_GATE_WHITE)
#define IS_GATE(e) (IS_RND_GATE(e) || \
IS_EM_GATE(e) || \
- IS_EMC_GATE(e))
+ IS_EMC_GATE(e) || \
+ IS_DC_GATE(e))
#define RND_GATE_NR(e) ((e) - EL_GATE_1)
#define EM_GATE_NR(e) ((e) - EL_EM_GATE_1)
#define EMC_GATE_NR(e) ((e) - EL_EMC_GATE_5 + 4)
(e) <= EL_EMC_GATE_8_GRAY)
#define IS_EMC_GATE_GRAY_ACTIVE(e) ((e) >= EL_EMC_GATE_5_GRAY_ACTIVE && \
(e) <= EL_EMC_GATE_8_GRAY_ACTIVE)
+#define IS_DC_GATE_GRAY(e) ((e) == EL_DC_GATE_WHITE_GRAY)
+#define IS_DC_GATE_GRAY_ACTIVE(e) ((e) == EL_DC_GATE_WHITE_GRAY_ACTIVE)
+
#define IS_GATE_GRAY(e) (IS_RND_GATE_GRAY(e) || \
IS_EM_GATE_GRAY(e) || \
- IS_EMC_GATE_GRAY(e))
+ IS_EMC_GATE_GRAY(e) || \
+ IS_DC_GATE_GRAY(e))
#define IS_GATE_GRAY_ACTIVE(e) (IS_RND_GATE_GRAY_ACTIVE(e) || \
IS_EM_GATE_GRAY_ACTIVE(e) || \
- IS_EMC_GATE_GRAY_ACTIVE(e))
+ IS_EMC_GATE_GRAY_ACTIVE(e) || \
+ IS_DC_GATE_GRAY_ACTIVE(e))
#define RND_GATE_GRAY_NR(e) ((e) - EL_GATE_1_GRAY)
#define RND_GATE_GRAY_ACTIVE_NR(e) ((e) - EL_GATE_1_GRAY_ACTIVE)
#define EM_GATE_GRAY_NR(e) ((e) - EL_EM_GATE_1_GRAY)
IS_EM_GATE_GRAY(e) ? EM_GATE_GRAY_NR(e) : \
IS_EMC_GATE_GRAY(e) ? EMC_GATE_GRAY_NR(e) : 0)
+#define IS_ACID_POOL_OR_ACID(e) (IS_ACID_POOL(e) || (e) == EL_ACID)
+
+#define IS_EMC_PILLAR(e) ((e) >= EL_EMC_WALL_1 && \
+ (e) <= EL_EMC_WALL_3)
+#define IS_SP_CHIP(e) ((e) == EL_SP_CHIP_SINGLE || \
+ (e) == EL_SP_CHIP_LEFT || \
+ (e) == EL_SP_CHIP_RIGHT || \
+ (e) == EL_SP_CHIP_TOP || \
+ (e) == EL_SP_CHIP_BOTTOM)
+#define IS_SP_HARDWARE_BASE(e) ((e) == EL_SP_HARDWARE_BASE_1 || \
+ (e) == EL_SP_HARDWARE_BASE_2 || \
+ (e) == EL_SP_HARDWARE_BASE_3 || \
+ (e) == EL_SP_HARDWARE_BASE_4 || \
+ (e) == EL_SP_HARDWARE_BASE_5 || \
+ (e) == EL_SP_HARDWARE_BASE_6)
+
+#define IS_DC_STEELWALL_2(e) ((e) >= EL_DC_STEELWALL_2_LEFT && \
+ (e) <= EL_DC_STEELWALL_2_SINGLE)
+
+#if 1
+
+#if 1
+#define GFX_ELEMENT(e) (element_info[e].gfx_element)
+#else
+#define GFX_ELEMENT(e) (element_info[e].gfx_element == \
+ (element_info[e].use_gfx_element ? \
+ element_info[e].gfx_element : e) ? \
+ element_info[e].gfx_element : \
+ element_info[e].gfx_element + \
+ 0 * printf("::: %d: %d <-> %d\n", \
+ e, \
+ element_info[e].gfx_element, \
+ element_info[e].use_gfx_element ? \
+ element_info[e].gfx_element : e))
+#endif
+
+#else
#define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \
element_info[e].gfx_element : e)
+#endif
/* !!! CHECK THIS !!! */
#if 1
#define SND_ELEMENT(e) (e)
#endif
-#if 1
#define GROUP_NR(e) ((e) - EL_GROUP_START)
#define IS_IN_GROUP(e, nr) (element_info[e].in_group[nr] == TRUE)
#define IS_IN_GROUP_EL(e, ge) (IS_IN_GROUP(e, (ge) - EL_GROUP_START))
#define IS_EQUAL_OR_IN_GROUP(e, ge) \
- (IS_GROUP_ELEMENT(ge) ? IS_IN_GROUP(e, GROUP_NR(ge)) : (e) == (ge))
-#endif
+ (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]))
(e) == EL_EMERALD_RED ? EL_DIAMOND : \
(e) == EL_EMERALD_PURPLE ? EL_DIAMOND : \
EL_ROCK)
-#define EL_CHANGED2(e) ((e) == EL_ROCK ? EL_BD_DIAMOND : \
+#define EL_CHANGED_BD(e) ((e) == EL_ROCK ? EL_BD_DIAMOND : \
(e) == EL_BD_ROCK ? EL_BD_DIAMOND : \
EL_BD_ROCK)
+#define EL_CHANGED_DC(e) ((e) == EL_ROCK ? EL_EMERALD : \
+ (e) == EL_BD_ROCK ? EL_BD_DIAMOND : \
+ (e) == EL_EMERALD ? EL_DIAMOND : \
+ (e) == EL_EMERALD_YELLOW ? EL_DIAMOND : \
+ (e) == EL_EMERALD_RED ? EL_DIAMOND : \
+ (e) == EL_EMERALD_PURPLE ? EL_DIAMOND : \
+ (e) == EL_PEARL ? EL_BOMB : \
+ (e) == EL_CRYSTAL ? EL_CRYSTAL : \
+ EL_ROCK)
#define IS_DRAWABLE(e) ((e) < EL_BLOCKED)
#define IS_NOT_DRAWABLE(e) ((e) >= EL_BLOCKED)
#define TAPE_IS_EMPTY(x) ((x).length == 0)
#define ANIM_DELAY(g) (graphic_info[g].anim_delay)
#define ANIM_MODE(g) (graphic_info[g].anim_mode)
+#define IS_ANIM_MODE_CE(g) (graphic_info[g].anim_mode & (ANIM_CE_VALUE | \
+ ANIM_CE_SCORE | \
+ ANIM_CE_DELAY))
#define IS_ANIMATED(g) (ANIM_FRAMES(g) > 1)
#define IS_NEW_DELAY(f, g) ((f) % ANIM_DELAY(g) == 0)
#define IS_NEW_FRAME(f, g) (IS_ANIMATED(g) && IS_NEW_DELAY(f, g))
#define IS_LOOP_SOUND(s) (sound_info[s].loop)
+#define IS_SPECIAL_GFX_ARG(a) ((a) >= 0 && (a) < NUM_SPECIAL_GFX_ARGS)
+
#define EL_CASCADE_ACTIVE(e) (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : (e))
#define EL_CASCADE_INACTIVE(e) (IS_EDITOR_CASCADE_ACTIVE(e) ? (e) - 1 : (e))
#define EL_CASCADE_TOGGLE(e) (IS_EDITOR_CASCADE_INACTIVE(e) ? (e) + 1 : \
(d) == MV_UP ? "MV_UP" : \
(d) == MV_DOWN ? "MV_DOWN" : "(various)")
+#define ELEMENT_ACTIVE(e) (ActiveElement[e])
+#define BUTTON_ACTIVE(b) (ActiveButton[b])
+#define FONT_ACTIVE(f) (ActiveFont[f])
+
+
/* fundamental game speed values */
#define MICROLEVEL_SCROLL_DELAY 50 /* delay for scrolling micro level */
#define MICROLEVEL_LABEL_DELAY 250 /* delay for micro level label */
#define MAX_ELEMENT_NAME_LEN 32
#define MAX_TAPES_PER_SET 1024
#define MAX_SCORE_ENTRIES 100
-#define MAX_NUM_TITLE_SCREENS 5
+#define MAX_NUM_TITLE_IMAGES 5
+#define MAX_NUM_TITLE_MESSAGES 5
#define MAX_NUM_AMOEBA 100
-#if 0 /* game.h */
-#define MAX_INVENTORY_SIZE 1000
-#define STD_NUM_KEYS 4
-#define MAX_NUM_KEYS 8
-#endif
-
-#define NUM_BELTS 4
-#define NUM_BELT_PARTS 3
#define NUM_ENVELOPES 4
#define MIN_ENVELOPE_XSIZE 1
#define MIN_ENVELOPE_YSIZE 1
#define STD_ELEMENT_CONTENTS 4
#define MAX_ELEMENT_CONTENTS 8
+/* values for initial player inventory */
+#define MIN_INITIAL_INVENTORY_SIZE 1
+#define MAX_INITIAL_INVENTORY_SIZE 8
+
/* often used screen positions */
+#if 0
#define SX 8
#define SY 8
#define REAL_SX (SX - 2)
#define VY 400
#define EX DX
#define EY (VY - 44)
+#endif
#define TILESIZE 32
#define TILEX TILESIZE
#define TILEY TILESIZE
+#define TILEX_VAR TILESIZE_VAR
+#define TILEY_VAR TILESIZE_VAR
#define MINI_TILESIZE (TILESIZE / 2)
#define MINI_TILEX MINI_TILESIZE
#define MINI_TILEY MINI_TILESIZE
#define MICRO_TILEY MICRO_TILESIZE
#define MIDPOSX (SCR_FIELDX / 2)
#define MIDPOSY (SCR_FIELDY / 2)
+#if NEW_TILESIZE
+#if NEW_SCROLL
+#if 0
+#define SXSIZE (SCR_FIELDX * TILEX_VAR)
+#define SYSIZE (SCR_FIELDY * TILEY_VAR)
+#endif
+#define FXSIZE ((2 + SCR_FIELDX + 2) * TILEX_VAR)
+#define FYSIZE ((2 + SCR_FIELDY + 2) * TILEY_VAR)
+#else
+#if 0
+#define SXSIZE (SCR_FIELDX * TILEX_VAR)
+#define SYSIZE (SCR_FIELDY * TILEY_VAR)
+#endif
+#define FXSIZE ((SCR_FIELDX + 2) * TILEX_VAR)
+#define FYSIZE ((SCR_FIELDY + 2) * TILEY_VAR)
+#endif
+#else
+#if NEW_SCROLL
+#if 0
#define SXSIZE (SCR_FIELDX * TILEX)
#define SYSIZE (SCR_FIELDY * TILEY)
+#endif
+#define FXSIZE ((2 + SCR_FIELDX + 2) * TILEX)
+#define FYSIZE ((2 + SCR_FIELDY + 2) * TILEY)
+#else
+#if 0
+#define SXSIZE (SCR_FIELDX * TILEX)
+#define SYSIZE (SCR_FIELDY * TILEY)
+#endif
#define FXSIZE ((SCR_FIELDX + 2) * TILEX)
#define FYSIZE ((SCR_FIELDY + 2) * TILEY)
+#endif
+#endif
#define DXSIZE 100
#define DYSIZE 280
#define VXSIZE DXSIZE
#define VYSIZE 100
#define EXSIZE DXSIZE
#define EYSIZE (VYSIZE + 44)
+#if 0
#define FULL_SXSIZE (2 + SXSIZE + 2)
#define FULL_SYSIZE (2 + SYSIZE + 2)
+#endif
#define MICROLEVEL_XSIZE ((STD_LEV_FIELDX + 2) * MICRO_TILEX)
#define MICROLEVEL_YSIZE ((STD_LEV_FIELDY + 2) * MICRO_TILEY)
#define MICROLEVEL_XPOS (SX + (SXSIZE - MICROLEVEL_XSIZE) / 2)
#define MICROLABEL1_YPOS (MICROLEVEL_YPOS - 36)
#define MICROLABEL2_YPOS (MICROLEVEL_YPOS + MICROLEVEL_YSIZE + 7)
+/* values for GfxRedraw */
+#define GFX_REDRAW_NONE (0)
+#define GFX_REDRAW_TILE (1 << 0)
+#define GFX_REDRAW_TILE_CRUMBLED (1 << 1)
+#define GFX_REDRAW_TILE_CRUMBLED_NEIGHBOURS (1 << 2)
+#define GFX_REDRAW_TILE_TWINKLED (1 << 3)
/* score for elements */
#define SC_EMERALD 0
#define EL_CRYSTAL 257
#define EL_WALL_PEARL 258
#define EL_WALL_CRYSTAL 259
-#define EL_DOOR_WHITE 260
-#define EL_DOOR_WHITE_GRAY 261
-#define EL_KEY_WHITE 262
+#define EL_DC_GATE_WHITE 260
+#define EL_DC_GATE_WHITE_GRAY 261
+#define EL_DC_KEY_WHITE 262
#define EL_SHIELD_NORMAL 263
#define EL_EXTRA_TIME 264
#define EL_SWITCHGATE_OPEN 265
#define EL_SIGN_STOP 301
#define EL_SIGN_WHEELCHAIR 302
#define EL_SIGN_PARKING 303
-#define EL_SIGN_ONEWAY 304
-#define EL_SIGN_HEART 305
-#define EL_SIGN_TRIANGLE 306
-#define EL_SIGN_ROUND 307
-#define EL_SIGN_EXIT 308
-#define EL_SIGN_YINYANG 309
-#define EL_SIGN_OTHER 310
+#define EL_SIGN_NO_ENTRY 304
+#define EL_SIGN_UNUSED_1 305
+#define EL_SIGN_GIVE_WAY 306
+#define EL_SIGN_ENTRY_FORBIDDEN 307
+#define EL_SIGN_EMERGENCY_EXIT 308
+#define EL_SIGN_YIN_YANG 309
+#define EL_SIGN_UNUSED_2 310
#define EL_MOLE_LEFT 311
#define EL_MOLE_RIGHT 312
#define EL_MOLE_UP 313
#define EL_BD_EXPANDABLE_WALL 713
-#define NUM_FILE_ELEMENTS 714
+#define EL_PREV_CE_8 714
+#define EL_PREV_CE_7 715
+#define EL_PREV_CE_6 716
+#define EL_PREV_CE_5 717
+#define EL_PREV_CE_4 718
+#define EL_PREV_CE_3 719
+#define EL_PREV_CE_2 720
+#define EL_PREV_CE_1 721
+#define EL_SELF 722
+#define EL_NEXT_CE_1 723
+#define EL_NEXT_CE_2 724
+#define EL_NEXT_CE_3 725
+#define EL_NEXT_CE_4 726
+#define EL_NEXT_CE_5 727
+#define EL_NEXT_CE_6 728
+#define EL_NEXT_CE_7 729
+#define EL_NEXT_CE_8 730
+#define EL_ANY_ELEMENT 731
+
+#define EL_STEEL_CHAR_START 732
+#define EL_STEEL_CHAR_ASCII0 (EL_STEEL_CHAR_START - 32)
+#define EL_STEEL_CHAR_ASCII0_START (EL_STEEL_CHAR_ASCII0 + 32)
+
+/* (auto-generated data structure definitions included with normal chars) */
+
+#define EL_STEEL_CHAR_ASCII0_END (EL_STEEL_CHAR_ASCII0 + 111)
+#define EL_STEEL_CHAR_END (EL_STEEL_CHAR_START + 79)
+
+#define EL_STEEL_CHAR(c) (EL_STEEL_CHAR_ASCII0+MAP_FONT_ASCII(c))
+
+#define EL_SPERMS 812
+#define EL_BULLET 813
+#define EL_HEART 814
+#define EL_CROSS 815
+#define EL_FRANKIE 816
+#define EL_SIGN_SPERMS 817
+#define EL_SIGN_BULLET 818
+#define EL_SIGN_HEART 819
+#define EL_SIGN_CROSS 820
+#define EL_SIGN_FRANKIE 821
+
+#define EL_STEEL_EXIT_CLOSED 822
+#define EL_STEEL_EXIT_OPEN 823
+
+#define EL_DC_STEELWALL_1_LEFT 824
+#define EL_DC_STEELWALL_1_RIGHT 825
+#define EL_DC_STEELWALL_1_TOP 826
+#define EL_DC_STEELWALL_1_BOTTOM 827
+#define EL_DC_STEELWALL_1_HORIZONTAL 828
+#define EL_DC_STEELWALL_1_VERTICAL 829
+#define EL_DC_STEELWALL_1_TOPLEFT 830
+#define EL_DC_STEELWALL_1_TOPRIGHT 831
+#define EL_DC_STEELWALL_1_BOTTOMLEFT 832
+#define EL_DC_STEELWALL_1_BOTTOMRIGHT 833
+#define EL_DC_STEELWALL_1_TOPLEFT_2 834
+#define EL_DC_STEELWALL_1_TOPRIGHT_2 835
+#define EL_DC_STEELWALL_1_BOTTOMLEFT_2 836
+#define EL_DC_STEELWALL_1_BOTTOMRIGHT_2 837
+
+#define EL_DC_STEELWALL_2_LEFT 838
+#define EL_DC_STEELWALL_2_RIGHT 839
+#define EL_DC_STEELWALL_2_TOP 840
+#define EL_DC_STEELWALL_2_BOTTOM 841
+#define EL_DC_STEELWALL_2_HORIZONTAL 842
+#define EL_DC_STEELWALL_2_VERTICAL 843
+#define EL_DC_STEELWALL_2_MIDDLE 844
+#define EL_DC_STEELWALL_2_SINGLE 845
+
+#define EL_DC_SWITCHGATE_SWITCH_UP 846
+#define EL_DC_SWITCHGATE_SWITCH_DOWN 847
+#define EL_DC_TIMEGATE_SWITCH 848
+#define EL_DC_TIMEGATE_SWITCH_ACTIVE 849
+
+#define EL_DC_LANDMINE 850
+
+#define EL_EXPANDABLE_STEELWALL 851
+#define EL_EXPANDABLE_STEELWALL_HORIZONTAL 852
+#define EL_EXPANDABLE_STEELWALL_VERTICAL 853
+#define EL_EXPANDABLE_STEELWALL_ANY 854
+
+#define EL_EM_EXIT_CLOSED 855
+#define EL_EM_EXIT_OPEN 856
+#define EL_EM_STEEL_EXIT_CLOSED 857
+#define EL_EM_STEEL_EXIT_OPEN 858
+
+#define EL_DC_GATE_FAKE_GRAY 859
+
+#define EL_DC_MAGIC_WALL 860
+
+#define EL_QUICKSAND_FAST_EMPTY 861
+#define EL_QUICKSAND_FAST_FULL 862
+
+#define EL_FROM_LEVEL_TEMPLATE 863
+
+#define NUM_FILE_ELEMENTS 864
/* "real" (and therefore drawable) runtime elements */
#define EL_CONVEYOR_BELT_4_RIGHT_ACTIVE (EL_FIRST_RUNTIME_REAL + 25)
#define EL_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 26)
#define EL_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 27)
-#define EL_SP_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 28)
-#define EL_SP_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 29)
-#define EL_SP_EXIT_OPEN (EL_FIRST_RUNTIME_REAL + 30)
-#define EL_SP_TERMINAL_ACTIVE (EL_FIRST_RUNTIME_REAL + 31)
-#define EL_SP_BUGGY_BASE_ACTIVATING (EL_FIRST_RUNTIME_REAL + 32)
-#define EL_SP_BUGGY_BASE_ACTIVE (EL_FIRST_RUNTIME_REAL + 33)
-#define EL_SP_MURPHY_CLONE (EL_FIRST_RUNTIME_REAL + 34)
-#define EL_AMOEBA_DROPPING (EL_FIRST_RUNTIME_REAL + 35)
-#define EL_QUICKSAND_EMPTYING (EL_FIRST_RUNTIME_REAL + 36)
-#define EL_MAGIC_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 37)
-#define EL_BD_MAGIC_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 38)
-#define EL_MAGIC_WALL_FULL (EL_FIRST_RUNTIME_REAL + 39)
-#define EL_BD_MAGIC_WALL_FULL (EL_FIRST_RUNTIME_REAL + 40)
-#define EL_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 41)
-#define EL_BD_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 42)
-#define EL_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 43)
-#define EL_BD_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 44)
-#define EL_EMC_FAKE_GRASS_ACTIVE (EL_FIRST_RUNTIME_REAL + 45)
-#define EL_GATE_1_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 46)
-#define EL_GATE_2_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 47)
-#define EL_GATE_3_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 48)
-#define EL_GATE_4_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 49)
-#define EL_EM_GATE_1_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 50)
-#define EL_EM_GATE_2_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 51)
-#define EL_EM_GATE_3_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 52)
-#define EL_EM_GATE_4_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 53)
-#define EL_EMC_GATE_5_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 54)
-#define EL_EMC_GATE_6_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 55)
-#define EL_EMC_GATE_7_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 56)
-#define EL_EMC_GATE_8_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 57)
-#define EL_EMC_DRIPPER_ACTIVE (EL_FIRST_RUNTIME_REAL + 58)
-#define EL_EMC_SPRING_BUMPER_ACTIVE (EL_FIRST_RUNTIME_REAL + 59)
+#define EL_STEEL_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 28)
+#define EL_STEEL_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 29)
+#define EL_EM_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 30)
+#define EL_EM_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 31)
+#define EL_EM_STEEL_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 32)
+#define EL_EM_STEEL_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 33)
+#define EL_SP_EXIT_OPENING (EL_FIRST_RUNTIME_REAL + 34)
+#define EL_SP_EXIT_CLOSING (EL_FIRST_RUNTIME_REAL + 35)
+#define EL_SP_EXIT_OPEN (EL_FIRST_RUNTIME_REAL + 36)
+#define EL_SP_TERMINAL_ACTIVE (EL_FIRST_RUNTIME_REAL + 37)
+#define EL_SP_BUGGY_BASE_ACTIVATING (EL_FIRST_RUNTIME_REAL + 38)
+#define EL_SP_BUGGY_BASE_ACTIVE (EL_FIRST_RUNTIME_REAL + 39)
+#define EL_SP_MURPHY_CLONE (EL_FIRST_RUNTIME_REAL + 40)
+#define EL_AMOEBA_DROPPING (EL_FIRST_RUNTIME_REAL + 41)
+#define EL_QUICKSAND_EMPTYING (EL_FIRST_RUNTIME_REAL + 42)
+#define EL_QUICKSAND_FAST_EMPTYING (EL_FIRST_RUNTIME_REAL + 43)
+#define EL_MAGIC_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 44)
+#define EL_BD_MAGIC_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 45)
+#define EL_DC_MAGIC_WALL_ACTIVE (EL_FIRST_RUNTIME_REAL + 46)
+#define EL_MAGIC_WALL_FULL (EL_FIRST_RUNTIME_REAL + 47)
+#define EL_BD_MAGIC_WALL_FULL (EL_FIRST_RUNTIME_REAL + 48)
+#define EL_DC_MAGIC_WALL_FULL (EL_FIRST_RUNTIME_REAL + 49)
+#define EL_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 50)
+#define EL_BD_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 51)
+#define EL_DC_MAGIC_WALL_EMPTYING (EL_FIRST_RUNTIME_REAL + 52)
+#define EL_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 53)
+#define EL_BD_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 54)
+#define EL_DC_MAGIC_WALL_DEAD (EL_FIRST_RUNTIME_REAL + 55)
+#define EL_EMC_FAKE_GRASS_ACTIVE (EL_FIRST_RUNTIME_REAL + 56)
+#define EL_GATE_1_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 57)
+#define EL_GATE_2_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 58)
+#define EL_GATE_3_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 59)
+#define EL_GATE_4_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 60)
+#define EL_EM_GATE_1_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 61)
+#define EL_EM_GATE_2_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 62)
+#define EL_EM_GATE_3_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 63)
+#define EL_EM_GATE_4_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 64)
+#define EL_EMC_GATE_5_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 65)
+#define EL_EMC_GATE_6_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 66)
+#define EL_EMC_GATE_7_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 67)
+#define EL_EMC_GATE_8_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 68)
+#define EL_DC_GATE_WHITE_GRAY_ACTIVE (EL_FIRST_RUNTIME_REAL + 69)
+#define EL_EMC_DRIPPER_ACTIVE (EL_FIRST_RUNTIME_REAL + 70)
+#define EL_EMC_SPRING_BUMPER_ACTIVE (EL_FIRST_RUNTIME_REAL + 71)
+
+#define NUM_DRAWABLE_ELEMENTS (EL_FIRST_RUNTIME_REAL + 72)
/* "unreal" (and therefore not drawable) runtime elements */
-#define EL_FIRST_RUNTIME_UNREAL (EL_FIRST_RUNTIME_REAL + 60)
+#define EL_FIRST_RUNTIME_UNREAL (NUM_DRAWABLE_ELEMENTS)
#define EL_BLOCKED (EL_FIRST_RUNTIME_UNREAL + 0)
#define EL_EXPLOSION (EL_FIRST_RUNTIME_UNREAL + 1)
#define EL_AMOEBA_GROWING (EL_FIRST_RUNTIME_UNREAL + 6)
#define EL_AMOEBA_SHRINKING (EL_FIRST_RUNTIME_UNREAL + 7)
#define EL_EXPANDABLE_WALL_GROWING (EL_FIRST_RUNTIME_UNREAL + 8)
-#define EL_FLAMES (EL_FIRST_RUNTIME_UNREAL + 9)
-#define EL_PLAYER_IS_LEAVING (EL_FIRST_RUNTIME_UNREAL + 10)
-#define EL_PLAYER_IS_EXPLODING_1 (EL_FIRST_RUNTIME_UNREAL + 11)
-#define EL_PLAYER_IS_EXPLODING_2 (EL_FIRST_RUNTIME_UNREAL + 12)
-#define EL_PLAYER_IS_EXPLODING_3 (EL_FIRST_RUNTIME_UNREAL + 13)
-#define EL_PLAYER_IS_EXPLODING_4 (EL_FIRST_RUNTIME_UNREAL + 14)
-#define EL_QUICKSAND_FILLING (EL_FIRST_RUNTIME_UNREAL + 15)
-#define EL_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 16)
-#define EL_BD_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 17)
-#define EL_ELEMENT_SNAPPING (EL_FIRST_RUNTIME_UNREAL + 18)
-#define EL_DIAGONAL_SHRINKING (EL_FIRST_RUNTIME_UNREAL + 19)
-#define EL_DIAGONAL_GROWING (EL_FIRST_RUNTIME_UNREAL + 20)
-
-#define NUM_RUNTIME_ELEMENTS (EL_FIRST_RUNTIME_UNREAL + 21)
+#define EL_EXPANDABLE_STEELWALL_GROWING (EL_FIRST_RUNTIME_UNREAL + 9)
+#define EL_FLAMES (EL_FIRST_RUNTIME_UNREAL + 10)
+#define EL_PLAYER_IS_LEAVING (EL_FIRST_RUNTIME_UNREAL + 11)
+#define EL_PLAYER_IS_EXPLODING_1 (EL_FIRST_RUNTIME_UNREAL + 12)
+#define EL_PLAYER_IS_EXPLODING_2 (EL_FIRST_RUNTIME_UNREAL + 13)
+#define EL_PLAYER_IS_EXPLODING_3 (EL_FIRST_RUNTIME_UNREAL + 14)
+#define EL_PLAYER_IS_EXPLODING_4 (EL_FIRST_RUNTIME_UNREAL + 15)
+#define EL_QUICKSAND_FILLING (EL_FIRST_RUNTIME_UNREAL + 16)
+#define EL_QUICKSAND_FAST_FILLING (EL_FIRST_RUNTIME_UNREAL + 17)
+#define EL_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 18)
+#define EL_BD_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 19)
+#define EL_DC_MAGIC_WALL_FILLING (EL_FIRST_RUNTIME_UNREAL + 20)
+#define EL_ELEMENT_SNAPPING (EL_FIRST_RUNTIME_UNREAL + 21)
+#define EL_DIAGONAL_SHRINKING (EL_FIRST_RUNTIME_UNREAL + 22)
+#define EL_DIAGONAL_GROWING (EL_FIRST_RUNTIME_UNREAL + 23)
+
+#define NUM_RUNTIME_ELEMENTS (EL_FIRST_RUNTIME_UNREAL + 24)
/* dummy elements (never used as game elements, only used as graphics) */
#define EL_FIRST_DUMMY NUM_RUNTIME_ELEMENTS
#define EL_BD_DEFAULT (EL_FIRST_DUMMY + 22)
#define EL_SP_DEFAULT (EL_FIRST_DUMMY + 23)
#define EL_SB_DEFAULT (EL_FIRST_DUMMY + 24)
+#define EL_GRAPHIC_1 (EL_FIRST_DUMMY + 25)
+#define EL_GRAPHIC_2 (EL_FIRST_DUMMY + 26)
+#define EL_GRAPHIC_3 (EL_FIRST_DUMMY + 27)
+#define EL_GRAPHIC_4 (EL_FIRST_DUMMY + 28)
+#define EL_GRAPHIC_5 (EL_FIRST_DUMMY + 29)
+#define EL_GRAPHIC_6 (EL_FIRST_DUMMY + 30)
+#define EL_GRAPHIC_7 (EL_FIRST_DUMMY + 31)
+#define EL_GRAPHIC_8 (EL_FIRST_DUMMY + 32)
/* internal elements (only used for internal purposes like copying) */
-#define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 25)
+#define EL_FIRST_INTERNAL (EL_FIRST_DUMMY + 33)
#define EL_INTERNAL_CLIPBOARD_CUSTOM (EL_FIRST_INTERNAL + 0)
#define EL_INTERNAL_CLIPBOARD_CHANGE (EL_FIRST_INTERNAL + 1)
#define EL_INTERNAL_CASCADE_DX_ACTIVE (EL_FIRST_INTERNAL + 19)
#define EL_INTERNAL_CASCADE_CHARS (EL_FIRST_INTERNAL + 20)
#define EL_INTERNAL_CASCADE_CHARS_ACTIVE (EL_FIRST_INTERNAL + 21)
-#define EL_INTERNAL_CASCADE_CE (EL_FIRST_INTERNAL + 22)
-#define EL_INTERNAL_CASCADE_CE_ACTIVE (EL_FIRST_INTERNAL + 23)
-#define EL_INTERNAL_CASCADE_GE (EL_FIRST_INTERNAL + 24)
-#define EL_INTERNAL_CASCADE_GE_ACTIVE (EL_FIRST_INTERNAL + 25)
-#define EL_INTERNAL_CASCADE_REF (EL_FIRST_INTERNAL + 26)
-#define EL_INTERNAL_CASCADE_REF_ACTIVE (EL_FIRST_INTERNAL + 27)
-#define EL_INTERNAL_CASCADE_USER (EL_FIRST_INTERNAL + 28)
-#define EL_INTERNAL_CASCADE_USER_ACTIVE (EL_FIRST_INTERNAL + 29)
-#define EL_INTERNAL_CASCADE_DYNAMIC (EL_FIRST_INTERNAL + 30)
-#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE (EL_FIRST_INTERNAL + 31)
+#define EL_INTERNAL_CASCADE_STEEL_CHARS (EL_FIRST_INTERNAL + 22)
+#define EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE (EL_FIRST_INTERNAL + 23)
+#define EL_INTERNAL_CASCADE_CE (EL_FIRST_INTERNAL + 24)
+#define EL_INTERNAL_CASCADE_CE_ACTIVE (EL_FIRST_INTERNAL + 25)
+#define EL_INTERNAL_CASCADE_GE (EL_FIRST_INTERNAL + 26)
+#define EL_INTERNAL_CASCADE_GE_ACTIVE (EL_FIRST_INTERNAL + 27)
+#define EL_INTERNAL_CASCADE_REF (EL_FIRST_INTERNAL + 28)
+#define EL_INTERNAL_CASCADE_REF_ACTIVE (EL_FIRST_INTERNAL + 29)
+#define EL_INTERNAL_CASCADE_USER (EL_FIRST_INTERNAL + 30)
+#define EL_INTERNAL_CASCADE_USER_ACTIVE (EL_FIRST_INTERNAL + 31)
+#define EL_INTERNAL_CASCADE_DYNAMIC (EL_FIRST_INTERNAL + 32)
+#define EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE (EL_FIRST_INTERNAL + 33)
#define EL_INTERNAL_CLIPBOARD_START (EL_FIRST_INTERNAL + 0)
#define EL_INTERNAL_CLIPBOARD_END (EL_FIRST_INTERNAL + 2)
#define EL_INTERNAL_START (EL_FIRST_INTERNAL + 0)
-#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 31)
+#define EL_INTERNAL_END (EL_FIRST_INTERNAL + 33)
-#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 32)
+#define MAX_NUM_ELEMENTS (EL_FIRST_INTERNAL + 34)
/* values for graphics/sounds action types */
/* values for special image configuration suffixes (must match game mode) */
#define GFX_SPECIAL_ARG_DEFAULT 0
-#define GFX_SPECIAL_ARG_TITLE 1
-#define GFX_SPECIAL_ARG_MAIN 2
-#define GFX_SPECIAL_ARG_LEVELS 3
-#define GFX_SPECIAL_ARG_SCORES 4
-#define GFX_SPECIAL_ARG_EDITOR 5
-#define GFX_SPECIAL_ARG_INFO 6
-#define GFX_SPECIAL_ARG_SETUP 7
-#define GFX_SPECIAL_ARG_PLAYING 8
-#define GFX_SPECIAL_ARG_DOOR 9
-#define GFX_SPECIAL_ARG_PREVIEW 10
-#define GFX_SPECIAL_ARG_CRUMBLED 11
-
-#define NUM_SPECIAL_GFX_ARGS 12
+#define GFX_SPECIAL_ARG_LOADING 1
+#define GFX_SPECIAL_ARG_TITLE_INITIAL 2
+#define GFX_SPECIAL_ARG_TITLE 3
+#define GFX_SPECIAL_ARG_MAIN 4
+#define GFX_SPECIAL_ARG_LEVELS 5
+#define GFX_SPECIAL_ARG_LEVELNR 6
+#define GFX_SPECIAL_ARG_SCORES 7
+#define GFX_SPECIAL_ARG_EDITOR 8
+#define GFX_SPECIAL_ARG_INFO 9
+#define GFX_SPECIAL_ARG_SETUP 10
+#define GFX_SPECIAL_ARG_PLAYING 11
+#define GFX_SPECIAL_ARG_DOOR 12
+#define GFX_SPECIAL_ARG_TAPE 13
+#define GFX_SPECIAL_ARG_PANEL 14
+#define GFX_SPECIAL_ARG_PREVIEW 15
+#define GFX_SPECIAL_ARG_CRUMBLED 16
+
+#define NUM_SPECIAL_GFX_ARGS 17
+
+/* these additional definitions are currently only used for draw offsets */
+#define GFX_SPECIAL_ARG_INFO_MAIN 0
+#define GFX_SPECIAL_ARG_INFO_TITLE 1
+#define GFX_SPECIAL_ARG_INFO_ELEMENTS 2
+#define GFX_SPECIAL_ARG_INFO_MUSIC 3
+#define GFX_SPECIAL_ARG_INFO_CREDITS 4
+#define GFX_SPECIAL_ARG_INFO_PROGRAM 5
+#define GFX_SPECIAL_ARG_INFO_VERSION 6
+#define GFX_SPECIAL_ARG_INFO_LEVELSET 7
+
+#define NUM_SPECIAL_GFX_INFO_ARGS 8
+
+/* these additional definitions are currently only used for draw offsets */
+#define GFX_SPECIAL_ARG_SETUP_MAIN 0
+#define GFX_SPECIAL_ARG_SETUP_GAME 1
+#define GFX_SPECIAL_ARG_SETUP_EDITOR 2
+#define GFX_SPECIAL_ARG_SETUP_GRAPHICS 3
+#define GFX_SPECIAL_ARG_SETUP_SOUND 4
+#define GFX_SPECIAL_ARG_SETUP_ARTWORK 5
+#define GFX_SPECIAL_ARG_SETUP_INPUT 6
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS 7
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_1 8
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_2 9
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_3 10
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4 11
+#define GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK 12
+#define GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER 13
+
+#define NUM_SPECIAL_GFX_SETUP_ARGS 14
/* values for image configuration suffixes */
#define GFX_ARG_NAME 36
#define GFX_ARG_SCALE_UP_FACTOR 37
#define GFX_ARG_CLONE_FROM 38
-
-#define NUM_GFX_ARGS 39
+#define GFX_ARG_FADE_MODE 39
+#define GFX_ARG_FADE_DELAY 40
+#define GFX_ARG_POST_DELAY 41
+#define GFX_ARG_AUTO_DELAY 42
+#define GFX_ARG_ALIGN 43
+#define GFX_ARG_VALIGN 44
+#define GFX_ARG_SORT_PRIORITY 45
+#define GFX_ARG_CLASS 46
+#define GFX_ARG_STYLE 47
+#define GFX_ARG_ACTIVE_XOFFSET 48
+#define GFX_ARG_ACTIVE_YOFFSET 49
+#define GFX_ARG_PRESSED_XOFFSET 50
+#define GFX_ARG_PRESSED_YOFFSET 51
+
+#define NUM_GFX_ARGS 52
/* values for sound configuration suffixes */
#define NUM_MUS_ARGS 1
-/* values for font configuration */
+/* values for font configuration (definitions must match those from main.c) */
#define FONT_INITIAL_1 0
#define FONT_INITIAL_2 1
#define FONT_INITIAL_3 2
#define FONT_INITIAL_4 3
#define FONT_TITLE_1 4
#define FONT_TITLE_2 5
-#define FONT_MENU_1 6
-#define FONT_MENU_2 7
-#define FONT_TEXT_1_ACTIVE 8
-#define FONT_TEXT_2_ACTIVE 9
-#define FONT_TEXT_3_ACTIVE 10
-#define FONT_TEXT_4_ACTIVE 11
-#define FONT_TEXT_1 12
-#define FONT_TEXT_2 13
-#define FONT_TEXT_3 14
-#define FONT_TEXT_4 15
-#define FONT_ENVELOPE_1 16
-#define FONT_ENVELOPE_2 17
-#define FONT_ENVELOPE_3 18
-#define FONT_ENVELOPE_4 19
-#define FONT_INPUT_1_ACTIVE 20
-#define FONT_INPUT_2_ACTIVE 21
-#define FONT_INPUT_1 22
-#define FONT_INPUT_2 23
-#define FONT_OPTION_OFF 24
-#define FONT_OPTION_ON 25
-#define FONT_VALUE_1 26
-#define FONT_VALUE_2 27
-#define FONT_VALUE_OLD 28
-#define FONT_LEVEL_NUMBER_ACTIVE 29
-#define FONT_LEVEL_NUMBER 30
-#define FONT_TAPE_RECORDER 31
-#define FONT_GAME_INFO 32
-
-#define NUM_FONTS 33
+#define FONT_MENU_1_ACTIVE 6
+#define FONT_MENU_2_ACTIVE 7
+#define FONT_MENU_1 8
+#define FONT_MENU_2 9
+#define FONT_TEXT_1_ACTIVE 10
+#define FONT_TEXT_2_ACTIVE 11
+#define FONT_TEXT_3_ACTIVE 12
+#define FONT_TEXT_4_ACTIVE 13
+#define FONT_TEXT_1 14
+#define FONT_TEXT_2 15
+#define FONT_TEXT_3 16
+#define FONT_TEXT_4 17
+#define FONT_ENVELOPE_1 18
+#define FONT_ENVELOPE_2 19
+#define FONT_ENVELOPE_3 20
+#define FONT_ENVELOPE_4 21
+#define FONT_INPUT_1_ACTIVE 22
+#define FONT_INPUT_2_ACTIVE 23
+#define FONT_INPUT_1 24
+#define FONT_INPUT_2 25
+#define FONT_OPTION_OFF 26
+#define FONT_OPTION_ON 27
+#define FONT_VALUE_1 28
+#define FONT_VALUE_2 29
+#define FONT_VALUE_OLD 30
+#define FONT_LEVEL_NUMBER_ACTIVE 31
+#define FONT_LEVEL_NUMBER 32
+#define FONT_TAPE_RECORDER 33
+#define FONT_GAME_INFO 34
+#define FONT_INFO_ELEMENTS 35
+#define FONT_INFO_LEVELSET 36
+
+#define NUM_FONTS 37
#define NUM_INITIAL_FONTS 4
+#if 0
+#define FONT_ACTIVE(f) \
+ ((f) == FONT_MENU_1 ? FONT_MENU_1_ACTIVE : \
+ (f) == FONT_MENU_2 ? FONT_MENU_2_ACTIVE : \
+ (f) == FONT_TEXT_1 ? FONT_TEXT_1_ACTIVE : \
+ (f) == FONT_TEXT_2 ? FONT_TEXT_2_ACTIVE : \
+ (f) == FONT_TEXT_3 ? FONT_TEXT_3_ACTIVE : \
+ (f) == FONT_TEXT_4 ? FONT_TEXT_4_ACTIVE : \
+ (f) == FONT_INPUT_1 ? FONT_INPUT_1_ACTIVE : \
+ (f) == FONT_INPUT_2 ? FONT_INPUT_2_ACTIVE : \
+ (f) == FONT_LEVEL_NUMBER ? FONT_LEVEL_NUMBER_ACTIVE : \
+ (f))
+#endif
+
/* values for game_status (must match special image configuration suffixes) */
#define GAME_MODE_DEFAULT 0
-#define GAME_MODE_TITLE 1
-#define GAME_MODE_MAIN 2
-#define GAME_MODE_LEVELS 3
-#define GAME_MODE_SCORES 4
-#define GAME_MODE_EDITOR 5
-#define GAME_MODE_INFO 6
-#define GAME_MODE_SETUP 7
-#define GAME_MODE_PLAYING 8
-#define GAME_MODE_PSEUDO_DOOR 9
-#define GAME_MODE_PSEUDO_PREVIEW 10
-#define GAME_MODE_PSEUDO_CRUMBLED 11
+#define GAME_MODE_LOADING 1
+#define GAME_MODE_TITLE_INITIAL 2
+#define GAME_MODE_TITLE 3
+#define GAME_MODE_MAIN 4
+#define GAME_MODE_LEVELS 5
+#define GAME_MODE_LEVELNR 6
+#define GAME_MODE_SCORES 7
+#define GAME_MODE_EDITOR 8
+#define GAME_MODE_INFO 9
+#define GAME_MODE_SETUP 10
+#define GAME_MODE_PLAYING 11
+#define GAME_MODE_PSEUDO_DOOR 12
+#define GAME_MODE_PSEUDO_TAPE 13
+#define GAME_MODE_PSEUDO_PANEL 14
+#define GAME_MODE_PSEUDO_PREVIEW 15
+#define GAME_MODE_PSEUDO_CRUMBLED 16
/* there are no special config file suffixes for these modes */
-#define GAME_MODE_PSEUDO_TYPENAME 12
-#define GAME_MODE_QUIT 13
+#define GAME_MODE_PSEUDO_TYPENAME 17
+#define GAME_MODE_QUIT 18
/* special definitions currently only used for custom artwork configuration */
#define MUSIC_PREFIX_BACKGROUND 0
#define NUM_MUSIC_PREFIXES 1
-#define MAX_LEVELS 1000
/* definitions for demo animation lists */
#define HELPANIM_LIST_NEXT -1
/* program information and versioning definitions */
#define PROGRAM_VERSION_MAJOR 3
-#define PROGRAM_VERSION_MINOR 2
+#define PROGRAM_VERSION_MINOR 3
#define PROGRAM_VERSION_PATCH 1
-#define PROGRAM_VERSION_BUILD 0
+#define PROGRAM_VERSION_BUILD 1
#define PROGRAM_TITLE_STRING "Rocks'n'Diamonds"
#define PROGRAM_AUTHOR_STRING "Holger Schemel"
-#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2006 by Holger Schemel"
+#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2013 by Holger Schemel"
#define PROGRAM_EMAIL_STRING "info@artsoft.org"
#define PROGRAM_WEBSITE_STRING "http://www.artsoft.org/"
+#define PROGRAM_GAME_BY_STRING "A Game by Artsoft Entertainment"
+#define PROGRAM_UNIX_DATADIR_STRING ".rocksndiamonds"
+
+#if defined(CREATE_SPECIAL_EDITION_RND_JUE)
+#undef PROGRAM_TITLE_STRING
+#define PROGRAM_TITLE_STRING "R'n'D jue"
+#undef PROGRAM_UNIX_DATADIR_STRING
+#define PROGRAM_UNIX_DATADIR_STRING ".rnd_jue"
+#endif
#define ICON_TITLE_STRING PROGRAM_TITLE_STRING
#define COOKIE_PREFIX "ROCKSNDIAMONDS"
#define USERDATA_DIRECTORY_WIN32 PROGRAM_TITLE_STRING
#define USERDATA_DIRECTORY_MACOSX PROGRAM_TITLE_STRING
-#define USERDATA_DIRECTORY_UNIX ".rocksndiamonds"
+#define USERDATA_DIRECTORY_UNIX PROGRAM_UNIX_DATADIR_STRING
#define USERDATA_DIRECTORY_DOS "userdata"
#if defined(PLATFORM_WIN32)
#define GAME_ENGINE_TYPE_UNKNOWN LEVEL_FILE_TYPE_UNKNOWN
#define GAME_ENGINE_TYPE_RND LEVEL_FILE_TYPE_RND
#define GAME_ENGINE_TYPE_EM LEVEL_FILE_TYPE_EM
+#define GAME_ENGINE_TYPE_SP LEVEL_FILE_TYPE_SP
+
+#define NUM_ENGINE_TYPES 4
+
+
+struct BorderInfo
+{
+ boolean draw_masked[NUM_SPECIAL_GFX_ARGS];
+ boolean draw_masked_when_fading;
+};
-#define NUM_ENGINE_TYPES 3
+struct MenuMainButtonInfo
+{
+ struct MenuPosInfo name;
+ struct MenuPosInfo levels;
+ struct MenuPosInfo scores;
+ struct MenuPosInfo editor;
+ struct MenuPosInfo info;
+ struct MenuPosInfo game;
+ struct MenuPosInfo setup;
+ struct MenuPosInfo quit;
+
+ struct MenuPosInfo prev_level;
+ struct MenuPosInfo next_level;
+};
+
+struct MenuMainTextInfo
+{
+ struct TextPosInfo name;
+ struct TextPosInfo levels;
+ struct TextPosInfo scores;
+ struct TextPosInfo editor;
+ struct TextPosInfo info;
+ struct TextPosInfo game;
+ struct TextPosInfo setup;
+ struct TextPosInfo quit;
+
+ struct TextPosInfo first_level;
+ struct TextPosInfo last_level;
+ struct TextPosInfo level_number;
+ struct TextPosInfo level_info_1;
+ struct TextPosInfo level_info_2;
+ struct TextPosInfo level_name;
+ struct TextPosInfo level_author;
+ struct TextPosInfo level_year;
+ struct TextPosInfo level_imported_from;
+ struct TextPosInfo level_imported_by;
+ struct TextPosInfo level_tested_by;
+ struct TextPosInfo title_1;
+ struct TextPosInfo title_2;
+ struct TextPosInfo title_3;
+};
+
+struct MenuMainInputInfo
+{
+ struct TextPosInfo name;
+};
+
+struct MenuMainInfo
+{
+ struct MenuMainButtonInfo button;
+ struct MenuMainTextInfo text;
+ struct MenuMainInputInfo input;
+};
+
+struct TitleFadingInfo
+{
+ int fade_mode;
+ int fade_delay;
+ int post_delay;
+ int auto_delay;
+};
+struct TitleMessageInfo
+{
+ int x, y;
+ int width, height;
+ int chars, lines;
+ int align, valign;
+ int font;
+ boolean autowrap;
+ boolean centered;
+ boolean parse_comments;
+ int sort_priority;
+
+ int fade_mode;
+ int fade_delay;
+ int post_delay;
+ int auto_delay;
+};
+
+struct InitInfo
+{
+ struct MenuPosInfo busy;
+};
struct MenuInfo
{
int draw_xoffset[NUM_SPECIAL_GFX_ARGS];
int draw_yoffset[NUM_SPECIAL_GFX_ARGS];
+ int draw_xoffset_info[NUM_SPECIAL_GFX_INFO_ARGS];
+ int draw_yoffset_info[NUM_SPECIAL_GFX_INFO_ARGS];
+ int draw_xoffset_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
+ int draw_yoffset_setup[NUM_SPECIAL_GFX_SETUP_ARGS];
int scrollbar_xoffset;
int list_size[NUM_SPECIAL_GFX_ARGS];
+ struct TitleFadingInfo enter_menu;
+ struct TitleFadingInfo leave_menu;
+ struct TitleFadingInfo enter_screen[NUM_SPECIAL_GFX_ARGS];
+ struct TitleFadingInfo leave_screen[NUM_SPECIAL_GFX_ARGS];
+ struct TitleFadingInfo next_screen;
+
int sound[NUM_SPECIAL_GFX_ARGS];
int music[NUM_SPECIAL_GFX_ARGS];
+
+ struct MenuMainInfo main;
};
struct DoorInfo
int anim_mode;
};
+struct PreviewInfo
+{
+ int x, y;
+ int align, valign;
+ int xsize, ysize;
+ int xoffset, yoffset;
+ int tile_size;
+ int step_offset;
+ int step_delay;
+ int anim_mode;
+};
+
+struct ViewportInfo
+{
+ struct RectWithBorder window;
+ struct RectWithBorder playfield[NUM_SPECIAL_GFX_ARGS];
+ struct RectWithBorder door_1[NUM_SPECIAL_GFX_ARGS];
+ struct RectWithBorder door_2[NUM_SPECIAL_GFX_ARGS];
+};
+
struct HiScore
{
char Name[MAX_PLAYER_NAME_LEN + 1];
int xsize;
int ysize;
+ boolean autowrap;
+ boolean centered;
+
char text[MAX_ENVELOPE_TEXT_LEN + 1];
};
int year;
int month;
int day;
+
+ enum
+ {
+ DATE_SRC_CLOCK,
+ DATE_SRC_LEVELFILE
+ } src;
};
struct LevelInfo
/* level stored in native format for the alternative native game engines */
struct LevelInfo_EM *native_em_level;
+ struct LevelInfo_SP *native_sp_level;
int file_version; /* file format version the level is stored with */
int game_version; /* game release version the level was created with */
char name[MAX_LEVEL_NAME_LEN + 1];
char author[MAX_LEVEL_AUTHOR_LEN + 1];
+ int random_seed;
+
struct EnvelopeInfo envelope[NUM_ENVELOPES];
int score[LEVEL_SCORE_ELEMENTS];
int explosion_element[MAX_PLAYERS];
boolean use_explosion_element[MAX_PLAYERS];
-#if 1
/* values for the new EMC elements */
int android_move_time;
int android_clone_time;
struct Content ball_content[MAX_ELEMENT_CONTENTS];
int num_ball_contents;
-#if 0
- boolean android_array[16];
-#endif
int num_android_clone_elements;
int android_clone_element[MAX_ANDROID_ELEMENTS];
-#endif
int can_move_into_acid_bits; /* bitfield to store property for elements */
int dont_collide_with_bits; /* bitfield to store property for elements */
int initial_player_stepsize[MAX_PLAYERS]; /* initial player speed */
boolean initial_player_gravity[MAX_PLAYERS];
+ boolean use_initial_inventory[MAX_PLAYERS];
+ int initial_inventory_size[MAX_PLAYERS];
+ int initial_inventory_content[MAX_PLAYERS][MAX_INITIAL_INVENTORY_SIZE];
+
boolean em_slippery_gems; /* EM style "gems slip from wall" behaviour */
+ boolean em_explodes_by_fire; /* EM style chain explosion behaviour */
boolean use_spring_bug; /* for compatibility with old levels */
boolean use_time_orb_bug; /* for compatibility with old levels */
boolean instant_relocation; /* no visual delay when relocating player */
+ boolean shifted_relocation; /* no level centering when relocating player */
boolean can_pass_to_walkable; /* player can pass to empty or walkable tile */
boolean grow_into_diggable; /* amoeba can grow into anything diggable */
+ boolean auto_exit_sokoban; /* automatically finish solved Sokoban levels */
boolean continuous_snapping; /* repeated snapping without releasing key */
boolean block_snap_field; /* snapping blocks field to show animation */
boolean no_valid_file; /* set when level file missing or invalid */
boolean changed; /* set when level was changed in the editor */
+
+ /* runtime flags to handle bugs in old levels (not stored in level file) */
+ boolean use_action_after_change_bug;
};
struct GlobalInfo
char *convert_leveldir;
int convert_level_nr;
+ char *create_images_dir;
+
int num_toons;
float frames_per_second;
boolean fps_slowdown;
int fps_slowdown_factor;
+
+ /* global values for fading screens and masking borders */
+ int border_status;
+#if 0
+ int fading_status;
+ int fading_type;
+#endif
+
+ boolean use_envelope_request;
};
struct ElementChangeInfo
int delay_random; /* added frame delay before changed (random) */
int delay_frames; /* either 1 (frames) or 50 (seconds; 50 fps) */
- int trigger_element; /* element triggering change */
+ int initial_trigger_element; /* initial element triggering change */
struct Content target_content;/* elements for extended change target */
boolean use_target_content; /* use extended change target */
int action_type; /* type of action */
int action_mode; /* mode of action */
int action_arg; /* parameter of action */
+ int action_element; /* element related to action */
/* ---------- internal values used at runtime when playing ---------- */
+ int trigger_element; /* element triggering change */
+
/* functions that are called before, while and after the change of an
element -- currently only used for non-custom elements */
void (*pre_change_function)(int x, int y);
short actual_trigger_element; /* element that actually triggered change */
int actual_trigger_side; /* element side that triggered the change */
int actual_trigger_player; /* player which actually triggered change */
+ int actual_trigger_player_bits; /* player bits of triggering players */
int actual_trigger_ce_value; /* CE value of element that triggered change */
int actual_trigger_ce_score; /* CE score of element that triggered change */
/* ---------- special element property values ---------- */
- unsigned long properties[NUM_EP_BITFIELDS]; /* element base properties */
+ unsigned int properties[NUM_EP_BITFIELDS]; /* element base properties */
boolean use_gfx_element; /* use custom graphic element */
- int gfx_element; /* optional custom graphic element */
+ int gfx_element_initial; /* initial optional custom graphic element */
int access_direction; /* accessible from which direction */
boolean in_group[NUM_GROUP_ELEMENTS];
+ int gfx_element; /* runtime optional custom graphic element */
+
int collect_score; /* runtime score value for collecting */
+ /* count of this element on playfield, calculated after each frame */
+ int element_count;
+
/* ---------- internal values used in level editor ---------- */
int access_type; /* walkable or passable */
int src_x, src_y; /* start position of animation frames */
int width, height; /* width/height of each animation frame */
+
int offset_x, offset_y; /* x/y offset to next animation frame */
int offset2_x, offset2_y; /* x/y offset to second movement tile */
+
boolean double_movement; /* animation has second movement tile */
int swap_double_tiles; /* explicitely force or forbid tile swapping */
+
int anim_frames;
int anim_frames_per_line;
int anim_start_frame;
int anim_delay; /* important: delay of 1 means "no delay"! */
int anim_mode;
+
boolean anim_global_sync;
+
int crumbled_like; /* element for cloning crumble graphics */
int diggable_like; /* element for cloning digging graphics */
+
int border_size; /* border size for "crumbled" graphics */
+
int scale_up_factor; /* optional factor for scaling image up */
+
int clone_from; /* graphic for cloning *all* settings */
int anim_delay_fixed; /* optional delay values for bored and */
int draw_masked; /* optional setting for drawing envelope gfx */
+ int fade_mode; /* optional setting for drawing title screens */
+ int fade_delay; /* optional setting for drawing title screens */
+ int post_delay; /* optional setting for drawing title screens */
+ int auto_delay; /* optional setting for drawing title screens */
+ int align, valign; /* optional setting for drawing title screens */
+ int sort_priority; /* optional setting for drawing title screens */
+
+ int class;
+ int style;
+
+ int active_xoffset;
+ int active_yoffset;
+ int pressed_xoffset;
+ int pressed_yoffset;
+
+ boolean use_image_size; /* use image size as default width and height */
+
#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
Pixmap clip_mask; /* single-graphic-only clip mask for X11 */
GC clip_gc; /* single-graphic-only clip gc for X11 */
};
-extern Bitmap *bitmap_db_title;
+extern Bitmap *bitmap_db_store;
+extern Bitmap *bitmap_db_cross;
extern Bitmap *bitmap_db_field;
+extern Bitmap *bitmap_db_panel;
extern Bitmap *bitmap_db_door;
+extern Bitmap *bitmap_db_toons;
extern Pixmap tile_clipmask[];
extern DrawBuffer *fieldbuffer;
extern DrawBuffer *drawto_field;
extern int key_joystick_mapping;
+#if 1
+#if NEW_SCROLL
+extern boolean redraw[2 + MAX_LEV_FIELDX + 2][2 + MAX_LEV_FIELDY + 2];
+#else
+extern boolean redraw[MAX_LEV_FIELDX + 2][MAX_LEV_FIELDY + 2];
+#endif
+#else
extern boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
+#endif
extern int redraw_x1, redraw_y1;
extern short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short WasJustMoving[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short WasJustFalling[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short CheckCollision[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern short CheckImpact[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short AmoebaNr[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short AmoebaCnt[MAX_NUM_AMOEBA];
extern short AmoebaCnt2[MAX_NUM_AMOEBA];
extern int RunnerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern int PlayerVisit[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-#if 0
-extern unsigned long Properties[MAX_NUM_ELEMENTS][NUM_EP_BITFIELDS];
-#endif
-
extern int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern int GfxRandom[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern int GfxElement[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern int GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern int GfxRedraw[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+
+extern int ActiveElement[MAX_NUM_ELEMENTS];
+extern int ActiveButton[NUM_IMAGE_FILES];
+extern int ActiveFont[NUM_FONTS];
extern int lev_fieldx, lev_fieldy;
extern int scroll_x, scroll_y;
+extern int WIN_XSIZE, WIN_YSIZE;
+extern int SCR_FIELDX, SCR_FIELDY;
+extern int SX, SY;
+extern int REAL_SX, REAL_SY;
+extern int DX, DY;
+extern int VX, VY;
+extern int EX, EY;
+extern int dDX, dDY;
+extern int SXSIZE, SYSIZE;
+extern int FULL_SXSIZE, FULL_SYSIZE;
+extern int TILESIZE_VAR;
+
extern int FX, FY;
extern int ScrollStepSize;
extern int ScreenMovDir, ScreenMovPos, ScreenGfxPos;
extern int AllPlayersGone;
extern int TimeFrames, TimePlayed, TimeLeft, TapeTime;
-extern boolean SiebAktiv;
-extern int SiebCount;
extern boolean network_player_action_received;
extern struct HiScore highscore[];
extern struct TapeInfo tape;
extern struct GlobalInfo global;
+extern struct BorderInfo border;
+extern struct ViewportInfo viewport;
+extern struct TitleFadingInfo fading;
+extern struct TitleFadingInfo fading_none;
+extern struct TitleFadingInfo title_initial_default;
+extern struct TitleFadingInfo title_default;
+extern struct TitleMessageInfo titlemessage_initial_default;
+extern struct TitleMessageInfo titlemessage_initial[];
+extern struct TitleMessageInfo titlemessage_default;
+extern struct TitleMessageInfo titlemessage[];
+extern struct TitleMessageInfo readme;
+extern struct InitInfo init, init_last;
extern struct MenuInfo menu;
extern struct DoorInfo door_1, door_2;
+extern struct PreviewInfo preview;
extern struct ElementInfo element_info[];
extern struct ElementNameInfo element_name_info[];
extern struct ElementActionInfo element_action_info[];
extern struct MusicFileInfo *music_file_info;
extern struct HelpAnimInfo *helpanim_info;
extern SetupFileHash *helptext_info;
+extern SetupFileHash *image_config_hash;
+extern SetupFileHash *element_token_hash;
+extern SetupFileHash *graphic_token_hash;
+extern SetupFileHash *font_token_hash;
extern struct ConfigTypeInfo image_config_suffix[];
extern struct ConfigTypeInfo sound_config_suffix[];
extern struct ConfigTypeInfo music_config_suffix[];