rnd-20030815-1-src
authorHolger Schemel <info@artsoft.org>
Fri, 15 Aug 2003 18:06:00 +0000 (20:06 +0200)
committerHolger Schemel <info@artsoft.org>
Sat, 30 Aug 2014 08:43:11 +0000 (10:43 +0200)
src/conftime.h
src/game.c
src/init.c
src/libgame/misc.c
src/libgame/setup.c
src/libgame/setup.h
src/screens.c

index 6a9ce93cd4e5db34f915e6e776104aa6c37c9fcb..c0029802f47c7ef9219c439236f676d1578d5ee8 100644 (file)
@@ -1 +1 @@
-#define COMPILE_DATE_STRING "[2003-08-09 03:13]"
+#define COMPILE_DATE_STRING "[2003-08-15 20:05]"
index 7968b389573e613f29b98c94da0921db3427d02c..2f2b0381cd79d02f3e6f12b28bf248b4e196359f 100644 (file)
@@ -427,7 +427,7 @@ static unsigned long trigger_events[MAX_NUM_ELEMENTS];
 void GetPlayerConfig()
 {
   if (!audio.sound_available)
-    setup.sound = FALSE;
+    setup.sound_simple = FALSE;
 
   if (!audio.loops_available)
     setup.sound_loops = FALSE;
@@ -438,7 +438,7 @@ void GetPlayerConfig()
   if (!video.fullscreen_available)
     setup.fullscreen = FALSE;
 
-  setup.sound_simple = setup.sound;
+  setup.sound = (setup.sound_simple || setup.sound_loops || setup.sound_music);
 
   SetAudioMode(setup.sound);
   InitJoysticks();
index ce61ae8b3331b30b7e4832162540072262c0fdeb..ddb8ff5fece3c0aa3c88a7fa33bc0c1980b2151a 100644 (file)
@@ -3203,7 +3203,9 @@ void InitLevelArtworkInfo()
 
 static void InitImages()
 {
+#if 0
   setLevelArtworkDir(artwork.gfx_first);
+#endif
 
 #if 0
   printf("::: InitImages for '%s' ['%s', '%s'] ['%s', '%s']\n",
@@ -3227,8 +3229,10 @@ static void InitSound(char *identifier)
   if (identifier == NULL)
     identifier = artwork.snd_current->identifier;
 
+#if 0
   /* set artwork path to send it to the sound server process */
   setLevelArtworkDir(artwork.snd_first);
+#endif
 
   InitReloadCustomSounds(identifier);
   ReinitializeSounds();
@@ -3239,8 +3243,10 @@ static void InitMusic(char *identifier)
   if (identifier == NULL)
     identifier = artwork.mus_current->identifier;
 
+#if 0
   /* set artwork path to send it to the sound server process */
   setLevelArtworkDir(artwork.mus_first);
+#endif
 
   InitReloadCustomMusic(identifier);
   ReinitializeMusic();
@@ -3279,7 +3285,11 @@ static char *getNewArtworkIdentifier(int type)
   boolean setup_override_artwork = SETUP_OVERRIDE_ARTWORK(setup, type);
   char *setup_artwork_set = SETUP_ARTWORK_SET(setup, type);
   char *leveldir_identifier = leveldir_current->identifier;
+#if 1
+  char *leveldir_artwork_set = setLevelArtworkDir(artwork_first_node);
+#else
   char *leveldir_artwork_set = LEVELDIR_ARTWORK_SET(leveldir_current, type);
+#endif
   boolean has_level_artwork_set = (leveldir_artwork_set != NULL);
   char *artwork_current_identifier;
   char *artwork_new_identifier = NULL; /* default: nothing has changed */
@@ -3288,7 +3298,6 @@ static char *getNewArtworkIdentifier(int type)
   if (!validLevelSeries(leveldir_current))
     return NULL;
 
-
   /* 1st step: determine artwork set to be activated in descending order:
      --------------------------------------------------------------------
      1. setup artwork (when configured to override everything else)
@@ -3310,6 +3319,16 @@ static char *getNewArtworkIdentifier(int type)
   /* 2nd step: check if it is really needed to reload artwork set
      ------------------------------------------------------------ */
 
+#if 0
+  if (type == ARTWORK_TYPE_GRAPHICS)
+    printf("::: 0: '%s' ['%s', '%s'] ['%s' ('%s')]\n",
+          artwork_new_identifier,
+          ARTWORK_CURRENT_IDENTIFIER(artwork, type),
+          artwork_current_identifier,
+          leveldir_current->graphics_set,
+          leveldir_current->identifier);
+#endif
+
   /* ---------- reload if level set and also artwork set has changed ------- */
   if (leveldir_current_identifier[type] != leveldir_identifier &&
       (last_has_level_artwork_set[type] || has_level_artwork_set))
@@ -3318,12 +3337,22 @@ static char *getNewArtworkIdentifier(int type)
   leveldir_current_identifier[type] = leveldir_identifier;
   last_has_level_artwork_set[type] = has_level_artwork_set;
 
+#if 0
+  if (type == ARTWORK_TYPE_GRAPHICS)
+    printf("::: 1: '%s'\n", artwork_new_identifier);
+#endif
+
   /* ---------- reload if "override artwork" setting has changed ----------- */
   if (last_override_level_artwork[type] != setup_override_artwork)
     artwork_new_identifier = artwork_current_identifier;
 
   last_override_level_artwork[type] = setup_override_artwork;
 
+#if 0
+  if (type == ARTWORK_TYPE_GRAPHICS)
+    printf("::: 2: '%s'\n", artwork_new_identifier);
+#endif
+
   /* ---------- reload if current artwork identifier has changed ----------- */
   if (strcmp(ARTWORK_CURRENT_IDENTIFIER(artwork, type),
             artwork_current_identifier) != 0)
@@ -3331,6 +3360,11 @@ static char *getNewArtworkIdentifier(int type)
 
   *(&(ARTWORK_CURRENT_IDENTIFIER(artwork, type))) = artwork_current_identifier;
 
+#if 0
+  if (type == ARTWORK_TYPE_GRAPHICS)
+    printf("::: 3: '%s'\n", artwork_new_identifier);
+#endif
+
   /* ---------- do not reload directly after starting ---------------------- */
   if (!initialized[type])
     artwork_new_identifier = NULL;
@@ -3338,10 +3372,16 @@ static char *getNewArtworkIdentifier(int type)
   initialized[type] = TRUE;
 
 #if 0
-  printf("CHECKING OLD/NEW GFX:\n- OLD: %s\n- NEW: %s ['%s', '%s'] ['%s']\n",
-        artwork.gfx_current_identifier, artwork_current_identifier,
-        artwork.gfx_current->identifier, leveldir_current->graphics_set,
-        artwork_new_identifier);
+  if (type == ARTWORK_TYPE_GRAPHICS)
+    printf("::: 4: '%s'\n", artwork_new_identifier);
+#endif
+
+#if 0
+  if (type == ARTWORK_TYPE_GRAPHICS)
+    printf("CHECKING OLD/NEW GFX:\n- OLD: %s\n- NEW: %s ['%s', '%s'] ['%s']\n",
+          artwork.gfx_current_identifier, artwork_current_identifier,
+          artwork.gfx_current->identifier, leveldir_current->graphics_set,
+          artwork_new_identifier);
 #endif
 
   return artwork_new_identifier;
@@ -3357,16 +3397,22 @@ void ReloadCustomArtwork()
   if (gfx_new_identifier != NULL)
   {
 #if 0
-    printf("RELOADING GRAPHICS '%s' -> '%s' ['%s']\n",
+    printf("RELOADING GRAPHICS '%s' -> '%s' ['%s', '%s']\n",
           artwork.gfx_current_identifier,
           gfx_new_identifier,
-          artwork.gfx_current->identifier);
+          artwork.gfx_current->identifier,
+          leveldir_current->graphics_set);
 #endif
 
     ClearRectangle(window, 0, 0, WIN_XSIZE, WIN_YSIZE);
 
     InitImages();
 
+#if 0
+    printf("... '%s'\n",
+          leveldir_current->graphics_set);
+#endif
+
     FreeTileClipmasks();
     InitTileClipmasks();
 
index f6cc110d4922e9e41be4fe8bae19fc1433919cab..70b2a5d6b802ccbcbe16894a44e5778ced15cfaf 100644 (file)
@@ -2165,8 +2165,7 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info,
     }
     END_HASH_ITERATION(extra_file_hash, itr)
 
-#if DEBUG
-    if (dynamic_tokens_found)
+    if (options.debug && dynamic_tokens_found)
     {
       Error(ERR_RETURN_LINE, "-");
       Error(ERR_RETURN, "dynamic token(s) found in config file:");
@@ -2182,7 +2181,6 @@ static void LoadArtworkConfigFromFilename(struct ArtworkListInfo *artwork_info,
 
       Error(ERR_RETURN_LINE, "-");
     }
-#endif
 
     if (unknown_tokens_found)
     {
index a99c7a83fa80178fbcb3638091dbc8eea39d431a..f0fbd60f3dc51c43ee6a62af47486917f035d616 100644 (file)
@@ -327,13 +327,13 @@ static char *getSetupArtworkDir(TreeInfo *ti)
   return artwork_dir;
 }
 
-void setLevelArtworkDir(TreeInfo *ti)
+char *setLevelArtworkDir(TreeInfo *ti)
 {
   char **artwork_path_ptr, **artwork_set_ptr;
   TreeInfo *level_artwork;
 
   if (ti == NULL || leveldir_current == NULL)
-    return;
+    return NULL;
 
   artwork_path_ptr = &(LEVELDIR_ARTWORK_PATH(leveldir_current, ti->type));
   artwork_set_ptr  = &(LEVELDIR_ARTWORK_SET( leveldir_current, ti->type));
@@ -370,6 +370,8 @@ void setLevelArtworkDir(TreeInfo *ti)
 
     free(dir);
   }
+
+  return *artwork_set_ptr;
 }
 
 inline static char *getLevelArtworkSet(int type)
index 30952c650e9b963aa26b0d658003d56599d79af9..5ae3bc4b97c36f72e00a292c0e25859a72219405 100644 (file)
@@ -185,7 +185,7 @@ typedef struct hashtable SetupFileHash;
                         ARTWORKCLASS_UNDEFINED)
 
 
-void setLevelArtworkDir(TreeInfo *);
+char *setLevelArtworkDir(TreeInfo *);
 char *getLevelFilename(int);
 char *getTapeFilename(int);
 char *getScoreFilename(int);
index c3b75a318bc81cf494c839d925f33a5f5f1ad09f..4637a650ff9dc1a1cc775a3312aa9c157288004c 100644 (file)
@@ -1830,8 +1830,6 @@ static struct TokenInfo setup_info_graphics[] =
 
 static struct TokenInfo setup_info_sound[] =
 {
-  { TYPE_SWITCH,       &setup.sound,           "Sound:",               },
-  { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_SWITCH,       &setup.sound_simple,    "Simple Sound:"         },
   { TYPE_SWITCH,       &setup.sound_loops,     "Sound Loops:"          },
   { TYPE_SWITCH,       &setup.sound_music,     "Game Music:"           },
@@ -2040,10 +2038,10 @@ static void DrawSetupScreen_Generic()
     int font_nr = FONT_MENU_1;
 
     /* set some entries to "unchangeable" according to other variables */
-    if ((value_ptr == &setup.sound       && !audio.sound_available) ||
-       (value_ptr == &setup.sound_loops && !audio.loops_available) ||
-       (value_ptr == &setup.sound_music && !audio.music_available) ||
-       (value_ptr == &setup.fullscreen  && !video.fullscreen_available))
+    if ((value_ptr == &setup.sound_simple && !audio.sound_available) ||
+       (value_ptr == &setup.sound_loops  && !audio.loops_available) ||
+       (value_ptr == &setup.sound_music  && !audio.music_available) ||
+       (value_ptr == &setup.fullscreen   && !video.fullscreen_available))
       setup_info[i].type |= TYPE_GHOSTED;
 
     if (setup_info[i].type & TYPE_STRING)