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, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *)
16 // simple grouping files w/o packing:
17 // Quake I/II .PAK (PACK)
18 // SiN .SIN (SPAK)
19 //
20 {$INCLUDE ../shared/a_modes.inc}
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);