mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Make encode_ui() and decode_ui() optional in back-ends
The majority of back-ends define encode_ui() to return NULL and decode_ui() to do nothing. This commit allows them to instead specify the relevant function pointers as NULL, in which case the mid-end won't try to call them. I'm planning to add a parameter to decode_ui(), and if I'm going to have to touch every back-end's version of decode_ui(), I may as well ensure that most of them never need to be touched again. And obviously encode_ui() should go the same way for symmetry.
This commit is contained in:
13
netslide.c
13
netslide.c
@ -983,15 +983,6 @@ static void free_ui(game_ui *ui)
|
||||
sfree(ui);
|
||||
}
|
||||
|
||||
static char *encode_ui(const game_ui *ui)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void decode_ui(game_ui *ui, const char *encoding)
|
||||
{
|
||||
}
|
||||
|
||||
/* ----------------------------------------------------------------------
|
||||
* Process a move.
|
||||
*/
|
||||
@ -1869,8 +1860,8 @@ const struct game thegame = {
|
||||
false, NULL, NULL, /* can_format_as_text_now, text_format */
|
||||
new_ui,
|
||||
free_ui,
|
||||
encode_ui,
|
||||
decode_ui,
|
||||
NULL, /* encode_ui */
|
||||
NULL, /* decode_ui */
|
||||
NULL, /* game_request_keys */
|
||||
game_changed_state,
|
||||
current_key_label,
|
||||
|
Reference in New Issue
Block a user