mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
First cut at a game timer. Yet another backend function which
indicates whether a particular game state should have the timer going (for Mines the initial indeterminate state does not have this property, and neither does a dead or won state); a midend function that optionally (on request from the game) prepends a timer to the front of the status bar text; some complicated midend timing code. It's not great. It's ugly; it's probably slightly inaccurate; it's got no provision for anyone but the game author decreeing whether a game is timed or not. But Mines can't be taken seriously without a timer, so it's a start. [originally from svn r5866]
This commit is contained in:
6
cube.c
6
cube.c
@ -1542,6 +1542,11 @@ static int game_wants_statusbar(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame cube
|
#define thegame cube
|
||||||
#endif
|
#endif
|
||||||
@ -1575,4 +1580,5 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
FALSE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
@ -802,6 +802,11 @@ static int game_wants_statusbar(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame fifteen
|
#define thegame fifteen
|
||||||
#endif
|
#endif
|
||||||
@ -835,4 +840,5 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
FALSE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
6
gtk.c
6
gtk.c
@ -98,10 +98,14 @@ void frontend_default_colour(frontend *fe, float *output)
|
|||||||
|
|
||||||
void status_bar(frontend *fe, char *text)
|
void status_bar(frontend *fe, char *text)
|
||||||
{
|
{
|
||||||
|
char *rewritten;
|
||||||
|
|
||||||
assert(fe->statusbar);
|
assert(fe->statusbar);
|
||||||
|
|
||||||
|
rewritten = midend_rewrite_statusbar(fe->me, text);
|
||||||
gtk_statusbar_pop(GTK_STATUSBAR(fe->statusbar), fe->statusctx);
|
gtk_statusbar_pop(GTK_STATUSBAR(fe->statusbar), fe->statusctx);
|
||||||
gtk_statusbar_push(GTK_STATUSBAR(fe->statusbar), fe->statusctx, text);
|
gtk_statusbar_push(GTK_STATUSBAR(fe->statusbar), fe->statusctx, rewritten);
|
||||||
|
sfree(rewritten);
|
||||||
}
|
}
|
||||||
|
|
||||||
void start_draw(frontend *fe)
|
void start_draw(frontend *fe)
|
||||||
|
74
midend.c
74
midend.c
@ -43,6 +43,10 @@ struct midend_data {
|
|||||||
float flash_time, flash_pos;
|
float flash_time, flash_pos;
|
||||||
int dir;
|
int dir;
|
||||||
|
|
||||||
|
int timing;
|
||||||
|
float elapsed;
|
||||||
|
char *laststatus;
|
||||||
|
|
||||||
int pressed_mouse_button;
|
int pressed_mouse_button;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -83,6 +87,9 @@ midend_data *midend_new(frontend *fe, const game *ourgame)
|
|||||||
me->dir = 0;
|
me->dir = 0;
|
||||||
me->ui = NULL;
|
me->ui = NULL;
|
||||||
me->pressed_mouse_button = 0;
|
me->pressed_mouse_button = 0;
|
||||||
|
me->laststatus = NULL;
|
||||||
|
me->timing = FALSE;
|
||||||
|
me->elapsed = 0.0F;
|
||||||
|
|
||||||
sfree(randseed);
|
sfree(randseed);
|
||||||
|
|
||||||
@ -100,6 +107,7 @@ void midend_free(midend_data *me)
|
|||||||
me->ourgame->free_params(me->params);
|
me->ourgame->free_params(me->params);
|
||||||
if (me->curparams)
|
if (me->curparams)
|
||||||
me->ourgame->free_params(me->curparams);
|
me->ourgame->free_params(me->curparams);
|
||||||
|
sfree(me->laststatus);
|
||||||
sfree(me);
|
sfree(me);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,6 +122,16 @@ void midend_set_params(midend_data *me, game_params *params)
|
|||||||
me->params = me->ourgame->dup_params(params);
|
me->params = me->ourgame->dup_params(params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void midend_set_timer(midend_data *me)
|
||||||
|
{
|
||||||
|
me->timing = (me->ourgame->is_timed &&
|
||||||
|
me->ourgame->timing_state(me->states[me->statepos-1].state));
|
||||||
|
if (me->timing || me->flash_time || me->anim_time)
|
||||||
|
activate_timer(me->frontend);
|
||||||
|
else
|
||||||
|
deactivate_timer(me->frontend);
|
||||||
|
}
|
||||||
|
|
||||||
void midend_new_game(midend_data *me)
|
void midend_new_game(midend_data *me)
|
||||||
{
|
{
|
||||||
while (me->nstates > 0)
|
while (me->nstates > 0)
|
||||||
@ -171,6 +189,8 @@ void midend_new_game(midend_data *me)
|
|||||||
me->nstates++;
|
me->nstates++;
|
||||||
me->statepos = 1;
|
me->statepos = 1;
|
||||||
me->drawstate = me->ourgame->new_drawstate(me->states[0].state);
|
me->drawstate = me->ourgame->new_drawstate(me->states[0].state);
|
||||||
|
me->elapsed = 0.0F;
|
||||||
|
midend_set_timer(me);
|
||||||
if (me->ui)
|
if (me->ui)
|
||||||
me->ourgame->free_ui(me->ui);
|
me->ourgame->free_ui(me->ui);
|
||||||
me->ui = me->ourgame->new_ui(me->states[0].state);
|
me->ui = me->ourgame->new_ui(me->states[0].state);
|
||||||
@ -227,10 +247,7 @@ static void midend_finish_move(midend_data *me)
|
|||||||
me->anim_pos = me->anim_time = 0;
|
me->anim_pos = me->anim_time = 0;
|
||||||
me->dir = 0;
|
me->dir = 0;
|
||||||
|
|
||||||
if (me->flash_time == 0 && me->anim_time == 0)
|
midend_set_timer(me);
|
||||||
deactivate_timer(me->frontend);
|
|
||||||
else
|
|
||||||
activate_timer(me->frontend);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void midend_stop_anim(midend_data *me)
|
static void midend_stop_anim(midend_data *me)
|
||||||
@ -266,7 +283,7 @@ void midend_restart_game(midend_data *me)
|
|||||||
me->anim_time = 0.0;
|
me->anim_time = 0.0;
|
||||||
midend_finish_move(me);
|
midend_finish_move(me);
|
||||||
midend_redraw(me);
|
midend_redraw(me);
|
||||||
activate_timer(me->frontend);
|
midend_set_timer(me);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int midend_really_process_key(midend_data *me, int x, int y, int button)
|
static int midend_really_process_key(midend_data *me, int x, int y, int button)
|
||||||
@ -349,7 +366,7 @@ static int midend_really_process_key(midend_data *me, int x, int y, int button)
|
|||||||
|
|
||||||
midend_redraw(me);
|
midend_redraw(me);
|
||||||
|
|
||||||
activate_timer(me->frontend);
|
midend_set_timer(me);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
@ -479,13 +496,22 @@ void midend_timer(midend_data *me, float tplus)
|
|||||||
if (me->anim_time > 0)
|
if (me->anim_time > 0)
|
||||||
midend_finish_move(me);
|
midend_finish_move(me);
|
||||||
}
|
}
|
||||||
|
|
||||||
me->flash_pos += tplus;
|
me->flash_pos += tplus;
|
||||||
if (me->flash_pos >= me->flash_time || me->flash_time == 0) {
|
if (me->flash_pos >= me->flash_time || me->flash_time == 0) {
|
||||||
me->flash_pos = me->flash_time = 0;
|
me->flash_pos = me->flash_time = 0;
|
||||||
}
|
}
|
||||||
if (me->flash_time == 0 && me->anim_time == 0)
|
|
||||||
deactivate_timer(me->frontend);
|
|
||||||
midend_redraw(me);
|
midend_redraw(me);
|
||||||
|
|
||||||
|
if (me->timing) {
|
||||||
|
float oldelapsed = me->elapsed;
|
||||||
|
me->elapsed += tplus;
|
||||||
|
if ((int)oldelapsed != (int)me->elapsed)
|
||||||
|
status_bar(me->frontend, me->laststatus ? me->laststatus : "");
|
||||||
|
}
|
||||||
|
|
||||||
|
midend_set_timer(me);
|
||||||
}
|
}
|
||||||
|
|
||||||
float *midend_colours(midend_data *me, int *ncolours)
|
float *midend_colours(midend_data *me, int *ncolours)
|
||||||
@ -866,6 +892,36 @@ char *midend_solve(midend_data *me)
|
|||||||
me->anim_time = 0.0;
|
me->anim_time = 0.0;
|
||||||
midend_finish_move(me);
|
midend_finish_move(me);
|
||||||
midend_redraw(me);
|
midend_redraw(me);
|
||||||
activate_timer(me->frontend);
|
midend_set_timer(me);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
char *midend_rewrite_statusbar(midend_data *me, char *text)
|
||||||
|
{
|
||||||
|
/*
|
||||||
|
* An important special case is that we are occasionally called
|
||||||
|
* with our own laststatus, to update the timer.
|
||||||
|
*/
|
||||||
|
if (me->laststatus != text) {
|
||||||
|
sfree(me->laststatus);
|
||||||
|
me->laststatus = dupstr(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (me->ourgame->is_timed) {
|
||||||
|
char timebuf[100], *ret;
|
||||||
|
int min, sec;
|
||||||
|
|
||||||
|
sec = me->elapsed;
|
||||||
|
min = sec / 60;
|
||||||
|
sec %= 60;
|
||||||
|
sprintf(timebuf, "[%d:%02d] ", min, sec);
|
||||||
|
|
||||||
|
ret = snewn(strlen(timebuf) + strlen(text) + 1, char);
|
||||||
|
strcpy(ret, timebuf);
|
||||||
|
strcat(ret, text);
|
||||||
|
return ret;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return dupstr(text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
10
mines.c
10
mines.c
@ -10,8 +10,6 @@
|
|||||||
* That hook can talk to the game_ui and set the cheated flag,
|
* That hook can talk to the game_ui and set the cheated flag,
|
||||||
* and then make_move can avoid setting the `won' flag after that.
|
* and then make_move can avoid setting the `won' flag after that.
|
||||||
*
|
*
|
||||||
* - timer
|
|
||||||
*
|
|
||||||
* - question marks (arrgh, preferences?)
|
* - question marks (arrgh, preferences?)
|
||||||
*
|
*
|
||||||
* - sensible parameter constraints
|
* - sensible parameter constraints
|
||||||
@ -2700,6 +2698,13 @@ static int game_wants_statusbar(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
if (state->dead || state->won || !state->layout->mines)
|
||||||
|
return FALSE;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame mines
|
#define thegame mines
|
||||||
#endif
|
#endif
|
||||||
@ -2733,4 +2738,5 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
TRUE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
6
net.c
6
net.c
@ -2568,6 +2568,11 @@ static int game_wants_statusbar(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame net
|
#define thegame net
|
||||||
#endif
|
#endif
|
||||||
@ -2601,4 +2606,5 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
FALSE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
@ -1725,6 +1725,11 @@ static int game_wants_statusbar(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame netslide
|
#define thegame netslide
|
||||||
#endif
|
#endif
|
||||||
@ -1758,4 +1763,5 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
FALSE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
@ -215,6 +215,11 @@ static int game_wants_statusbar(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame nullgame
|
#define thegame nullgame
|
||||||
#endif
|
#endif
|
||||||
@ -248,4 +253,5 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
FALSE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
10
osx.m
10
osx.m
@ -383,7 +383,7 @@ struct frontend {
|
|||||||
- (void)keyDown:(NSEvent *)ev;
|
- (void)keyDown:(NSEvent *)ev;
|
||||||
- (void)activateTimer;
|
- (void)activateTimer;
|
||||||
- (void)deactivateTimer;
|
- (void)deactivateTimer;
|
||||||
- (void)setStatusLine:(NSString *)text;
|
- (void)setStatusLine:(char *)text;
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation MyImageView
|
@implementation MyImageView
|
||||||
@ -1131,9 +1131,11 @@ struct frontend {
|
|||||||
[self sheetEndWithStatus:NO];
|
[self sheetEndWithStatus:NO];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)setStatusLine:(NSString *)text
|
- (void)setStatusLine:(char *)text
|
||||||
{
|
{
|
||||||
[[status cell] setTitle:text];
|
char *rewritten = midend_rewrite_statusbar(me, text);
|
||||||
|
[[status cell] setTitle:[NSString stringWithCString:rewritten]];
|
||||||
|
sfree(rewritten);
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@ -1267,7 +1269,7 @@ void activate_timer(frontend *fe)
|
|||||||
|
|
||||||
void status_bar(frontend *fe, char *text)
|
void status_bar(frontend *fe, char *text)
|
||||||
{
|
{
|
||||||
[fe->window setStatusLine:[NSString stringWithCString:text]];
|
[fe->window setStatusLine:text];
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ----------------------------------------------------------------------
|
/* ----------------------------------------------------------------------
|
||||||
|
@ -1105,6 +1105,11 @@ static int game_wants_statusbar(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame pattern
|
#define thegame pattern
|
||||||
#endif
|
#endif
|
||||||
@ -1138,6 +1143,7 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
FALSE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef STANDALONE_SOLVER
|
#ifdef STANDALONE_SOLVER
|
||||||
|
@ -145,6 +145,7 @@ char *midend_game_id(midend_data *me, char *id);
|
|||||||
char *midend_text_format(midend_data *me);
|
char *midend_text_format(midend_data *me);
|
||||||
char *midend_solve(midend_data *me);
|
char *midend_solve(midend_data *me);
|
||||||
void midend_supersede_game_desc(midend_data *me, char *desc);
|
void midend_supersede_game_desc(midend_data *me, char *desc);
|
||||||
|
char *midend_rewrite_statusbar(midend_data *me, char *text);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* malloc.c
|
* malloc.c
|
||||||
@ -239,6 +240,8 @@ struct game {
|
|||||||
float (*flash_length)(game_state *oldstate, game_state *newstate, int dir,
|
float (*flash_length)(game_state *oldstate, game_state *newstate, int dir,
|
||||||
game_ui *ui);
|
game_ui *ui);
|
||||||
int (*wants_statusbar)(void);
|
int (*wants_statusbar)(void);
|
||||||
|
int is_timed;
|
||||||
|
int (*timing_state)(game_state *state);
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
6
rect.c
6
rect.c
@ -2515,6 +2515,11 @@ static int game_wants_statusbar(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame rect
|
#define thegame rect
|
||||||
#endif
|
#endif
|
||||||
@ -2548,4 +2553,5 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
FALSE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
@ -961,6 +961,11 @@ static int game_wants_statusbar(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame sixteen
|
#define thegame sixteen
|
||||||
#endif
|
#endif
|
||||||
@ -994,4 +999,5 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
FALSE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
6
solo.c
6
solo.c
@ -2140,6 +2140,11 @@ static int game_wants_statusbar(void)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame solo
|
#define thegame solo
|
||||||
#endif
|
#endif
|
||||||
@ -2173,6 +2178,7 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
FALSE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef STANDALONE_SOLVER
|
#ifdef STANDALONE_SOLVER
|
||||||
|
@ -1111,6 +1111,11 @@ static int game_wants_statusbar(void)
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int game_timing_state(game_state *state)
|
||||||
|
{
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef COMBINED
|
#ifdef COMBINED
|
||||||
#define thegame twiddle
|
#define thegame twiddle
|
||||||
#endif
|
#endif
|
||||||
@ -1144,4 +1149,5 @@ const struct game thegame = {
|
|||||||
game_anim_length,
|
game_anim_length,
|
||||||
game_flash_length,
|
game_flash_length,
|
||||||
game_wants_statusbar,
|
game_wants_statusbar,
|
||||||
|
FALSE, game_timing_state,
|
||||||
};
|
};
|
||||||
|
12
windows.c
12
windows.c
@ -118,6 +118,7 @@ struct frontend {
|
|||||||
HFONT cfgfont;
|
HFONT cfgfont;
|
||||||
char *help_path;
|
char *help_path;
|
||||||
int help_has_contents;
|
int help_has_contents;
|
||||||
|
char *laststatus;
|
||||||
};
|
};
|
||||||
|
|
||||||
void fatal(char *fmt, ...)
|
void fatal(char *fmt, ...)
|
||||||
@ -144,7 +145,14 @@ void get_random_seed(void **randseed, int *randseedsize)
|
|||||||
|
|
||||||
void status_bar(frontend *fe, char *text)
|
void status_bar(frontend *fe, char *text)
|
||||||
{
|
{
|
||||||
SetWindowText(fe->statusbar, text);
|
char *rewritten = midend_rewrite_statusbar(fe->me, text);
|
||||||
|
if (!fe->laststatus || strcmp(rewritten, fe->laststatus)) {
|
||||||
|
SetWindowText(fe->statusbar, rewritten);
|
||||||
|
sfree(fe->laststatus);
|
||||||
|
fe->laststatus = rewritten;
|
||||||
|
} else {
|
||||||
|
sfree(rewritten);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void frontend_default_colour(frontend *fe, float *output)
|
void frontend_default_colour(frontend *fe, float *output)
|
||||||
@ -437,6 +445,8 @@ static frontend *new_window(HINSTANCE inst, char *game_id, char **error)
|
|||||||
fe->fonts = NULL;
|
fe->fonts = NULL;
|
||||||
fe->nfonts = fe->fontsize = 0;
|
fe->nfonts = fe->fontsize = 0;
|
||||||
|
|
||||||
|
fe->laststatus = NULL;
|
||||||
|
|
||||||
{
|
{
|
||||||
int i, ncolours;
|
int i, ncolours;
|
||||||
float *colours;
|
float *colours;
|
||||||
|
Reference in New Issue
Block a user