+2007-04-05
+ * fixed some general bugs with handling of ".active" elements and fonts
+
2007-04-04
* cleanup of game panel elements (some elements were not really needed)
* added displaying of gravity state (on/off) as new game panel control
conf_fnt.c \
conf_g2s.c \
conf_g2m.c \
- conf_var.c
+ conf_var.c \
+ conf_act.c
CNFS_CMD = ../Scripts/create_element_defs.pl
--- /dev/null
+/***********************************************************
+* Rocks'n'Diamonds -- McDuffin Strikes Back! *
+*----------------------------------------------------------*
+* (c) 1995-2006 Artsoft Entertainment *
+* Holger Schemel *
+* Detmolder Strasse 189 *
+* 33604 Bielefeld *
+* Germany *
+* e-mail: info@artsoft.org *
+*----------------------------------------------------------*
+* conf_act.c *
+***********************************************************/
+
+/* ----- this file was automatically generated -- do not edit by hand ----- */
+
+#ifndef CONF_ACT_C
+#define CONF_ACT_C
+
+/* values for active states of elements and fonts */
+
+static struct
+{
+ int element;
+ int element_active;
+}
+element_with_active_state[] =
+{
+ {
+ EL_BD_MAGIC_WALL,
+ EL_BD_MAGIC_WALL_ACTIVE
+ },
+ {
+ EL_CONVEYOR_BELT_1_LEFT,
+ EL_CONVEYOR_BELT_1_LEFT_ACTIVE
+ },
+ {
+ EL_CONVEYOR_BELT_1_MIDDLE,
+ EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE
+ },
+ {
+ EL_CONVEYOR_BELT_1_RIGHT,
+ EL_CONVEYOR_BELT_1_RIGHT_ACTIVE
+ },
+ {
+ EL_CONVEYOR_BELT_2_LEFT,
+ EL_CONVEYOR_BELT_2_LEFT_ACTIVE
+ },
+ {
+ EL_CONVEYOR_BELT_2_MIDDLE,
+ EL_CONVEYOR_BELT_2_MIDDLE_ACTIVE
+ },
+ {
+ EL_CONVEYOR_BELT_2_RIGHT,
+ EL_CONVEYOR_BELT_2_RIGHT_ACTIVE
+ },
+ {
+ EL_CONVEYOR_BELT_3_LEFT,
+ EL_CONVEYOR_BELT_3_LEFT_ACTIVE
+ },
+ {
+ EL_CONVEYOR_BELT_3_MIDDLE,
+ EL_CON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L_CASCADE_DYNAMIC,
+ EL_INTERNAL_CASCADE_DYNAMIC_ACTIVE
+ },
+ {
+ EL_INTERNAL_CASCADE_EM,
+ EL_INTERNAL_CASCADE_EM_ACTIVE
+ },
+ {
+ EL_INTERNAL_CASCADE_EMC,
+ EL_INTERNAL_CASCADE_EMC_ACTIVE
+ },
+ {
+ EL_INTERNAL_CASCADE_GE,
+ EL_INTERNAL_CASCADE_GE_ACTIVE
+ },
+ {
+ EL_INTERNAL_CASCADE_REF,
+ EL_INTERNAL_CASCADE_REF_ACTIVE
+ },
+ {
+ EL_INTERNAL_CASCADE_RND,
+ EL_INTERNAL_CASCADE_RND_ACTIVE
+ },
+ {
+ EL_INTERNAL_CASCADE_SB,
+ EL_INTERNAL_CASCADE_SB_ACTIVE
+ },
+ {
+ EL_INTERNAL_CASCADE_SP,
+ EL_INTERNAL_CASCADE_SP_ACTIVE
+ },
+ {
+ EL_INTERNAL_CASCADE_STEEL_CHARS,
+ EL_INTERNAL_CASCADE_STEEL_CHARS_ACTIVE
+ },
+ {
+ EL_INTERNAL_CASCADE_USER,
+ EL_INTERNAL_CASCADE_USER_ACTIVE
+ },
+ {
+ EL_INVISIBLE_SAND,
+ EL_INVISIBLE_SAND_ACTIVE
+ },
+ {
+ EL_INVISIBLE_STEELWALL,
+ EL_INVISIBLE_STEELWALL_ACTIVE
+ },
+ {
+ EL_INVISIBLE_WALL,
+ EL_INVISIBLE_WALL_ACTIVE
+ },
+ {
+ EL_LAMP,
+ EL_LAMP_ACTIVE
+ },
+ {
+ EL_LIGHT_SWITCH,
+ EL_LIGHT_SWITCH_ACTIVE
+ },
+ {
+ EL_MAGIC_WALL,
+ EL_MAGIC_WALL_ACTIVE
+ },
+ {
+ EL_ROBOT_WHEEL,
+ EL_ROBOT_WHEEL_ACTIVE
+ },
+ {
+ EL_SHIELD_DEADLY,
+ EL_SHIELD_DEADLY_ACTIVE
+ },
+ {
+ EL_SHIELD_NORMAL,
+ EL_SHIELD_NORMAL_ACTIVE
+ },
+ {
+ EL_SP_BUGGY_BASE,
+ EL_SP_BUGGY_BASE_ACTIVE
+ },
+ {
+ EL_SP_DISK_RED,
+ EL_SP_DISK_RED_ACTIVE
+ },
+ {
+ EL_SP_TERMINAL,
+ EL_SP_TERMINAL_ACTIVE
+ },
+ {
+ EL_TIMEGATE_SWITCH,
+ EL_TIMEGATE_SWITCH_ACTIVE
+ },
+ {
+ EL_TRAP,
+ EL_TRAP_ACTIVE
+ },
+ {
+ -1,
+ -1
+ },
+};
+
+
+static struct
+{
+ int font_nr;
+ int font_nr_active;
+}
+font_with_active_state[] =
+{
+ {
+ FONT_INPUT_1,
+ FONT_INPUT_1_ACTIVE
+ },
+ {
+ FONT_INPUT_2,
+ FONT_INPUT_2_ACTIVE
+ },
+ {
+ FONT_LEVEL_NUMBER,
+ FONT_LEVEL_NUMBER_ACTIVE
+ },
+ {
+ FONT_MENU_1,
+ FONT_MENU_1_ACTIVE
+ },
+ {
+ FONT_MENU_2,
+ FONT_MENU_2_ACTIVE
+ },
+ {
+ FONT_TEXT_1,
+ FONT_TEXT_1_ACTIVE
+ },
+ {
+ FONT_TEXT_2,
+ FONT_TEXT_2_ACTIVE
+ },
+ {
+ FONT_TEXT_3,
+ FONT_TEXT_3_ACTIVE
+ },
+ {
+ FONT_TEXT_4,
+ FONT_TEXT_4_ACTIVE
+ },
+ {
+ -1,
+ -1
+ },
+};
+
+#endif /* CONF_ACT_C */
-#define COMPILE_DATE_STRING "2007-04-05 02:56"
+#define COMPILE_DATE_STRING "2007-04-07 03:38"
for (j = 0; j < NUM_BELT_PARTS; j++)
{
int element = belt_base_active_element[belt_nr] + j;
- int graphic = el2img(element);
+ int graphic_1 = el2img(element);
+ int graphic_2 = el2panelimg(element);
if (game.belt_dir[i] == MV_LEFT)
- graphic_info[graphic].anim_mode &= ~ANIM_REVERSE;
+ {
+ graphic_info[graphic_1].anim_mode &= ~ANIM_REVERSE;
+ graphic_info[graphic_2].anim_mode &= ~ANIM_REVERSE;
+ }
else
- graphic_info[graphic].anim_mode |= ANIM_REVERSE;
+ {
+ graphic_info[graphic_1].anim_mode |= ANIM_REVERSE;
+ graphic_info[graphic_2].anim_mode |= ANIM_REVERSE;
+ }
}
}
for (i = 0; i < NUM_BELT_PARTS; i++)
{
int element = belt_base_active_element[belt_nr] + i;
- int graphic = el2img(element);
+ int graphic_1 = el2img(element);
+ int graphic_2 = el2panelimg(element);
if (belt_dir == MV_LEFT)
- graphic_info[graphic].anim_mode &= ~ANIM_REVERSE;
+ {
+ graphic_info[graphic_1].anim_mode &= ~ANIM_REVERSE;
+ graphic_info[graphic_2].anim_mode &= ~ANIM_REVERSE;
+ }
else
- graphic_info[graphic].anim_mode |= ANIM_REVERSE;
+ {
+ graphic_info[graphic_1].anim_mode |= ANIM_REVERSE;
+ graphic_info[graphic_2].anim_mode |= ANIM_REVERSE;
+ }
}
SCAN_PLAYFIELD(xx, yy)
#include "conf_fnt.c" /* include auto-generated data structure definitions */
#include "conf_g2s.c" /* include auto-generated data structure definitions */
#include "conf_g2m.c" /* include auto-generated data structure definitions */
+#include "conf_act.c" /* include auto-generated data structure definitions */
#define CONFIG_TOKEN_FONT_INITIAL "font.initial"
int graphic = property_mapping[i].artwork_index;
boolean crumbled = FALSE;
+#if 0
+ if ((element == EL_EM_DYNAMITE ||
+ element == EL_EM_DYNAMITE_ACTIVE) &&
+ action == ACTION_ACTIVE &&
+ (special == GFX_SPECIAL_ARG_EDITOR ||
+ special == GFX_SPECIAL_ARG_PANEL))
+ printf("::: DYNAMIC: %d, %d, %d -> %d\n",
+ element, action, special, graphic);
+#endif
+
if (special == GFX_SPECIAL_ARG_CRUMBLED)
{
special = -1;
boolean special_redefined =
getImageListEntryFromImageID(graphic)->redefined;
+#if 0
+ if ((element == EL_EM_DYNAMITE ||
+ element == EL_EM_DYNAMITE_ACTIVE) &&
+ (special == GFX_SPECIAL_ARG_EDITOR ||
+ special == GFX_SPECIAL_ARG_PANEL))
+ printf("::: SPECIAL STATIC: %d, %d -> %d\n",
+ element, special, graphic);
+#endif
+
/* if the base graphic ("emerald", for example) has been redefined,
but not the special graphic ("emerald.EDITOR", for example), do not
use an existing (in this case considered obsolete) special graphic
/* initialize special element/graphic mapping from dynamic configuration */
for (i = 0; i < num_property_mappings; i++)
{
- int element = property_mapping[i].base_index;
- int special = property_mapping[i].ext3_index;
- int graphic = property_mapping[i].artwork_index;
+ int element = property_mapping[i].base_index;
+ int action = property_mapping[i].ext1_index;
+ int direction = property_mapping[i].ext2_index;
+ int special = property_mapping[i].ext3_index;
+ int graphic = property_mapping[i].artwork_index;
+
+#if 0
+ if ((element == EL_EM_DYNAMITE ||
+ element == EL_EM_DYNAMITE_ACTIVE ||
+ element == EL_CONVEYOR_BELT_1_MIDDLE ||
+ element == EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE) &&
+ (special == GFX_SPECIAL_ARG_EDITOR ||
+ special == GFX_SPECIAL_ARG_PANEL))
+ printf("::: SPECIAL DYNAMIC: %d, %d -> %d [%d]\n",
+ element, special, graphic, property_mapping[i].ext1_index);
+#endif
+
+#if 0
+ if (element == EL_CONVEYOR_BELT_1_MIDDLE &&
+ action == ACTION_ACTIVE)
+ {
+ element = EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE;
+ action = -1;
+ }
+#endif
+
+#if 0
+ if (element == EL_MAGIC_WALL &&
+ action == ACTION_ACTIVE)
+ {
+ element = EL_MAGIC_WALL_ACTIVE;
+ action = -1;
+ }
+#endif
+
+#if 1
+ /* for action ".active", replace element with active element, if exists */
+ if (action == ACTION_ACTIVE && element != ELEMENT_ACTIVE(element))
+ {
+ element = ELEMENT_ACTIVE(element);
+ action = -1;
+ }
+#endif
if (element >= MAX_NUM_ELEMENTS)
continue;
+ /* do not change special graphic if action or direction was specified */
+ if (action != -1 || direction != -1)
+ continue;
+
if (IS_SPECIAL_GFX_ARG(special))
element_info[element].special_graphic[special] = graphic;
}
#endif
}
+ /* always start with reliable default values (all elements) */
+ for (i = 0; i < MAX_NUM_ELEMENTS; i++)
+ ActiveElement[i] = i;
+
+ /* now add all entries that have an active state (active elements) */
+ for (i = 0; element_with_active_state[i].element != -1; i++)
+ {
+ int element = element_with_active_state[i].element;
+ int element_active = element_with_active_state[i].element_active;
+
+ ActiveElement[element] = element_active;
+ }
+
+ /* always start with reliable default values (all fonts) */
+ for (i = 0; i < NUM_FONTS; i++)
+ ActiveFont[i] = i;
+
+ /* now add all entries that have an active state (active fonts) */
+ for (i = 0; font_with_active_state[i].font_nr != -1; i++)
+ {
+ int font = font_with_active_state[i].font_nr;
+ int font_active = font_with_active_state[i].font_nr_active;
+
+ ActiveFont[font] = font_active;
+ }
+
global.autoplay_leveldir = NULL;
global.convert_leveldir = NULL;
base_index = i;
+#if 0
+ if (IS_PARENT_PROCESS())
+ printf("===> MATCH: '%s', '%s'\n", token, base_prefix);
+#endif
+
if (start_pos + len_base_prefix == len_token) /* exact match */
{
exact_match = TRUE;
+#if 0
+ if (IS_PARENT_PROCESS())
+ printf("===> EXACT MATCH: '%s', '%s'\n", token, base_prefix);
+#endif
+
add_dynamic_file_list_entry(dynamic_file_list,
num_dynamic_file_list_entries,
extra_file_hash,
ext1_index = j;
+#if 0
+ if (IS_PARENT_PROCESS())
+ printf("===> MATCH: '%s', '%s'\n", token, ext1_suffix);
+#endif
+
if (start_pos + len_ext1_suffix == len_token) /* exact match */
{
exact_match = TRUE;
+#if 0
+ if (IS_PARENT_PROCESS())
+ printf("===> EXACT MATCH: '%s', '%s'\n", token, ext1_suffix);
+#endif
+
add_dynamic_file_list_entry(dynamic_file_list,
num_dynamic_file_list_entries,
extra_file_hash,
ext2_index = k;
+#if 0
+ if (IS_PARENT_PROCESS())
+ printf("===> MATCH: '%s', '%s'\n", token, ext2_suffix);
+#endif
+
if (start_pos + len_ext2_suffix == len_token) /* exact match */
{
exact_match = TRUE;
+#if 0
+ if (IS_PARENT_PROCESS())
+ printf("===> EXACT MATCH: '%s', '%s'\n", token, ext2_suffix);
+#endif
+
add_dynamic_file_list_entry(dynamic_file_list,
num_dynamic_file_list_entries,
extra_file_hash,
ext3_index = l;
+#if 0
+ if (IS_PARENT_PROCESS())
+ printf("===> MATCH: '%s', '%s'\n", token, ext3_suffix);
+#endif
+
if (start_pos + len_ext3_suffix == len_token) /* exact match */
{
exact_match = TRUE;
+#if 0
+ if (IS_PARENT_PROCESS())
+ printf("===> EXACT MATCH: '%s', '%s'\n", token, ext3_suffix);
+#endif
+
add_dynamic_file_list_entry(dynamic_file_list,
num_dynamic_file_list_entries,
extra_file_hash,
int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
int GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+int ActiveElement[MAX_NUM_ELEMENTS];
+int ActiveFont[NUM_FONTS];
+
int lev_fieldx, lev_fieldy;
int scroll_x, scroll_y;
(d) == MV_UP ? "MV_UP" : \
(d) == MV_DOWN ? "MV_DOWN" : "(various)")
+#define ELEMENT_ACTIVE(e) (ActiveElement[e])
+
+#define FONT_ACTIVE(f) (ActiveFont[f])
+
+
/* fundamental game speed values */
#define MICROLEVEL_SCROLL_DELAY 50 /* delay for scrolling micro level */
#define MICROLEVEL_LABEL_DELAY 250 /* delay for micro level label */
#define NUM_FONTS 37
#define NUM_INITIAL_FONTS 4
+#if 0
#define FONT_ACTIVE(f) \
((f) == FONT_MENU_1 ? FONT_MENU_1_ACTIVE : \
(f) == FONT_MENU_2 ? FONT_MENU_2_ACTIVE : \
(f) == FONT_INPUT_2 ? FONT_INPUT_2_ACTIVE : \
(f) == FONT_LEVEL_NUMBER ? FONT_LEVEL_NUMBER_ACTIVE : \
(f))
-
+#endif
/* values for game_status (must match special image configuration suffixes) */
#define GAME_MODE_DEFAULT 0
extern int GfxAction[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern int GfxDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
+extern int ActiveElement[MAX_NUM_ELEMENTS];
+extern int ActiveFont[NUM_FONTS];
+
extern int lev_fieldx, lev_fieldy;
extern int scroll_x, scroll_y;
title = title_default;
#endif
+#if 0
+ {
+ int graphicA = element_info[EL_EM_DYNAMITE_ACTIVE].special_graphic[GFX_SPECIAL_ARG_EDITOR];
+ int graphicB = element_info[EL_EM_DYNAMITE_ACTIVE].special_graphic[GFX_SPECIAL_ARG_PANEL];
+ int graphic1 = element_info[EL_CONVEYOR_BELT_1_MIDDLE].special_graphic[GFX_SPECIAL_ARG_EDITOR];
+ int graphic2 = element_info[EL_CONVEYOR_BELT_1_MIDDLE_ACTIVE].special_graphic[GFX_SPECIAL_ARG_EDITOR];
+
+ printf("::: %d [%d] -> %d, %d [%d, %d]\n",
+ graphicA, graphicB,
+ graphic_info[graphicA].src_x,
+ graphic_info[graphicA].src_y,
+ graphic1, graphic2);
+ }
+#endif
+
#if 0
printf("::: %d, %d\n", fading.anim_mode == ANIM_CROSSFADE,
redraw_mask == REDRAW_ALL);