diff --git a/src/sfs/sfsPlainFS.pas b/src/sfs/sfsPlainFS.pas
index e43f367e994916171437e500548c679231ba6623..e116d933e2fd8ebab29d3429c5113cc44a531eff 100644 (file)
--- a/src/sfs/sfsPlainFS.pas
+++ b/src/sfs/sfsPlainFS.pas
-// Streaming R/O Virtual File System v0.2.0
-// Copyright (C) XL A.S. Ketmar. All rights reserved
-// See the file aplicense.txt for conditions of use.
-//
+(* 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.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *)
// simple grouping files w/o packing:
// Quake I/II .PAK (PACK)
// SiN .SIN (SPAK)
//
-{$MODE DELPHI}
-{$R+}
+{$INCLUDE ../shared/a_modes.inc}
+{.$R+}
unit sfsPlainFS;
interface
begin
if (fType <> sfspvPAK) and (fType <> sfspvSIN) then raise ESFSError.Create('invalid archive');
fFileStream.Seek(4, soCurrent); // skip signature
- fFileStream.ReadBuffer(dofs, 4);
- fFileStream.ReadBuffer(dsize, 4);
+ dofs := readLongWord(fFileStream);
+ dsize := readLongWord(fFileStream);
fFileStream.Position := dofs;
if fType = sfspvPAK then esz := 64 else esz := 128;
while dsize >= esz do
FillChar(name[0], length(name), 0);
fFileStream.ReadBuffer(name[0], esz-8);
fi.fName := PChar(@name[0]);
- fFileStream.ReadBuffer(fi.fOfs, 4);
- fFileStream.ReadBuffer(fi.fSize, 4);
+ fi.fOfs := readLongWord(fFileStream);
+ fi.fSize := readLongWord(fFileStream);
Dec(dsize, esz);
end;
end;
vt := sfspvNone;
st.ReadBuffer(sign[0], 4);
- st.ReadBuffer(dofs, 4);
- st.ReadBuffer(dsize, 4);
+ dofs := readLongWord(st);
+ dsize := readLongWord(st);
st.Seek(-12, soCurrent);
if sign = 'PACK' then
begin