DEADSOFTWARE

added license info
[d2df-sdl.git] / src / sfs / sfsPlainFS.pas
index e43f367e994916171437e500548c679231ba6623..9a58e83c2e495b83d6c1f3d97adecbfb49178bec 100644 (file)
@@ -1,7 +1,18 @@
-// 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)
@@ -52,8 +63,8 @@ var
 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
@@ -62,8 +73,8 @@ begin
     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;
@@ -100,8 +111,8 @@ begin
   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