mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-24 13:01:48 +00:00
- snd_midipatchset and fluid_patchset are now processed through NicePath() for variable
substitution. In addition, on Windows, if they contain no path separator, they will automatically have $PROGDIR prepended to them. SVN r3781 (trunk)
This commit is contained in:
parent
37dffe210f
commit
12ef53a2ff
2 changed files with 31 additions and 2 deletions
|
@ -1598,6 +1598,7 @@ SoundStream *FMODSoundRenderer::OpenStream(const char *filename_or_data, int fla
|
|||
FMOD::Sound *stream;
|
||||
FMOD_RESULT result;
|
||||
bool url;
|
||||
FString patches;
|
||||
|
||||
InitCreateSoundExInfo(&exinfo);
|
||||
mode = FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESTREAM;
|
||||
|
@ -1614,7 +1615,20 @@ SoundStream *FMODSoundRenderer::OpenStream(const char *filename_or_data, int fla
|
|||
exinfo.fileoffset = offset;
|
||||
if ((*snd_midipatchset)[0] != '\0')
|
||||
{
|
||||
exinfo.dlsname = snd_midipatchset;
|
||||
#ifdef _WIN32
|
||||
// If the path does not contain any path separators, automatically
|
||||
// prepend $PROGDIR to the path.
|
||||
if (strcspn(snd_midipatchset, ":/\\") == strlen(snd_midipatchset))
|
||||
{
|
||||
patches << "$PROGDIR/" << snd_midipatchset;
|
||||
patches = NicePath(patches);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
patches = NicePath(snd_midipatchset);
|
||||
}
|
||||
exinfo.dlsname = patches;
|
||||
}
|
||||
|
||||
url = (offset == 0 && length == 0 && strstr(filename_or_data, "://") > filename_or_data);
|
||||
|
|
|
@ -42,6 +42,7 @@
|
|||
#include "m_swap.h"
|
||||
#include "w_wad.h"
|
||||
#include "v_text.h"
|
||||
#include "cmdlib.h"
|
||||
|
||||
// MACROS ------------------------------------------------------------------
|
||||
|
||||
|
@ -471,7 +472,21 @@ int FluidSynthMIDIDevice::LoadPatchSets(const char *patches)
|
|||
count = 0;
|
||||
while (tok != NULL)
|
||||
{
|
||||
if (FLUID_FAILED != fluid_synth_sfload(FluidSynth, tok, count == 0))
|
||||
FString path;
|
||||
#ifdef _WIN32
|
||||
// If the path does not contain any path separators, automatically
|
||||
// prepend $PROGDIR to the path.
|
||||
if (strcspn(tok, ":/\\") == strlen(tok))
|
||||
{
|
||||
path << "$PROGDIR/" << tok;
|
||||
path = NicePath(path);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
path = NicePath(tok);
|
||||
}
|
||||
if (FLUID_FAILED != fluid_synth_sfload(FluidSynth, path, count == 0))
|
||||
{
|
||||
DPrintf("Loaded patch set %s.\n", tok);
|
||||
count++;
|
||||
|
|
Loading…
Reference in a new issue