From: Holger Schemel Date: Sat, 2 Aug 2003 22:38:37 +0000 (+0200) Subject: rnd-20030803-1-src X-Git-Tag: 3.0.0^2~5 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=c2e3fd53db25f745d11fbe9b19bef78b3a3461a7;p=rocksndiamonds.git rnd-20030803-1-src --- diff --git a/src/conftime.h b/src/conftime.h index f2784dea..8793f015 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-08-02 20:23]" +#define COMPILE_DATE_STRING "[2003-08-03 00:37]" diff --git a/src/init.c b/src/init.c index dde09f6d..79a67d1e 100644 --- a/src/init.c +++ b/src/init.c @@ -3195,17 +3195,8 @@ void InitLevelArtworkInfo() static void InitImages() { - - TreeInfo *tst1 = getTreeInfoFromIdentifier(leveldir_first, "jue1"); - TreeInfo *tst2 = getTreeInfoFromIdentifier(leveldir_first, "demojue"); - printf("::: XXX 0 '%s' [%x, %x]\n", tst1->graphics_path, - tst1->graphics_path, tst2->graphics_path); - - setLevelArtworkDir(artwork.gfx_first); - printf("::: XXX 1 '%s'\n", tst1->graphics_path); - #if 0 printf("::: InitImages for '%s' ['%s', '%s'] ['%s', '%s']\n", leveldir_current->identifier, @@ -3217,16 +3208,10 @@ static void InitImages() ReloadCustomImages(); - printf("::: XXX 2 '%s'\n", tst1->graphics_path); - LoadCustomElementDescriptions(); LoadSpecialMenuDesignSettings(); - printf("::: XXX 3 '%s'\n", tst1->graphics_path); - ReinitializeGraphics(); - - printf("::: XXX 4 '%s'\n", tst1->graphics_path); } static void InitSound(char *identifier) diff --git a/src/libgame/misc.c b/src/libgame/misc.c index deac8050..cb79ee22 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2167,7 +2167,8 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info, if (dynamic_tokens_found) { Error(ERR_RETURN_LINE, "-"); - Error(ERR_RETURN, "dynamic token(s) found:"); + Error(ERR_RETURN, "dynamic token(s) found in config file:"); + Error(ERR_RETURN, "- config file: '%s'", filename); for (list = setup_file_list; list != NULL; list = list->next) { @@ -2220,7 +2221,7 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info) struct FileInfo *file_list = artwork_info->file_list; int num_file_list_entries = artwork_info->num_file_list_entries; int num_suffix_list_entries = artwork_info->num_suffix_list_entries; - char *filename_base, *filename_local; + char *filename_base = UNDEFINED_FILENAME, *filename_local; int i, j; #if 0 @@ -2264,11 +2265,14 @@ void LoadArtworkConfig(struct ArtworkListInfo *artwork_info) artwork_info->num_property_mapping_entries = 0; } - /* first look for special artwork configured in level series config */ - filename_base = getCustomArtworkLevelConfigFilename(artwork_info->type); + if (!SETUP_OVERRIDE_ARTWORK(setup, artwork_info->type)) + { + /* first look for special artwork configured in level series config */ + filename_base = getCustomArtworkLevelConfigFilename(artwork_info->type); - if (fileExists(filename_base)) - LoadArtworkConfigFromFilename(artwork_info, filename_base); + if (fileExists(filename_base)) + LoadArtworkConfigFromFilename(artwork_info, filename_base); + } filename_local = getCustomArtworkConfigFilename(artwork_info->type); @@ -2319,9 +2323,11 @@ static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info, { int error_mode = ERR_WARN; +#if 1 /* we can get away without sounds and music, but not without graphics */ if (*listnode == NULL && artwork_info->type == ARTWORK_TYPE_GRAPHICS) error_mode = ERR_EXIT; +#endif Error(error_mode, "cannot find artwork file '%s'", basename); return; @@ -2378,9 +2384,11 @@ static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info, { int error_mode = ERR_WARN; +#if 1 /* we can get away without sounds and music, but not without graphics */ if (artwork_info->type == ARTWORK_TYPE_GRAPHICS) error_mode = ERR_EXIT; +#endif Error(error_mode, "cannot load artwork file '%s'", basename); return; @@ -2455,6 +2463,18 @@ void ReloadCustomArtworkList(struct ArtworkListInfo *artwork_info) LoadArtworkToList(artwork_info, &artwork_info->artwork_list[i], file_list[i].filename, i); + +#if 0 + if (artwork_info->artwork_list[i] == NULL && + strcmp(file_list[i].default_filename, file_list[i].filename) != 0) + { + Error(ERR_WARN, "trying default artwork file '%s'", + file_list[i].default_filename); + + LoadArtworkToList(artwork_info, &artwork_info->artwork_list[i], + file_list[i].default_filename, i); + } +#endif } #if 0 diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 20160fc7..a99c7a83 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -332,39 +332,17 @@ void setLevelArtworkDir(TreeInfo *ti) char **artwork_path_ptr, **artwork_set_ptr; TreeInfo *level_artwork; - TreeInfo *tst1 = getTreeInfoFromIdentifier(leveldir_first, "jue1"); - printf("::: XXX 0.1 '%s'\n", tst1->graphics_path); - if (ti == NULL || leveldir_current == NULL) return; artwork_path_ptr = &(LEVELDIR_ARTWORK_PATH(leveldir_current, ti->type)); artwork_set_ptr = &(LEVELDIR_ARTWORK_SET( leveldir_current, ti->type)); - printf("::: ['%s', '%s']\n", tst1->identifier, leveldir_current->identifier); - - printf("::: XXX 0.2 '%s' [%x]\n", tst1->graphics_path, tst1->graphics_path); - -#if 1 if (*artwork_path_ptr != NULL) - { - if (ti->type == 0) - printf("::: free'ing '%s' [%x] [%x] [type %d] ...\n", - *artwork_path_ptr, *artwork_path_ptr, - leveldir_current->graphics_path, ti->type); - free(*artwork_path_ptr); - } -#endif - - printf("::: XXX 0.3 '%s' [%x]\n", tst1->graphics_path, tst1->graphics_path); if ((level_artwork = getTreeInfoFromIdentifier(ti, *artwork_set_ptr))) - { *artwork_path_ptr = getStringCopy(getSetupArtworkDir(level_artwork)); - - printf(":1: setting to '%s' [type %d] ...\n", *artwork_path_ptr, ti->type); - } else { /* No (or non-existing) artwork configured in "levelinfo.conf". This would @@ -383,19 +361,11 @@ void setLevelArtworkDir(TreeInfo *ti) { *artwork_path_ptr = getStringCopy(getDefaultArtworkDir(ti->type)); *artwork_set_ptr = getStringCopy(getDefaultArtworkSet(ti->type)); - - if (ti->type == 0) - printf(":2: setting to '%s' [type %d] ...\n", - *artwork_path_ptr, ti->type); } else { *artwork_path_ptr = getStringCopy(UNDEFINED_FILENAME); *artwork_set_ptr = NULL; - - if (ti->type == 0) - printf(":3: setting to '%s' [type %d] ...\n", - *artwork_path_ptr, ti->type); } free(dir); @@ -1922,13 +1892,6 @@ void LoadLevelInfo() LoadLevelInfoFromLevelDir(&leveldir_first, NULL, options.level_directory); LoadLevelInfoFromLevelDir(&leveldir_first, NULL, getUserLevelDir(NULL)); - { - TreeInfo *tst1 = getTreeInfoFromIdentifier(leveldir_first, "jue1"); - TreeInfo *tst2 = getTreeInfoFromIdentifier(leveldir_first, "demojue"); - printf("::: ??? 1 '%s' [%x, %x]\n", tst1->graphics_path, - tst1->graphics_path, tst2->graphics_path); - } - /* before sorting, the first entries will be from the user directory */ leveldir_current = getFirstValidTreeInfoEntry(leveldir_first); diff --git a/src/screens.c b/src/screens.c index d096d3bb..d0b5313d 100644 --- a/src/screens.c +++ b/src/screens.c @@ -197,8 +197,6 @@ void DrawMainMenu() int level_width = font_width * strlen("Level:"); int i; - printf("::: CHECK A: '%s'\n", leveldir_current->graphics_path); - UnmapAllGadgets(); FadeSounds(); @@ -224,24 +222,16 @@ void DrawMainMenu() /* needed if last screen was the setup screen and fullscreen state changed */ ToggleFullscreenIfNeeded(); - printf("::: CHECK B.1: '%s'\n", leveldir_current->graphics_path); - -#if 1 /* leveldir_current may be invalid (level group, parent link) */ if (!validLevelSeries(leveldir_current)) leveldir_current = getFirstValidTreeInfoEntry(leveldir_last_valid); /* store valid level series information */ leveldir_last_valid = leveldir_current; -#endif - - printf("::: CHECK B.2: '%s'\n", leveldir_current->graphics_path); /* needed if last screen (level choice) changed graphics, sounds or music */ ReloadCustomArtwork(); - printf("::: CHECK C: '%s'\n", leveldir_current->graphics_path); - #ifdef TARGET_SDL SetDrawtoField(DRAW_BACKBUFFER); #endif @@ -249,15 +239,6 @@ void DrawMainMenu() /* map gadgets for main menu screen */ MapTapeButtons(); -#if 0 - /* leveldir_current may be invalid (level group, parent link) */ - if (!validLevelSeries(leveldir_current)) - leveldir_current = getFirstValidTreeInfoEntry(leveldir_last_valid); - - /* store valid level series information */ - leveldir_last_valid = leveldir_current; -#endif - /* level_nr may have been set to value over handicap with level editor */ if (setup.handicap && level_nr > leveldir_current->handicap_level) level_nr = leveldir_current->handicap_level; @@ -325,8 +306,6 @@ static void gotoTopLevelDir() /* move upwards to top level directory */ while (leveldir_current->node_parent) { - printf("::: ---> '%s'\n", leveldir_current->graphics_path); - /* write a "path" into level tree for easy navigation to last level */ if (leveldir_current->node_parent->node_group->cl_first == -1) { @@ -348,11 +327,7 @@ static void gotoTopLevelDir() } leveldir_current = leveldir_current->node_parent; - - printf("::: +++> '%s'\n", leveldir_current->graphics_path); } - - printf("::: ===> '%s'\n", leveldir_current->graphics_path); } void HandleMainMenu(int mx, int my, int dx, int dy, int button) @@ -443,12 +418,8 @@ void HandleMainMenu(int mx, int my, int dx, int dy, int button) SaveLevelSetup_LastSeries(); SaveLevelSetup_SeriesInfo(); - printf("::: CHECK C.1: '%s'\n", leveldir_current->graphics_path); - gotoTopLevelDir(); - printf("::: CHECK C.2: '%s'\n", leveldir_current->graphics_path); - DrawChooseLevel(); } }