[MOTIF_CFLAGS=$dx_cv_motif_cflags MOTIF_LIBS=$dx_cv_motif_libs],
[AC_DEFINE([X_DISPLAY_MISSING])])
AM_CONDITIONAL([HAVE_MOTIF], [test x"$dx_cv_have_motif" = x"yes"])
+AH_TEMPLATE([X11_RENDER_DEBUG],
+ [Define to 1 to enable visual aids for debugging X11 rendering.])
AC_CONFIG_TESTDIR([.], [t:.])
DX_PROG_AUTOTEST
/* Size of the traditional icon pixmap (multiple of 3) */
#define ICON_SIZE 48
+/* Define to 1 to add highlights and delays for visually debugging redraws */
+#if X11_RENDER_DEBUG
+# include <unistd.h>
+#endif
+
enum {
NUM_TILE_COLOURS = COLOUR_MAX*(TILE_MAX-1),
COLOUR_UI_GAMEBG = NUM_TILE_COLOURS,
void x11_redraw_goal(struct app_state *state, uint_fast32_t mask)
{
Display *display = XtDisplay(state->goal);
- Window window = XtWindow(state->goal);
+ Window goal = XtWindow(state->goal);
Dimension w, h;
int i;
int x = i%3, y = i/3;
if (mask & 1) {
- redraw_goal_tile(state, display, window,
- x, y, w/3, h/3);
+#if X11_RENDER_DEBUG
+ XRectangle r = { w/3*(i%3), w/3*(i/3), w/3, h/3 };
+ XSetForeground(display, state->tile_gc, 0xff0000);
+ XFillRectangles(display, goal, state->tile_gc, &r, 1);
+ XFlush(display);
+ usleep(70000);
+#endif
+ redraw_goal_tile(state, display, goal, x, y, w/3, h/3);
}
/*
for (i = 0; i < 25; i++) {
if (mask & 1) {
+#if X11_RENDER_DEBUG
+ XRectangle r = { w*(i%5), w*(i/5), w, h };
+ XSetForeground(display, state->tile_gc, 0xff0000);
+ XFillRectangles(display, game, state->tile_gc, &r, 1);
+ XFlush(display);
+ usleep(70000);
+#endif
redraw_tile(state, display, game,
gp[0], gp[1], gp[2],
i%5, i/5, w, h);