From: Holger Schemel Date: Wed, 23 Jul 2003 21:04:05 +0000 (+0200) Subject: rnd-20030722-1-src X-Git-Tag: 3.0.0^2~13 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=2ff21518535f914abaacf8ffc72bfbd2f319dcd5;p=rocksndiamonds.git rnd-20030722-1-src --- diff --git a/src/conftime.h b/src/conftime.h index 7c13c9f4..f45491f6 100644 --- a/src/conftime.h +++ b/src/conftime.h @@ -1 +1 @@ -#define COMPILE_DATE_STRING "[2003-07-19 19:45]" +#define COMPILE_DATE_STRING "[2003-07-23 01:01]" diff --git a/src/game.c b/src/game.c index 78aa5158..c2deb648 100644 --- a/src/game.c +++ b/src/game.c @@ -6417,6 +6417,7 @@ void ScrollScreen(struct PlayerInfo *player, int mode) void TestIfPlayerTouchesCustomElement(int x, int y) { + static boolean check_changing = FALSE; static int xy[4][2] = { { 0, -1 }, @@ -6427,6 +6428,12 @@ void TestIfPlayerTouchesCustomElement(int x, int y) boolean center_is_player = (IS_PLAYER(x, y)); int i; + /* prevent TestIfPlayerTouchesCustomElement() from looping */ + if (check_changing) + return; + + check_changing = TRUE; + for (i=0; i<4; i++) { int xx = x + xy[i][0]; @@ -6448,10 +6455,13 @@ void TestIfPlayerTouchesCustomElement(int x, int y) break; } } + + check_changing = FALSE; } void TestIfElementTouchesCustomElement(int x, int y) { + static boolean check_changing = FALSE; static int xy[4][2] = { { 0, -1 }, @@ -6462,6 +6472,12 @@ void TestIfElementTouchesCustomElement(int x, int y) boolean center_is_custom = (IS_CUSTOM_ELEMENT(Feld[x][y])); int i; + /* prevent TestIfElementTouchesCustomElement() from looping */ + if (check_changing) + return; + + check_changing = TRUE; + for (i=0; i<4; i++) { int xx = x + xy[i][0]; @@ -6482,6 +6498,8 @@ void TestIfElementTouchesCustomElement(int x, int y) CheckElementChange(xx, yy, Feld[xx][yy], CE_OTHER_IS_TOUCHING); } } + + check_changing = FALSE; } void TestIfGoodThingHitsBadThing(int good_x, int good_y, int good_move_dir) diff --git a/src/init.c b/src/init.c index e7013f64..57cdc8e1 100644 --- a/src/init.c +++ b/src/init.c @@ -3200,8 +3200,8 @@ void ReloadCustomArtwork() if (leveldir_current->music_set != NULL) mus_new_identifier = leveldir_current->music_set; -#if 0 - printf("CHECKING OLD/NEW GFX:\n OLD: '%s'\n NEW: '%s' ['%s', '%s']\n", +#if 1 + printf("CHECKING OLD/NEW GFX:\n OLD: '%s'\n NEW: '%s' [setup '%s', level '%s']\n", artwork.gfx_current_identifier, gfx_new_identifier, artwork.gfx_current->identifier, leveldir_current->graphics_set); #endif @@ -3209,7 +3209,7 @@ void ReloadCustomArtwork() if (strcmp(artwork.gfx_current_identifier, gfx_new_identifier) != 0 || last_override_level_graphics != setup.override_level_graphics) { -#if 0 +#if 1 printf("RELOADING GRAPHICS '%s' -> '%s' ['%s']\n", artwork.gfx_current_identifier, gfx_new_identifier, diff --git a/src/libgame/misc.c b/src/libgame/misc.c index f9ebbccd..f4871757 100644 --- a/src/libgame/misc.c +++ b/src/libgame/misc.c @@ -2282,6 +2282,11 @@ static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info, ListNode *node; char *filename = getCustomArtworkFilename(basename, artwork_info->type); +#if 1 + if (strcmp(basename, "RocksScreen.pcx") == 0) + printf("::: got filename '%s'\n", filename); +#endif + if (filename == NULL) { int error_mode = ERR_WARN; @@ -2301,8 +2306,11 @@ static void replaceArtworkListEntry(struct ArtworkListInfo *artwork_info, This usually means that this artwork does not exist in this artwork set and a fallback to the existing artwork is done. */ -#if 0 - printf("[artwork '%s' already exists (same list entry)]\n", filename); +#if 1 +#if 1 + if (strcmp(basename, "RocksScreen.pcx") == 0) +#endif + printf("[artwork '%s' already exists (same list entry)]\n", filename); #endif return; diff --git a/src/libgame/setup.c b/src/libgame/setup.c index 9b23e8af..165b8a2a 100644 --- a/src/libgame/setup.c +++ b/src/libgame/setup.c @@ -455,6 +455,10 @@ char *getCustomImageFilename(char *basename) { /* 1st try: look for special artwork configured in level series config */ filename = getPath2(getLevelArtworkDir(TREE_TYPE_GRAPHICS_DIR), basename); +#if 1 + if (strcmp(basename, "RocksScreen.pcx") == 0) + printf("::: check 1: filename '%s'\n", filename); +#endif if (fileExists(filename)) return filename; @@ -462,6 +466,10 @@ char *getCustomImageFilename(char *basename) /* 2nd try: look for special artwork in current level series directory */ filename = getPath3(getCurrentLevelDir(), GRAPHICS_DIRECTORY, basename); +#if 1 + if (strcmp(basename, "RocksScreen.pcx") == 0) + printf("::: check 2: filename '%s'\n", filename); +#endif if (fileExists(filename)) return filename; @@ -470,6 +478,10 @@ char *getCustomImageFilename(char *basename) /* 3rd try: look for special artwork in configured artwork directory */ filename = getPath2(getSetupArtworkDir(artwork.gfx_current), basename); +#if 1 + if (strcmp(basename, "RocksScreen.pcx") == 0) + printf("::: check 3: filename '%s'\n", filename); +#endif if (fileExists(filename)) return filename; @@ -477,6 +489,10 @@ char *getCustomImageFilename(char *basename) /* 4th try: look for default artwork in new default artwork directory */ filename = getPath2(getDefaultGraphicsDir(GRAPHICS_SUBDIR), basename); +#if 1 + if (strcmp(basename, "RocksScreen.pcx") == 0) + printf("::: check 4: filename '%s'\n", filename); +#endif if (fileExists(filename)) return filename; @@ -484,6 +500,10 @@ char *getCustomImageFilename(char *basename) /* 5th try: look for default artwork in old default artwork directory */ filename = getPath2(options.graphics_directory, basename); +#if 1 + if (strcmp(basename, "RocksScreen.pcx") == 0) + printf("::: check 5: filename '%s'\n", filename); +#endif if (fileExists(filename)) return filename; diff --git a/src/screens.c b/src/screens.c index f0f2a51f..1a239518 100644 --- a/src/screens.c +++ b/src/screens.c @@ -1698,13 +1698,13 @@ static void execSetupSound() static void execSetupArtwork() { - /* needed if last screen (setup choice) changed graphics, sounds or music */ - ReloadCustomArtwork(); - setup.graphics_set = artwork.gfx_current->identifier; setup.sounds_set = artwork.snd_current->identifier; setup.music_set = artwork.mus_current->identifier; + /* needed if last screen (setup choice) changed graphics, sounds or music */ + ReloadCustomArtwork(); + /* needed for displaying artwork name instead of artwork identifier */ graphics_set_name = artwork.gfx_current->name; sounds_set_name = artwork.snd_current->name;