X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Finit.c;h=32b2cb8e3d6504c2f426e26ba65b554695b3c855;hb=cd9add1d9479d1938d05ca9df4f31c3f99bd5f3e;hp=b10b8ec9fa1aff18f4b6caaa28dd2e2380c65fd8;hpb=b1aea9dea523d02f9539d7d85761861092ad4a83;p=rocksndiamonds.git diff --git a/src/init.c b/src/init.c index b10b8ec9..32b2cb8e 100644 --- a/src/init.c +++ b/src/init.c @@ -26,6 +26,9 @@ #include "cartoons.h" #include "config.h" +#include "conf_e2g.c" /* include auto-generated data structure definitions */ + + static char *image_filename[NUM_PICTURES] = { "RocksScreen.pcx", @@ -556,8 +559,7 @@ void InitGadgets() void InitElementInfo() { - int i, j; - +#if 0 static struct { int element; @@ -575,7 +577,6 @@ void InitElementInfo() { EL_EXIT_OPENING, GFX_AUSGANG_ACT }, { EL_EXIT_OPEN, GFX_AUSGANG_AUF }, { EL_SP_EXIT_OPEN, GFX_SP_EXIT }, - { EL_PLAYER, GFX_SPIELFIGUR }, { EL_PLAYER1, GFX_SPIELER1 }, { EL_PLAYER2, GFX_SPIELER2 }, { EL_PLAYER3, GFX_SPIELER3 }, @@ -678,10 +679,10 @@ void InitElementInfo() { EL_BD_MAGIC_WALL_EMPTYING, GFX_MAGIC_WALL_BD_EMPTY }, { EL_BD_MAGIC_WALL_FULL, GFX_MAGIC_WALL_BD_FULL }, { EL_BD_MAGIC_WALL_DEAD, GFX_MAGIC_WALL_BD_DEAD }, - { EL_DYNABOMB_ACTIVE_1, GFX_DYNABOMB }, - { EL_DYNABOMB_ACTIVE_2, GFX_DYNABOMB }, - { EL_DYNABOMB_ACTIVE_3, GFX_DYNABOMB }, - { EL_DYNABOMB_ACTIVE_4, GFX_DYNABOMB }, + { EL_DYNABOMB_PLAYER1_ACTIVE, GFX_DYNABOMB }, + { EL_DYNABOMB_PLAYER2_ACTIVE, GFX_DYNABOMB }, + { EL_DYNABOMB_PLAYER3_ACTIVE, GFX_DYNABOMB }, + { EL_DYNABOMB_PLAYER4_ACTIVE, GFX_DYNABOMB }, { EL_DYNABOMB_NR, GFX_DYNABOMB_NR }, { EL_DYNABOMB_SZ, GFX_DYNABOMB_SZ }, { EL_DYNABOMB_XL, GFX_DYNABOMB_XL }, @@ -920,21 +921,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) @@ -976,6 +991,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 @@ -1685,7 +1780,7 @@ void InitElementProperties() EL_EXIT_CLOSED, EL_EXIT_OPEN, EL_STEELWALL, - EL_PLAYER, + EL_PLAYER1, EL_BD_FIREFLY, EL_BD_FIREFLY_1, EL_BD_FIREFLY_2, @@ -1708,7 +1803,7 @@ void InitElementProperties() EL_SOKOBAN_OBJECT, EL_SOKOBAN_FIELD_EMPTY, EL_SOKOBAN_FIELD_FULL, - EL_PLAYER, + EL_PLAYER1, EL_INVISIBLE_STEELWALL }; static int ep_sb_element_num = SIZEOF_ARRAY_INT(ep_sb_element); @@ -1865,10 +1960,10 @@ void InitElementProperties() EL_BOMB, EL_DYNAMITE_ACTIVE, EL_DYNAMITE, - EL_DYNABOMB_ACTIVE_1, - EL_DYNABOMB_ACTIVE_2, - EL_DYNABOMB_ACTIVE_3, - EL_DYNABOMB_ACTIVE_4, + EL_DYNABOMB_PLAYER1_ACTIVE, + EL_DYNABOMB_PLAYER2_ACTIVE, + EL_DYNABOMB_PLAYER3_ACTIVE, + EL_DYNABOMB_PLAYER4_ACTIVE, EL_DYNABOMB_NR, EL_DYNABOMB_SZ, EL_DYNABOMB_XL, @@ -1921,7 +2016,6 @@ void InitElementProperties() static int ep_player[] = { - EL_PLAYER, EL_PLAYER1, EL_PLAYER2, EL_PLAYER3, @@ -2056,10 +2150,10 @@ void InitElementProperties() static int ep_active_bomb[] = { EL_DYNAMITE_ACTIVE, - EL_DYNABOMB_ACTIVE_1, - EL_DYNABOMB_ACTIVE_2, - EL_DYNABOMB_ACTIVE_3, - EL_DYNABOMB_ACTIVE_4 + EL_DYNABOMB_PLAYER1_ACTIVE, + EL_DYNABOMB_PLAYER2_ACTIVE, + EL_DYNABOMB_PLAYER3_ACTIVE, + EL_DYNABOMB_PLAYER4_ACTIVE }; static int ep_active_bomb_num = SIZEOF_ARRAY_INT(ep_active_bomb);