Changed my mind about midend_is_solved: I've now reprototyped it as
[sgt/puzzles] / rect.c
diff --git a/rect.c b/rect.c
index af369e1..0a93638 100644 (file)
--- a/rect.c
+++ b/rect.c
@@ -2431,9 +2431,10 @@ static char *interpret_move(game_state *from, game_ui *ui, game_drawstate *ds,
        (xc != ui->drag_end_x || yc != ui->drag_end_y)) {
        int t;
 
+       if (ui->drag_end_x != -1 && ui->drag_end_y != -1)
+           ui->dragged = TRUE;
         ui->drag_end_x = xc;
         ui->drag_end_y = yc;
-        ui->dragged = TRUE;
         active = TRUE;
 
        if (xc >= 0 && xc <= 2*from->w &&
@@ -2813,7 +2814,8 @@ static void game_redraw(drawing *dr, game_drawstate *ds, game_state *oldstate,
     {
        char buf[256];
 
-       if (ui->x1 >= 0 && ui->y1 >= 0 &&
+       if (ui->dragged &&
+           ui->x1 >= 0 && ui->y1 >= 0 &&
            ui->x2 >= 0 && ui->y2 >= 0) {
            sprintf(buf, "%dx%d ",
                    ui->x2-ui->x1,
@@ -2853,6 +2855,11 @@ static float game_flash_length(game_state *oldstate,
     return 0.0F;
 }
 
+static int game_status(game_state *state)
+{
+    return state->completed ? +1 : 0;
+}
+
 static int game_timing_state(game_state *state, game_ui *ui)
 {
     return TRUE;
@@ -2958,6 +2965,7 @@ const struct game thegame = {
     game_redraw,
     game_anim_length,
     game_flash_length,
+    game_status,
     TRUE, FALSE, game_print_size, game_print,
     TRUE,                             /* wants_statusbar */
     FALSE, game_timing_state,