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 WAV loader that just uses SDL_LoadWAV
26 public
33 private
41 public
47 implementation
49 uses
50 {$IFDEF USE_SDL}
51 SDL,
52 {$ELSE}
53 SDL2,
54 {$ENDIF}
57 (* TWAVLoaderFactory *)
60 var
62 begin
64 begin
66 exit;
69 Result := ((P+0)^ = Ord('R')) and ((P+1)^ = Ord('I')) and ((P+2)^ = Ord('F')) and ((P+3)^ = Ord('F'));
73 begin
74 // TODO: ehhh
79 begin
83 (* TWAVLoader *)
84 function ConvertSound (var buf: PUInt8; var len: UInt32; var format: UInt16; rate: cint; chan: UInt8): Boolean;
86 begin
97 begin
100 begin
106 format := tformat
107 end
108 end
112 var
116 begin
118 {$IFDEF USE_SDL2}
120 {$ELSE}
122 {$ENDIF}
123 begin
126 begin
128 begin
130 {$IFDEF USE_SDL2}
132 {$ELSE}
134 {$ENDIF}
139 end
140 end
141 else
142 begin
144 end
145 end
149 var
151 begin
162 var
164 begin
167 begin
171 end
172 else
173 begin
183 begin
188 begin
194 var
197 begin
202 begin
216 begin
224 initialization