changeset 591:6b21b2140262 1.5.x

Merge r594 and r595 from trunk.
author Simon Cross <hodgestar@gmail.com>
date Sat, 28 Nov 2009 23:27:38 +0000
parents e13f9380242b
children 7581c2fe1498
files gamelib/main.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/gamelib/main.py	Sat Nov 28 23:16:47 2009 +0000
+++ b/gamelib/main.py	Sat Nov 28 23:27:38 2009 +0000
@@ -12,8 +12,7 @@
 from pgu import gui
 from pygame.locals import SWSURFACE, SRCALPHA
 
-#from engine import Engine, MainMenuState
-from sound import init_sound
+import sound
 import constants
 from config import config
 import data
@@ -47,11 +46,18 @@
         pygame.Surface((100, 100), flags=SRCALPHA)
     except Exception, e:
         complaint_dialog("Unable to create a suitable screen, please check your display settings")
+    if sound.SOUND_INITIALIZED:
+        try:
+            sound.play_sound('silence.ogg')
+            sound.background_music('silence.ogg')
+        except pygame.error:
+            complaint_dialog('Error trying to play sound. Please run with --no-sound')
+        sound.stop_background_music()
 
 def main():
     """Main script."""
     config.configure(sys.argv[1:])
-    init_sound()
+    sound.init_sound()
     sanity_check()
     screen = pygame.display.set_mode(constants.SCREEN, SWSURFACE)
     pygame.display.set_icon(pygame.image.load(