-#define COMPILE_DATE_STRING "2007-09-18 02:08"
+#define COMPILE_DATE_STRING "2007-09-25 03:18"
#define SETUP_TOKEN_OVERRIDE_LEVEL_GRAPHICS 28
#define SETUP_TOKEN_OVERRIDE_LEVEL_SOUNDS 29
#define SETUP_TOKEN_OVERRIDE_LEVEL_MUSIC 30
+#define SETUP_TOKEN_OVERRIDE_CLASSIC_ARTWORK 31
-#define NUM_GLOBAL_SETUP_TOKENS 31
+#define NUM_GLOBAL_SETUP_TOKENS 32
/* editor setup */
#define SETUP_TOKEN_EDITOR_EL_BOULDERDASH 0
{ TYPE_SWITCH, &si.override_level_graphics, "override_level_graphics" },
{ TYPE_SWITCH, &si.override_level_sounds, "override_level_sounds" },
{ TYPE_SWITCH, &si.override_level_music, "override_level_music" },
+ { TYPE_SWITCH, &si.override_classic_artwork,"override_classic_artwork"},
};
static boolean not_used = FALSE;
si->override_level_graphics = FALSE;
si->override_level_sounds = FALSE;
si->override_level_music = FALSE;
+ si->override_classic_artwork = FALSE;
si->editor.el_boulderdash = TRUE;
si->editor.el_emerald_mine = TRUE;
InitMenuDesignSettings_Static();
InitMenuDesignSettings_SpecialPreProcessing();
+#if 1
+ if (!GFX_OVERRIDE_ARTWORK(ARTWORK_TYPE_GRAPHICS))
+#else
if (!SETUP_OVERRIDE_ARTWORK(setup, ARTWORK_TYPE_GRAPHICS))
+#endif
{
/* first look for special settings configured in level series config */
filename_base = getCustomArtworkLevelConfigFilename(ARTWORK_TYPE_GRAPHICS);
getFontBitmapID, getFontFromToken);
}
+static void CheckArtworkConfigForCustomElements(char *filename)
+{
+ SetupFileHash *setup_file_hash;
+ boolean redefined_ce_found = FALSE;
+
+ if ((setup_file_hash = loadSetupFileHash(filename)) != NULL)
+ {
+ BEGIN_HASH_ITERATION(setup_file_hash, itr)
+ {
+ char *token = HASH_ITERATION_TOKEN(itr);
+
+ if (strPrefix(token, "custom_"))
+ redefined_ce_found = TRUE;
+ }
+ END_HASH_ITERATION(setup_file_hash, itr)
+
+ freeSetupFileHash(setup_file_hash);
+ }
+
+ printf("::: redefined_ce_found == %d [%s]\n", redefined_ce_found, filename);
+}
+
+static void CheckCustomElementGraphicInfo()
+{
+ struct PropertyMapping *property_mapping = getImageListPropertyMapping();
+ int num_property_mappings = getImageListPropertyMappingSize();
+ boolean redefined_ce_found = FALSE;
+ int i;
+
+ /* check normal element/graphic mapping from static configuration */
+ for (i = 0; element_to_graphic[i].element > -1; i++)
+ {
+ int element = element_to_graphic[i].element;
+ int graphic = element_to_graphic[i].graphic;
+
+ if (IS_CUSTOM_ELEMENT(element))
+ if (getImageListEntryFromImageID(graphic)->redefined)
+ redefined_ce_found = TRUE;
+ }
+
+ /* check normal element/graphic mapping from dynamic configuration */
+ for (i = 0; i < num_property_mappings; i++)
+ {
+ int element = property_mapping[i].base_index;
+
+ if (IS_CUSTOM_ELEMENT(element))
+ redefined_ce_found = TRUE;
+ }
+
+ printf("::: redefined_ce_found == %d\n", redefined_ce_found);
+}
+
void InitElementGraphicInfo()
{
struct PropertyMapping *property_mapping = getImageListPropertyMapping();
InitGfxDoor1Info(DX, DY, DXSIZE, DYSIZE);
InitGfxDoor2Info(VX, VY, VXSIZE, VYSIZE);
InitGfxScrollbufferInfo(FXSIZE, FYSIZE);
+ InitGfxCustomArtworkInfo();
bitmap_font_initial = LoadCustomImage(filename_font_initial);
static boolean last_has_level_artwork_set[3] = { FALSE, FALSE, FALSE };
static boolean initialized[3] = { FALSE, FALSE, FALSE };
TreeInfo *artwork_first_node = ARTWORK_FIRST_NODE(artwork, type);
+#if 1
+ boolean setup_override_artwork = GFX_OVERRIDE_ARTWORK(type);
+#else
boolean setup_override_artwork = SETUP_OVERRIDE_ARTWORK(setup, type);
+#endif
char *setup_artwork_set = SETUP_ARTWORK_SET(setup, type);
char *leveldir_identifier = leveldir_current->identifier;
#if 1
boolean force_reload_mus = (force_reload & (1 << ARTWORK_TYPE_MUSIC));
boolean reload_needed;
+#if 1
+ gfx.draw_init_text = FALSE;
+
+ gfx.override_level_graphics = FALSE;
+ gfx.override_level_sounds = FALSE;
+ gfx.override_level_music = FALSE;
+
+#if 0
+ LoadImageConfig();
+#endif
+#if 0
+ CheckCustomElementGraphicInfo();
+#endif
+
+#if 1
+ {
+ char *filename_base, *filename_local;
+
+ /* first look for special artwork configured in level series config */
+ filename_base = getCustomArtworkLevelConfigFilename(ARTWORK_TYPE_GRAPHICS);
+
+ if (fileExists(filename_base))
+ CheckArtworkConfigForCustomElements(filename_base);
+
+ filename_local = getCustomArtworkConfigFilename(ARTWORK_TYPE_GRAPHICS);
+
+ if (filename_local != NULL && !strEqual(filename_base, filename_local))
+ CheckArtworkConfigForCustomElements(filename_local);
+ }
+#endif
+
+ gfx.override_level_graphics = setup.override_level_graphics;
+ gfx.override_level_sounds = setup.override_level_sounds;
+ gfx.override_level_music = setup.override_level_music;
+
+ gfx.draw_init_text = TRUE;
+#endif
+
force_reload_gfx |= AdjustGraphicsForEMC();
gfx_new_identifier = getNewArtworkIdentifier(ARTWORK_TYPE_GRAPHICS);
image_info->free_artwork = FreeImage;
}
+void LoadImageConfig()
+{
+ LoadArtworkConfig(image_info);
+}
+
void ReloadCustomImages()
{
#if 0
void InitImageList(struct ConfigInfo *, int, struct ConfigTypeInfo *,
char **, char **, char **, char **, char **);
+void LoadImageConfig();
void ReloadCustomImages();
void CreateImageWithSmallImages(int, int);
void ScaleImage(int, int);
artwork_info->num_property_mapping_entries = 0;
}
+#if 1
+ if (!GFX_OVERRIDE_ARTWORK(artwork_info->type))
+#else
if (!SETUP_OVERRIDE_ARTWORK(setup, artwork_info->type))
+#endif
{
/* first look for special artwork configured in level series config */
filename_base = getCustomArtworkLevelConfigFilename(artwork_info->type);
basename = getLevelSetTitleMessageBasename(nr, initial);
- if (!setup.override_level_graphics)
+ if (!gfx.override_level_graphics)
{
/* 1st try: look for special artwork in current level series directory */
filename = getPath3(getCurrentLevelDir(), GRAPHICS_DIRECTORY, basename);
basename = getCorrectedArtworkBasename(basename);
- if (!setup.override_level_graphics)
+ if (!gfx.override_level_graphics)
{
/* 1st try: look for special artwork in current level series directory */
filename = getPath3(getCurrentLevelDir(), GRAPHICS_DIRECTORY, basename);
basename = getCorrectedArtworkBasename(basename);
- if (!setup.override_level_sounds)
+ if (!gfx.override_level_sounds)
{
/* 1st try: look for special artwork in current level series directory */
filename = getPath3(getCurrentLevelDir(), SOUNDS_DIRECTORY, basename);
basename = getCorrectedArtworkBasename(basename);
- if (!setup.override_level_music)
+ if (!gfx.override_level_music)
{
/* 1st try: look for special artwork in current level series directory */
filename = getPath3(getCurrentLevelDir(), MUSIC_DIRECTORY, basename);
checked_free(directory);
- if (!setup.override_level_music)
+ if (!gfx.override_level_music)
{
/* 1st try: look for special artwork in current level series directory */
directory = getPath2(getCurrentLevelDir(), MUSIC_DIRECTORY);
unsigned long str_size4 = strlen(ti->basepath) + 1;
unsigned long str_size5 = strlen(ti->fullpath) + 1;
boolean override_level_artwork = (type == SND_CTRL_RELOAD_SOUNDS ?
- setup.override_level_sounds :
- setup.override_level_music);
+ gfx.override_level_sounds :
+ gfx.override_level_music);
if (IS_CHILD_PROCESS())
return;
unsigned long str_size1, str_size2, str_size3, str_size4, str_size5;
static char *set_identifier = NULL;
boolean *override_level_artwork = (snd_ctrl->state & SND_CTRL_RELOAD_SOUNDS ?
- &setup.override_level_sounds :
- &setup.override_level_music);
+ &gfx.override_level_sounds :
+ &gfx.override_level_music);
checked_free(set_identifier);
gfx.draw_busy_anim_function = draw_busy_anim_function;
}
+void InitGfxCustomArtworkInfo()
+{
+ gfx.override_level_graphics = FALSE;
+ gfx.override_level_sounds = FALSE;
+ gfx.override_level_music = FALSE;
+
+ gfx.draw_init_text = TRUE;
+}
+
void SetDrawDeactivationMask(int draw_deactivation_mask)
{
gfx.draw_deactivation_mask = draw_deactivation_mask;
(setup).override_level_sounds : \
(setup).override_level_music)
+#define GFX_OVERRIDE_ARTWORK(type) \
+ ((type) == ARTWORK_TYPE_GRAPHICS ? \
+ gfx.override_level_graphics : \
+ (type) == ARTWORK_TYPE_SOUNDS ? \
+ gfx.override_level_sounds : \
+ gfx.override_level_music)
+
#define ARTWORK_FIRST_NODE(artwork, type) \
((type) == ARTWORK_TYPE_GRAPHICS ? \
(artwork).gfx_first : \
Bitmap *background_bitmap;
int background_bitmap_mask;
+ boolean override_level_graphics;
+ boolean override_level_sounds;
+ boolean override_level_music;
+
+ boolean draw_init_text;
+
int num_fonts;
struct FontBitmapInfo *font_bitmap_info;
int (*select_font_function)(int);
boolean override_level_graphics;
boolean override_level_sounds;
boolean override_level_music;
-#if 0
+#if 1
boolean override_classic_artwork;
#endif
void InitGfxDoor2Info(int, int, int, int);
void InitGfxScrollbufferInfo(int, int);
void InitGfxDrawBusyAnimFunction(void (*draw_busy_anim_function)(void));
+void InitGfxCustomArtworkInfo();
void SetDrawDeactivationMask(int);
void SetDrawBackgroundMask(int);
void SetWindowBackgroundBitmap(Bitmap *);
return;
if (window != NULL &&
+ gfx.draw_init_text &&
gfx.num_fonts > 0 &&
gfx.font_bitmap_info[font_nr].bitmap != NULL)
{
{ TYPE_YES_NO, &setup.override_level_graphics,"Override Level Graphics:" },
{ TYPE_YES_NO, &setup.override_level_sounds, "Override Level Sounds:" },
{ TYPE_YES_NO, &setup.override_level_music, "Override Level Music:" },
+ { TYPE_YES_NO, &setup.override_classic_artwork,"Override Classic Artwork:" },
#else
{ TYPE_STRING, NULL, "Override Level Artwork:"},
{ TYPE_YES_NO, &setup.override_level_graphics, "Graphics:" },