#include "cartoons.h"
#include "config.h"
+#include "conf_e2g.c" /* include auto-generated data structure definitions */
+
+
static char *image_filename[NUM_PICTURES] =
{
"RocksScreen.pcx",
void InitElementInfo()
{
- int i, j;
-
+#if 0
static struct
{
int element;
-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<MAX_ELEMENTS; i++)
{
- for(j=0; j<NUM_GFX_ACTIONS_MAPPED; j++)
+ for(act=0; act<NUM_GFX_ACTIONS_MAPPED; act++)
{
- element_info[i].graphic[j] = GFX_LEERRAUM;
- element_info[i].has_direction_graphic[j] = FALSE;
+ element_info[i].graphic[act] = -1;
+
+ for(dir=0; dir<NUM_MV_DIRECTIONS; dir++)
+ element_info[i].direction_graphic[act][dir] = -1;
}
}
GFX_START_ROCKSSP + nr_graphic;
}
+#if 0
/* this overrides some of the above default settings (GFX_SP_ZONK etc.) */
i = 0;
while (element_to_graphic[i].element > -1)
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<MAX_ELEMENTS; i++)
+ {
+ int default_action_graphic = element_info[i].graphic[GFX_ACTION_DEFAULT];
+ int default_action_direction_graphic[NUM_MV_DIRECTIONS];
+
+ if (default_action_graphic == -1)
+ default_action_graphic = EL_CHAR_QUESTION;
+
+ for(dir=0; dir<NUM_MV_DIRECTIONS; dir++)
+ {
+ default_action_direction_graphic[dir] =
+ element_info[i].direction_graphic[GFX_ACTION_DEFAULT][dir];
+
+ if (default_action_direction_graphic[dir] == -1)
+ default_action_direction_graphic[dir] = default_action_graphic;
+ }
+
+ for(act=0; act<NUM_GFX_ACTIONS_MAPPED; act++)
+ {
+ for(dir=0; dir<NUM_MV_DIRECTIONS; dir++)
+ {
+ int default_direction_graphic = element_info[i].graphic[act];
+
+ /* no graphic for current action -- use default direction graphic */
+ if (default_direction_graphic == -1)
+ default_direction_graphic = default_action_direction_graphic[dir];
+
+ if (element_info[i].direction_graphic[act][dir] == -1)
+ element_info[i].direction_graphic[act][dir] =
+ default_direction_graphic;
+ }
+
+ /* no graphic for this specific action -- use default action graphic */
+ if (element_info[i].graphic[act] == -1)
+ element_info[i].graphic[act] = default_action_graphic;
+ }
+ }
+
+#endif
}
static void InitGraphicInfo()
if (new_graphic_info[i].anim_delay == 0) /* delay must be at least 1 */
new_graphic_info[i].anim_delay = 1;
- /* basically, animation can be either normal or reverse direction */
- if (parameter[GFX_ARG_REVERSE])
- new_graphic_info[i].anim_mode = ANIM_REVERSE;
+ /* set mode for animation frame order */
+ if (parameter[GFX_ARG_MODE_LINEAR])
+ new_graphic_info[i].anim_mode = ANIM_LINEAR;
+ else if (parameter[GFX_ARG_MODE_PINGPONG])
+ new_graphic_info[i].anim_mode = ANIM_PINGPONG;
+ else if (parameter[GFX_ARG_MODE_PINGPONG2])
+ new_graphic_info[i].anim_mode = ANIM_PINGPONG2;
+ else if (parameter[GFX_ARG_FRAMES] > 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];