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, either version 3 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>.
16 *)
17 {$INCLUDE ../shared/a_modes.inc}
18 {.$DEFINE FUI_WADREAD_DEBUG}
21 interface
23 uses
29 // returns `nil` if file wasn't found
33 var
37 implementation
39 uses
43 // ////////////////////////////////////////////////////////////////////////// //
44 type
46 public
50 public
54 // returns `nil` if file wasn't found
60 {$IFDEF FUI_WADREAD_DEBUG}
61 var
63 {$ENDIF}
64 begin
68 {$IFDEF FUI_WADREAD_DEBUG}
70 begin
73 begin
79 {$ENDIF}
84 begin
92 var
95 begin
98 // backwards, due to possible similar names and such
100 begin
104 begin
105 try
107 except
117 // ////////////////////////////////////////////////////////////////////////// //
119 begin
124 // ////////////////////////////////////////////////////////////////////////// //
125 var
130 var
135 begin
138 // find disk file
141 if (Length(wadfile) > 2) and (wadfile[1] = '.') and ((wadfile[2] = '/') or (wadfile[2] = '\')) then
142 begin
146 begin
148 exit;
150 end
151 else
152 begin
157 begin
161 begin
163 exit;
168 // check if we already have this file opened
170 begin
173 begin
174 // i found her! move it to the bottom of the list, so it will be checked first
177 exit;
181 // create new wad file
182 try
186 exit;
197 // ////////////////////////////////////////////////////////////////////////// //
198 // returns `nil` if file wasn't found
200 var
202 begin
204 try
207 except
213 // returns `nil` if file wasn't found
215 var
217 begin
218 // disk
220 begin
224 // wads
226 begin
229 begin
230 {$IFDEF FUI_WADREAD_DEBUG}writeln('FUI: opened WAD file: ''', fname, ''' (from ''', wadlist[f].wadname, ''')');{$ENDIF}
231 exit;
234 // disk
236 begin