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 FixSoundEndian (Buf: PUInt8; Len: UInt32; format: UInt16; rate: cint; chan: UInt8): Boolean;
83 const
84 {$IFDEF FPC_LITTLE_ENDIAN}
87 {$ELSE}
90 {$ENDIF}
92 begin
100 begin
103 begin
110 end
111 end
115 var
119 begin
121 {$IFDEF USE_SDL2}
123 {$ELSE}
125 {$ENDIF}
126 begin
129 begin
131 begin
133 {$IFDEF USE_SDL2}
135 {$ELSE}
137 {$ENDIF}
142 end
143 end
144 else
145 begin
147 end
148 end
152 var
154 begin
163 var
165 begin
168 begin
172 end
173 else
174 begin
182 begin
187 begin
191 begin
194 end
195 else
200 begin
206 begin
211 initialization