-#define COMPILE_DATE_STRING "[2003-01-27 04:33]"
+#define COMPILE_DATE_STRING "[2003-01-28 00:43]"
gd_x2 = DOOR_GFX_PAGEX6 + ED_ELEMENTLIST_XPOS;
gd_y = DOOR_GFX_PAGEY1 + ED_ELEMENTLIST_YPOS;
- getMiniGraphicSource(el2img(element), &deco_bitmap, &deco_x, &deco_y);
+ getMiniGraphicSource(el2edimg(element), &deco_bitmap, &deco_x, &deco_y);
deco_xpos = (ED_ELEMENTLIST_XSIZE - MINI_TILEX) / 2;
deco_ypos = (ED_ELEMENTLIST_YSIZE - MINI_TILEY) / 2;
/* draw mouse button brush elements */
DrawMiniGraphicExt(drawto,
DX + ED_WIN_MB_LEFT_XPOS, DY + ED_WIN_MB_LEFT_YPOS,
- el2img(new_element1));
+ el2edimg(new_element1));
DrawMiniGraphicExt(drawto,
DX + ED_WIN_MB_MIDDLE_XPOS, DY + ED_WIN_MB_MIDDLE_YPOS,
- el2img(new_element2));
+ el2edimg(new_element2));
DrawMiniGraphicExt(drawto,
DX + ED_WIN_MB_RIGHT_XPOS, DY + ED_WIN_MB_RIGHT_YPOS,
- el2img(new_element3));
+ el2edimg(new_element3));
/* draw bigger door */
DrawSpecialEditorDoor();
new_element1 = element;
DrawMiniGraphicExt(drawto,
DX + ED_WIN_MB_LEFT_XPOS, DY + ED_WIN_MB_LEFT_YPOS,
- el2img(new_element1));
+ el2edimg(new_element1));
}
else if (button == 2)
{
new_element2 = element;
DrawMiniGraphicExt(drawto,
DX + ED_WIN_MB_MIDDLE_XPOS, DY + ED_WIN_MB_MIDDLE_YPOS,
- el2img(new_element2));
+ el2edimg(new_element2));
}
else
{
new_element3 = element;
DrawMiniGraphicExt(drawto,
DX + ED_WIN_MB_RIGHT_XPOS, DY + ED_WIN_MB_RIGHT_YPOS,
- el2img(new_element3));
+ el2edimg(new_element3));
}
redraw_mask |= REDRAW_DOOR_1;
DrawGraphicAnimationExt(drawto,
SX + xstart * MINI_TILEX,
SY + ystart * MINI_TILEY + MINI_TILEY / 2,
- el2img(properties_element), -1, NO_MASKING);
+ el2edimg(properties_element), -1, NO_MASKING);
FrameCounter = 0; /* restart animation frame counter */
DrawMiniGraphicExt(drawto,
gi->x + sx * MINI_TILEX,
gi->y + sy * MINI_TILEY,
- el2img(new_element));
+ el2edimg(new_element));
DrawMiniGraphicExt(window,
gi->x + sx * MINI_TILEX,
gi->y + sy * MINI_TILEY,
- el2img(new_element));
+ el2edimg(new_element));
if (id == GADGET_ID_AMOEBA_CONTENT)
level.amoeba_content = new_element;
int element = editor_elements[element_shift + i];
UnmapGadget(gi);
- getMiniGraphicSource(el2img(element), &gd->bitmap, &gd->x, &gd->y);
+ getMiniGraphicSource(el2edimg(element), &gd->bitmap, &gd->x, &gd->y);
ModifyGadget(gi, GDI_INFO_TEXT, getElementInfoText(element), GDI_END);
MapGadget(gi);
}
DrawGraphicAnimationExt(drawto,
SX + xpos * TILEX,
SY + ypos * TILEY + MINI_TILEY / 2,
- el2img(properties_element), -1, NO_MASKING);
+ el2edimg(properties_element), -1, NO_MASKING);
MarkTileDirty(xpos, ypos);
MarkTileDirty(xpos, ypos + 1);
static void InitGadgets();
static void InitElementImages();
static void InitElementGraphicInfo();
+static void InitElementEditorGraphicInfo();
static void InitElementSoundInfo();
static void InitElementProperties();
static void InitGraphicInfo();
static char *sound_class_prefix[MAX_NUM_ELEMENTS + 1];
static char *action_suffix[NUM_ACTIONS + 1];
static char *direction_suffix[NUM_DIRECTIONS + 1];
+ static char *special_suffix[NUM_SPECIAL_GFX_ARGS + 1];
static char *dummy[1] = { NULL };
int i;
- for (i=0; i<MAX_NUM_ELEMENTS; i++)
- element_info[i].custom_description = NULL;
-
for (i=0; i<MAX_NUM_ELEMENTS + 1; i++)
element_prefix[i] = element_info[i].token_name;
for (i=0; i<MAX_NUM_ELEMENTS + 1; i++)
action_suffix[i] = element_action_info[i].suffix;
for (i=0; i<NUM_DIRECTIONS + 1; i++)
direction_suffix[i] = element_direction_info[i].suffix;
+ for (i=0; i<NUM_SPECIAL_GFX_ARGS + 1; i++)
+ special_suffix[i] = special_suffix_info[i].suffix;
InitImageList(image_config, NUM_IMAGE_FILES, image_config_suffix,
- element_prefix, action_suffix, direction_suffix);
+ element_prefix, action_suffix,direction_suffix,special_suffix);
InitSoundList(sound_config, NUM_SOUND_FILES, sound_config_suffix,
- sound_class_prefix, action_suffix, dummy);
+ sound_class_prefix, action_suffix, dummy, dummy);
}
void InitLevelArtworkInfo()
static void ReinitializeGraphics()
{
- InitElementGraphicInfo(); /* initialize element/graphic config info */
- InitGraphicInfo(); /* initialize graphic info from config file */
+ InitElementGraphicInfo(); /* element => game graphic mapping */
+ InitElementEditorGraphicInfo(); /* element => editor graphic mapping */
+ InitGraphicInfo(); /* graphic => properties mapping */
InitFontInfo(bitmap_font_initial,
graphic_info[IMG_FONT_BIG].bitmap,
static void ReinitializeSounds()
{
- InitElementSoundInfo(); /* initialize element/sound config info */
- InitSoundInfo(); /* initialize sounds info from config file */
+ InitElementSoundInfo(); /* element => game sound mapping */
+ InitSoundInfo(); /* sound => properties mapping */
- InitPlaySoundLevel(); /* initialize internal game sound values */
+ InitPlaySoundLevel(); /* internal game sound settings */
}
static void ReinitializeMusic()
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 (special != -1)
+ continue;
+
if (action < 0)
action = ACTION_DEFAULT;
}
}
+void InitElementEditorGraphicInfo()
+{
+ struct PropertyMapping *property_mapping = getImageListPropertyMapping();
+ int num_property_mappings = getImageListPropertyMappingSize();
+ int i;
+
+ /* always start with reliable default values */
+ for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ element_info[i].editor_graphic = element_info[i].graphic[ACTION_DEFAULT];
+
+#if 0
+ /* initialize element/graphic mapping from static configuration */
+ for (i=0; ... ; i++)
+ {
+ int element = ... element;
+ int special = ... special;
+ int graphic = ... graphic;
+
+ if (special != GFX_SPECIAL_ARG_EDITOR)
+ continue;
+
+ element_info[element].editor_graphic = graphic;
+ }
+#endif
+
+ /* initialize 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;
+
+ if (special != GFX_SPECIAL_ARG_EDITOR)
+ continue;
+
+ element_info[element].editor_graphic = graphic;
+ }
+}
+
static void InitElementSoundInfo()
{
/* soon to come */
struct ConfigInfo *config_suffix_list,
char **base_prefixes,
char **ext1_suffixes,
- char **ext2_suffixes)
+ char **ext2_suffixes,
+ char **ext3_suffixes)
{
int i;
for (i=0; ext2_suffixes[i] != NULL; i++)
image_info->num_ext2_suffixes++;
+ image_info->num_ext3_suffixes = 0;
+ for (i=0; ext3_suffixes[i] != NULL; i++)
+ image_info->num_ext3_suffixes++;
+
image_info->base_prefixes = base_prefixes;
image_info->ext1_suffixes = ext1_suffixes;
image_info->ext2_suffixes = ext2_suffixes;
+ image_info->ext3_suffixes = ext3_suffixes;
image_info->num_property_mapping_entries = 0;
int getImageListPropertyMappingSize();
struct PropertyMapping *getImageListPropertyMapping();
void InitImageList(struct ConfigInfo *, int, struct ConfigInfo *,
- char **, char **, char **);
+ char **, char **, char **, char **);
void ReloadCustomImages();
void CreateImageWithSmallImages(int);
for (i=0; config_list[i].token != NULL; i++)
{
+#if 0
+ int len_config_token;
+ int len_config_value;
+ boolean is_file_entry;
+
+ printf("%d: '%s' => '%s'\n",
+ i, config_list[i].token, config_list[i].value);
+
+ len_config_token = strlen(config_list[i].token);
+ len_config_value = strlen(config_list[i].value);
+ is_file_entry = TRUE;
+
+#else
int len_config_token = strlen(config_list[i].token);
int len_config_value = strlen(config_list[i].value);
boolean is_file_entry = TRUE;
+#endif
for (j=0; suffix_list[j].token != NULL; j++)
{
int len_suffix = strlen(suffix);
#if 0
- if (IS_PARENT_PROCESS(audio.mixer_pid))
+ if (IS_PARENT_PROCESS())
printf(":::::::::: check '%s' for '%s' ::::::::::\n", token, suffix);
#endif
char *known_token_value = KNOWN_TOKEN_VALUE;
int i;
+ if (file_list_entry->filename != NULL)
+ free(file_list_entry->filename);
+
if (filename != NULL)
{
/* when file definition found, set all parameters to default values */
int parameter_array_size = num_suffix_list_entries * sizeof(int);
#if 0
- if (IS_PARENT_PROCESS(audio.mixer_pid))
+ if (IS_PARENT_PROCESS())
printf("===> found dynamic definition '%s'\n", token);
#endif
new_list_entry = &(*list)[*num_list_entries - 1];
new_list_entry->token = getStringCopy(token);
+ new_list_entry->filename = NULL;
new_list_entry->parameter = checked_calloc(parameter_array_size);
read_token_parameters(extra_file_list, suffix_list, new_list_entry);
static void add_property_mapping(struct PropertyMapping **list,
int *num_list_entries,
- int base_index, int ext1_index,int ext2_index,
+ int base_index, int ext1_index,
+ int ext2_index, int ext3_index,
int artwork_index)
{
struct PropertyMapping *new_list_entry;
new_list_entry->base_index = base_index;
new_list_entry->ext1_index = ext1_index;
new_list_entry->ext2_index = ext2_index;
+ new_list_entry->ext3_index = ext3_index;
new_list_entry->artwork_index = artwork_index;
}
char **base_prefixes = artwork_info->base_prefixes;
char **ext1_suffixes = artwork_info->ext1_suffixes;
char **ext2_suffixes = artwork_info->ext2_suffixes;
+ char **ext3_suffixes = artwork_info->ext3_suffixes;
int num_file_list_entries = artwork_info->num_file_list_entries;
int num_suffix_list_entries = artwork_info->num_suffix_list_entries;
int num_base_prefixes = artwork_info->num_base_prefixes;
int num_ext1_suffixes = artwork_info->num_ext1_suffixes;
int num_ext2_suffixes = artwork_info->num_ext2_suffixes;
+ int num_ext3_suffixes = artwork_info->num_ext3_suffixes;
char *filename = getCustomArtworkConfigFilename(artwork_info->type);
struct SetupFileList *setup_file_list;
struct SetupFileList *extra_file_list = NULL;
struct SetupFileList *list;
char *known_token_value = KNOWN_TOKEN_VALUE;
- int i, j, k;
+ int i, j, k, l;
#if 0
printf("GOT CUSTOM ARTWORK CONFIG FILE '%s'\n", filename);
{
if (file_list[i].filename != NULL)
free(file_list[i].filename);
- file_list[i].filename = NULL;
+ file_list[i].filename = getStringCopy(file_list[i].default_filename);
for (j=0; j<num_suffix_list_entries; j++)
file_list[i].parameter[j] = file_list[i].default_parameter[j];
}
#if 0
- if (IS_PARENT_PROCESS(audio.mixer_pid))
+ if (IS_PARENT_PROCESS())
{
if (parameter_suffix_found)
printf("---> skipping token '%s' (parameter token)\n", token);
if (parameter_suffix_found)
continue;
- /* ---------- step 1: search for matching base prefix ---------- */
+ /* ---------- step 0: search for matching base prefix ---------- */
start_pos = 0;
for (i=0; i<num_base_prefixes && !base_prefix_found; i++)
char *base_prefix = base_prefixes[i];
int len_base_prefix = strlen(base_prefix);
boolean ext1_suffix_found = FALSE;
+ boolean ext2_suffix_found = FALSE;
+ boolean ext3_suffix_found = FALSE;
+ boolean exact_match = FALSE;
+ int base_index = -1;
+ int ext1_index = -1;
+ int ext2_index = -1;
+ int ext3_index = -1;
base_prefix_found = token_suffix_match(token, base_prefix, start_pos);
if (!base_prefix_found)
continue;
+ base_index = i;
+
if (start_pos + len_base_prefix == len_token) /* exact match */
{
+ exact_match = TRUE;
+
add_dynamic_file_list_entry(dynamic_file_list,
num_dynamic_file_list_entries,
extra_file_list,
token);
add_property_mapping(property_mapping,
num_property_mapping_entries,
- i, -1, -1,
+ base_index, -1, -1, -1,
current_summarized_file_list_entry);
continue;
}
#if 0
- if (IS_PARENT_PROCESS(audio.mixer_pid))
+ if (IS_PARENT_PROCESS())
printf("---> examining token '%s': search 1st suffix ...\n", token);
#endif
- /* ---------- step 2: search for matching first suffix ---------- */
+ /* ---------- step 1: search for matching first suffix ---------- */
start_pos += len_base_prefix;
for (j=0; j<num_ext1_suffixes && !ext1_suffix_found; j++)
{
char *ext1_suffix = ext1_suffixes[j];
int len_ext1_suffix = strlen(ext1_suffix);
- boolean ext2_suffix_found = FALSE;
ext1_suffix_found = token_suffix_match(token, ext1_suffix, start_pos);
if (!ext1_suffix_found)
continue;
+ ext1_index = j;
+
if (start_pos + len_ext1_suffix == len_token) /* exact match */
{
+ exact_match = TRUE;
+
add_dynamic_file_list_entry(dynamic_file_list,
num_dynamic_file_list_entries,
extra_file_list,
token);
add_property_mapping(property_mapping,
num_property_mapping_entries,
- i, j, -1,
+ base_index, ext1_index, -1, -1,
current_summarized_file_list_entry);
continue;
}
+ start_pos += len_ext1_suffix;
+ }
+
+ if (exact_match)
+ break;
+
#if 0
- if (IS_PARENT_PROCESS(audio.mixer_pid))
- printf("---> examining token '%s': search 2nd suffix ...\n", token);
+ if (IS_PARENT_PROCESS())
+ printf("---> examining token '%s': search 2nd suffix ...\n", token);
#endif
- /* ---------- step 3: search for matching second suffix ---------- */
+ /* ---------- step 2: search for matching second suffix ---------- */
- start_pos += len_ext1_suffix;
- for (k=0; k<num_ext2_suffixes && !ext2_suffix_found; k++)
+ for (k=0; k<num_ext2_suffixes && !ext2_suffix_found; k++)
+ {
+ char *ext2_suffix = ext2_suffixes[k];
+ int len_ext2_suffix = strlen(ext2_suffix);
+
+ ext2_suffix_found = token_suffix_match(token, ext2_suffix,start_pos);
+
+ if (!ext2_suffix_found)
+ continue;
+
+ ext2_index = k;
+
+ if (start_pos + len_ext2_suffix == len_token) /* exact match */
+ {
+ exact_match = TRUE;
+
+ add_dynamic_file_list_entry(dynamic_file_list,
+ num_dynamic_file_list_entries,
+ extra_file_list,
+ suffix_list,
+ num_suffix_list_entries,
+ token);
+ add_property_mapping(property_mapping,
+ num_property_mapping_entries,
+ base_index, ext1_index, ext2_index, -1,
+ current_summarized_file_list_entry);
+ continue;
+ }
+
+ start_pos += len_ext2_suffix;
+ }
+
+ if (exact_match)
+ break;
+
+#if 0
+ if (IS_PARENT_PROCESS())
+ printf("---> examining token '%s': search 3rd suffix ...\n",token);
+#endif
+
+ /* ---------- step 3: search for matching third suffix ---------- */
+
+ for (l=0; l<num_ext3_suffixes && !ext3_suffix_found; l++)
+ {
+ char *ext3_suffix = ext3_suffixes[l];
+ int len_ext3_suffix = strlen(ext3_suffix);
+
+ ext3_suffix_found =token_suffix_match(token,ext3_suffix,start_pos);
+
+ if (!ext3_suffix_found)
+ continue;
+
+ ext3_index = l;
+
+ if (start_pos + len_ext3_suffix == len_token) /* exact match */
{
- char *ext2_suffix = ext2_suffixes[k];
- int len_ext2_suffix = strlen(ext2_suffix);
-
- ext2_suffix_found = token_suffix_match(token, ext2_suffix,start_pos);
-
- if (!ext2_suffix_found)
- continue;
-
- if (start_pos + len_ext2_suffix == len_token) /* exact match */
- {
- add_dynamic_file_list_entry(dynamic_file_list,
- num_dynamic_file_list_entries,
- extra_file_list,
- suffix_list,
- num_suffix_list_entries,
- token);
- add_property_mapping(property_mapping,
- num_property_mapping_entries,
- i, j, k,
- current_summarized_file_list_entry);
- continue;
- }
+ exact_match = TRUE;
+
+ add_dynamic_file_list_entry(dynamic_file_list,
+ num_dynamic_file_list_entries,
+ extra_file_list,
+ suffix_list,
+ num_suffix_list_entries,
+ token);
+ add_property_mapping(property_mapping,
+ num_property_mapping_entries,
+ base_index, ext1_index, ext2_index, ext3_index,
+ current_summarized_file_list_entry);
+ continue;
}
}
}
artwork_info->sizeof_artwork_list_entry);
}
- if (extra_file_list != NULL &&
- options.verbose && IS_PARENT_PROCESS(audio.mixer_pid))
+ if (extra_file_list != NULL && options.verbose && IS_PARENT_PROCESS())
{
boolean dynamic_tokens_found = FALSE;
boolean unknown_tokens_found = FALSE;
#if 0
printf("DEBUG: reloading %d static artwork files ...\n",
num_file_list_entries);
- printf("DEBUG: reloading %d dynamic artwork files ...\n",
- num_dynamic_file_list_entries);
#endif
for(i=0; i<num_file_list_entries; i++)
LoadArtworkToList(artwork_info, &artwork_info->artwork_list[i],
file_list[i].filename, i);
+#if 0
+ printf("DEBUG: reloading %d dynamic artwork files ...\n",
+ num_dynamic_file_list_entries);
+#endif
+
for(i=0; i<num_dynamic_file_list_entries; i++)
LoadArtworkToList(artwork_info, &artwork_info->dynamic_artwork_list[i],
dynamic_file_list[i].filename, i);
#if 0
printf("%s: FREEING ARTWORK ...\n",
- IS_CHILD_PROCESS(audio.mixer_pid) ? "CHILD" : "PARENT");
+ IS_CHILD_PROCESS() ? "CHILD" : "PARENT");
#endif
FreeCustomArtworkList(artwork_info, &artwork_info->artwork_list,
#if 0
printf("%s: FREEING ARTWORK -- DONE\n",
- IS_CHILD_PROCESS(audio.mixer_pid) ? "CHILD" : "PARENT");
+ IS_CHILD_PROCESS() ? "CHILD" : "PARENT");
#endif
}
return FALSE;
}
+ if (audio.mixer_pid == 0) /* we are the child process */
+ audio.mixer_pid = getpid();
+
#if 0
- printf("PID: %d [%s]\n", getpid(),
- (IS_CHILD_PROCESS(audio.mixer_pid) ? "child" : "parent"));
+ printf("PID: %d [%s]\n", getpid(),(IS_CHILD_PROCESS() ? "child" : "parent"));
Delay(10000 * 0);
#endif
- if (IS_CHILD_PROCESS(audio.mixer_pid))
+ if (IS_CHILD_PROCESS())
Mixer_Main(); /* this function never returns */
else
close(audio.mixer_pipe[0]); /* no reading from pipe needed */
if (audio.device_fd)
close(audio.device_fd);
- if (IS_PARENT_PROCESS(audio.mixer_pid))
+ if (IS_PARENT_PROCESS())
kill(audio.mixer_pid, SIGTERM);
}
static void SendSoundControlToMixerProcess(SoundControl *snd_ctrl)
{
- if (IS_CHILD_PROCESS(audio.mixer_pid))
+ if (IS_CHILD_PROCESS())
return;
if (write(audio.mixer_pipe[1], snd_ctrl, sizeof(SoundControl)) < 0)
static void ReadSoundControlFromMainProcess(SoundControl *snd_ctrl)
{
- if (IS_PARENT_PROCESS(audio.mixer_pid))
+ if (IS_PARENT_PROCESS())
return;
if (read(audio.mixer_pipe[0], snd_ctrl, sizeof(SoundControl))
setup.override_level_sounds :
setup.override_level_music);
- if (IS_CHILD_PROCESS(audio.mixer_pid))
+ if (IS_CHILD_PROCESS())
return;
if (leveldir_current == NULL) /* should never happen */
int i;
#if defined(AUDIO_UNIX_NATIVE)
- if (IS_PARENT_PROCESS(audio.mixer_pid))
+ if (IS_PARENT_PROCESS())
{
SendSoundControlToMixerProcess(&snd_ctrl);
return;
struct ConfigInfo *config_suffix_list,
char **base_prefixes,
char **ext1_suffixes,
- char **ext2_suffixes)
+ char **ext2_suffixes,
+ char **ext3_suffixes)
{
int i;
for (i=0; ext2_suffixes[i] != NULL; i++)
sound_info->num_ext2_suffixes++;
+ sound_info->num_ext3_suffixes = 0;
+ for (i=0; ext3_suffixes[i] != NULL; i++)
+ sound_info->num_ext3_suffixes++;
+
sound_info->base_prefixes = base_prefixes;
sound_info->ext1_suffixes = ext1_suffixes;
sound_info->ext2_suffixes = ext2_suffixes;
+ sound_info->ext3_suffixes = ext3_suffixes;
sound_info->num_property_mapping_entries = 0;
int getSoundListPropertyMappingSize();
struct PropertyMapping *getSoundListPropertyMapping();
void InitSoundList(struct ConfigInfo *, int, struct ConfigInfo *,
- char **, char **, char **);
+ char **, char **, char **, char **);
void InitReloadCustomSounds(char *);
void InitReloadCustomMusic(char *);
void FreeAllSounds(void);
audio.sound_deactivated = FALSE;
audio.mixer_pipe[0] = audio.mixer_pipe[1] = 0;
- audio.mixer_pid = -1;
+ audio.mixer_pid = 0;
audio.device_name = NULL;
audio.device_fd = -1;
#define VERSION_PATCH(x) ((x) % 100)
/* functions for parent/child process identification */
-#define IS_PARENT_PROCESS(pid) ((pid) > 0 || (pid) == -1)
-#define IS_CHILD_PROCESS(pid) ((pid) == 0)
+#define IS_PARENT_PROCESS() (audio.mixer_pid != getpid())
+#define IS_CHILD_PROCESS() (audio.mixer_pid == getpid())
/* type definitions */
int base_index;
int ext1_index;
int ext2_index;
+ int ext3_index;
int artwork_index;
};
int num_base_prefixes;
int num_ext1_suffixes;
int num_ext2_suffixes;
+ int num_ext3_suffixes;
char **base_prefixes; /* base token prefixes array */
char **ext1_suffixes; /* property suffixes array 1 */
char **ext2_suffixes; /* property suffixes array 2 */
+ char **ext3_suffixes; /* property suffixes array 3 */
int num_property_mapping_entries;
{ ".active", ACTION_ACTIVE, TRUE },
{ ".other", ACTION_OTHER, FALSE },
- { NULL, 0, 0 },
+ { NULL, 0, 0 }
};
struct ElementDirectionInfo element_direction_info[] =
{ ".up", MV_BIT_UP },
{ ".down", MV_BIT_DOWN },
- { NULL, 0 },
+ { NULL, 0 }
+};
+
+struct SpecialSuffixInfo special_suffix_info[] =
+{
+ { ".EDITOR", 0, },
+
+ { NULL, 0, }
};
#define NUM_ACTIONS 21
+/* values for special image configuration suffixes */
+#define GFX_SPECIAL_ARG_EDITOR 0
+
+#define NUM_SPECIAL_GFX_ARGS 1
+
/* values for image configuration suffixes */
#define GFX_ARG_XPOS 0
/* special graphics for left/right/up/down */
int direction_graphic[NUM_ACTIONS][NUM_DIRECTIONS];
+ int editor_graphic; /* graphic displayed in level editor */
+
int sound[NUM_ACTIONS]; /* default sounds for several actions */
};
int value;
};
+struct SpecialSuffixInfo
+{
+ char *suffix;
+ int value;
+};
+
#if 0
extern GC tile_clip_gc;
extern struct ElementInfo element_info[];
extern struct ElementActionInfo element_action_info[];
extern struct ElementDirectionInfo element_direction_info[];
+extern struct SpecialSuffixInfo special_suffix_info[];
extern struct GraphicInfo *graphic_info;
extern struct SoundInfo *sound_info;
extern struct ConfigInfo image_config[], sound_config[];
{
int graphic;
- graphic = el2img(element);
+ graphic = el2edimg(element);
DrawMiniGraphic(x, y, graphic);
}
{
return element_info[element].graphic[ACTION_DEFAULT];
}
+
+int el2edimg(int element)
+{
+ return element_info[element].editor_graphic;
+}
int el_act2img(int, int);
int el_dir2img(int, int);
int el2img(int);
+int el2edimg(int);
#endif /* TOOLS_H */