1 /*------------------------------------------------------------------.
2 | Copyright 1997, 1998, 2000, 2001  Alexandre Duret-Lutz            |
3 |                                    <duret_g@epita.fr>             |
4 |                                                                   |
5 | This file is part of Heroes.                                      |
6 |                                                                   |
7 | Heroes is free software; you can redistribute it and/or modify it |
8 | under the terms of the GNU General Public License version 2 as    |
9 | published by the Free Software Foundation.                        |
10 |                                                                   |
11 | Heroes is distributed in the hope that it will be useful, but     |
12 | WITHOUT ANY WARRANTY; without even the implied warranty of        |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU |
14 | General Public License for more details.                          |
15 |                                                                   |
16 | You should have received a copy of the GNU General Public License |
17 | along with this program; if not, write to the Free Software       |
18 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA          |
19 | 02111-1307 USA                                                    |
20 `------------------------------------------------------------------*/
21 
22 #include "system.h"
23 #include <SDL_mixer.h>
24 #include "sfx.h"
25 #include "prefs.h"
26 
27 void *
load_sfx_low(char * file)28 load_sfx_low (char *file)
29 {
30   return Mix_LoadWAV (file);
31 }
32 
33 void
free_sfx_low(void * sfx)34 free_sfx_low (void *sfx)
35 {
36   Mix_FreeChunk (sfx);
37 }
38 
39 void
play_sfx_low(void * sfx)40 play_sfx_low (void *sfx)
41 {
42   Mix_Chunk *tmp = sfx;
43     /* set the sample volume */
44   tmp->volume = (13 - opt.sfx_volume) * MIX_MAX_VOLUME / 13;
45   Mix_PlayChannel (-1, tmp, 0);
46 }
47