Added Marek music to cvs and play it in the main menu.
[supertux.git] / src / sound.cpp
index 30a49a5..f5dd915 100644 (file)
@@ -1,14 +1,22 @@
-/*
-  sound.c
-  
-  Super Tux - Audio Functions
-  
-  by Bill Kendrick
-  bill@newbreedsoftware.com
-  http://www.newbreedsoftware.com/supertux/
-  April 22, 2000 - March 15, 2004
-*/
+//  $Id$
+//
+//  SuperTux -  A Jump'n Run
+//  Copyright (C) 2000 Bill Kendrick <bill@newbreedsoftware.com>
+//  Copyright (C) 2004 Duong-Khang NGUYEN <neoneurone@users.sf.net>
+//
+//  This program is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU General Public License
+//  as published by the Free Software Foundation; either version 2
+//  of the License, or (at your option) any later version.
+//
+//  This program is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+//  GNU General Public License for more details.
+//
+//  You should have received a copy of the GNU General Public License
+//  along with this program; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
 #include "defines.h"
 #include "globals.h"
@@ -123,7 +131,7 @@ void play_sound(Mix_Chunk * snd, enum Sound_Speaker whichSpeaker)
   /* this won't call the function if the user has disabled sound
    * either via menu or via command-line option
    */
-  if ((use_sound == true) && (audio_device == true))
+  if (use_sound && audio_device)
     {
       Mix_PlayChannel( whichSpeaker, snd, 0);
 
@@ -156,7 +164,7 @@ void free_chunk(Mix_Chunk *chunk)
 
 int playing_music(void)
 {
-  if (use_music == true)
+  if (use_music)
     {
       return Mix_PlayingMusic();
     }
@@ -170,7 +178,7 @@ int playing_music(void)
 
 int halt_music(void)
 {
-  if ((use_music == true) && (audio_device == true))
+  if (use_music && audio_device)
     {
       return Mix_HaltMusic();
     }
@@ -183,7 +191,7 @@ int halt_music(void)
 
 int play_music(Mix_Music *music, int loops)
 {
-  if ((use_music == true) && (audio_device == true))
+  if (use_music && audio_device)
     {
       DEBUG_MSG(__PRETTY_FUNCTION__);
       return Mix_PlayMusic(music, loops);