graphics everywheresvn diff | less! anigif everywheresvn diff | less! :)

This commit is contained in:
p.kosyh 2009-10-04 12:46:00 +00:00
parent f5f3e02331
commit 528a6606e6
3 changed files with 28 additions and 8 deletions

View file

@ -459,24 +459,40 @@ static void anigif_do(void *data)
{
void *v;
img_t img;
if (gfx_frame_gif(el_img(el_spic))) {
if (gfx_frame_gif(el_img(el_spic))) { /* scene */
game_cursor(CURSOR_ON);
gfx_update_gif(el_img(el_spic));
}
for (v = NULL; (img = txt_layout_images(txt_box_layout(el_box(el_scene)), &v)); ) { /* scene */
if ((img != el_img(el_spic)) && gfx_frame_gif(img)) {
game_cursor(CURSOR_ON);
gfx_update_gif(img);
}
}
for (v = NULL; (img = txt_layout_image(txt_box_layout(el_box(el_inv)), &v)); ) {
for (v = NULL; (img = txt_layout_images(txt_box_layout(el_box(el_inv)), &v)); ) { /* inv */
if (gfx_frame_gif(img)) {
game_cursor(CURSOR_ON);
gfx_update_gif(img);
}
}
for (v = NULL; (img = txt_layout_image(txt_box_layout(el_box(el_scene)), &v)); ) {
if ((img != el_img(el_spic)) && gfx_frame_gif(img)) {
for (v = NULL; (img = txt_layout_images(el_layout(el_title), &v)); ) { /* title */
if (gfx_frame_gif(img)) {
game_cursor(CURSOR_ON);
gfx_update_gif(img);
}
}
for (v = NULL; (img = txt_layout_images(el_layout(el_ways), &v)); ) { /* ways */
if (gfx_frame_gif(img)) {
game_cursor(CURSOR_ON);
gfx_update_gif(img);
}
}
}
int counter_fn(int interval, void *p)
@ -645,10 +661,10 @@ int el_clear(int n)
o->drawn = 0;
game_clear(x, y, w, h);
if (o->type == elt_box) {
for (v = NULL; (img = txt_layout_image(txt_box_layout(el_box(n)), &v)); )
for (v = NULL; (img = txt_layout_images(txt_box_layout(el_box(n)), &v)); )
gfx_dispose_gif(img);
} else if (o->type == elt_layout) {
for (v = NULL; (img = txt_layout_image(el_layout(n), &v)); )
for (v = NULL; (img = txt_layout_images(el_layout(n), &v)); )
gfx_dispose_gif(img);
}
return 1;

View file

@ -1173,10 +1173,14 @@ struct image *_layout_lookup_image(struct layout *layout, const char *name)
return NULL;
}
img_t txt_layout_image(layout_t lay, void **v)
img_t txt_layout_images(layout_t lay, void **v)
{
struct image **g = (struct image **)v;
struct layout *layout = (struct layout *)lay;
if (!layout)
return NULL;
if (!*g)
*g = layout->images;
else

View file

@ -83,7 +83,7 @@ extern void txt_layout_link_color(layout_t lay, color_t link);
extern void txt_layout_active_color(layout_t lay, color_t link);
extern void txt_layout_link_style(layout_t lay, int style);
extern int txt_layout_add_img(layout_t lay, const char *name, img_t img);
extern img_t txt_layout_image(layout_t lay, void **v); /* enumerator */
extern img_t txt_layout_images(layout_t lay, void **v); /* enumerator */
extern void txt_layout_size(layout_t lay, int *w, int *h);
extern textbox_t txt_box(int w, int h);
extern layout_t txt_box_layout(textbox_t tbox);