X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=96eefb31e38a97845effe5bed1ed39bef1ea794a;hb=5133ddcefba9bf010336d0e36519d3f84c30f3fb;hp=ca5d16b6be699cbf992e0d0983b8297456ef53b4;hpb=fe4ae2ae6dd24628a3141093d8cddea7b57812e1;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index ca5d16b6..96eefb31 100644 --- a/src/init.c +++ b/src/init.c @@ -230,6 +230,11 @@ void InitImageTextures() { int i, j, k; + FreeAllImageTextures(); + + for (i = 0; i < MAX_NUM_TOONS; i++) + CreateImageTextures(IMG_TOON_1 + i); + for (i = 0; i < NUM_GLOBAL_ANIMS; i++) { for (j = 0; j < NUM_GLOBAL_ANIM_PARTS_ALL; j++) @@ -241,8 +246,7 @@ void InitImageTextures() if (graphic == IMG_UNDEFINED) continue; - // (re)create textures from images for fast GPU blitting, if possible - ReCreateImageTextures(graphic); + CreateImageTextures(graphic); } } } @@ -1123,6 +1127,8 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, g->scale_up_factor = 1; /* default: no scaling up */ g->tile_size = TILESIZE; /* default: standard tile size */ g->clone_from = -1; /* do not use clone graphic */ + g->init_delay_fixed = 0; + g->init_delay_random = 0; g->anim_delay_fixed = 0; g->anim_delay_random = 0; g->post_delay_fixed = 0; @@ -1328,7 +1334,11 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, if (parameter[GFX_ARG_BORDER_SIZE] != ARG_UNDEFINED_VALUE) g->border_size = parameter[GFX_ARG_BORDER_SIZE]; - /* this is only used for player "boring" and "sleeping" actions */ + /* used for global animations and player "boring" and "sleeping" actions */ + if (parameter[GFX_ARG_INIT_DELAY_FIXED] != ARG_UNDEFINED_VALUE) + g->init_delay_fixed = parameter[GFX_ARG_INIT_DELAY_FIXED]; + if (parameter[GFX_ARG_INIT_DELAY_RANDOM] != ARG_UNDEFINED_VALUE) + g->init_delay_random = parameter[GFX_ARG_INIT_DELAY_RANDOM]; if (parameter[GFX_ARG_ANIM_DELAY_FIXED] != ARG_UNDEFINED_VALUE) g->anim_delay_fixed = parameter[GFX_ARG_ANIM_DELAY_FIXED]; if (parameter[GFX_ARG_ANIM_DELAY_RANDOM] != ARG_UNDEFINED_VALUE) @@ -1338,7 +1348,7 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, if (parameter[GFX_ARG_POST_DELAY_RANDOM] != ARG_UNDEFINED_VALUE) g->post_delay_random = parameter[GFX_ARG_POST_DELAY_RANDOM]; - /* this is only used for toon animations */ + /* used for toon animations and global animations */ g->step_offset = parameter[GFX_ARG_STEP_OFFSET]; g->step_xoffset = parameter[GFX_ARG_STEP_XOFFSET]; g->step_yoffset = parameter[GFX_ARG_STEP_YOFFSET];