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
39 public
45 implementation
47 uses
48 {$IFDEF USE_SDL}
49 SDL,
50 {$ELSE}
51 SDL2,
52 {$ENDIF}
55 (* TWAVLoaderFactory *)
58 var
60 begin
62 begin
64 exit;
67 Result := ((P+0)^ = Ord('R')) and ((P+1)^ = Ord('I')) and ((P+2)^ = Ord('F')) and ((P+3)^ = Ord('F'));
71 begin
72 // TODO: ehhh
77 begin
81 (* TWAVLoader *)
82 function ConvertSound (var buf: PUInt8; var len: UInt32; var format: UInt16; rate: cint; chan: UInt8): Boolean;
84 begin
95 begin
98 begin
104 format := tformat
105 end
106 end
110 var
114 begin
116 {$IFDEF USE_SDL2}
118 {$ELSE}
120 {$ENDIF}
121 begin
124 begin
126 begin
128 {$IFDEF USE_SDL2}
130 {$ELSE}
132 {$ENDIF}
137 end
138 end
139 else
140 begin
142 end
143 end
147 var
149 begin
158 var
160 begin
163 begin
167 end
168 else
169 begin
177 begin
182 begin
186 begin
189 end
190 else
195 begin
201 begin
206 initialization