$include for SNDINFO

Remember, just because you request it, that doesn't mean you'll get it.

Moderator: GZDoom Developers

$include for SNDINFO

Postby Marrub » Wed Jan 02, 2019 1:19 am

I would submit a PR for this but unfortunately I don't have a proper development environment right now, my suggestion is to add an $include directive to SNDINFO so that files can be included from it, for instance:
Code: Select allExpand view
$include "my/cool_file.txt"

My mod currently has 17 SNDINFO files for organization purposes, but they're all stuffed in the root directory with different extensions, which is rather awful. It's made worse since "SNDINFO" is 7 characters, so you can only have one extension, i.e. "sndinfo.1_thing" instead of "sndinfo.1_thing.txt".

EDIT: Seems all that would need to be added is a recursion in S_AddSNDINFO and a new SI_ enum.
EDIT EDIT: Actually, here's a diff, but I can't test it:
Code: Select allExpand view
@@ -133,10 +133,11 @@ enum SICommands
    SI_Rolloff,
    SI_Volume,
    SI_MusicAlias,
    SI_EDFOverride,
    SI_Attenuation,
+   SI_Include,
 };
 
 // Blood was a cool game. If Monolith ever releases the source for it,
 // you can bet I'll port it.
 
@@ -230,10 +231,11 @@ static const char *SICommandStrings[] =
    "$rolloff",
    "$volume",
    "$musicalias",
    "$edfoverride",
    "$attenuation",
+   "$include",
    NULL
 };
 
 static TArray<FRandomSoundList> S_rnd;
 static FMusicVolume *MusicVolumes;
@@ -1482,10 +1484,17 @@ static void S_AddSNDINFO (int lump)
          case SI_IfStrife:
          case SI_IfHeretic:
          case SI_IfHexen:
             skipToEndIf = !CheckGame(sc.String+3, true);
             break;
+         case SI_Include:
+            sc.MustGetString();
+            if (Wads.CheckNumForName (sc.String))
+            {
+               S_AddSNDINFO (lump);
+            }
+            break;
          }
       }
       else
       { // Got a logical sound mapping
          FString name (sc.String);
User avatar
Marrub
Xevv Va Rkvyr
 
 
 
Joined: 26 Feb 2013
Discord: Marrub#5455
Twitch ID: marrubdaskuleion
Github ID: marrub--

Return to Feature Suggestions

Who is online

Users browsing this forum: No registered users and 1 guest

cron