index 818e912f7ee532a42591b2059d890d39c4b27edb..1419f264faf6876b54adfe1d0b3f4dfa076bf713 100644 (file)
--- a/src/shared/wadreader.pas
+++ b/src/shared/wadreader.pas
-(* 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
*
* 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
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
uses
Classes,
uses
Classes,
- mempool, sfs, xstreams, utils;
+ {$IFDEF USE_MEMPOOL}mempool,{$ENDIF}
+ sfs, xstreams, utils;
type
type
- TWADFile = class(TPoolObject)
+ TWADFile = class{$IFDEF USE_MEMPOOL}(TPoolObject){$ENDIF}
private
fFileName: AnsiString; // empty: not opened
fIter: TSFSFileList;
private
fFileName: AnsiString; // empty: not opened
fIter: TSFSFileList;
property isOpen: Boolean read getIsOpen;
end;
property isOpen: Boolean read getIsOpen;
end;
-
+// g_ExtractWadName C:\svr\shit.wad:\MAPS\MAP01 -> C:/svr/shit.wad
function g_ExtractWadName (resourceStr: AnsiString): AnsiString;
function g_ExtractWadName (resourceStr: AnsiString): AnsiString;
+
+// g_ExtractWadNameNoPath C:\svr\shit.wad:\MAPS\MAP01 -> shit.wad
function g_ExtractWadNameNoPath (resourceStr: AnsiString): AnsiString;
function g_ExtractWadNameNoPath (resourceStr: AnsiString): AnsiString;
+
+// g_ExtractFilePath C:\svr\shit.wad:\MAPS\MAP01 -> :/MAPS
function g_ExtractFilePath (resourceStr: AnsiString): AnsiString;
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_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
var
SysUtils, e_log, MAPDEF, xdynrec;
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;
function normSlashes (s: AnsiString): AnsiString;
var
f: Integer;