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 {$SCOPEDENUMS OFF}
22 {.$R+}
25 interface
27 uses
31 type
35 protected
40 public
45 public
52 implementation
54 uses
58 { TSFSPlainVolume }
60 var
64 begin
72 begin
84 begin
88 result := TSFSPartialStream.Create(fFileStream, TSFSFileInfo(fFiles[index]).fOfs, TSFSFileInfo(fFiles[index]).fSize, false);
92 { TSFSPlainVolumeFactory }
94 begin
95 result :=
101 begin
105 function TSFSPlainVolumeFactory.Produce (const prefix, fileName: AnsiString; st: TStream): TSFSVolume;
106 var
110 begin
119 begin
120 if (dsize < 0) or (dofs < 0) or (dofs > st.Size) or (dofs+dsize > st.Size) or (dsize mod 64 <> 0) then exit;
122 end
124 begin
125 if (dsize < 0) or (dofs < 0) or (dofs > st.Size) or (dofs+dsize > st.Size) or (dsize mod 64 <> 0) then exit;
131 try
133 except
140 var
142 initialization
145 //finalization
146 // SFSUnregisterVolumeFactory(pakf);