diff options
| author | Simon Tatham <anakin@pobox.com> | 2005-10-22 16:35:23 +0000 |
|---|---|---|
| committer | Simon Tatham <anakin@pobox.com> | 2005-10-22 16:35:23 +0000 |
| commit | b7f192eea34e0bd36abcd457333ab37eb221789f (patch) | |
| tree | 91f6482f7eec6deb4d1de4a0e2838a2b091962f3 | |
| parent | 6824dcde03d894886fea4c1e16e0020a9c176225 (diff) | |
| download | puzzles-b7f192eea34e0bd36abcd457333ab37eb221789f.zip puzzles-b7f192eea34e0bd36abcd457333ab37eb221789f.tar.gz puzzles-b7f192eea34e0bd36abcd457333ab37eb221789f.tar.bz2 puzzles-b7f192eea34e0bd36abcd457333ab37eb221789f.tar.xz | |
Cleanup: the `mouse_priorities' field in the back end has been a
more general-purpose flags word for some time now. Rename it to
`flags'.
[originally from svn r6414]
| -rw-r--r-- | blackbox.c | 2 | ||||
| -rw-r--r-- | bridges.c | 2 | ||||
| -rw-r--r-- | cube.c | 2 | ||||
| -rw-r--r-- | devel.but | 11 | ||||
| -rw-r--r-- | dominosa.c | 2 | ||||
| -rw-r--r-- | fifteen.c | 2 | ||||
| -rw-r--r-- | flip.c | 2 | ||||
| -rw-r--r-- | guess.c | 2 | ||||
| -rw-r--r-- | inertia.c | 2 | ||||
| -rw-r--r-- | lightup.c | 2 | ||||
| -rw-r--r-- | loopy.c | 2 | ||||
| -rw-r--r-- | map.c | 2 | ||||
| -rw-r--r-- | midend.c | 6 | ||||
| -rw-r--r-- | net.c | 2 | ||||
| -rw-r--r-- | netslide.c | 2 | ||||
| -rw-r--r-- | nullgame.c | 2 | ||||
| -rw-r--r-- | pattern.c | 2 | ||||
| -rw-r--r-- | pegs.c | 2 | ||||
| -rw-r--r-- | puzzles.h | 10 | ||||
| -rw-r--r-- | rect.c | 2 | ||||
| -rw-r--r-- | samegame.c | 2 | ||||
| -rw-r--r-- | sixteen.c | 2 | ||||
| -rw-r--r-- | slant.c | 2 | ||||
| -rw-r--r-- | solo.c | 2 | ||||
| -rw-r--r-- | tents.c | 2 | ||||
| -rw-r--r-- | twiddle.c | 2 | ||||
| -rw-r--r-- | untangle.c | 2 |
27 files changed, 38 insertions, 37 deletions
@@ -1434,7 +1434,7 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; /* vim: set shiftwidth=4 tabstop=8: */ @@ -2668,7 +2668,7 @@ const struct game thegame = { TRUE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; /* vim: set shiftwidth=4 tabstop=8: */ @@ -1738,5 +1738,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -1166,8 +1166,7 @@ State changes as a result of a Restart operation are never animated; the mid-end will handle them internally and never consult this function at all. State changes as a result of Solve operations are also not animated by default, although you can change this for a -particular game by setting a flag in \c{mouse_priorities} -(\k{backend-mouse-priorities}). +particular game by setting a flag in \c{flags} (\k{backend-flags}). The function is also passed a pointer to the local \c{game_ui}. It may refer to information in here to help with its decision (see @@ -1441,12 +1440,12 @@ the game was first completed (by setting a flag in freeze the timer thereafter so that the user can undo back through their solution process without altering their time. -\S{backend-mouse-priorities} \c{mouse_priorities} +\S{backend-flags} \c{flags} -\c int mouse_priorities; +\c int flags; -This field is badly named. It is in fact a generic flags word. It -consists of the bitwise OR of the following flags: +This field contains miscellaneous per-backend flags. It consists of +the bitwise OR of some combination of the following: \dt \cw{BUTTON_BEATS(x,y)} @@ -1778,5 +1778,5 @@ const struct game thegame = { TRUE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -883,5 +883,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -1304,5 +1304,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -1314,7 +1314,7 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; /* vim: set shiftwidth=4 tabstop=8: */ @@ -2178,5 +2178,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -2254,7 +2254,7 @@ const struct game thegame = { TRUE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; #ifdef STANDALONE_SOLVER @@ -2753,5 +2753,5 @@ const struct game thegame = { TRUE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -3123,7 +3123,7 @@ const struct game thegame = { TRUE, TRUE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; #ifdef STANDALONE_SOLVER @@ -578,7 +578,7 @@ static int midend_really_process_key(midend *me, int x, int y, int button) * See if this move requires an animation. */ if (special(type) && !(type == SOLVE && - (me->ourgame->mouse_priorities & SOLVE_ANIMATES))) { + (me->ourgame->flags & SOLVE_ANIMATES))) { anim_time = 0; } else { anim_time = me->ourgame->anim_length(oldstate, @@ -690,7 +690,7 @@ int midend_process_key(midend *me, int x, int y, int button) * If the new button has lower priority than the old one, * don't bother doing this. */ - if (me->ourgame->mouse_priorities & + if (me->ourgame->flags & BUTTON_BEATS(me->pressed_mouse_button, button)) return ret; /* just ignore it */ @@ -1214,7 +1214,7 @@ char *midend_solve(midend *me) me->states[me->statepos-2].state, me->states[me->statepos-1].state); me->dir = +1; - if (me->ourgame->mouse_priorities & SOLVE_ANIMATES) { + if (me->ourgame->flags & SOLVE_ANIMATES) { me->oldstate = me->ourgame->dup_game(me->states[me->statepos-2].state); me->anim_time = me->ourgame->anim_length(me->states[me->statepos-2].state, @@ -2873,5 +2873,5 @@ const struct game thegame = { TRUE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -1827,5 +1827,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -289,5 +289,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -1281,7 +1281,7 @@ const struct game thegame = { TRUE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; #ifdef STANDALONE_SOLVER @@ -1224,5 +1224,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -60,12 +60,14 @@ enum { #define IS_MOUSE_RELEASE(m) ( (unsigned)((m) - LEFT_RELEASE) <= \ (unsigned)(RIGHT_RELEASE - LEFT_RELEASE)) +/* + * Flags in the back end's `flags' word. + */ /* Bit flags indicating mouse button priorities */ #define BUTTON_BEATS(x,y) ( 1 << (((x)-LEFT_BUTTON)*3+(y)-LEFT_BUTTON) ) - -/* Another random flag that goes in the mouse priorities section for want - * of a better place to put it */ +/* Flag indicating that Solve operations should be animated */ #define SOLVE_ANIMATES ( 1 << 9 ) +/* end of `flags' word definitions */ #define IGNOREARG(x) ( (x) = (x) ) @@ -397,7 +399,7 @@ struct game { int (*wants_statusbar)(void); int is_timed; int (*timing_state)(game_state *state, game_ui *ui); - int mouse_priorities; + int flags; }; /* @@ -2874,5 +2874,5 @@ const struct game thegame = { TRUE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -1664,5 +1664,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -1059,5 +1059,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -2089,7 +2089,7 @@ const struct game thegame = { TRUE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; #ifdef STANDALONE_SOLVER @@ -3090,7 +3090,7 @@ const struct game thegame = { TRUE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; #ifdef STANDALONE_SOLVER @@ -2091,7 +2091,7 @@ const struct game thegame = { TRUE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; #ifdef STANDALONE_SOLVER @@ -1226,5 +1226,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - 0, /* mouse_priorities */ + 0, /* flags */ }; @@ -1463,5 +1463,5 @@ const struct game thegame = { FALSE, FALSE, game_print_size, game_print, game_wants_statusbar, FALSE, game_timing_state, - SOLVE_ANIMATES, /* mouse_priorities */ + SOLVE_ANIMATES, /* flags */ }; |