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 <mikmod.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   struct SAMPLE *tmp;
31 
32   tmp = Sample_Load (file);
33   if (tmp)
34     tmp->panning = (PAN_RIGHT + PAN_LEFT) / 2;
35   return tmp;
36 }
37 
38 void
free_sfx_low(void * sfx)39 free_sfx_low (void *sfx)
40 {
41   Sample_Free (sfx);
42 }
43 
44 void
play_sfx_low(void * sfx)45 play_sfx_low (void *sfx)
46 {
47   struct SAMPLE *tmp = sfx;
48   /* set the sample volume */
49   tmp->volume = (13 - opt.sfx_volume) * 64 / 13;
50   Sample_Play (tmp, 0, 0);
51 }
52