2012-10-13
- * fixed display of current level time when making use of time orb bug
- (see level set "rnd_equinox_tetrachloride_ii", level 053)
+ * fixed display of level time switching from ascending to descending
+ when making use of the "time orb bug" (see element setting in editor)
+ (see level 053 of set "rnd_equinox_tetrachloride_ii" for an example)
+ * fixed graphics performance problems (especially on Mac OS X) by using
+ whole-playfield redraw on SDL target, while still using the previous
+ single-tile redraw method on X11 target (using redraw tiles threshold)
2011-10-07
* fixed code (esp. random/tape handling) when compiled on 64-bit systems
- (by simply replacing all "long" by "int" types)
+ (by replacing all "long" types by "int" types)
2010-11-19
* fixed nasty bug (affecting crumbled graphics) after adding new special
game_panel_controls[GAME_PANEL_TIME].value = TimeLeft;
- DisplayGameControlValues();
+ /* (already called by UpdateAndDisplayGameControlValues() below) */
+ // DisplayGameControlValues();
#else
DrawGameValue_Time(TimeLeft);
#endif
{
game_panel_controls[GAME_PANEL_TIME].value = TimePlayed;
- DisplayGameControlValues();
+ /* (already called by UpdateAndDisplayGameControlValues() below) */
+ // DisplayGameControlValues();
}
#else
else if (game.no_time_limit && !AllPlayersGone) /* level w/o time limit */
REDRAW_TILES | \
REDRAW_MICROLEVEL)
#define REDRAW_FPS (1 << 11)
+
+#if defined(TARGET_X11)
+/* on old-style, classic and potentially slow graphics systems, redraw single
+ tiles instead of the whole playfield unless a certain threshold is reached;
+ when using the X11 target, this method should still be fast on all systems */
#define REDRAWTILES_THRESHOLD (SCR_FIELDX * SCR_FIELDY / 2)
+#else
+/* on modern graphics systems and when using the SDL target, this tile redraw
+ optimization can slow things down a lot due to many small blits compared to
+ one single playfield-sized blit (especially observed on Mac OS X with SDL) */
+#define REDRAWTILES_THRESHOLD 0
+#endif
#define IN_GFX_SCREEN(x, y) (x >= gfx.sx && x < gfx.sx + gfx.sxsize && \
y >= gfx.sy && y < gfx.sy + gfx.sysize)
redraw_mask |= REDRAW_FIELD;
#if 0
- /* !!! TEST ONLY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1 */
+ // never redraw single tiles, always redraw the whole field
+ // (redrawing single tiles up to a certain threshold was faster on old,
+ // now legacy graphics, but slows things down on modern graphics now)
+ if (redraw_mask & REDRAW_TILES)
+ redraw_mask |= REDRAW_FIELD;
+#endif
+
+#if 0
+ /* !!! TEST ONLY !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
/* (force full redraw) */
if (game_status == GAME_MODE_PLAYING)
redraw_mask |= REDRAW_FIELD;
if (redraw_mask == REDRAW_NONE)
return;
+#if 0
+ printf("::: ");
+ if (redraw_mask & REDRAW_ALL)
+ printf("[REDRAW_ALL]");
+ if (redraw_mask & REDRAW_FIELD)
+ printf("[REDRAW_FIELD]");
+ if (redraw_mask & REDRAW_TILES)
+ printf("[REDRAW_TILES]");
+ if (redraw_mask & REDRAW_DOOR_1)
+ printf("[REDRAW_DOOR_1]");
+ if (redraw_mask & REDRAW_DOOR_2)
+ printf("[REDRAW_DOOR_2]");
+ if (redraw_mask & REDRAW_FROM_BACKBUFFER)
+ printf("[REDRAW_FROM_BACKBUFFER]");
+ printf(" [%d]\n", FrameCounter);
+#endif
+
if (redraw_mask & REDRAW_TILES &&
game_status == GAME_MODE_PLAYING &&
border.draw_masked[GAME_MODE_PLAYING])
ClearRectangleOnBackground(backbuffer, x, y, width, height);
#endif
+#if 1
+ /* (this only works for the current arrangement of playfield and panels) */
+ if (x < gfx.dx)
+ redraw_mask |= REDRAW_FIELD;
+ else if (y < gfx.vy)
+ redraw_mask |= REDRAW_DOOR_1;
+ else
+ redraw_mask |= REDRAW_DOOR_2;
+#else
+ /* (this is just wrong (when drawing to one of the two door panel areas)) */
redraw_mask |= REDRAW_FIELD;
+#endif
}
void DrawBackgroundForFont(int x, int y, int width, int height, int font_nr)