}
}
+#if 1
+ /* now set all undefined/invalid graphics to -1 to set to default after it */
+ for (i=0; i<MAX_NUM_ELEMENTS; i++)
+ {
+ for (act=0; act<NUM_ACTIONS; act++)
+ {
+ if (graphic_info[element_info[i].graphic[act]].bitmap == NULL)
+ element_info[i].graphic[act] = -1;
+
+ if (graphic_info[element_info[i].crumbled[act]].bitmap == NULL)
+ element_info[i].crumbled[act] = -1;
+
+ for (dir=0; dir<NUM_DIRECTIONS; dir++)
+ {
+ int graphic;
+
+ graphic = element_info[i].direction_graphic[act][dir];
+ if (graphic_info[graphic].bitmap == NULL)
+ element_info[i].direction_graphic[act][dir] = -1;
+
+ graphic = element_info[i].direction_crumbled[act][dir];
+ if (graphic_info[graphic].bitmap == NULL)
+ element_info[i].direction_crumbled[act][dir] = -1;
+ }
+ }
+ }
+#endif
+
/* now set all '-1' values to element specific default values */
for (i=0; i<MAX_NUM_ELEMENTS; i++)
{
for (act=0; act<NUM_ACTIONS; act++)
{
- boolean act_remove = (act == ACTION_DIGGING ||
- act == ACTION_SNAPPING ||
- act == ACTION_COLLECTING);
+ boolean act_remove = ((IS_DIGGABLE(i) && act == ACTION_DIGGING) ||
+ (IS_SNAPPABLE(i) && act == ACTION_SNAPPING) ||
+ (IS_COLLECTIBLE(i) && act == ACTION_COLLECTING));
/* generic default action graphic (defined by "[default]" directive) */
int default_action_graphic = element_info[EL_DEFAULT].graphic[act];
if (special >= 0 && special < NUM_SPECIAL_GFX_ARGS)
element_info[element].special_graphic[special] = graphic;
}
+
+#if 1
+ /* now set all undefined/invalid graphics to default */
+ for (i=0; i < MAX_NUM_ELEMENTS; i++)
+ for (j=0; j < NUM_SPECIAL_GFX_ARGS; j++)
+ if (graphic_info[element_info[i].special_graphic[j]].bitmap == NULL)
+ element_info[i].special_graphic[j] =
+ element_info[i].graphic[ACTION_DEFAULT];
+#endif
}
static int get_element_from_token(char *token)
int src_x, src_y;
int first_frame, last_frame;
-#if 0
- printf("::: image: '%s'\n", image->token);
+#if 1
+ if (strcmp(image->token, "dynamite.EDITOR") == 0)
+ printf("::: image: '%s' [%d]\n", image->token, i);
#endif
#if 0
/* now check if no animation frames are outside of the loaded image */
+#if 1
+ if (graphic_info[i].bitmap == NULL)
+ printf("::: graphic_info['%s'].bitmap == NULL\n", image->token);
+#endif
+
if (graphic_info[i].bitmap == NULL)
continue; /* skip check for optional images that are undefined */
EL_PLAYER_2,
EL_PLAYER_3,
EL_PLAYER_4,
+ EL_SP_MURPHY,
-1
};
InitEventFilter(FilterMouseMotionEvents);
InitElementPropertiesStatic();
+ InitElementPropertiesEngine(GAME_VERSION_ACTUAL);
InitGfx();
static char *getDefaultArtworkSet(int type)
{
- return (type == TREE_TYPE_GRAPHICS_DIR ? GRAPHICS_SUBDIR :
- type == TREE_TYPE_SOUNDS_DIR ? SOUNDS_SUBDIR :
- type == TREE_TYPE_MUSIC_DIR ? MUSIC_SUBDIR : "");
+ return (type == TREE_TYPE_GRAPHICS_DIR ? GFX_CLASSIC_SUBDIR :
+ type == TREE_TYPE_SOUNDS_DIR ? SND_CLASSIC_SUBDIR :
+ type == TREE_TYPE_MUSIC_DIR ? MUS_CLASSIC_SUBDIR : "");
}
static char *getDefaultArtworkDir(int type)
{
return (type == TREE_TYPE_GRAPHICS_DIR ?
- getDefaultGraphicsDir(GRAPHICS_SUBDIR) :
+ getDefaultGraphicsDir(GFX_CLASSIC_SUBDIR) :
type == TREE_TYPE_SOUNDS_DIR ?
- getDefaultSoundsDir(SOUNDS_SUBDIR) :
+ getDefaultSoundsDir(SND_CLASSIC_SUBDIR) :
type == TREE_TYPE_MUSIC_DIR ?
- getDefaultMusicDir(MUSIC_SUBDIR) : "");
+ getDefaultMusicDir(MUS_CLASSIC_SUBDIR) : "");
}
static char *getUserGraphicsDir()
return filename;
}
-static char *getCorrectedImageBasename(char *basename)
+static char *getCorrectedArtworkBasename(char *basename)
{
char *basename_corrected = basename;
/* if corrected filename is still longer than standard MS-DOS filename
size (8 characters + 1 dot + 3 characters file extension), shorten
filename by writing file extension after 8th basename character */
- if (strlen(basename_corrected) > 8+1+3)
+ if (strlen(basename_corrected) > 8 + 1 + 3)
{
static char *msdos_filename = NULL;
free(msdos_filename);
msdos_filename = getStringCopy(basename_corrected);
- strncpy(&msdos_filename[8], &basename[strlen(basename) - 1+3], 1+3 + 1);
+ strncpy(&msdos_filename[8], &basename[strlen(basename) - (1+3)], 1+3 +1);
+
+ basename_corrected = msdos_filename;
}
}
#endif
if (filename != NULL)
free(filename);
- basename = getCorrectedImageBasename(basename);
+ basename = getCorrectedArtworkBasename(basename);
if (!setup.override_level_graphics)
{
}
/* 4th try: look for default artwork in new default artwork directory */
- filename = getPath2(getDefaultGraphicsDir(GRAPHICS_SUBDIR), basename);
+ filename = getPath2(getDefaultGraphicsDir(GFX_CLASSIC_SUBDIR), basename);
if (fileExists(filename))
return filename;
if (filename != NULL)
free(filename);
+ basename = getCorrectedArtworkBasename(basename);
+
if (!setup.override_level_sounds)
{
/* 1st try: look for special artwork in current level series directory */
}
/* 4th try: look for default artwork in new default artwork directory */
- filename = getPath2(getDefaultSoundsDir(SOUNDS_SUBDIR), basename);
+ filename = getPath2(getDefaultSoundsDir(SND_CLASSIC_SUBDIR), basename);
if (fileExists(filename))
return filename;
}
/* 4th try: look for default artwork in new default artwork directory */
- directory = getStringCopy(getDefaultMusicDir(MUSIC_SUBDIR));
+ directory = getStringCopy(getDefaultMusicDir(MUS_CLASSIC_SUBDIR));
if (fileExists(directory))
return directory;
getTreeInfoFromIdentifier(artwork.gfx_first, setup.graphics_set);
if (artwork.gfx_current == NULL)
artwork.gfx_current =
- getTreeInfoFromIdentifier(artwork.gfx_first, GRAPHICS_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.gfx_first, GFX_CLASSIC_SUBDIR);
if (artwork.gfx_current == NULL)
artwork.gfx_current = getFirstValidTreeInfoEntry(artwork.gfx_first);
getTreeInfoFromIdentifier(artwork.snd_first, setup.sounds_set);
if (artwork.snd_current == NULL)
artwork.snd_current =
- getTreeInfoFromIdentifier(artwork.snd_first, SOUNDS_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.snd_first, SND_CLASSIC_SUBDIR);
if (artwork.snd_current == NULL)
artwork.snd_current = getFirstValidTreeInfoEntry(artwork.snd_first);
getTreeInfoFromIdentifier(artwork.mus_first, setup.music_set);
if (artwork.mus_current == NULL)
artwork.mus_current =
- getTreeInfoFromIdentifier(artwork.mus_first, MUSIC_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.mus_first, MUS_CLASSIC_SUBDIR);
if (artwork.mus_current == NULL)
artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first);
getTreeInfoFromIdentifier(artwork.gfx_first, setup.graphics_set);
if (artwork.gfx_current == NULL)
artwork.gfx_current =
- getTreeInfoFromIdentifier(artwork.gfx_first, GRAPHICS_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.gfx_first, GFX_CLASSIC_SUBDIR);
if (artwork.gfx_current == NULL)
artwork.gfx_current = getFirstValidTreeInfoEntry(artwork.gfx_first);
}
getTreeInfoFromIdentifier(artwork.snd_first, setup.sounds_set);
if (artwork.snd_current == NULL)
artwork.snd_current =
- getTreeInfoFromIdentifier(artwork.snd_first, SOUNDS_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.snd_first, SND_CLASSIC_SUBDIR);
if (artwork.snd_current == NULL)
artwork.snd_current = getFirstValidTreeInfoEntry(artwork.snd_first);
}
getTreeInfoFromIdentifier(artwork.mus_first, setup.music_set);
if (artwork.mus_current == NULL)
artwork.mus_current =
- getTreeInfoFromIdentifier(artwork.mus_first, MUSIC_SUBDIR);
+ getTreeInfoFromIdentifier(artwork.mus_first, MUS_CLASSIC_SUBDIR);
if (artwork.mus_current == NULL)
artwork.mus_current = getFirstValidTreeInfoEntry(artwork.mus_first);
}
ldi.first_level = 1;
ldi.sort_priority = LEVELCLASS_USER_START;
ldi.readonly = FALSE;
- setString(&ldi.graphics_set, GRAPHICS_SUBDIR);
- setString(&ldi.sounds_set, SOUNDS_SUBDIR);
- setString(&ldi.music_set, MUSIC_SUBDIR);
+ setString(&ldi.graphics_set, GFX_CLASSIC_SUBDIR);
+ setString(&ldi.sounds_set, SND_CLASSIC_SUBDIR);
+ setString(&ldi.music_set, MUS_CLASSIC_SUBDIR);
#else
ldi.name = getStringCopy(getLoginName());
ldi.author = getStringCopy(getRealName());
ldi.first_level = 1;
ldi.sort_priority = LEVELCLASS_USER_START;
ldi.readonly = FALSE;
- ldi.graphics_set = getStringCopy(GRAPHICS_SUBDIR);
- ldi.sounds_set = getStringCopy(SOUNDS_SUBDIR);
- ldi.music_set = getStringCopy(MUSIC_SUBDIR);
+ ldi.graphics_set = getStringCopy(GFX_CLASSIC_SUBDIR);
+ ldi.sounds_set = getStringCopy(SND_CLASSIC_SUBDIR);
+ ldi.music_set = getStringCopy(MUS_CLASSIC_SUBDIR);
#endif
fprintf(file, "%s\n\n", getFormattedSetupEntry(TOKEN_STR_FILE_IDENTIFIER,