/[enigma]/enigma/sound.cc
ViewVC logotype

Diff of /enigma/sound.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.9 by dheck, Mon Sep 16 09:25:49 2002 UTC revision 1.10 by dheck, Sat Dec 14 23:42:41 2002 UTC
# Line 16  Line 16 
16  // 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.  // 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
17  //======================================================================  //======================================================================
18  #include "enigma.hh"  #include "enigma.hh"
19    #include "options.hh"
20  #include "sound.hh"  #include "sound.hh"
21  #include "SDL.h"  #include "SDL.h"
22  #include "SDL_mixer.h"  #include "SDL_mixer.h"
23  #include "px/dict.hh"  #include "px/dict.hh"
24    #include "px/tools.hh"
25  #include <string>  #include <string>
26    
27    using namespace px;
28  using namespace std;  using namespace std;
29    
30  namespace  namespace
# Line 51  sound::Init() Line 54  sound::Init()
54          sound_enabled = false;          sound_enabled = false;
55          return;          return;
56      }      }
57        UpdateVolume();
58      sound_initialized = true;      sound_initialized = true;
59  }  }
60    
61    void
62    sound::UpdateVolume()
63    {
64        int soundvol = int(options::SoundVolume * MIX_MAX_VOLUME);
65        Mix_Volume(-1, Max(0, Min(soundvol, MIX_MAX_VOLUME)));
66        int musicvol = int(options::MusicVolume * MIX_MAX_VOLUME);
67        Mix_VolumeMusic(Max(0, Min(musicvol, MIX_MAX_VOLUME)));
68    }
69    
70  void  void
71  sound::Shutdown()  sound::Shutdown()
72  {  {

Legend:
Removed from v.1.9  
changed lines
  Added in v.1.10

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26