void RedrawPlayfield(boolean force_redraw, int x, int y, int width, int height)
{
void RedrawPlayfield(boolean force_redraw, int x, int y, int width, int height)
{
{
BlitBitmap(backbuffer, window,
REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY);
{
BlitBitmap(backbuffer, window,
REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE, REAL_SX, REAL_SY);
{
DrawBackground(REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
{
DrawBackground(REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
{
ClearRectangle(fieldbuffer, 0, 0, FXSIZE, FYSIZE);
SetDrawtoField(DRAW_BUFFERED);
{
ClearRectangle(fieldbuffer, 0, 0, FXSIZE, FYSIZE);
SetDrawtoField(DRAW_BUFFERED);
{
ClearRectangle(window, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
SetDrawtoField(DRAW_DIRECT);
{
ClearRectangle(window, REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE);
SetDrawtoField(DRAW_DIRECT);
/* draw things behind the player, if needed */
/* ----------------------------------------------------------------------- */
/* draw things behind the player, if needed */
/* ----------------------------------------------------------------------- */
else if (IS_ACTIVE_BOMB(element))
DrawLevelElement(jx, jy, EL_EMPTY);
else
else if (IS_ACTIVE_BOMB(element))
DrawLevelElement(jx, jy, EL_EMPTY);
else
int stored = Store[last_jx][last_jy];
int graphic = (game.emulation != EMU_SUPAPLEX ? IMG_EXPLOSION :
stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON :
IMG_SP_EXPLOSION);
int stored = Store[last_jx][last_jy];
int graphic = (game.emulation != EMU_SUPAPLEX ? IMG_EXPLOSION :
stored == EL_SP_INFOTRON ? IMG_SP_EXPLOSION_INFOTRON :
IMG_SP_EXPLOSION);
int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2);
int phase = ExplodePhase[last_jx][last_jy] - 1;
int frame = getGraphicAnimationFrame(graphic, phase - delay);
int delay = (game.emulation == EMU_SUPAPLEX ? 3 : 2);
int phase = ExplodePhase[last_jx][last_jy] - 1;
int frame = getGraphicAnimationFrame(graphic, phase - delay);
/* ----------------------------------------------------------------------- */
/* handle the field the player is leaving ... */
/* ----------------------------------------------------------------------- */
/* handle the field the player is leaving ... */
- *x = g->src_x + (frame % g->anim_frames_per_line) * g->offset_x;
- *y = g->src_y + (frame / g->anim_frames_per_line) * g->height;
+ int max_width = g->anim_frames_per_line * g->width;
+
+ *x = (g->src_x + frame * g->offset_x) % max_width;
+ *y = g->src_y + (g->src_x + frame * g->offset_x) / max_width * g->height;
- *x = g->src_x + (frame / g->anim_frames_per_line) * g->width;
- *y = g->src_y + (frame % g->anim_frames_per_line) * g->offset_y;
+ int max_height = g->anim_frames_per_line * g->height;
+
+ *x = g->src_x + (g->src_y + frame * g->offset_y) / max_height * g->width;
+ *y = (g->src_y + frame * g->offset_y) % max_height;
src_bitmap = graphic_info[graphic].bitmap;
src_x = graphic_info[graphic].src_x;
src_y = graphic_info[graphic].src_y;
offset_x = graphic_info[graphic].offset_x;
offset_y = graphic_info[graphic].offset_y;
src_bitmap = graphic_info[graphic].bitmap;
src_x = graphic_info[graphic].src_x;
src_y = graphic_info[graphic].src_y;
offset_x = graphic_info[graphic].offset_x;
offset_y = graphic_info[graphic].offset_y;
element = (GfxElement[x][y] != EL_UNDEFINED ? GfxElement[x][y] : Feld[x][y]);
/* crumble field itself */
element = (GfxElement[x][y] != EL_UNDEFINED ? GfxElement[x][y] : Feld[x][y]);
/* crumble field itself */
if (!IN_LEV_FIELD(xx, yy) ||
!IN_SCR_FIELD(sxx, syy) ||
if (!IN_LEV_FIELD(xx, yy) ||
!IN_SCR_FIELD(sxx, syy) ||
int src_x = mini_startx + graphic_info[graphic].src_x / 8;
int src_y = mini_starty + graphic_info[graphic].src_y / 8;
int src_x = mini_startx + graphic_info[graphic].src_x / 8;
int src_y = mini_starty + graphic_info[graphic].src_y / 8;
static int label_state, label_counter;
int last_game_status = game_status; /* save current game status */
static int label_state, label_counter;
int last_game_status = game_status; /* save current game status */
/* clear door drawing field */
DrawBackground(DX, DY, DXSIZE, DYSIZE);
/* clear door drawing field */
DrawBackground(DX, DY, DXSIZE, DYSIZE);
static int door1 = DOOR_OPEN_1;
static int door2 = DOOR_CLOSE_2;
static unsigned long door_delay = 0;
static int door1 = DOOR_OPEN_1;
static int door2 = DOOR_CLOSE_2;
static unsigned long door_delay = 0;
- int x, start, stepsize = global.door_step_offset;
- unsigned long door_delay_value = global.door_step_delay;
+ int x, start, stepsize = door.step_offset;
+ unsigned long door_delay_value = door.step_delay;
direction = MV_DIR_BIT(direction);
return element_info[element].direction_graphic[action][direction];
direction = MV_DIR_BIT(direction);
return element_info[element].direction_graphic[action][direction];
return element_info[element].graphic[action];
}
int el_dir2img(int element, int direction)
{
return element_info[element].graphic[action];
}
int el_dir2img(int element, int direction)
{