X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fshared%2Fwadreader.pas;h=1419f264faf6876b54adfe1d0b3f4dfa076bf713;hb=03988912c6a1d85d8ba35362e45690c414f13d0b;hp=818e912f7ee532a42591b2059d890d39c4b27edb;hpb=cd1ca85acc0740e0f307782e2af54e5ba0a59507;p=d2df-sdl.git diff --git a/src/shared/wadreader.pas b/src/shared/wadreader.pas index 818e912..1419f26 100644 --- a/src/shared/wadreader.pas +++ b/src/shared/wadreader.pas @@ -1,9 +1,8 @@ -(* Copyright (C) DooM 2D:Forever Developers +(* Copyright (C) Doom 2D: Forever Developers * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. + * the Free Software Foundation, version 3 of the License ONLY. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -23,11 +22,12 @@ interface uses Classes, - mempool, sfs, xstreams, utils; + {$IFDEF USE_MEMPOOL}mempool,{$ENDIF} + sfs, xstreams, utils; type - TWADFile = class(TPoolObject) + TWADFile = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF} private fFileName: AnsiString; // empty: not opened fIter: TSFSFileList; @@ -56,15 +56,20 @@ type property isOpen: Boolean read getIsOpen; end; - +// g_ExtractWadName C:\svr\shit.wad:\MAPS\MAP01 -> C:/svr/shit.wad function g_ExtractWadName (resourceStr: AnsiString): AnsiString; + +// g_ExtractWadNameNoPath C:\svr\shit.wad:\MAPS\MAP01 -> shit.wad function g_ExtractWadNameNoPath (resourceStr: AnsiString): AnsiString; + +// g_ExtractFilePath C:\svr\shit.wad:\MAPS\MAP01 -> :/MAPS function g_ExtractFilePath (resourceStr: AnsiString): AnsiString; + +// g_ExtractFileName C:\svr\shit.wad:\MAPS\MAP01 -> MAP01 function g_ExtractFileName (resourceStr: AnsiString): AnsiString; // without path -function g_ExtractFilePathName (resourceStr: AnsiString): AnsiString; -// return fixed AnsiString or empty AnsiString -function findDiskWad (fname: AnsiString): AnsiString; +// g_ExtractFilePathName C:\svr\shit.wad:\MAPS\MAP01 -> MAPS/MAP01 +function g_ExtractFilePathName (resourceStr: AnsiString): AnsiString; var @@ -78,33 +83,6 @@ uses SysUtils, e_log, MAPDEF, xdynrec; -function findDiskWad (fname: AnsiString): AnsiString; -begin - result := ''; - if not findFileCI(fname) then - begin - //e_WriteLog(Format('findDiskWad: error looking for [%s]', [fname]), MSG_NOTIFY); - if StrEquCI1251(ExtractFileExt(fname), '.wad') then - begin - fname := ChangeFileExt(fname, '.pk3'); - //e_WriteLog(Format(' looking for [%s]', [fname]), MSG_NOTIFY); - if not findFileCI(fname) then - begin - fname := ChangeFileExt(fname, '.zip'); - //e_WriteLog(Format(' looking for [%s]', [fname]), MSG_NOTIFY); - if not findFileCI(fname) then exit; - end; - end - else - begin - exit; - end; - end; - //e_WriteLog(Format('findDiskWad: FOUND [%s]', [fname]), MSG_NOTIFY); - result := fname; -end; - - function normSlashes (s: AnsiString): AnsiString; var f: Integer;