600512b06e9cb05d805cb8d36e527f9b1b570fe4
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 {$INCLUDE ../shared/a_modes.inc}
18 interface
22 type
23 // a module loader that uses libmodplug
26 public
33 private
40 public
46 implementation
50 var
66 );
68 (* TModPlugLoaderFactory *)
71 var
73 begin
74 // HACK: there's no "test" function in modplug, so just try to load that shit
85 var
87 begin
93 begin
94 // update interpolation setting
97 else
103 (* TModPlugLoader *)
106 begin
111 begin
113 Exit;
127 var
131 begin
134 try
136 // ayy just read the entire file
144 except
154 begin
159 begin
168 var
170 begin
180 begin
182 begin
183 // assume it just ended and restart, because modplug only loops if the
184 // module tells it to
186 // this used to be Result := Cnt + Read(FFile, Buf + Cnt, Len - Cnt)
187 // but the difference appears to be negligible
189 end
190 else
196 begin
198 begin
206 initialization