X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Finit.c;h=6db9d2463deae2799248ff3d5cc1058540cf8da5;hb=e093d2ffd9547d556207818c38f71d5afa455ad0;hp=86b4ecaec8e64acd0d09510a9fcb2a485dea11a5;hpb=10b9382e55f3a8cd0a15644cf1ed6e1451654a76;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 86b4ecae..6db9d246 100644 --- a/src/init.c +++ b/src/init.c @@ -24,6 +24,7 @@ #include "network.h" #include "netserv.h" #include "cartoons.h" +#include "config.h" #include "conf_e2g.c" /* include auto-generated data structure definitions */ #include "conf_esg.c" /* include auto-generated data structure definitions */ @@ -291,8 +292,13 @@ void InitFontGraphicInfo() /* ---------- initialize font graphic definitions ---------- */ /* always start with reliable default values (normal font graphics) */ +#if 1 + for (i=0; i < NUM_FONTS; i++) + font_info[i].graphic = IMG_FONT_INITIAL_1; +#else for (i=0; i < NUM_FONTS; i++) font_info[i].graphic = FONT_INITIAL_1; +#endif /* initialize normal font/graphic mapping from static configuration */ for (i=0; font_to_graphic[i].font_nr > -1; i++) @@ -554,22 +560,24 @@ void InitElementGraphicInfo() { for (act=0; act 0 && graphic_info[graphic].bitmap == NULL) element_info[i].graphic[act] = -1; - if (graphic_info[element_info[i].crumbled[act]].bitmap == NULL) + graphic = element_info[i].crumbled[act]; + if (graphic > 0 && graphic_info[graphic].bitmap == NULL) element_info[i].crumbled[act] = -1; for (dir=0; dir 0 && graphic_info[graphic].bitmap == NULL) element_info[i].direction_graphic[act][dir] = -1; graphic = element_info[i].direction_crumbled[act][dir]; - if (graphic_info[graphic].bitmap == NULL) + if (graphic > 0 && graphic_info[graphic].bitmap == NULL) element_info[i].direction_crumbled[act][dir] = -1; } } @@ -607,6 +615,10 @@ void InitElementGraphicInfo() boolean act_remove = ((IS_DIGGABLE(i) && act == ACTION_DIGGING) || (IS_SNAPPABLE(i) && act == ACTION_SNAPPING) || (IS_COLLECTIBLE(i) && act == ACTION_COLLECTING)); + boolean act_turning = (act == ACTION_TURNING_FROM_LEFT || + act == ACTION_TURNING_FROM_RIGHT || + act == ACTION_TURNING_FROM_UP || + act == ACTION_TURNING_FROM_DOWN); /* generic default action graphic (defined by "[default]" directive) */ int default_action_graphic = element_info[EL_DEFAULT].graphic[act]; @@ -640,10 +652,16 @@ void InitElementGraphicInfo() /* no graphic for current action -- use default direction graphic */ if (default_action_direction_graphic == -1) default_action_direction_graphic = - (act_remove ? IMG_EMPTY : default_direction_graphic[dir]); + (act_remove ? IMG_EMPTY : + act_turning ? + element_info[i].direction_graphic[ACTION_TURNING][dir] : + default_direction_graphic[dir]); if (default_action_direction_crumbled == -1) default_action_direction_crumbled = - (act_remove ? IMG_EMPTY : default_direction_crumbled[dir]); + (act_remove ? IMG_EMPTY : + act_turning ? + element_info[i].direction_crumbled[ACTION_TURNING][dir] : + default_direction_crumbled[dir]); if (element_info[i].direction_graphic[act][dir] == -1) element_info[i].direction_graphic[act][dir] = @@ -656,12 +674,44 @@ void InitElementGraphicInfo() /* no graphic for this specific action -- use default action graphic */ if (element_info[i].graphic[act] == -1) element_info[i].graphic[act] = - (act_remove ? IMG_EMPTY : default_action_graphic); + (act_remove ? IMG_EMPTY : + act_turning ? element_info[i].graphic[ACTION_TURNING] : + default_action_graphic); if (element_info[i].crumbled[act] == -1) element_info[i].crumbled[act] = - (act_remove ? IMG_EMPTY : default_action_crumbled); + (act_remove ? IMG_EMPTY : + act_turning ? element_info[i].crumbled[ACTION_TURNING] : + default_action_crumbled); + } + } + +#if 1 + /* set animation mode to "none" for each graphic with only 1 frame */ + for (i=0; i VERSION_IDENT(2,0,1))); + engine_version > VERSION_IDENT(2,0,1,0))); } -#if 0 - /* dynamically adjust element properties according to game engine version */ -#if 0 - if (engine_version < RELEASE_IDENT(2,2,0,7)) -#endif +#if 1 + /* set default push delay values (corrected since version 3.0.7-1) */ + if (engine_version < VERSION_IDENT(3,0,7,1)) { - for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) - { - int element = EL_CUSTOM_START + i; + game.default_push_delay_fixed = 2; + game.default_push_delay_random = 8; + } + else + { + game.default_push_delay_fixed = 8; + game.default_push_delay_random = 8; + } - element_info[element].push_delay_fixed = 2; - element_info[element].push_delay_random = 8; - } + /* set uninitialized push delay values of custom elements in older levels */ + for (i=0; i < NUM_CUSTOM_ELEMENTS; i++) + { + int element = EL_CUSTOM_START + i; + + if (element_info[element].push_delay_fixed == -1) + element_info[element].push_delay_fixed = game.default_push_delay_fixed; + if (element_info[element].push_delay_random == -1) + element_info[element].push_delay_random = game.default_push_delay_random; } #endif } @@ -3205,8 +3296,8 @@ void InitGfx() InitFontGraphicInfo(); - DrawInitText(WINDOW_TITLE_STRING, 20, FC_YELLOW); - DrawInitText(WINDOW_SUBTITLE_STRING, 50, FC_RED); + DrawInitText(getProgramInitString(), 20, FC_YELLOW); + DrawInitText(PROGRAM_COPYRIGHT_STRING, 50, FC_RED); DrawInitText("Loading graphics:", 120, FC_GREEN);