anigif while menu bug

This commit is contained in:
p.kosyh 2010-01-27 11:20:41 +00:00
parent ee38c06266
commit 5baa094fe7
4 changed files with 20 additions and 14 deletions

1
debian/changelog vendored
View file

@ -11,6 +11,7 @@ instead (1.1.0) unstable; urgency=low
* mouse input
* bluesteel theme
* nop cmd added in stead.lua
* anigif while menu bug
-- Peter Kosyh <p.kosyh@gmail.com> Thu, 14 Jan 2010 15:47:50 +0300

View file

@ -477,6 +477,10 @@ static void anigif_do(void *data)
{
void *v;
img_t img;
if (menu_shown || gfx_fading())
return;
game_cursor(CURSOR_CLEAR);
if (gfx_frame_gif(el_img(el_spic))) { /* scene */
@ -869,11 +873,8 @@ void game_menu_box(int show, const char *txt)
layout_t lay;
menu_shown = show;
if (show)
gfx_stop_gif(el_img(el_spic));
else
gfx_start_gif(el_img(el_spic));
el(el_menu)->drawn = 0;
if (el_layout(el_menu)) {
txt_layout_free(el_layout(el_menu));
el(el_menu)->p.p = NULL;
@ -1512,7 +1513,7 @@ static struct el *old_el = NULL;
int game_paused(void)
{
return menu_shown || use_xref || old_xref || (fade_step_nr != -1);
return menu_shown || use_xref || old_xref || gfx_fading();
}
void menu_update(struct el *elem)

View file

@ -2741,7 +2741,12 @@ void gfx_warp_cursor(int x, int y)
SDL_WarpMouse(x, y);
}
#define ALPHA_STEPS 5
int fade_step_nr = -1;
static int fade_step_nr = -1;
int gfx_fading(void)
{
return (fade_step_nr != -1);
}
static void update_gfx(void *aux)
{
@ -2774,7 +2779,7 @@ void gfx_change_screen(img_t src)
SDL_TimerID han;
fade_step_nr = 0;
han = SDL_AddTimer(60, update, src);
while (input(&ev, 1) >=0 && fade_step_nr != -1) /* just wait for change */
while (input(&ev, 1) >=0 && gfx_fading()) /* just wait for change */
game_cursor(CURSOR_ON);
SDL_RemoveTimer(han);
}

View file

@ -17,8 +17,6 @@ typedef struct {
int b;
} color_t;
extern int fade_step_nr;
#define ALIGN_LEFT 1
#define ALIGN_RIGHT 2
#define ALIGN_CENTER 4
@ -70,11 +68,12 @@ extern img_t gfx_combine(img_t src, img_t dst);
extern void gfx_set_alpha(img_t src, int alpha);
extern img_t gfx_alpha_img(img_t src, int alpha);
extern img_t gfx_scale(img_t src, float xscale, float yscale);
extern void gfx_draw_bg(img_t p, int x, int y, int width, int height);
extern void gfx_draw_from(img_t p, int x, int y, int xx, int yy, int width, int height);
extern void gfx_cursor(int *xp, int *yp, int *w, int *h);
extern void gfx_warp_cursor(int x, int y);
extern void gfx_change_screen(img_t src);
extern void gfx_draw_bg(img_t p, int x, int y, int width, int height);
extern void gfx_draw_from(img_t p, int x, int y, int xx, int yy, int width, int height);
extern void gfx_cursor(int *xp, int *yp, int *w, int *h);
extern void gfx_warp_cursor(int x, int y);
extern void gfx_change_screen(img_t src);
extern int gfx_fading(void);
extern void gfx_img_fill(img_t img, int x, int y, int w, int h, color_t col);
extern void gfx_fill(int x, int y, int w, int h, color_t col);