From 87a32d9095699e17dab65701dd07b4cbb63c7d1c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 26 Dec 2021 13:10:03 +0100 Subject: [PATCH] Revert "- fixed music lookup for user maps." This reverts commit 9558e7d518c1d5f7a898fcb2564078bd9ec956ac. --- source/common/filesystem/filesystem.cpp | 17 ----------------- source/core/raze_music.cpp | 7 ++++++- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/source/common/filesystem/filesystem.cpp b/source/common/filesystem/filesystem.cpp index f03a613ef..3e7cdef79 100644 --- a/source/common/filesystem/filesystem.cpp +++ b/source/common/filesystem/filesystem.cpp @@ -1668,20 +1668,3 @@ FResourceLump* FileSystem::GetFileAt(int no) return FileInfo[no].lump; } -#include "c_dispatch.h" - -CCMD(fs_dir) -{ - int numfiles = fileSystem.GetNumEntries(); - - for (int i = 0; i < numfiles; i++) - { - auto container = fileSystem.GetResourceFileFullName(fileSystem.GetFileContainer(i)); - auto fn1 = fileSystem.GetFileFullName(i); - auto fns = fileSystem.GetFileShortName(i); - auto fnid = fileSystem.GetResourceId(i); - auto length = fileSystem.FileLength(i); - bool hidden = fileSystem.FindFile(fn1) != i; - Printf(PRINT_NONOTIFY, "%s%-64s %-15s (%5d) %10d %s %s\n", hidden? TEXTCOLOR_RED : TEXTCOLOR_UNTRANSLATED, fn1, fns, fnid, length, container, hidden ? "(h)" : ""); - } -} \ No newline at end of file diff --git a/source/core/raze_music.cpp b/source/core/raze_music.cpp index 09b010d34..a27b4146f 100644 --- a/source/core/raze_music.cpp +++ b/source/core/raze_music.cpp @@ -75,10 +75,15 @@ FString G_SetupFilenameBasedMusic(const char* fn, const char* defmusic) FString name = StripExtension(fn); FString test; + // Test if a real file with this name exists with all known extensions for music. for (auto& ext : knownMusicExts) { test.Format("%s.%s", name.GetChars(), ext); - if (fileSystem.FileExists(test)) return test; + if (FileExists(test)) return test; +#ifdef __unix__ + test.Format("%s.%s", name.GetChars(), FString(ext).MakeLower().GetChars()); + if (FileExists(test)) return test; +#endif } return defmusic; }