summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 97d6006)
raw | patch | inline | side by side (parent: 97d6006)
author | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 21 Oct 2019 16:49:24 +0000 (19:49 +0300) | ||
committer | DeaDDooMER <deaddoomer@deadsoftware.ru> | |
Mon, 21 Oct 2019 16:49:24 +0000 (19:49 +0300) |
src/engine/e_res.pas | patch | blob | history |
diff --git a/src/engine/e_res.pas b/src/engine/e_res.pas
index a4f9da50bd829c9fc28605d850bd0b60df8e12f7..a6d4bd5349806af849ef63eb4bcb27015e4dc808 100644 (file)
--- a/src/engine/e_res.pas
+++ b/src/engine/e_res.pas
{--- returns relative wad name; never empty string ---}
function e_FindWadRel (dirs: SSArray; name: AnsiString): AnsiString;
- {--- append dirs to 'path.wad:\file'. if disk is void, append defWad ---}
+ {--- prepend dirs to 'disk.wad:\file'. if empty disk string then prepend defWad ---}
+ {--- return empty string if error occured or 'path/to/disk.wad:\file' on success ---}
function e_GetResourcePath (dirs: SSArray; path: AnsiString; defWad: AnsiString): AnsiString;
{--- same as SysUtils.FinFirst ---}
var diskName, fileName: AnsiString;
begin
if debug_e_res then
- e_LogWritefln('e_GetResourcePath0 %s (%s)', [path, defWad]);
+ e_LogWritefln('e_GetResourcePath %s (%s)', [path, defWad]);
assert(length(dirs) > 0);
assert(path <> '');
assert(defWad <> '');
diskName := g_ExtractWadName(path);
fileName := g_ExtractFilePathName(path);
if diskName = '' then diskName := defWad else diskName := e_FindWad(dirs, diskName);
- assert(diskName <> '', 'oh fuck, wad "' + diskName + '" not founded');
- result := diskName + ':\' + fileName;
+ if diskName = '' then result := '' else result := diskName + ':\' + fileName;
if debug_e_res then
e_LogWritefln(' this>>> %s', [result]);
end;