X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=972aea39f0a80c02f8fd84cee894a88694452b4a;hb=39af00f43cf5c4cea174d0e90633877df08a2f7c;hp=86b4ecaec8e64acd0d09510a9fcb2a485dea11a5;hpb=10b9382e55f3a8cd0a15644cf1ed6e1451654a76;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index 86b4ecae..972aea39 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; } } @@ -663,6 +671,34 @@ void InitElementGraphicInfo() } } +#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 +3282,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);