aboutsummaryrefslogtreecommitdiff
path: root/midend.c
diff options
context:
space:
mode:
authorJacob Nevins <jacobn@chiark.greenend.org.uk>2007-03-03 23:43:22 +0000
committerJacob Nevins <jacobn@chiark.greenend.org.uk>2007-03-03 23:43:22 +0000
commitd0a824540b1ab2ae0abd6c35f2e1619b857e6bb2 (patch)
tree4db229753600c844e2d2d14366faee27eafc52c5 /midend.c
parent8b21ddc396e51aca66a935957f8e62298736443d (diff)
downloadpuzzles-d0a824540b1ab2ae0abd6c35f2e1619b857e6bb2.zip
puzzles-d0a824540b1ab2ae0abd6c35f2e1619b857e6bb2.tar.gz
puzzles-d0a824540b1ab2ae0abd6c35f2e1619b857e6bb2.tar.bz2
puzzles-d0a824540b1ab2ae0abd6c35f2e1619b857e6bb2.tar.xz
Since we've changed the semantics of the `expand' argument to midend_size(),
change the name. Also document the new semantics. [originally from svn r7369]
Diffstat (limited to 'midend.c')
-rw-r--r--midend.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/midend.c b/midend.c
index d0bc950..250a479 100644
--- a/midend.c
+++ b/midend.c
@@ -212,7 +212,7 @@ static void midend_size_new_drawstate(midend *me)
}
}
-void midend_size(midend *me, int *x, int *y, int expand)
+void midend_size(midend *me, int *x, int *y, int user_size)
{
int min, max;
int rx, ry;
@@ -230,11 +230,14 @@ void midend_size(midend *me, int *x, int *y, int expand)
/*
* Find the tile size that best fits within the given space. If
- * `expand' is TRUE, we must actually find the _largest_ such
- * tile size; otherwise, we bound above at the game's preferred
- * tile size.
+ * `user_size' is TRUE, we must actually find the _largest_ such
+ * tile size, in order to get as close to the user's explicit
+ * request as possible; otherwise, we bound above at the game's
+ * preferred tile size, so that the game gets what it wants
+ * provided that this doesn't break the constraint from the
+ * front-end (which is likely to be a screen size or similar).
*/
- if (expand) {
+ if (user_size) {
max = 1;
do {
max *= 2;
@@ -264,7 +267,8 @@ void midend_size(midend *me, int *x, int *y, int expand)
*/
me->tilesize = min;
- if (expand)
+ if (user_size)
+ /* If the user requested a change in size, make it permanent. */
me->preferred_tilesize = me->tilesize;
midend_size_new_drawstate(me);
*x = me->winwidth;