- debug(("make_move: over_col %d, over_guess %d, over_hint %d",
- over_col, over_guess, over_hint));
+ debug(("make_move: over_col %d, over_guess %d, over_hint %d,"
+ " over_past_guess %d", over_col, over_guess, over_hint,
+ over_past_guess));
ds->pegrad = (ds->pegsz -1)/2; /* radius of peg to fit in pegsz (which is 2r+1) */
ds->hintrad = (ds->hintsz-1)/2;
ds->pegrad = (ds->pegsz -1)/2; /* radius of peg to fit in pegsz (which is 2r+1) */
ds->hintrad = (ds->hintsz-1)/2;
- ret[COL_2 * 3 + 0] = 0.0F;
- ret[COL_2 * 3 + 1] = 0.5F;
+ /* yellow (toned down a bit due to pale grey background) */
+ ret[COL_2 * 3 + 0] = 0.7F;
+ ret[COL_2 * 3 + 1] = 0.7F;
- ret[COL_3 * 3 + 0] = 1.0F;
- ret[COL_3 * 3 + 1] = 0.0F;
+ /* green (also toned down) */
+ ret[COL_3 * 3 + 0] = 0.0F;
+ ret[COL_3 * 3 + 1] = 0.5F;
- ret[COL_4 * 3 + 0] = 1.0F;
- ret[COL_4 * 3 + 1] = 1.0F;
- ret[COL_4 * 3 + 2] = 0.0F;
+ /* blue */
+ ret[COL_4 * 3 + 0] = 0.0F;
+ ret[COL_4 * 3 + 1] = 0.0F;
+ ret[COL_4 * 3 + 2] = 1.0F;
- ret[COL_5 * 3 + 1] = 0.0F;
- ret[COL_5 * 3 + 2] = 1.0F;
-
- ret[COL_6 * 3 + 0] = 0.0F;
- ret[COL_6 * 3 + 1] = 1.0F;
- ret[COL_6 * 3 + 2] = 1.0F;
-
- ret[COL_7 * 3 + 0] = 0.5F;
- ret[COL_7 * 3 + 1] = 0.5F;
- ret[COL_7 * 3 + 2] = 1.0F;
-
- ret[COL_8 * 3 + 0] = 0.5F;
- ret[COL_8 * 3 + 1] = 1.0F;
- ret[COL_8 * 3 + 2] = 0.5F;
-
- ret[COL_9 * 3 + 0] = 1.0F;
- ret[COL_9 * 3 + 1] = 0.5F;
+ ret[COL_5 * 3 + 1] = 0.5F;
+ ret[COL_5 * 3 + 2] = 0.0F;
+
+ /* purple */
+ ret[COL_6 * 3 + 0] = 0.5F;
+ ret[COL_6 * 3 + 1] = 0.0F;
+ ret[COL_6 * 3 + 2] = 0.7F;
+
+ /* brown */
+ ret[COL_7 * 3 + 0] = 0.4F;
+ ret[COL_7 * 3 + 1] = 0.2F;
+ ret[COL_7 * 3 + 2] = 0.2F;
+
+ /* light blue */
+ ret[COL_8 * 3 + 0] = 0.4F;
+ ret[COL_8 * 3 + 1] = 0.7F;
+ ret[COL_8 * 3 + 2] = 1.0F;
+
+ /* light green */
+ ret[COL_9 * 3 + 0] = 0.5F;
+ ret[COL_9 * 3 + 1] = 0.8F;
ret[COL_EMPTY * 3 + 1] = ret[COL_BACKGROUND * 3 + 1] * 2.0 / 3.0;
ret[COL_EMPTY * 3 + 2] = ret[COL_BACKGROUND * 3 + 2] * 2.0 / 3.0;
ret[COL_EMPTY * 3 + 1] = ret[COL_BACKGROUND * 3 + 1] * 2.0 / 3.0;
ret[COL_EMPTY * 3 + 2] = ret[COL_BACKGROUND * 3 + 2] * 2.0 / 3.0;
-static void draw_peg(frontend *fe, game_drawstate *ds, int cx, int cy, int col)
+static void draw_peg(frontend *fe, game_drawstate *ds, int cx, int cy,
+ int moving, int col)
+ /*
+ * Some platforms antialias circles, which means we shouldn't
+ * overwrite a circle of one colour with a circle of another
+ * colour without erasing the background first. However, if the
+ * peg is the one being dragged, we don't erase the background
+ * because we _want_ it to alpha-blend nicely into whatever's
+ * behind it.
+ */
+ if (!moving)
+ draw_rect(fe, cx-1, cy-1, PEGSZ+2, PEGSZ+2, COL_BACKGROUND);
+ if (PEGRAD > 0) {
draw_circle(fe, cx+PEGRAD, cy+PEGRAD, PEGRAD, 1, COL_EMPTY + col);
draw_circle(fe, cx+PEGRAD, cy+PEGRAD, PEGRAD, 1, COL_EMPTY + col);
draw_rect(fe, cx, cy, PEGSZ, PEGSZ, COL_EMPTY + col);
draw_update(fe, cx, cy, PEGSZ, PEGSZ);
}
draw_rect(fe, cx, cy, PEGSZ, PEGSZ, COL_EMPTY + col);
draw_update(fe, cx, cy, PEGSZ, PEGSZ);
}
for (i = 0; i < dest->npegs; i++) {
scol = src ? src->pegs[i] : 0;
if ((dest->pegs[i] != scol) || force)
for (i = 0; i < dest->npegs; i++) {
scol = src ? src->pegs[i] : 0;
if ((dest->pegs[i] != scol) || force)
- draw_peg(fe, ds, rowx + PEGOFF * i, rowy, scol);
+ draw_peg(fe, ds, rowx + PEGOFF * i, rowy, FALSE, scol);
+ /* erase background for antialiasing platforms */
+ draw_rect(fe, rowx-1, rowy-1, HINTSZ+2, HINTSZ+2, COL_BACKGROUND);
+ if (HINTRAD > 0) {
draw_circle(fe, rowx+HINTRAD, rowy+HINTRAD, HINTRAD, 1, col);
draw_circle(fe, rowx+HINTRAD, rowy+HINTRAD, HINTRAD, 1, col);
draw_rect(fe, rowx, rowy, HINTSZ, HINTSZ, col);
draw_rect(fe, rowx, rowy, HINTSZ, HINTSZ, col);
draw_update(fe, rowx, rowy, HINTSZ, HINTSZ);
}
dest->feedback[i] = scol;
draw_update(fe, rowx, rowy, HINTSZ, HINTSZ);
}
dest->feedback[i] = scol;
- draw_peg(fe, ds, COL_X(i), COL_Y(i), i+1);
+ draw_peg(fe, ds, COL_X(i), COL_Y(i), FALSE, i+1);
int oy = ui->drag_y - (PEGSZ/2);
debug(("Saving to blitter at (%d,%d)", ox, oy));
blitter_save(fe, ds->blit_peg, ox, oy);
int oy = ui->drag_y - (PEGSZ/2);
debug(("Saving to blitter at (%d,%d)", ox, oy));
blitter_save(fe, ds->blit_peg, ox, oy);
- draw_peg(fe, ds, ox, oy, ui->drag_col);
+ draw_peg(fe, ds, ox, oy, TRUE, ui->drag_col);