IMG_NUT_MOVING_RIGHT
},
{
- EL_NUT_CRACKING, -1, GFX_ACTION_CRACKING,
+ EL_NUT_CRACKING, -1, -1,
IMG_NUT_CRACKING
},
{
IMG_AMOEBA_CREATING
},
{
- EL_AMOEBA_SHRINKING, -1, GFX_ACTION_SHRINKING,
+ EL_AMOEBA_SHRINKING, -1, -1,
IMG_AMOEBA_SHRINKING
},
{
IMG_EXIT_CLOSED
},
{
- EL_EXIT_OPENING, -1, GFX_ACTION_OPENING,
+ EL_EXIT_OPENING, -1, -1,
IMG_EXIT_OPENING
},
{
IMG_SWITCHGATE_CLOSED
},
{
- EL_SWITCHGATE_OPENING, -1, GFX_ACTION_OPENING,
+ EL_SWITCHGATE_OPENING, -1, -1,
IMG_SWITCHGATE_OPENING
},
{
IMG_SWITCHGATE_OPEN
},
{
- EL_SWITCHGATE_CLOSING, -1, GFX_ACTION_CLOSING,
+ EL_SWITCHGATE_CLOSING, -1, -1,
IMG_SWITCHGATE_CLOSING
},
{
IMG_TIMEGATE_CLOSED
},
{
- EL_TIMEGATE_OPENING, -1, GFX_ACTION_OPENING,
+ EL_TIMEGATE_OPENING, -1, -1,
IMG_TIMEGATE_OPENING
},
{
IMG_TIMEGATE_OPEN
},
{
- EL_TIMEGATE_CLOSING, -1, GFX_ACTION_CLOSING,
+ EL_TIMEGATE_CLOSING, -1, -1,
IMG_TIMEGATE_CLOSING
},
{
IMG_PEARL
},
{
- EL_PEARL_BREAKING, -1, GFX_ACTION_BREAKING,
+ EL_PEARL_BREAKING, -1, -1,
IMG_PEARL_BREAKING
},
{
-#define COMPILE_DATE_STRING "[2003-01-10 20:34]"
+#define COMPILE_DATE_STRING "[2003-01-11 14:56]"
static void DrawDrawingWindow()
{
- SetMainBackgroundImage(IMG_NONE);
+ SetMainBackgroundImage(IMG_UNDEFINED);
ClearWindow();
UnmapLevelEditorWindowGadgets();
DrawGraphicAnimationExt(drawto,
SX + xstart * MINI_TILEX,
SY + ystart * MINI_TILEY + MINI_TILEY / 2,
- el2img(properties_element), NO_MASKING);
+ el2img(properties_element), -1, NO_MASKING);
FrameCounter = 0; /* restart animation frame counter */
DrawGraphicAnimationExt(drawto,
SX + xpos * TILEX,
SY + ypos * TILEY + MINI_TILEY / 2,
- el2img(properties_element), NO_MASKING);
+ el2img(properties_element), -1, NO_MASKING);
#else
DrawGraphicAnimationExt(drawto,
SY + ypos * TILEY + MINI_TILEY / 2,
el_dir_act2img(properties_element,
MV_NO_MOVING,
- ...));
+ ...), -1, NO_MASKING);
#endif
MarkTileDirty(xpos, ypos);
static struct GadgetInfo *game_gadget[NUM_GAME_BUTTONS];
+
+/* ------------------------------------------------------------------------- */
+/* sound definitions */
+/* ------------------------------------------------------------------------- */
+
#define SND_ACTION_UNKNOWN 0
#define SND_ACTION_WAITING 1
#define SND_ACTION_MOVING 2
#define IS_LOOP_SOUND(x) (is_loop_sound[x])
+/* -------------------------------------------------------------------------
+ definition of elements that automatically change to other elements after
+ a specified time, eventually calling a function when changing
+ ------------------------------------------------------------------------- */
+
+struct ChangingElementInfo
+{
+ int base_element;
+ int next_element;
+ int change_delay;
+ void (*changer_function)(int x, int y);
+};
+
+static struct ChangingElementInfo changing_element_list[] =
+{
+ { EL_NUT_CRACKING, EL_EMERALD, 6, NULL },
+ { EL_PEARL_BREAKING, EL_EMPTY, 8, NULL },
+ { EL_UNDEFINED, EL_UNDEFINED, -1, NULL }
+};
+
+static struct ChangingElementInfo changing_element[MAX_NUM_ELEMENTS];
+
+#define IS_AUTO_CHANGING(e) (changing_element[e].base_element != EL_UNDEFINED)
+
+
+
#ifdef DEBUG
#if 0
static unsigned int getStateCheckSum(int counter)
debug_print_timestamp(0, NULL);
#endif
+ /* initialize sound effect for all elements to "no sound" */
for (i=0; i<MAX_NUM_ELEMENTS; i++)
for (j=0; j<NUM_SND_ACTIONS; j++)
element_action_sound[i][j] = -1;
for (i=0; i<ep_em_slippery_wall_num; i++)
{
if (level.em_slippery_gems) /* special EM style gems behaviour */
- Elementeigenschaften2[ep_em_slippery_wall[i]] |=
+ Properties2[ep_em_slippery_wall[i]] |=
EP_BIT_EM_SLIPPERY_WALL;
else
- Elementeigenschaften2[ep_em_slippery_wall[i]] &=
+ Properties2[ep_em_slippery_wall[i]] &=
~EP_BIT_EM_SLIPPERY_WALL;
}
/* "EL_WALL_GROWING_ACTIVE" wasn't slippery for EM gems in version 2.0.1 */
if (level.em_slippery_gems && game.engine_version > VERSION_IDENT(2,0,1))
- Elementeigenschaften2[EL_WALL_GROWING_ACTIVE] |= EP_BIT_EM_SLIPPERY_WALL;
+ Properties2[EL_WALL_GROWING_ACTIVE] |= EP_BIT_EM_SLIPPERY_WALL;
else
- Elementeigenschaften2[EL_WALL_GROWING_ACTIVE] &=~EP_BIT_EM_SLIPPERY_WALL;
+ Properties2[EL_WALL_GROWING_ACTIVE] &=~EP_BIT_EM_SLIPPERY_WALL;
+ }
+
+ /* initialize changing elements information */
+ for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ {
+ changing_element[i].base_element = EL_UNDEFINED;
+ changing_element[i].next_element = EL_UNDEFINED;
+ changing_element[i].change_delay = -1;
+ changing_element[i].changer_function = NULL;
+ }
+
+ i = 0;
+ while (changing_element_list[i].base_element != EL_UNDEFINED)
+ {
+ struct ChangingElementInfo *ce = &changing_element_list[i];
+ int element = ce->base_element;
+
+ changing_element[element].base_element = ce->base_element;
+ changing_element[element].next_element = ce->next_element;
+ changing_element[element].change_delay = ce->change_delay;
+ changing_element[element].changer_function = ce->changer_function;
+
+ i++;
}
}
}
}
else if (element == EL_SP_ELECTRON)
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SP_ELECTRON);
+ DrawLevelElementAnimation(x, y, element);
else if (element == EL_DRAGON)
{
int i;
element == EL_SP_SNIKSNAK || element == EL_MOLE)
DrawLevelField(x, y);
else if (element == EL_BD_BUTTERFLY || element == EL_BD_FIREFLY)
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), el2img(element));
+ DrawLevelElementAnimation(x, y, element);
else if (element == EL_SATELLITE)
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SATELLITE);
+ DrawLevelElementAnimation(x, y, element);
else if (element == EL_SP_ELECTRON)
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_SP_ELECTRON);
+ DrawLevelElementAnimation(x, y, element);
if (DONT_TOUCH(element))
TestIfBadThingTouchesHero(x, y);
{
int graphic = (type == 1 ? IMG_MAGIC_WALL_FULL : IMG_BD_MAGIC_WALL_FULL);
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+ DrawLevelGraphicAnimation(x, y, graphic);
}
void AusgangstuerPruefen(int x, int y)
return;
if (Feld[x][y] == EL_BD_DIAMOND)
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), IMG_BD_DIAMOND);
+ DrawLevelElementAnimation(x, y, el2img(Feld[x][y]));
else
{
if (!MovDelay[x][y]) /* next animation frame */
#if 0
DrawGraphic(SCREENX(x), SCREENY(y), el2img(Feld[x][y]), 0);
#else
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), el2img(Feld[x][y]));
+ DrawLevelElementAnimation(x, y, Feld[x][y]);
#endif
if (MovDelay[x][y])
if (belt_dir != MV_NO_MOVING)
{
- int graphic = el2img(element);
-
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+ DrawLevelElementAnimation(x, y, element);
if (!(FrameCounter % 2))
- PlaySoundLevel(x, y, SND_CONVEYOR_BELT_ACTIVE);
+ PlaySoundLevelAction(x, y, SND_ACTION_ACTIVE);
}
}
+static void ChangeElement(int x, int y)
+{
+ int element = Feld[x][y];
+ int change_delay = changing_element[element].change_delay;
+
+ if (!MovDelay[x][y]) /* next animation frame */
+ {
+ MovDelay[x][y] = change_delay + 1;
+ GfxFrame[x][y] = 0;
+ }
+
+ if (MovDelay[x][y]) /* wait some time before next frame */
+ {
+ MovDelay[x][y]--;
+
+ if (MovDelay[x][y])
+ {
+ DrawLevelElementAnimation(x, y, element);
+
+ return;
+ }
+ }
+
+ Feld[x][y] = changing_element[element].next_element;
+ DrawLevelField(x, y);
+
+ if (changing_element[element].changer_function)
+ changing_element[element].changer_function(x, y);
+}
+
static void PlayerActions(struct PlayerInfo *player, byte player_action)
{
static byte stored_player_action[MAX_PLAYERS];
#if 1
if (new_graphic_info[graphic].anim_frames > 1)
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+ DrawLevelGraphicAnimation(x, y, graphic);
#endif
continue;
if (Feld[x][y] == EL_EMERALD &&
new_graphic_info[graphic].anim_frames > 1 &&
!IS_MOVING(x, y))
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+ DrawLevelGraphicAnimation(x, y, graphic);
#endif
if (IS_GEM(element) || element == EL_SP_INFOTRON)
element == EL_SHIELD_NORMAL ||
element == EL_SHIELD_DEADLY) &&
new_graphic_info[graphic].anim_frames > 1)
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+ DrawLevelGraphicAnimation(x, y, graphic);
#endif
else if (IS_MOVING(x, y))
else if (element == EL_ACID_SPLASH_LEFT ||
element == EL_ACID_SPLASH_RIGHT)
Blurb(x, y);
+#if 0
else if (element == EL_NUT_CRACKING)
NussKnacken(x, y);
else if (element == EL_PEARL_BREAKING)
BreakingPearl(x, y);
+#endif
else if (element == EL_EXIT_CLOSED)
AusgangstuerPruefen(x, y);
else if (element == EL_SP_EXIT_CLOSED)
CheckBuggyBase(x, y);
else if (element == EL_TRAP || element == EL_TRAP_ACTIVE)
CheckTrap(x, y);
+#if 0
else if (IS_BELT_ACTIVE(element))
DrawBeltAnimation(x, y, element);
+#endif
else if (element == EL_SWITCHGATE_OPENING)
OpenSwitchgate(x, y);
else if (element == EL_SWITCHGATE_CLOSING)
else if (element == EL_TIMEGATE_CLOSING)
CloseTimegate(x, y);
+ else if (IS_AUTO_CHANGING(element))
+ ChangeElement(x, y);
+
#if 1
else if (new_graphic_info[graphic].anim_frames > 1)
- DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+ DrawLevelGraphicAnimation(x, y, graphic);
#endif
+ if (IS_BELT_ACTIVE(element))
+ PlaySoundLevelAction(x, y, SND_ACTION_ACTIVE);
+
if (game.magic_wall_active)
{
boolean sieb = FALSE;
static void InitTileClipmasks()
{
+#if 0
#if defined(TARGET_X11)
XGCValues clip_gc_values;
unsigned long clip_gc_valuemask;
#endif /* TARGET_X11_NATIVE */
#endif /* TARGET_X11 */
+#endif
}
void FreeTileClipmasks()
{
+#if 0
#if defined(TARGET_X11)
int i;
#endif
#endif /* TARGET_X11 */
+#endif
}
void InitGfx()
int i, act, dir;
/* set values to -1 to identify later as "uninitialized" values */
- for (i=0; i<MAX_ELEMENTS; i++)
+ for (i=0; i<MAX_NUM_ELEMENTS; i++)
{
for (act=0; act<NUM_GFX_ACTIONS_MAPPED; act++)
{
}
/* now set all '-1' values to element specific default values */
- for (i=0; i<MAX_ELEMENTS; i++)
+ for (i=0; i<MAX_NUM_ELEMENTS; i++)
{
int default_action_graphic = element_info[i].graphic[GFX_ACTION_DEFAULT];
int default_action_direction_graphic[NUM_MV_DIRECTIONS];
static int num_properties1 = SIZEOF_ARRAY(ep1_num, int *);
static int num_properties2 = SIZEOF_ARRAY(ep2_num, int *);
- for (i=0; i<MAX_ELEMENTS; i++)
+ for (i=0; i<MAX_NUM_ELEMENTS; i++)
{
- Elementeigenschaften1[i] = 0;
- Elementeigenschaften2[i] = 0;
+ Properties1[i] = 0;
+ Properties2[i] = 0;
}
for (i=0; i<num_properties1; i++)
for (j=0; j<*(ep1_num[i]); j++)
- Elementeigenschaften1[(ep1_array[i])[j]] |= ep1_bit[i];
+ Properties1[(ep1_array[i])[j]] |= ep1_bit[i];
for (i=0; i<num_properties2; i++)
for (j=0; j<*(ep2_num[i]); j++)
- Elementeigenschaften2[(ep2_array[i])[j]] |= ep2_bit[i];
+ Properties2[(ep2_array[i])[j]] |= ep2_bit[i];
for (i=EL_CHAR_START; i<=EL_CHAR_END; i++)
- Elementeigenschaften1[i] |= (EP_BIT_CHAR | EP_BIT_INACTIVE);
+ Properties1[i] |= (EP_BIT_CHAR | EP_BIT_INACTIVE);
}
void Execute_Command(char *command)
#include "game.h"
#include "events.h"
-GC tile_clip_gc;
#if 0
+GC tile_clip_gc;
Bitmap *pix[NUM_BITMAPS];
#endif
Bitmap *bitmap_db_field, *bitmap_db_door;
+#if 0
Pixmap tile_clipmask[NUM_TILES];
+#endif
DrawBuffer *fieldbuffer;
DrawBuffer *drawto_field;
short AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-unsigned long Elementeigenschaften1[MAX_ELEMENTS];
-unsigned long Elementeigenschaften2[MAX_ELEMENTS];
+
+unsigned long Properties1[MAX_NUM_ELEMENTS];
+unsigned long Properties2[MAX_NUM_ELEMENTS];
int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
struct FileInfo *image_files;
struct FileInfo *sound_files;
-struct ElementInfo element_info[MAX_ELEMENTS] =
+struct ElementInfo element_info[MAX_NUM_ELEMENTS] =
{
+ /* "real" level file elements */
+
{ "empty_space", "empty space" }, /* 0 */
{ "sand", "sand" },
{ "wall", "normal wall" },
{ "dx_bomb", "stable bomb (DX style)" },
{ NULL, "-" },
{ NULL, "-" },
- { "custom", "custom element 1" },
+ { "custom", "custom element 1" }, /* 360 */
{ "custom", "custom element 2" },
{ "custom", "custom element 3" },
{ "custom", "custom element 4" },
{ "custom", "custom element 8" },
{ "custom", "custom element 9" },
{ "custom", "custom element 10" },
- { "custom", "custom element 11" },
+ { "custom", "custom element 11" }, /* 370 */
{ "custom", "custom element 12" },
{ "custom", "custom element 13" },
{ "custom", "custom element 14" },
{ "custom", "custom element 18" },
{ "custom", "custom element 19" },
{ "custom", "custom element 20" },
- { "custom", "custom element 21" },
+ { "custom", "custom element 21" }, /* 380 */
{ "custom", "custom element 22" },
{ "custom", "custom element 23" },
{ "custom", "custom element 24" },
{ "custom", "custom element 28" },
{ "custom", "custom element 29" },
{ "custom", "custom element 30" },
- { "custom", "custom element 31" },
+ { "custom", "custom element 31" }, /* 390 */
{ "custom", "custom element 32" },
{ "custom", "custom element 33" },
{ "custom", "custom element 34" },
{ "custom", "custom element 38" },
{ "custom", "custom element 39" },
{ "custom", "custom element 40" },
- { "custom", "custom element 41" },
+ { "custom", "custom element 41" }, /* 400 */
{ "custom", "custom element 42" },
{ "custom", "custom element 43" },
{ "custom", "custom element 44" },
{ "custom", "custom element 48" },
{ "custom", "custom element 49" },
{ "custom", "custom element 50" },
- { "custom", "custom element 51" },
+ { "custom", "custom element 51" }, /* 410 */
{ "custom", "custom element 52" },
{ "custom", "custom element 53" },
{ "custom", "custom element 54" },
{ "custom", "custom element 58" },
{ "custom", "custom element 59" },
{ "custom", "custom element 60" },
- { "custom", "custom element 61" },
+ { "custom", "custom element 61" }, /* 420 */
{ "custom", "custom element 62" },
{ "custom", "custom element 63" },
{ "custom", "custom element 64" },
{ "custom", "custom element 68" },
{ "custom", "custom element 69" },
{ "custom", "custom element 70" },
- { "custom", "custom element 71" },
+ { "custom", "custom element 71" }, /* 430 */
{ "custom", "custom element 72" },
{ "custom", "custom element 73" },
{ "custom", "custom element 74" },
{ "custom", "custom element 78" },
{ "custom", "custom element 79" },
{ "custom", "custom element 80" },
- { "custom", "custom element 81" },
+ { "custom", "custom element 81" }, /* 440 */
{ "custom", "custom element 82" },
{ "custom", "custom element 83" },
{ "custom", "custom element 84" },
{ "custom", "custom element 88" },
{ "custom", "custom element 89" },
{ "custom", "custom element 90" },
- { "custom", "custom element 91" },
+ { "custom", "custom element 91" }, /* 450 */
{ "custom", "custom element 92" },
{ "custom", "custom element 93" },
{ "custom", "custom element 94" },
{ "custom", "custom element 98" },
{ "custom", "custom element 99" },
{ "custom", "custom element 100" },
- { "custom", "custom element 101" },
+ { "custom", "custom element 101" }, /* 460 */
{ "custom", "custom element 102" },
{ "custom", "custom element 103" },
{ "custom", "custom element 104" },
{ "custom", "custom element 108" },
{ "custom", "custom element 109" },
{ "custom", "custom element 110" },
- { "custom", "custom element 111" },
+ { "custom", "custom element 111" }, /* 470 */
{ "custom", "custom element 112" },
{ "custom", "custom element 113" },
{ "custom", "custom element 114" },
{ "custom", "custom element 118" },
{ "custom", "custom element 119" },
{ "custom", "custom element 120" },
- { "custom", "custom element 121" },
+ { "custom", "custom element 121" }, /* 480 */
{ "custom", "custom element 122" },
{ "custom", "custom element 123" },
{ "custom", "custom element 124" },
{ "custom", "custom element 127" },
{ "custom", "custom element 128" },
- { NULL, "-" }
+ /* "real" (and therefore drawable) runtime elements */
+
+ { "magic_wall", "-" },
+ { "magic_wall", "-" },
+ { "magic_wall", "-" }, /* 490 */
+ { "magic_wall", "-" },
+ { "wall", "-" },
+ { "wall", "-" },
+ { "exit", "-" },
+ { "sp_terminal", "-" },
+ { "sp_buggy_base", "-" },
+ { "key", "-" },
+ { "key", "-" },
+ { "key", "-" },
+ { "key", "-" }, /* 500 */
+ { "dynabomb", "-" },
+ { "dynabomb", "-" },
+ { "dynabomb", "-" },
+ { "dynabomb", "-" },
+ { "switchgate", "-" },
+ { "switchgate", "-" },
+ { "timegate", "-" },
+ { "timegate", "-" },
+ { "pearl", "-" },
+ { "trap", "-" }, /* 510 */
+ { "murphy_clone", "-" },
+ { "quicksand", "-" },
+ { "magic_wall", "-" },
+ { "magic_wall", "-" },
+ { "amoeba", "-" },
+ { "sp_exit", "-" },
+ { "wall", "-" },
+ { "sand", "-" },
+ { "wall", "-" },
+ { "conveyor_belt", "-" }, /* 520 */
+ { "conveyor_belt", "-" },
+ { "conveyor_belt", "-" },
+ { "conveyor_belt", "-" },
+ { "conveyor_belt", "-" },
+ { "conveyor_belt", "-" },
+ { "conveyor_belt", "-" },
+ { "conveyor_belt", "-" },
+ { "conveyor_belt", "-" },
+ { "conveyor_belt", "-" },
+ { "conveyor_belt", "-" }, /* 530 */
+ { "conveyor_belt", "-" },
- /*
- "-------------------------------",
- */
+ { NULL, "-" }
};
+#if 0
struct GraphicInfo graphic_info[MAX_GRAPHICS];
+#endif
struct NewGraphicInfo new_graphic_info[NUM_IMAGE_FILES];
#include "conf_gfx.h"
#include "conf_snd.h"
-#define IMG_NONE (-1)
+#define IMG_UNDEFINED (-1)
#define IMG_EMPTY IMG_EMPTY_SPACE
#define IMG_SP_EMPTY IMG_SP_EMPTY_SPACE
#define IMG_CHAR_START IMG_CHAR_SPACE
#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)
-/* values for 'Elementeigenschaften1' */
+/* values for 'Properties1' */
#define EP_BIT_AMOEBALIVE (1 << 0)
#define EP_BIT_AMOEBOID (1 << 1)
#define EP_BIT_SCHLUESSEL (1 << 2)
#define EP_BIT_OVER_PLAYER (1 << 30)
#define EP_BIT_ACTIVE_BOMB (1 << 31)
-/* values for 'Elementeigenschaften2' */
+/* values for 'Properties2' */
#define EP_BIT_BELT (1 << 0)
#define EP_BIT_BELT_ACTIVE (1 << 1)
#define EP_BIT_BELT_SWITCH (1 << 2)
#define EP_BIT_TUBE (1 << 3)
#define EP_BIT_EM_SLIPPERY_WALL (1 << 4)
-#define IS_AMOEBALIVE(e) (Elementeigenschaften1[e] & EP_BIT_AMOEBALIVE)
-#define IS_AMOEBOID(e) (Elementeigenschaften1[e] & EP_BIT_AMOEBOID)
-#define IS_SCHLUESSEL(e) (Elementeigenschaften1[e] & EP_BIT_SCHLUESSEL)
-#define IS_PFORTE(e) (Elementeigenschaften1[e] & EP_BIT_PFORTE)
-#define IS_SOLID(e) (Elementeigenschaften1[e] & EP_BIT_SOLID)
-#define IS_MASSIVE(e) (Elementeigenschaften1[e] & EP_BIT_MASSIVE)
-#define IS_SLIPPERY(e) (Elementeigenschaften1[e] & EP_BIT_SLIPPERY)
-#define IS_ENEMY(e) (Elementeigenschaften1[e] & EP_BIT_ENEMY)
-#define IS_MAUER(e) (Elementeigenschaften1[e] & EP_BIT_MAUER)
-#define CAN_FALL(e) (Elementeigenschaften1[e] & EP_BIT_CAN_FALL)
-#define CAN_SMASH(e) (Elementeigenschaften1[e] & EP_BIT_CAN_SMASH)
-#define CAN_CHANGE(e) (Elementeigenschaften1[e] & EP_BIT_CAN_CHANGE)
-#define CAN_MOVE(e) (Elementeigenschaften1[e] & EP_BIT_CAN_MOVE)
-#define COULD_MOVE(e) (Elementeigenschaften1[e] & EP_BIT_COULD_MOVE)
-#define DONT_TOUCH(e) (Elementeigenschaften1[e] & EP_BIT_DONT_TOUCH)
-#define DONT_GO_TO(e) (Elementeigenschaften1[e] & EP_BIT_DONT_GO_TO)
-#define IS_MAMPF2(e) (Elementeigenschaften1[e] & EP_BIT_MAMPF2)
-#define IS_CHAR(e) (Elementeigenschaften1[e] & EP_BIT_CHAR)
-#define IS_BD_ELEMENT(e) (Elementeigenschaften1[e] & EP_BIT_BD_ELEMENT)
-#define IS_SB_ELEMENT(e) (Elementeigenschaften1[e] & EP_BIT_SB_ELEMENT)
-#define IS_GEM(e) (Elementeigenschaften1[e] & EP_BIT_GEM)
-#define IS_INACTIVE(e) (Elementeigenschaften1[e] & EP_BIT_INACTIVE)
-#define IS_EXPLOSIVE(e) (Elementeigenschaften1[e] & EP_BIT_EXPLOSIVE)
-#define IS_MAMPF3(e) (Elementeigenschaften1[e] & EP_BIT_MAMPF3)
-#define IS_PUSHABLE(e) (Elementeigenschaften1[e] & EP_BIT_PUSHABLE)
-#define ELEM_IS_PLAYER(e) (Elementeigenschaften1[e] & EP_BIT_PLAYER)
-#define HAS_CONTENT(e) (Elementeigenschaften1[e] & EP_BIT_HAS_CONTENT)
-#define IS_EATABLE(e) (Elementeigenschaften1[e] & EP_BIT_EATABLE)
-#define IS_SP_ELEMENT(e) (Elementeigenschaften1[e] & EP_BIT_SP_ELEMENT)
-#define IS_QUICK_GATE(e) (Elementeigenschaften1[e] & EP_BIT_QUICK_GATE)
-#define IS_OVER_PLAYER(e) (Elementeigenschaften1[e] & EP_BIT_OVER_PLAYER)
-#define IS_ACTIVE_BOMB(e) (Elementeigenschaften1[e] & EP_BIT_ACTIVE_BOMB)
-
-#define IS_BELT(e) (Elementeigenschaften2[e] & EP_BIT_BELT)
-#define IS_BELT_ACTIVE(e) (Elementeigenschaften2[e] & EP_BIT_BELT_ACTIVE)
-#define IS_BELT_SWITCH(e) (Elementeigenschaften2[e] & EP_BIT_BELT_SWITCH)
-#define IS_TUBE(e) (Elementeigenschaften2[e] & EP_BIT_TUBE)
-#define IS_EM_SLIPPERY_WALL(e) (Elementeigenschaften2[e] & EP_BIT_EM_SLIPPERY_WALL)
+#define IS_AMOEBALIVE(e) (Properties1[e] & EP_BIT_AMOEBALIVE)
+#define IS_AMOEBOID(e) (Properties1[e] & EP_BIT_AMOEBOID)
+#define IS_SCHLUESSEL(e) (Properties1[e] & EP_BIT_SCHLUESSEL)
+#define IS_PFORTE(e) (Properties1[e] & EP_BIT_PFORTE)
+#define IS_SOLID(e) (Properties1[e] & EP_BIT_SOLID)
+#define IS_MASSIVE(e) (Properties1[e] & EP_BIT_MASSIVE)
+#define IS_SLIPPERY(e) (Properties1[e] & EP_BIT_SLIPPERY)
+#define IS_ENEMY(e) (Properties1[e] & EP_BIT_ENEMY)
+#define IS_MAUER(e) (Properties1[e] & EP_BIT_MAUER)
+#define CAN_FALL(e) (Properties1[e] & EP_BIT_CAN_FALL)
+#define CAN_SMASH(e) (Properties1[e] & EP_BIT_CAN_SMASH)
+#define CAN_CHANGE(e) (Properties1[e] & EP_BIT_CAN_CHANGE)
+#define CAN_MOVE(e) (Properties1[e] & EP_BIT_CAN_MOVE)
+#define COULD_MOVE(e) (Properties1[e] & EP_BIT_COULD_MOVE)
+#define DONT_TOUCH(e) (Properties1[e] & EP_BIT_DONT_TOUCH)
+#define DONT_GO_TO(e) (Properties1[e] & EP_BIT_DONT_GO_TO)
+#define IS_MAMPF2(e) (Properties1[e] & EP_BIT_MAMPF2)
+#define IS_CHAR(e) (Properties1[e] & EP_BIT_CHAR)
+#define IS_BD_ELEMENT(e) (Properties1[e] & EP_BIT_BD_ELEMENT)
+#define IS_SB_ELEMENT(e) (Properties1[e] & EP_BIT_SB_ELEMENT)
+#define IS_GEM(e) (Properties1[e] & EP_BIT_GEM)
+#define IS_INACTIVE(e) (Properties1[e] & EP_BIT_INACTIVE)
+#define IS_EXPLOSIVE(e) (Properties1[e] & EP_BIT_EXPLOSIVE)
+#define IS_MAMPF3(e) (Properties1[e] & EP_BIT_MAMPF3)
+#define IS_PUSHABLE(e) (Properties1[e] & EP_BIT_PUSHABLE)
+#define ELEM_IS_PLAYER(e) (Properties1[e] & EP_BIT_PLAYER)
+#define HAS_CONTENT(e) (Properties1[e] & EP_BIT_HAS_CONTENT)
+#define IS_EATABLE(e) (Properties1[e] & EP_BIT_EATABLE)
+#define IS_SP_ELEMENT(e) (Properties1[e] & EP_BIT_SP_ELEMENT)
+#define IS_QUICK_GATE(e) (Properties1[e] & EP_BIT_QUICK_GATE)
+#define IS_OVER_PLAYER(e) (Properties1[e] & EP_BIT_OVER_PLAYER)
+#define IS_ACTIVE_BOMB(e) (Properties1[e] & EP_BIT_ACTIVE_BOMB)
+
+#define IS_BELT(e) (Properties2[e] & EP_BIT_BELT)
+#define IS_BELT_ACTIVE(e) (Properties2[e] & EP_BIT_BELT_ACTIVE)
+#define IS_BELT_SWITCH(e) (Properties2[e] & EP_BIT_BELT_SWITCH)
+#define IS_TUBE(e) (Properties2[e] & EP_BIT_TUBE)
+#define IS_EM_SLIPPERY_WALL(e) (Properties2[e] & EP_BIT_EM_SLIPPERY_WALL)
#define IS_PLAYER(x,y) (ELEM_IS_PLAYER(StorePlayer[x][y]))
#define MAX_LEVEL_AUTHOR_LEN 32
#define MAX_TAPELEN (1000 * 50) /* max. time * framerate */
#define MAX_SCORE_ENTRIES 100
+#if 0
#define MAX_ELEMENTS 700 /* 500 static + 200 runtime */
#define MAX_GRAPHICS 1536 /* see below: NUM_TILES */
+#endif
#define MAX_NUM_AMOEBA 100
/* values for elements with content */
** 0 <= element < xxx: real elements, stored in level file
** xxx <= element < yyy: flag elements, only used at runtime
*/
-/* "real" level elements */
+/* "real" level file elements */
+#define EL_UNDEFINED -1
+
#define EL_EMPTY_SPACE 0
#define EL_EMPTY EL_EMPTY_SPACE
#define EL_SAND 1
#define GFX_START_ROCKSMORE 1280
#define GFX_END_ROCKSMORE 1535
+#if 0
#define NUM_TILES 1536 /* see above: MAX_GRAPHICS */
+#endif
/* graphics from "RocksScreen" */
/* Zeile 0 (0) */
#endif
};
-extern GC tile_clip_gc;
#if 0
+extern GC tile_clip_gc;
extern Bitmap *pix[];
#endif
extern Bitmap *bitmap_db_field, *bitmap_db_door;
extern short AmoebaCnt[MAX_NUM_AMOEBA], AmoebaCnt2[MAX_NUM_AMOEBA];
extern short ExplodePhase[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short ExplodeField[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
-extern unsigned long Elementeigenschaften1[MAX_ELEMENTS];
-extern unsigned long Elementeigenschaften2[MAX_ELEMENTS];
+
+extern unsigned long Properties1[MAX_NUM_ELEMENTS];
+extern unsigned long Properties2[MAX_NUM_ELEMENTS];
extern int GfxFrame[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern struct GameInfo game;
extern struct GlobalInfo global;
extern struct ElementInfo element_info[];
+#if 0
extern struct GraphicInfo graphic_info[];
+#endif
extern struct NewGraphicInfo new_graphic_info[];
extern struct ConfigInfo image_config[], sound_config[];
extern struct ConfigInfo image_config_suffix[], sound_config_suffix[];
void SetMainBackgroundImage(int graphic)
{
- SetMainBackgroundBitmap(graphic == IMG_NONE ? NULL :
+ SetMainBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL :
new_graphic_info[graphic].bitmap ?
new_graphic_info[graphic].bitmap :
new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
void SetDoorBackgroundImage(int graphic)
{
- SetDoorBackgroundBitmap(graphic == IMG_NONE ? NULL :
+ SetDoorBackgroundBitmap(graphic == IMG_UNDEFINED ? NULL :
new_graphic_info[graphic].bitmap ?
new_graphic_info[graphic].bitmap :
new_graphic_info[IMG_BACKGROUND_DEFAULT].bitmap);
MarkTileDirty(sx,sy);
}
-void DrawGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y,
- int graphic, int mask_mode)
+inline void DrawGraphicAnimationExt(DrawBuffer *dst_bitmap, int x, int y,
+ int graphic, int sync_frame, int mask_mode)
{
- int frame = getGraphicAnimationFrame(graphic, -1);
+ int frame = getGraphicAnimationFrame(graphic, sync_frame);
if (mask_mode == USE_MASKING)
DrawGraphicThruMaskExt(dst_bitmap, x, y, graphic, frame);
DrawGraphicExt(dst_bitmap, x, y, graphic, frame);
}
-void DrawGraphicAnimation(int x, int y, int graphic)
+inline void DrawGraphicAnimation(int x, int y, int graphic)
{
- int ux = LEVELX(x), uy = LEVELY(y);
+ int lx = LEVELX(x), ly = LEVELY(y);
if (!IN_SCR_FIELD(x, y) ||
- (GfxFrame[ux][uy] % new_graphic_info[graphic].anim_delay) != 0)
+ (GfxFrame[lx][ly] % new_graphic_info[graphic].anim_delay) != 0)
return;
DrawGraphicAnimationExt(drawto_field, FX + x * TILEX, FY + y * TILEY,
- graphic, NO_MASKING);
+ graphic, GfxFrame[lx][ly], NO_MASKING);
MarkTileDirty(x, y);
}
+void DrawLevelGraphicAnimation(int x, int y, int graphic)
+{
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), graphic);
+}
+
+void DrawLevelElementAnimation(int x, int y, int element)
+{
+ DrawGraphicAnimation(SCREENX(x), SCREENY(y), el2img(element));
+}
+
#if 0
void getOldGraphicSource(int graphic, Bitmap **bitmap, int *x, int *y)
{
#if DEBUG
int graphic_OLD = el2gfx_OLD(element);
- if (element >= MAX_ELEMENTS)
+ if (element >= MAX_NUM_ELEMENTS)
{
- Error(ERR_WARN, "el2gfx: element == %d >= MAX_ELEMENTS", element);
+ Error(ERR_WARN, "el2gfx: element == %d >= MAX_NUM_ELEMENTS", element);
}
if (graphic_NEW != graphic_OLD)
void DrawPlayerField(int, int);
void DrawPlayer(struct PlayerInfo *);
int getGraphicAnimationFrame(int, int);
+void DrawGraphicAnimationExt(DrawBuffer *, int, int, int, int, int);
void DrawGraphicAnimation(int, int, int);
-void DrawGraphicAnimationExt(DrawBuffer *, int, int, int, int);
+void DrawLevelGraphicAnimation(int, int, int);
+void DrawLevelElementAnimation(int, int, int);
void getGraphicSource(int, int, Bitmap **, int *, int *);
void DrawGraphic(int, int, int, int);
#if 0