1 (* coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
2 * Understanding is not required. Only obedience.
3 *
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, version 3 of the License ONLY.
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 {$INCLUDE ../shared/a_modes.inc}
17 {.$DEFINE FUI_WADREAD_DEBUG}
20 interface
22 uses
28 // returns `nil` if file wasn't found
32 var
36 implementation
38 uses
42 // ////////////////////////////////////////////////////////////////////////// //
43 type
45 public
49 public
53 // returns `nil` if file wasn't found
59 {$IFDEF FUI_WADREAD_DEBUG}
60 var
62 {$ENDIF}
63 begin
67 {$IFDEF FUI_WADREAD_DEBUG}
69 begin
72 begin
78 {$ENDIF}
83 begin
91 var
94 begin
97 // backwards, due to possible similar names and such
99 begin
103 begin
104 try
106 except
116 // ////////////////////////////////////////////////////////////////////////// //
118 begin
123 // ////////////////////////////////////////////////////////////////////////// //
124 var
129 var
134 begin
137 // find disk file
140 if (Length(wadfile) > 2) and (wadfile[1] = '.') and ((wadfile[2] = '/') or (wadfile[2] = '\')) then
141 begin
145 begin
147 exit;
149 end
150 else
151 begin
156 begin
160 begin
162 exit;
167 // check if we already have this file opened
169 begin
172 begin
173 // i found her! move it to the bottom of the list, so it will be checked first
176 exit;
180 // create new wad file
181 try
185 exit;
196 // ////////////////////////////////////////////////////////////////////////// //
197 // returns `nil` if file wasn't found
199 var
201 begin
203 try
206 except
212 // returns `nil` if file wasn't found
214 var
216 begin
217 // disk
219 begin
223 // wads
225 begin
228 begin
229 {$IFDEF FUI_WADREAD_DEBUG}writeln('FUI: opened WAD file: ''', fname, ''' (from ''', wadlist[f].wadname, ''')');{$ENDIF}
230 exit;
233 // disk
235 begin