1 (* Copyright (C) Doom 2D: Forever Developers
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
14 *)
15 // simple grouping files w/o packing:
16 // Quake I/II .PAK (PACK)
17 // SiN .SIN (SPAK)
18 //
19 {$INCLUDE ../shared/a_modes.inc}
20 {$SCOPEDENUMS OFF}
21 {.$R+}
24 interface
26 uses
30 type
34 protected
39 public
44 public
51 implementation
53 uses
57 { TSFSPlainVolume }
59 var
63 begin
71 begin
83 begin
87 result := TSFSPartialStream.Create(fFileStream, TSFSFileInfo(fFiles[index]).fOfs, TSFSFileInfo(fFiles[index]).fSize, false);
91 { TSFSPlainVolumeFactory }
93 begin
94 result :=
100 begin
104 function TSFSPlainVolumeFactory.Produce (const prefix, fileName: AnsiString; st: TStream): TSFSVolume;
105 var
109 begin
118 begin
119 if (dsize < 0) or (dofs < 0) or (dofs > st.Size) or (dofs+dsize > st.Size) or (dsize mod 64 <> 0) then exit;
121 end
123 begin
124 if (dsize < 0) or (dofs < 0) or (dofs > st.Size) or (dofs+dsize > st.Size) or (dsize mod 64 <> 0) then exit;
130 try
132 except
139 var
141 initialization
144 //finalization
145 // SFSUnregisterVolumeFactory(pakf);