mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 23:51:29 -07:00
Require games to accept new_ui(NULL) if they have preferences.
This will be necessary in the next commit, so that the midend can make a game_ui out of nothing in order to store preferences in it. The only game actually affected by this requirement is Pearl, which has a preference (GUI style) and also allocates space based on the game_state's grid size to store the coordinates of a path being dragged, so if there is no game_state, it can't do the latter - which is OK, because it also won't be expected to.
This commit is contained in:
3
pearl.c
3
pearl.c
@ -1897,10 +1897,9 @@ static void legacy_prefs_override(struct game_ui *ui_out)
|
||||
static game_ui *new_ui(const game_state *state)
|
||||
{
|
||||
game_ui *ui = snew(game_ui);
|
||||
int sz = state->shared->sz;
|
||||
|
||||
ui->ndragcoords = -1;
|
||||
ui->dragcoords = snewn(sz, int);
|
||||
ui->dragcoords = state ? snewn(state->shared->sz, int) : NULL;
|
||||
ui->cursor_active = getenv_bool("PUZZLES_SHOW_CURSOR", false);
|
||||
ui->curx = ui->cury = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user