rnd-20020505-2-src
[rocksndiamonds.git] / src / libgame / setup.c
index fefe33dfbd0dfa074578769eb7d865371ce4b9ee..7b0189b880f3744e0ff6a0d85137cc7b261bf233 100644 (file)
@@ -79,7 +79,8 @@ static char *levelclass_desc[NUM_LEVELCLASS_DESC] =
                         IS_LEVELCLASS_USER(n) ?                7 : \
                         9)
 
-#define TOKEN_VALUE_POSITION           30
+#define TOKEN_VALUE_POSITION           40
+#define TOKEN_COMMENT_POSITION         60
 
 #define MAX_COOKIE_LEN                 256
 
@@ -422,6 +423,11 @@ char *getCustomSoundFilename(char *basename)
   return NULL;                                 /* cannot find image file */
 }
 
+char *getCustomSoundConfigFilename()
+{
+  return getCustomSoundFilename(SOUNDSINFO_FILENAME);
+}
+
 char *getCustomMusicDirectory(void)
 {
   static char *directory = NULL;
@@ -1649,12 +1655,12 @@ static boolean LoadArtworkInfoFromArtworkConf(TreeInfo **node_first,
 
   if (node_parent == NULL)             /* top level group */
   {
-    artwork_new->basepath = base_directory;
-    artwork_new->fullpath = artwork_new->filename;
+    artwork_new->basepath = getStringCopy(base_directory);
+    artwork_new->fullpath = getStringCopy(artwork_new->filename);
   }
   else                                 /* sub level group */
   {
-    artwork_new->basepath = node_parent->basepath;
+    artwork_new->basepath = getStringCopy(node_parent->basepath);
     artwork_new->fullpath = getPath2(node_parent->fullpath, directory_name);
   }
 
@@ -1922,7 +1928,9 @@ char *getSetupLine(struct TokenInfo *token_info, char *prefix, int token_nr)
     if (strcmp(keyname, "(undefined)") != 0 &&
        strcmp(keyname, "(unknown)") != 0)
     {
-      for (i=strlen(entry); i<50; i++)
+      /* add at least one whitespace */
+      strcat(entry, " ");
+      for (i=strlen(entry); i<TOKEN_COMMENT_POSITION; i++)
        strcat(entry, " ");
 
       strcat(entry, "# ");