int editor_element[] =
{
- EL_CHAR_A + ('B' - 'A'),
- EL_CHAR_A + ('O' - 'A'),
- EL_CHAR_A + ('U' - 'A'),
- EL_CHAR_A + ('L' - 'A'),
+ EL_CHAR('B'),
+ EL_CHAR('O'),
+ EL_CHAR('U'),
+ EL_CHAR('L'),
EL_CHAR_MINUS,
- EL_CHAR_A + ('D' - 'A'),
- EL_CHAR_A + ('E' - 'A'),
- EL_CHAR_A + ('R' - 'A'),
+ EL_CHAR('D'),
+ EL_CHAR('E'),
+ EL_CHAR('R'),
- EL_CHAR_A + ('D' - 'A'),
- EL_CHAR_A + ('A' - 'A'),
- EL_CHAR_A + ('S' - 'A'),
- EL_CHAR_A + ('H' - 'A'),
+ EL_CHAR('D'),
+ EL_CHAR('A'),
+ EL_CHAR('S'),
+ EL_CHAR('H'),
EL_SPIELFIGUR,
EL_LEERRAUM,
EL_FIREFLY_U,
EL_LEERRAUM,
- EL_CHAR_A + ('E' - 'A'),
- EL_CHAR_A + ('M' - 'A'),
- EL_CHAR_A + ('E' - 'A'),
+ EL_CHAR('E'),
+ EL_CHAR('M'),
+ EL_CHAR('E'),
EL_CHAR_MINUS,
- EL_CHAR_A + ('R' - 'A'),
- EL_CHAR_A + ('A' - 'A'),
- EL_CHAR_A + ('L' - 'A'),
- EL_CHAR_A + ('D' - 'A'),
+ EL_CHAR('R'),
+ EL_CHAR('A'),
+ EL_CHAR('L'),
+ EL_CHAR('D'),
- EL_CHAR_A + ('M' - 'A'),
- EL_CHAR_A + ('I' - 'A'),
- EL_CHAR_A + ('N' - 'A'),
- EL_CHAR_A + ('E' - 'A'),
+ EL_CHAR('M'),
+ EL_CHAR('I'),
+ EL_CHAR('N'),
+ EL_CHAR('E'),
EL_SPIELER1,
EL_SPIELER2,
EL_SCHLUESSEL3,
EL_SCHLUESSEL4,
+ EL_EM_GATE_1,
+ EL_EM_GATE_2,
+ EL_EM_GATE_3,
+ EL_EM_GATE_4,
+
+ EL_EM_GATE_1X,
+ EL_EM_GATE_2X,
+ EL_EM_GATE_3X,
+ EL_EM_GATE_4X,
+
+ EL_CHAR('M'),
+ EL_CHAR('O'),
+ EL_CHAR('R'),
+ EL_CHAR('E'),
+
EL_PFORTE1,
EL_PFORTE2,
EL_PFORTE3,
EL_PFORTE3X,
EL_PFORTE4X,
- EL_CHAR_A + ('M' - 'A'),
- EL_CHAR_A + ('O' - 'A'),
- EL_CHAR_A + ('R' - 'A'),
- EL_CHAR_A + ('E' - 'A'),
-
EL_PFEIL_L,
EL_PFEIL_R,
EL_PFEIL_O,
EL_SPEED_PILL,
EL_BLACK_ORB,
- EL_CHAR_A + ('S' - 'A'),
- EL_CHAR_A + ('O' - 'A'),
- EL_CHAR_A + ('K' - 'A'),
- EL_CHAR_A + ('O' - 'A'),
+ EL_CHAR('S'),
+ EL_CHAR('O'),
+ EL_CHAR('K'),
+ EL_CHAR('O'),
EL_CHAR_MINUS,
- EL_CHAR_A + ('B' - 'A'),
- EL_CHAR_A + ('A' - 'A'),
- EL_CHAR_A + ('N' - 'A'),
+ EL_CHAR('B'),
+ EL_CHAR('A'),
+ EL_CHAR('N'),
EL_SOKOBAN_OBJEKT,
EL_SOKOBAN_FELD_LEER,
EL_SP_CHIP_LOWER,
/*
- EL_CHAR_A + ('D' - 'A'),
- EL_CHAR_A + ('Y' - 'A'),
- EL_CHAR_A + ('N' - 'A'),
- EL_CHAR_A + ('A' - 'A'),
+ EL_CHAR('D'),
+ EL_CHAR('Y'),
+ EL_CHAR('N'),
+ EL_CHAR('A'),
- EL_CHAR_A + ('B' - 'A'),
- EL_CHAR_A + ('L' - 'A'),
- EL_CHAR_A + ('A' - 'A'),
- EL_CHAR_A + ('S' - 'A'),
+ EL_CHAR('B'),
+ EL_CHAR('L'),
+ EL_CHAR('A'),
+ EL_CHAR('S'),
EL_CHAR_MINUS,
- EL_CHAR_A + ('T' - 'A'),
- EL_CHAR_A + ('E' - 'A'),
- EL_CHAR_A + ('R' - 'A'),
+ EL_CHAR('T'),
+ EL_CHAR('E'),
+ EL_CHAR('R'),
*/
EL_LEERRAUM,
break;
#endif
-#if 1
+#if 0
case XK_m:
if (MoveSpeed == 8)
{
player->move_delay = 0;
player->last_move_dir = MV_NO_MOVING;
+ player->move_speed = (level.double_speed ? 4 : 8);
player->snapped = FALSE;
player->gone = FALSE;
ScreenMovPos = 0;
ScreenGfxPos = 0;
+ /*
MoveSpeed = (level.double_speed ? 4 : 8);
ScrollStepSize = TILEX / MoveSpeed;
+ */
+
+ ScrollStepSize = 0;
AllPlayersGone = FALSE;
SiebAktiv = FALSE;
{
DigField(player, 0, 0, 0, 0, DF_NO_PUSH);
SnapField(player, 0, 0);
+
+ /*
if (++player->frame_reset_delay > MoveSpeed)
player->Frame = 0;
+ */
+
+ if (++player->frame_reset_delay > player->move_speed)
+ player->Frame = 0;
}
if (tape.recording && num_stored_actions >= MAX_PLAYERS && save_tape_entry)
/* this is very bad and need to be fixed!!! */
unsigned long move_delay = stored_player[i].move_delay;
+ /*
if (FrameReached(&move_delay, MoveSpeed))
+ */
+
+ if (FrameReached(&move_delay, stored_player[i].move_speed))
{
actual_player_action = stored_player[i].programmed_action;
stored_player[i].programmed_action = 0;
jy = player->jy = new_jy;
StorePlayer[jx][jy] = player->element_nr;
+ /*
player->MovPos = (dx > 0 || dy > 0 ? -1 : 1) * (TILEX - TILEX / MoveSpeed);
+ */
+
+ player->MovPos =
+ (dx > 0 || dy > 0 ? -1 : 1) * (TILEX - TILEX / player->move_speed);
ScrollFigure(player, SCROLL_INIT);
if (player->gone || (!dx && !dy))
return FALSE;
+ /*
if (!FrameReached(&player->move_delay, MoveSpeed) && !tape.playing)
return FALSE;
+ */
+
+ if (!FrameReached(&player->move_delay, player->move_speed) && !tape.playing)
+ return FALSE;
if (player->MovPos)
{
/* should only happen if pre-1.2 tape recordings are played */
/* this is only for backward compatibility */
+ /*
int old_move_speed = MoveSpeed;
+ */
+
+ int old_move_speed = player->move_speed;
#if DEBUG
printf("THIS SHOULD ONLY HAPPEN WITH PRE-1.2 LEVEL TAPES.\n");
#endif
/* scroll remaining steps with finest movement resolution */
+
+ /*
MoveSpeed = 8;
+ */
+
+ player->move_speed = 8;
while (player->MovPos)
{
BackToFront();
}
+ /*
MoveSpeed = old_move_speed;
+ */
+
+ player->move_speed = old_move_speed;
+
}
if (player->last_move_dir & (MV_LEFT | MV_RIGHT))
{
int jx = player->jx, jy = player->jy;
int last_jx = player->last_jx, last_jy = player->last_jy;
+ int move_stepsize = TILEX / player->move_speed;
if (!player->active || player->gone || !player->MovPos)
return;
if (mode == SCROLL_INIT)
{
player->actual_frame_counter = FrameCounter;
- player->GfxPos = ScrollStepSize * (player->MovPos / ScrollStepSize);
+ player->GfxPos = move_stepsize * (player->MovPos / move_stepsize);
if (Feld[last_jx][last_jy] == EL_LEERRAUM)
Feld[last_jx][last_jy] = EL_PLAYER_IS_LEAVING;
else if (!FrameReached(&player->actual_frame_counter, 1))
return;
- player->MovPos += (player->MovPos > 0 ? -1 : 1) * TILEX / MoveSpeed;
- player->GfxPos = ScrollStepSize * (player->MovPos / ScrollStepSize);
+ player->MovPos += (player->MovPos > 0 ? -1 : 1) * move_stepsize;
+ player->GfxPos = move_stepsize * (player->MovPos / move_stepsize);
if (Feld[last_jx][last_jy] == EL_PLAYER_IS_LEAVING)
Feld[last_jx][last_jy] = EL_LEERRAUM;
if (!player->MovPos)
{
- switch (Feld[last_jx][last_jy])
+ if (IS_QUICK_GATE(Feld[last_jx][last_jy]))
{
- case EL_SP_PORT1_LEFT:
- case EL_SP_PORT2_LEFT:
- case EL_SP_PORT1_RIGHT:
- case EL_SP_PORT2_RIGHT:
- case EL_SP_PORT1_UP:
- case EL_SP_PORT2_UP:
- case EL_SP_PORT1_DOWN:
- case EL_SP_PORT2_DOWN:
- case EL_SP_PORT_X:
- case EL_SP_PORT_Y:
- case EL_SP_PORT_XY:
- /* continue with normal speed after moving through port */
- /* FIX THIS: what about player already having eaten a speed pill? */
- MoveSpeed = 8;
- ScrollStepSize = TILEX / MoveSpeed;
-
- /* don't wait for the next move -- the whole move delay stuff
- is worse at the moment; FIX THIS! ;-) */
- player->move_delay = 0;
- break;
+ /* continue with normal speed after moving through port */
+ /* FIX THIS: what about player already having eaten a speed pill? */
- default:
- break;
+ /*
+ MoveSpeed = 8;
+ ScrollStepSize = TILEX / MoveSpeed;
+ */
+
+ player->move_speed = 8;
+
+ /* don't wait for the next move -- the whole move delay stuff
+ is worse at the moment; FIX THIS! ;-) */
+ player->move_delay = 0;
}
player->last_jx = jx;
if (mode == SCROLL_INIT)
{
+ /* set scrolling step size according to actual player's moving speed */
+ ScrollStepSize = TILEX / player->move_speed;
+
screen_frame_counter = FrameCounter;
ScreenMovDir = player->MovDir;
ScreenMovPos = player->MovPos;
if (ScreenMovPos)
{
- ScreenMovPos += (ScreenMovPos > 0 ? -1 : 1) * TILEX / MoveSpeed;
+ ScreenMovPos += (ScreenMovPos > 0 ? -1 : 1) * ScrollStepSize;
ScreenGfxPos = ScrollStepSize * (ScreenMovPos / ScrollStepSize);
redraw_mask |= REDRAW_FIELD;
}
{
int jx = player->jx, jy = player->jy;
int dx = x - jx, dy = y - jy;
+ int move_direction = (dx == -1 ? MV_LEFT :
+ dx == +1 ? MV_RIGHT :
+ dy == -1 ? MV_UP :
+ dy == +1 ? MV_DOWN : MV_NO_MOVING);
int element;
if (!player->MovPos)
case EL_SPEED_PILL:
RemoveField(x, y);
+
+ player->move_speed = 4;
+
+ /*
MoveSpeed = 4;
ScrollStepSize = TILEX / MoveSpeed;
+ */
+
PlaySoundLevel(x, y, SND_PONG);
break;
case EL_PFORTE2:
case EL_PFORTE3:
case EL_PFORTE4:
- if (!player->key[element-EL_PFORTE1])
+ if (!player->key[element - EL_PFORTE1])
return MF_NO_ACTION;
break;
case EL_PFORTE2X:
case EL_PFORTE3X:
case EL_PFORTE4X:
- if (!player->key[element-EL_PFORTE1X])
+ if (!player->key[element - EL_PFORTE1X])
+ return MF_NO_ACTION;
+ break;
+
+ case EL_EM_GATE_1:
+ case EL_EM_GATE_2:
+ case EL_EM_GATE_3:
+ case EL_EM_GATE_4:
+ if (!player->key[element - EL_EM_GATE_1])
return MF_NO_ACTION;
+
+ if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy))
+ return MF_NO_ACTION;
+
+ /* automatically move to the next field with double speed */
+ player->programmed_action = move_direction;
+ player->move_speed = 4;
+
+ break;
+
+ case EL_EM_GATE_1X:
+ case EL_EM_GATE_2X:
+ case EL_EM_GATE_3X:
+ case EL_EM_GATE_4X:
+ if (!player->key[element - EL_EM_GATE_1X])
+ return MF_NO_ACTION;
+
+ if (!IN_LEV_FIELD(x + dx, y + dy) || !IS_FREE(x + dx, y + dy))
+ return MF_NO_ACTION;
+
+ /* automatically move to the next field with double speed */
+ player->programmed_action = move_direction;
+ player->move_speed = 4;
+
break;
case EL_SP_PORT1_LEFT:
!IS_FREE(x + dx, y + dy))
return MF_NO_ACTION;
- /* automatically move to field behind the port */
- player->programmed_action = (dx == -1 ? MV_LEFT :
- dx == +1 ? MV_RIGHT :
- dy == -1 ? MV_UP :
- dy == +1 ? MV_DOWN : MV_NO_MOVING);
- /* move through port with double speed */
+ /* automatically move to the next field with double speed */
+ player->programmed_action = move_direction;
+ player->move_speed = 4;
+
+ /*
MoveSpeed = 4;
ScrollStepSize = TILEX / MoveSpeed;
+ */
+
break;
case EL_AUSGANG_ZU:
EL_PFORTE1X,
EL_PFORTE2X,
EL_PFORTE3X,
- EL_PFORTE4X
+ EL_PFORTE4X,
+ EL_EM_GATE_1,
+ EL_EM_GATE_2,
+ EL_EM_GATE_3,
+ EL_EM_GATE_4,
+ EL_EM_GATE_1X,
+ EL_EM_GATE_2X,
+ EL_EM_GATE_3X,
+ EL_EM_GATE_4X
};
static int ep_pforte_num = sizeof(ep_pforte)/sizeof(int);
EL_PFORTE2X,
EL_PFORTE3X,
EL_PFORTE4X,
+ EL_EM_GATE_1,
+ EL_EM_GATE_2,
+ EL_EM_GATE_3,
+ EL_EM_GATE_4,
+ EL_EM_GATE_1X,
+ EL_EM_GATE_2X,
+ EL_EM_GATE_3X,
+ EL_EM_GATE_4X,
EL_SP_HARD_GRAY,
EL_SP_HARD_GREEN,
EL_SP_HARD_BLUE,
EL_PFORTE2X,
EL_PFORTE3X,
EL_PFORTE4X,
+ EL_EM_GATE_1,
+ EL_EM_GATE_2,
+ EL_EM_GATE_3,
+ EL_EM_GATE_4,
+ EL_EM_GATE_1X,
+ EL_EM_GATE_2X,
+ EL_EM_GATE_3X,
+ EL_EM_GATE_4X,
EL_AUSGANG_ZU,
EL_AUSGANG_ACT,
EL_AUSGANG_AUF,
EL_PFORTE2X,
EL_PFORTE3X,
EL_PFORTE4X,
+ EL_EM_GATE_1,
+ EL_EM_GATE_2,
+ EL_EM_GATE_3,
+ EL_EM_GATE_4,
+ EL_EM_GATE_1X,
+ EL_EM_GATE_2X,
+ EL_EM_GATE_3X,
+ EL_EM_GATE_4X,
EL_DYNAMIT_AUS,
EL_UNSICHTBAR,
EL_BIRNE_AUS,
};
static int ep_sp_element_num = sizeof(ep_sp_element)/sizeof(int);
+ static int ep_quick_gate[] =
+ {
+ EL_EM_GATE_1,
+ EL_EM_GATE_2,
+ EL_EM_GATE_3,
+ EL_EM_GATE_4,
+ EL_EM_GATE_1X,
+ EL_EM_GATE_2X,
+ EL_EM_GATE_3X,
+ EL_EM_GATE_4X,
+ EL_SP_PORT1_LEFT,
+ EL_SP_PORT2_LEFT,
+ EL_SP_PORT1_RIGHT,
+ EL_SP_PORT2_RIGHT,
+ EL_SP_PORT1_UP,
+ EL_SP_PORT2_UP,
+ EL_SP_PORT1_DOWN,
+ EL_SP_PORT2_DOWN,
+ EL_SP_PORT_X,
+ EL_SP_PORT_Y,
+ EL_SP_PORT_XY
+ };
+ static int ep_quick_gate_num = sizeof(ep_quick_gate)/sizeof(int);
+
+ static int ep_over_player[] =
+ {
+ EL_SP_PORT1_LEFT,
+ EL_SP_PORT2_LEFT,
+ EL_SP_PORT1_RIGHT,
+ EL_SP_PORT2_RIGHT,
+ EL_SP_PORT1_UP,
+ EL_SP_PORT2_UP,
+ EL_SP_PORT1_DOWN,
+ EL_SP_PORT2_DOWN,
+ EL_SP_PORT_X,
+ EL_SP_PORT_Y,
+ EL_SP_PORT_XY
+ };
+ static int ep_over_player_num = sizeof(ep_over_player)/sizeof(int);
+
static long ep_bit[] =
{
EP_BIT_AMOEBALIVE,
EP_BIT_PLAYER,
EP_BIT_HAS_CONTENT,
EP_BIT_EATABLE,
- EP_BIT_SP_ELEMENT
+ EP_BIT_SP_ELEMENT,
+ EP_BIT_QUICK_GATE,
+ EP_BIT_OVER_PLAYER
};
static int *ep_array[] =
{
ep_player,
ep_has_content,
ep_eatable,
- ep_sp_element
+ ep_sp_element,
+ ep_quick_gate,
+ ep_over_player
};
static int *ep_num[] =
{
&ep_player_num,
&ep_has_content_num,
&ep_eatable_num,
- &ep_sp_element_num
+ &ep_sp_element_num,
+ &ep_quick_gate_num,
+ &ep_over_player_num
};
static int num_properties = sizeof(ep_num)/sizeof(int *);
int level_nr, leveldir_nr, num_leveldirs;
int lev_fieldx,lev_fieldy, scroll_x,scroll_y;
-int FX = SX, FY = SY, ScrollStepSize = TILEX/8;
+int FX = SX, FY = SY, ScrollStepSize;
int ScreenMovDir = MV_NO_MOVING, ScreenMovPos = 0;
int ScreenGfxPos = 0;
int BorderElement = EL_BETON;
int GameFrameDelay = GAME_FRAME_DELAY;
int FfwdFrameDelay = FFWD_FRAME_DELAY;
-int MoveSpeed = 8;
int BX1 = 0, BY1 = 0, BX2 = SCR_FIELDX-1, BY2 = SCR_FIELDY-1;
int SBX_Left, SBX_Right;
int SBY_Upper, SBY_Lower;
#define EP_BIT_HAS_CONTENT (1 << 26)
#define EP_BIT_EATABLE (1 << 27)
#define EP_BIT_SP_ELEMENT (1 << 28)
+#define EP_BIT_QUICK_GATE (1 << 29)
+#define EP_BIT_OVER_PLAYER (1 << 30)
#define IS_AMOEBALIVE(e) (Elementeigenschaften[e] & EP_BIT_AMOEBALIVE)
#define IS_AMOEBOID(e) (Elementeigenschaften[e] & EP_BIT_AMOEBOID)
#define HAS_CONTENT(e) (Elementeigenschaften[e] & EP_BIT_HAS_CONTENT)
#define IS_EATABLE(e) (Elementeigenschaften[e] & EP_BIT_EATABLE)
#define IS_SP_ELEMENT(e) (Elementeigenschaften[e] & EP_BIT_SP_ELEMENT)
+#define IS_QUICK_GATE(e) (Elementeigenschaften[e] & EP_BIT_QUICK_GATE)
+#define IS_OVER_PLAYER(e) (Elementeigenschaften[e] & EP_BIT_OVER_PLAYER)
#define IS_PLAYER(x,y) (ELEM_IS_PLAYER(StorePlayer[x][y]))
boolean gone, LevelSolved, GameOver;
boolean snapped;
+ int move_speed;
unsigned long move_delay;
int last_move_dir;
extern int BorderElement;
extern int GameFrameDelay;
extern int FfwdFrameDelay;
-extern int MoveSpeed;
extern int BX1,BY1, BX2,BY2;
extern int SBX_Left, SBX_Right;
extern int SBY_Upper, SBY_Lower;
#define MICRO_GFX_PER_LINE 128
#define HEROES_PER_LINE 16
#define MINI_MORE_STARTX 0
-#define MINI_MORE_STARTY 224
+#define MINI_MORE_STARTY 352
#define MICRO_MORE_STARTX 0
-#define MICRO_MORE_STARTY 336
+#define MICRO_MORE_STARTY 448
#define MORE_PER_LINE 16
#define MINI_MORE_PER_LINE 16
-#define MICRO_MORE_PER_LINE 16
+#define MICRO_MORE_PER_LINE 64
#define FONT_CHARS_PER_LINE 16
#define FONT_LINES_PER_FONT 4
#define EL_MAUER_Y 201
#define EL_MAUER_XY 202
-#define EL_UNUSED_203 203
-#define EL_UNUSED_204 204
-#define EL_UNUSED_205 205
-#define EL_UNUSED_206 206
+#define EL_EM_GATE_1 203
+#define EL_EM_GATE_2 204
+#define EL_EM_GATE_3 205
+#define EL_EM_GATE_4 206
+
#define EL_UNUSED_207 207
#define EL_UNUSED_208 208
#define EL_UNUSED_209 209
#define EL_SP_CHIP_LOWER (EL_SP_START + 39)
#define EL_SP_END (EL_SP_START + 39)
-#define EL_UNUSED_250 250
-#define EL_UNUSED_251 251
-#define EL_UNUSED_252 252
-#define EL_UNUSED_253 253
+#define EL_EM_GATE_1X 250
+#define EL_EM_GATE_2X 251
+#define EL_EM_GATE_3X 252
+#define EL_EM_GATE_4X 253
+
#define EL_UNUSED_254 254
#define EL_UNUSED_255 255
#define GFX_UNSICHTBAR (GFX_START_ROCKSMORE + 5 * MORE_PER_LINE + 7)
#define GFX_SP_ZONK (GFX_START_ROCKSMORE + 6 * MORE_PER_LINE + 0)
+#define GFX_EM_KEY_1 (GFX_START_ROCKSMORE + 6 * MORE_PER_LINE + 4)
+#define GFX_EM_KEY_2 (GFX_START_ROCKSMORE + 6 * MORE_PER_LINE + 5)
+#define GFX_EM_KEY_3 (GFX_START_ROCKSMORE + 6 * MORE_PER_LINE + 6)
+#define GFX_EM_KEY_4 (GFX_START_ROCKSMORE + 6 * MORE_PER_LINE + 7)
+#define GFX_EM_GATE_1 (GFX_START_ROCKSMORE + 7 * MORE_PER_LINE + 0)
+#define GFX_EM_GATE_2 (GFX_START_ROCKSMORE + 7 * MORE_PER_LINE + 1)
+#define GFX_EM_GATE_3 (GFX_START_ROCKSMORE + 7 * MORE_PER_LINE + 2)
+#define GFX_EM_GATE_4 (GFX_START_ROCKSMORE + 7 * MORE_PER_LINE + 3)
+#define GFX_EM_GATE_1X (GFX_START_ROCKSMORE + 7 * MORE_PER_LINE + 4)
+#define GFX_EM_GATE_2X (GFX_START_ROCKSMORE + 7 * MORE_PER_LINE + 5)
+#define GFX_EM_GATE_3X (GFX_START_ROCKSMORE + 7 * MORE_PER_LINE + 6)
+#define GFX_EM_GATE_4X (GFX_START_ROCKSMORE + 7 * MORE_PER_LINE + 7)
+
#define GFX_MURPHY_GO_LEFT (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 8)
#define GFX_MURPHY_ANY_LEFT (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 9)
#define GFX_MURPHY_GO_RIGHT (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 11)
int next_jx = jx + (jx - last_jx), next_jy = jy + (jy - last_jy);
int sx = SCREENX(jx), sy = SCREENY(jy);
int sxx = 0, syy = 0;
- int element = Feld[jx][jy];
+ int element = Feld[jx][jy], last_element = Feld[last_jx][last_jy];
int graphic, phase;
+ boolean player_is_moving = (last_jx != jx || last_jy != jy ? TRUE : FALSE);
if (!player->active || player->gone ||
!IN_SCR_FIELD(SCREENX(last_jx), SCREENY(last_jy)))
/* draw things in the field the player is leaving, if needed */
+ /*
if (last_jx != jx || last_jy != jy)
+ */
+
+ if (player_is_moving)
{
- if (Store[last_jx][last_jy] && IS_DRAWABLE(Feld[last_jx][last_jy]))
+ if (Store[last_jx][last_jy] && IS_DRAWABLE(last_element))
{
DrawLevelElement(last_jx, last_jy, Store[last_jx][last_jy]);
DrawLevelFieldThruMask(last_jx, last_jy);
}
- else if (Feld[last_jx][last_jy] == EL_DYNAMIT)
+ else if (last_element == EL_DYNAMIT)
DrawDynamite(last_jx, last_jy);
else
DrawLevelField(last_jx, last_jy);
{
static int last_dir = MV_LEFT;
boolean action_moving =
- ((player->action & (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)) &&
- !(player->action & ~(MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)));
+ (player_is_moving ||
+ ((player->action & (MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN)) &&
+ !(player->action & ~(MV_LEFT | MV_RIGHT | MV_UP | MV_DOWN))));
graphic = GFX_SP_MURPHY;
{
int px = SCREENX(next_jx), py = SCREENY(next_jy);
- if (Feld[jx][jy] == EL_SOKOBAN_FELD_LEER ||
+ if (element == EL_SOKOBAN_FELD_LEER ||
Feld[next_jx][next_jy] == EL_SOKOBAN_FELD_VOLL)
DrawGraphicShiftedThruMask(px, py, sxx, syy, GFX_SOKOBAN_OBJEKT,
NO_CUTTING);
}
}
- /* draw things in front of player (EL_DYNAMIT || EL_DYNABOMB) */
+ /* draw things in front of player (EL_DYNAMIT or EL_DYNABOMB) */
if (element == EL_DYNAMIT || element == EL_DYNABOMB)
{
DrawGraphicThruMask(sx, sy, graphic + phase);
}
- if ((last_jx != jx || last_jy != jy) &&
- Feld[last_jx][last_jy] == EL_EXPLODING)
+ /*
+ if ((last_jx != jx || last_jy != jy) && last_element == EL_EXPLODING)
+ */
+
+ if (player_is_moving && last_element == EL_EXPLODING)
{
int phase = Frame[last_jx][last_jy];
int delay = 2;
GFX_EXPLOSION + ((phase - 1) / delay - 1));
}
+ /* draw elements that stay over the player */
+ /* handle the field the player is leaving ... */
+ if (player_is_moving && IS_OVER_PLAYER(last_element))
+ DrawLevelField(last_jx, last_jy);
+ /* ... and the field the player is entering */
+ if (IS_OVER_PLAYER(element))
+ DrawLevelField(jx, jy);
+
if (setup.direct_draw)
{
int dest_x = SX + SCREENX(MIN(jx, last_jx)) * TILEX;
else if (graphic >= GFX_START_ROCKSMORE && graphic <= GFX_END_ROCKSMORE)
{
graphic -= GFX_START_ROCKSMORE;
+ graphic -= ((graphic / MORE_PER_LINE) * MORE_PER_LINE) / 2;
*pixmap = pix[PIX_MORE];
*x = MINI_MORE_STARTX + (graphic % MINI_MORE_PER_LINE) * MINI_TILEX;
*y = MINI_MORE_STARTY + (graphic / MINI_MORE_PER_LINE) * MINI_TILEY;
if (graphic >= GFX_START_ROCKSMORE && graphic <= GFX_END_ROCKSMORE)
{
graphic -= GFX_START_ROCKSMORE;
+ graphic -= ((graphic / MORE_PER_LINE) * MORE_PER_LINE) / 2;
XCopyArea(display, pix[PIX_MORE], drawto, gc,
MICRO_MORE_STARTX + (graphic % MICRO_MORE_PER_LINE) *MICRO_TILEX,
MICRO_MORE_STARTY + (graphic / MICRO_MORE_PER_LINE) *MICRO_TILEY,
/* ^^^^^^^^^^ non-standard position in supaplex graphic set! */
case EL_INVISIBLE_STEEL: return GFX_INVISIBLE_STEEL;
case EL_BLACK_ORB: return GFX_BLACK_ORB;
+ case EL_EM_GATE_1: return GFX_EM_GATE_1;
+ case EL_EM_GATE_2: return GFX_EM_GATE_2;
+ case EL_EM_GATE_3: return GFX_EM_GATE_3;
+ case EL_EM_GATE_4: return GFX_EM_GATE_4;
+ case EL_EM_GATE_1X: return GFX_EM_GATE_1X;
+ case EL_EM_GATE_2X: return GFX_EM_GATE_2X;
+ case EL_EM_GATE_3X: return GFX_EM_GATE_3X;
+ case EL_EM_GATE_4X: return GFX_EM_GATE_4X;
default:
{