~ubuntu-branches/ubuntu/saucy/sgt-puzzles/saucy

« back to all changes in this revision

Viewing changes to devel.but

  • Committer: Bazaar Package Importer
  • Author(s): Ben Hutchings
  • Date: 2011-07-11 03:56:55 UTC
  • mfrom: (1.1.13 upstream) (3.1.14 sid)
  • Revision ID: james.westby@ubuntu.com-20110711035655-bfr08qpm3dm3unnq
Tags: 9179-1
* New upstream version:
  - Remove unused-but-set variables - closes: #625425
  - Avoid infinite loop in Loopy at Easy level
  - Add Penrose tilings to Loopy
* Update German translation, thanks to Helge Kreutzmann
* Do not compile with -Werror

Show diffs side-by-side

added added

removed removed

Lines of Context:
1224
1224
to achieve this, its \cw{flash_length()} function has to store a
1225
1225
flag in the \c{game_ui} to indicate which flash type is required.)
1226
1226
 
 
1227
\S{backend-status} \cw{status()}
 
1228
 
 
1229
\c int (*status)(game_state *state);
 
1230
 
 
1231
This function returns a status value indicating whether the current
 
1232
game is still in play, or has been won, or has been conclusively lost.
 
1233
The mid-end uses this to implement \cw{midend_status()}
 
1234
(\k{midend-status}).
 
1235
 
 
1236
The return value should be +1 if the game has been successfully
 
1237
solved. If the game has been lost in a situation where further play is
 
1238
unlikely, the return value should be -1. If neither is true (so play
 
1239
is still ongoing), return zero.
 
1240
 
 
1241
Front ends may wish to use a non-zero status as a cue to proactively
 
1242
offer the option of starting a new game. Therefore, back ends should
 
1243
not return -1 if the game has been \e{technically} lost but undoing
 
1244
and continuing is still a realistic possibility.
 
1245
 
 
1246
(For instance, games with hidden information such as Guess or Mines
 
1247
might well return a non-zero status whenever they reveal the solution,
 
1248
whether or not the player guessed it correctly, on the grounds that a
 
1249
player would be unlikely to hide the solution and continue playing
 
1250
after the answer was spoiled. On the other hand, games where you can
 
1251
merely get into a dead end such as Same Game or Inertia might choose
 
1252
to return 0 in that situation, on the grounds that the player would
 
1253
quite likely press Undo and carry on playing.)
 
1254
 
1227
1255
\S{backend-redraw} \cw{redraw()}
1228
1256
 
1229
1257
\c void (*redraw)(drawing *dr, game_drawstate *ds,
3096
3124
\cw{activate_timer()} to be called from within a call to this
3097
3125
function.
3098
3126
 
 
3127
\H{midend-status} \cw{midend_status()}
 
3128
 
 
3129
\c int midend_status(midend *me);
 
3130
 
 
3131
This function returns +1 if the midend is currently displaying a game
 
3132
in a solved state, -1 if the game is in a permanently lost state, or 0
 
3133
otherwise. This function just calls the back end's \cw{status()}
 
3134
function. Front ends may wish to use this as a cue to proactively
 
3135
offer the option of starting a new game.
 
3136
 
 
3137
(See \k{backend-status} for more detail about the back end's
 
3138
\cw{status()} function and discussion of what should count as which
 
3139
status code.)
 
3140
 
 
3141
\H{midend-can-undo} \cw{midend_can_undo()}
 
3142
 
 
3143
\c int midend_can_undo(midend *me);
 
3144
 
 
3145
Returns \cw{TRUE} if the midend is currently in a state where the undo
 
3146
operation is meaningful (i.e. at least one position exists on the undo
 
3147
chain before the present one). Front ends may wish to use this to
 
3148
visually activate and deactivate an undo button.
 
3149
 
 
3150
\H{midend-can-redo} \cw{midend_can_redo()}
 
3151
 
 
3152
\c int midend_can_redo(midend *me);
 
3153
 
 
3154
Returns \cw{TRUE} if the midend is currently in a state where the redo
 
3155
operation is meaningful (i.e. at least one position exists on the redo
 
3156
chain after the present one). Front ends may wish to use this to
 
3157
visually activate and deactivate a redo button.
 
3158
 
3099
3159
\H{midend-serialise} \cw{midend_serialise()}
3100
3160
 
3101
3161
\c void midend_serialise(midend *me,