- 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:
Randy Heit 2012-07-21 03:46:36 +00:00
commit 12ef53a2ff
2 changed files with 31 additions and 2 deletions

View file

@ -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);