X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Finit.c;h=e7cbd04a43af6d10c3515e66e5300a32469dd393;hb=f78f30b84a0345ea31b30c5bd95e338c9d9ebd4b;hp=e33a5adb8e7037d22a2fef9be46d92db6f3760ce;hpb=8d67b62445143c8f9fdde2cea730bfee49cc4271;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index e33a5adb..e7cbd04a 100644 --- a/src/init.c +++ b/src/init.c @@ -226,10 +226,18 @@ void InitBitmapPointers() graphic_info[i].bitmap = graphic_info[i].bitmaps[IMG_BITMAP_STANDARD]; } -static void InitGlobalAnimImages() +void InitImageTextures() { int i, j, k; + FreeAllImageTextures(); + + for (i = IMG_GLOBAL_BORDER_FIRST; i <= IMG_GLOBAL_BORDER_LAST; i++) + CreateImageTextures(i); + + 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,7 +249,6 @@ static void InitGlobalAnimImages() if (graphic == IMG_UNDEFINED) continue; - // create textures from images for fast GPU blitting, if possible CreateImageTextures(graphic); } } @@ -1123,6 +1130,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 +1337,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,11 +1351,10 @@ 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]; - g->step_frames = parameter[GFX_ARG_STEP_FRAMES]; g->step_delay = parameter[GFX_ARG_STEP_DELAY]; g->direction = parameter[GFX_ARG_DIRECTION]; g->position = parameter[GFX_ARG_POSITION]; @@ -1356,6 +1368,9 @@ static void set_graphic_parameters_ext(int graphic, int *parameter, /* this is only used for drawing envelope graphics */ g->draw_masked = parameter[GFX_ARG_DRAW_MASKED]; + /* used for toon animations and global animations */ + g->draw_order = parameter[GFX_ARG_DRAW_ORDER]; + /* optional graphic for cloning all graphics settings */ if (parameter[GFX_ARG_CLONE_FROM] != ARG_UNDEFINED_VALUE) g->clone_from = parameter[GFX_ARG_CLONE_FROM]; @@ -2026,8 +2041,9 @@ static void ReinitializeGraphics() print_timestamp_time("InitFontGraphicInfo"); InitGlobalAnimGraphicInfo(); /* initialize global animation config */ print_timestamp_time("InitGlobalAnimGraphicInfo"); - InitGlobalAnimImages(); /* initialize global animation images */ - print_timestamp_time("InitGlobalAnimImages"); + + InitImageTextures(); /* create textures for certain images */ + print_timestamp_time("InitImageTextures"); InitGraphicInfo_EM(); /* graphic mapping for EM engine */ print_timestamp_time("InitGraphicInfo_EM"); @@ -2043,6 +2059,7 @@ static void ReinitializeGraphics() InitGadgets(); print_timestamp_time("InitGadgets"); InitToons(); + InitGlobalAnimations(); print_timestamp_time("InitToons"); InitDoors(); print_timestamp_time("InitDoors"); @@ -5305,6 +5322,7 @@ void InitGfx() InitGfxDrawBusyAnimFunction(DrawInitAnim); InitGfxDrawGlobalAnimFunction(DrawGlobalAnim); + InitGfxDrawGlobalBorderFunction(DrawMaskedBorderToScreen); /* use copy of busy animation to prevent change while reloading artwork */ init_last = init;