anigif while menu bug
This commit is contained in:
parent
ee38c06266
commit
5baa094fe7
1
debian/changelog
vendored
1
debian/changelog
vendored
|
@ -11,6 +11,7 @@ instead (1.1.0) unstable; urgency=low
|
||||||
* mouse input
|
* mouse input
|
||||||
* bluesteel theme
|
* bluesteel theme
|
||||||
* nop cmd added in stead.lua
|
* nop cmd added in stead.lua
|
||||||
|
* anigif while menu bug
|
||||||
|
|
||||||
-- Peter Kosyh <p.kosyh@gmail.com> Thu, 14 Jan 2010 15:47:50 +0300
|
-- Peter Kosyh <p.kosyh@gmail.com> Thu, 14 Jan 2010 15:47:50 +0300
|
||||||
|
|
||||||
|
|
|
@ -477,6 +477,10 @@ static void anigif_do(void *data)
|
||||||
{
|
{
|
||||||
void *v;
|
void *v;
|
||||||
img_t img;
|
img_t img;
|
||||||
|
|
||||||
|
if (menu_shown || gfx_fading())
|
||||||
|
return;
|
||||||
|
|
||||||
game_cursor(CURSOR_CLEAR);
|
game_cursor(CURSOR_CLEAR);
|
||||||
|
|
||||||
if (gfx_frame_gif(el_img(el_spic))) { /* scene */
|
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;
|
layout_t lay;
|
||||||
|
|
||||||
menu_shown = show;
|
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;
|
el(el_menu)->drawn = 0;
|
||||||
|
|
||||||
if (el_layout(el_menu)) {
|
if (el_layout(el_menu)) {
|
||||||
txt_layout_free(el_layout(el_menu));
|
txt_layout_free(el_layout(el_menu));
|
||||||
el(el_menu)->p.p = NULL;
|
el(el_menu)->p.p = NULL;
|
||||||
|
@ -1512,7 +1513,7 @@ static struct el *old_el = NULL;
|
||||||
|
|
||||||
int game_paused(void)
|
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)
|
void menu_update(struct el *elem)
|
||||||
|
|
|
@ -2741,7 +2741,12 @@ void gfx_warp_cursor(int x, int y)
|
||||||
SDL_WarpMouse(x, y);
|
SDL_WarpMouse(x, y);
|
||||||
}
|
}
|
||||||
#define ALPHA_STEPS 5
|
#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)
|
static void update_gfx(void *aux)
|
||||||
{
|
{
|
||||||
|
@ -2774,7 +2779,7 @@ void gfx_change_screen(img_t src)
|
||||||
SDL_TimerID han;
|
SDL_TimerID han;
|
||||||
fade_step_nr = 0;
|
fade_step_nr = 0;
|
||||||
han = SDL_AddTimer(60, update, src);
|
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);
|
game_cursor(CURSOR_ON);
|
||||||
SDL_RemoveTimer(han);
|
SDL_RemoveTimer(han);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,6 @@ typedef struct {
|
||||||
int b;
|
int b;
|
||||||
} color_t;
|
} color_t;
|
||||||
|
|
||||||
extern int fade_step_nr;
|
|
||||||
|
|
||||||
#define ALIGN_LEFT 1
|
#define ALIGN_LEFT 1
|
||||||
#define ALIGN_RIGHT 2
|
#define ALIGN_RIGHT 2
|
||||||
#define ALIGN_CENTER 4
|
#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 void gfx_set_alpha(img_t src, int alpha);
|
||||||
extern img_t gfx_alpha_img(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 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_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_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_cursor(int *xp, int *yp, int *w, int *h);
|
||||||
extern void gfx_warp_cursor(int x, int y);
|
extern void gfx_warp_cursor(int x, int y);
|
||||||
extern void gfx_change_screen(img_t src);
|
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_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);
|
extern void gfx_fill(int x, int y, int w, int h, color_t col);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue