X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=bd79cc787135c9e05e7e9692620ffc1fd31a8822;hb=7cd6d9ecca4ccd4927eddc994b616569ef23b231;hp=db21b860d7917146073a284dc62f96d5433837b8;hpb=2455ce294b0108d3a848467ea9d30d049527a545;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index db21b860..bd79cc78 100644 --- a/src/init.c +++ b/src/init.c @@ -26,8 +26,20 @@ #include "cartoons.h" #include "config.h" +#include "conf_e2g.c" /* include auto-generated data structure definitions */ + + static char *image_filename[NUM_PICTURES] = { +#if 0 + "RocksScreen.pcx", + "RocksDoor.pcx", + "RocksToons.pcx", + "RocksFontBig.pcx", + "RocksFontSmall.pcx", + "RocksFontMedium.pcx", + "RocksFontEM.pcx" +#else "RocksScreen.pcx", "RocksElements.pcx", "RocksDoor.pcx", @@ -40,6 +52,7 @@ static char *image_filename[NUM_PICTURES] = "RocksFontSmall.pcx", "RocksFontMedium.pcx", "RocksFontEM.pcx" +#endif }; static void InitSetup(void); @@ -106,9 +119,9 @@ void OpenAll(void) InitLevelInfo(); InitLevelArtworkInfo(); - InitGadgets(); /* needs to know number of level series */ InitImages(); /* needs to know current level directory */ InitSound(); /* needs to know current level directory */ + InitGadgets(); /* needs images + number of level series */ InitGfxBackground(); InitToons(); @@ -211,6 +224,8 @@ static void InitTileClipmasks() unsigned long clip_gc_valuemask; #if defined(TARGET_X11_NATIVE) + +#if 0 GC copy_clipmask_gc; static struct @@ -264,6 +279,8 @@ static void InitTileClipmasks() { GFX2_SHIELD_ACTIVE, 3 }, { -1, 0 } }; +#endif + #endif /* TARGET_X11_NATIVE */ #endif /* TARGET_X11 */ @@ -298,6 +315,7 @@ static void InitTileClipmasks() #if defined(TARGET_X11_NATIVE) +#if 0 /* create graphic context structures needed for clipping */ clip_gc_values.graphics_exposures = False; clip_gc_valuemask = GCGraphicsExposures; @@ -329,6 +347,7 @@ static void InitTileClipmasks() } XFreeGC(display, copy_clipmask_gc); +#endif #endif /* TARGET_X11_NATIVE */ #endif /* TARGET_X11 */ @@ -556,8 +575,7 @@ void InitGadgets() void InitElementInfo() { - int i, j; - +#if 0 static struct { int element; @@ -919,21 +937,33 @@ void InitElementInfo() -1, -1 } }; +#endif + + int i, act, dir; - /* always start with reliable default values */ + /* set values to -1 to identify later as "uninitialized" values */ for(i=0; i -1) @@ -975,6 +1007,73 @@ void InitElementInfo() element_info[element].has_direction_graphic[GFX_ACTION_DEFAULT] = TRUE; i++; } +#else + + i = 0; + while (element_to_graphic[i].element > -1) + { + int element = element_to_graphic[i].element; + int direction = element_to_graphic[i].direction; + int action = element_to_graphic[i].action; + int graphic = element_to_graphic[i].graphic; + + if (action > -1) + action = graphics_action_mapping[action]; + else + action = GFX_ACTION_DEFAULT; + + if (direction > -1) + { + direction = MV_DIR_BIT(direction); + + element_info[element].direction_graphic[action][direction] = graphic; + } + else + element_info[element].graphic[action] = graphic; + + i++; + } + + /* now set all '-1' values to element specific default values */ + for(i=0; i 1) + new_graphic_info[i].anim_mode = ANIM_LOOP; else - new_graphic_info[i].anim_mode = ANIM_NORMAL; + new_graphic_info[i].anim_mode = ANIM_NONE; - /* additionally, animation can be either pingpong or pingpong2 layout */ - if (parameter[GFX_ARG_PINGPONG]) - new_graphic_info[i].anim_mode |= ANIM_PINGPONG; - else if (parameter[GFX_ARG_PINGPONG2]) - new_graphic_info[i].anim_mode |= ANIM_PINGPONG2; + /* set additional flag to play animation frames in reverse order */ + if (parameter[GFX_ARG_MODE_REVERSE]) + new_graphic_info[i].anim_mode |= ANIM_REVERSE; /* animation synchronized with global frame counter, not move position */ new_graphic_info[i].anim_global_sync = parameter[GFX_ARG_GLOBAL_SYNC]; - - new_graphic_info[i].anim_vertical = parameter[GFX_ARG_VERTICAL]; } #if 0