Patch from Ben Hutchings to allow user-initiated tilesize changes to persist
[sgt/puzzles] / midend.c
index 4d729e3..d0bc950 100644 (file)
--- a/midend.c
+++ b/midend.c
@@ -264,6 +264,8 @@ void midend_size(midend *me, int *x, int *y, int expand)
      */
 
     me->tilesize = min;
+    if (expand)
+        me->preferred_tilesize = me->tilesize;
     midend_size_new_drawstate(me);
     *x = me->winwidth;
     *y = me->winheight;
@@ -740,6 +742,17 @@ void midend_redraw(midend *me)
     }
 }
 
+/*
+ * Nasty hacky function used to implement the --redo option in
+ * gtk.c. Only used for generating the puzzles' icons.
+ */
+void midend_freeze_timer(midend *me, float tprop)
+{
+    me->anim_pos = me->anim_time * tprop;
+    midend_redraw(me);
+    deactivate_timer(me->frontend);
+}
+
 void midend_timer(midend *me, float tplus)
 {
     int need_redraw = (me->anim_time > 0 || me->flash_time > 0);