if (leveldir_current == NULL) /* only when dumping level */
return;
+ /* all engine modifications also valid for levels which use latest engine */
+#if 1
+ if (level->game_version < VERSION_IDENT(3,2,0,5))
+ {
+ /* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */
+ level->score[SC_TIME_BONUS] /= 10;
+ }
+#endif
+
if (leveldir_current->latest_engine)
{
/* ---------- use latest game engine ----------------------------------- */
/* extra time score was same value as time left score before 3.2.0-5 */
level->extra_time_score = level->score[SC_TIME_BONUS];
+#if 0
/* time bonus score was given for 10 s instead of 1 s before 3.2.0-5 */
level->score[SC_TIME_BONUS] /= 10;
+#endif
}
/* only few elements were able to actively move into acid before 3.1.0 */
unsigned int frame; /* current screen frame */
+#if 0
unsigned int screen_x; /* current scroll position */
unsigned int screen_y;
+#else
+int screen_x; /* current scroll position */
+int screen_y;
+#endif
/* tiles currently on screen */
static unsigned int screentiles[MAX_BUF_YSIZE][MAX_BUF_XSIZE];
void RedrawPlayfield_EM()
{
- unsigned int i, x, y;
+ int i, sx, sy;
+
+#if 1
+
+ int screen_x_min = TILEX;
+ int screen_y_min = TILEY;
+ int screen_x_max = (lev.width - (SCR_FIELDX - 1)) * TILEX;
+ int screen_y_max = (lev.height - (SCR_FIELDY - 1)) * TILEY;
+ int offset = (setup.scroll_delay ? 3 : 0) * TILEX;
+ int stepsize = TILEX / 8;
+ int nr = 0; /* !!! FIX THIS (CENTERED TO PLAYER 1) !!! */
+
+ sx = (frame * ply[nr].oldx + (8 - frame) * ply[nr].x) * stepsize
+ - ((SCR_FIELDX - 1) * TILEX) / 2;
+ sy = (frame * ply[nr].oldy + (8 - frame) * ply[nr].y) * stepsize
+ - ((SCR_FIELDY - 1) * TILEY) / 2;
+
+ /* calculate new screen scrolling position, with regard to scroll delay */
+ screen_x = (sx < screen_x - offset ? sx + offset :
+ sx > screen_x + offset ? sx - offset : screen_x);
+ screen_y = (sy < screen_y - offset ? sy + offset :
+ sy > screen_y + offset ? sy - offset : screen_y);
+
+ /* check minimal and maximal boundaries for screen scrolling position */
+ screen_x = (screen_x < screen_x_min ? screen_x_min :
+ screen_x > screen_x_max ? screen_x_max : screen_x);
+ screen_y = (screen_y < screen_y_min ? screen_y_min :
+ screen_y > screen_y_max ? screen_y_max : screen_y);
+
+#else
/* !!! FIX THIS (CENTERED TO PLAYER 1) !!! */
- x = (frame * ply[0].oldx + (8 - frame) * ply[0].x) * TILEX / 8
+ sx = (frame * ply[0].oldx + (8 - frame) * ply[0].x) * TILEX / 8
+ ((SCR_FIELDX - 1) * TILEX) / 2;
- y = (frame * ply[0].oldy + (8 - frame) * ply[0].y) * TILEY / 8
+ sy = (frame * ply[0].oldy + (8 - frame) * ply[0].y) * TILEY / 8
+ ((SCR_FIELDY - 1) * TILEY) / 2;
- if (x > lev.width * TILEX)
- x = lev.width * TILEX;
- if (y > lev.height * TILEY)
- y = lev.height * TILEY;
+ if (sx > lev.width * TILEX)
+ sx = lev.width * TILEX;
+ if (sy > lev.height * TILEY)
+ sy = lev.height * TILEY;
- if (x < SCR_FIELDX * TILEX)
- x = SCR_FIELDX * TILEY;
- if (y < SCR_FIELDY * TILEY)
- y = SCR_FIELDY * TILEY;
+ if (sx < SCR_FIELDX * TILEX)
+ sx = SCR_FIELDX * TILEY;
+ if (sy < SCR_FIELDY * TILEY)
+ sy = SCR_FIELDY * TILEY;
- screen_x = x - (SCR_FIELDX - 1) * TILEX;
- screen_y = y - (SCR_FIELDY - 1) * TILEY;
+ screen_x = sx - (SCR_FIELDX - 1) * TILEX;
+ screen_y = sy - (SCR_FIELDY - 1) * TILEY;
+
+#endif
animscreen();
int y2 = y + SIGN(dy);
int anim_frames = graphic_info[graphic].anim_frames;
int sync_frame = (dx ? ABS(dx) : ABS(dy)) * anim_frames / TILESIZE;
+ boolean draw_start_tile = (cut_mode != CUT_ABOVE); /* only for falling! */
+ boolean draw_end_tile = (cut_mode != CUT_BELOW); /* only for falling! */
/* re-calculate animation frame for two-tile movement animation */
frame = getGraphicAnimationFrame(graphic, sync_frame);
- if (IN_SCR_FIELD(x1, y1)) /* movement start graphic inside screen area */
+ /* check if movement start graphic inside screen area and should be drawn */
+ if (draw_start_tile && IN_SCR_FIELD(x1, y1))
{
getGraphicSourceExt(graphic, frame, &src_bitmap, &src_x, &src_y, TRUE);
MarkTileDirty(x1, y1);
}
- if (IN_SCR_FIELD(x2, y2)) /* movement end graphic inside screen area */
+ /* check if movement end graphic inside screen area and should be drawn */
+ if (draw_end_tile && IN_SCR_FIELD(x2, y2))
{
getGraphicSourceExt(graphic, frame, &src_bitmap, &src_x, &src_y, FALSE);