Przeglądaj źródła

warnings if sound files don't load

David Rose 24 lat temu
rodzic
commit
04334687dd
1 zmienionych plików z 8 dodań i 14 usunięć
  1. 8 14
      direct/src/showbase/ShowBase.py

+ 8 - 14
direct/src/showbase/ShowBase.py

@@ -55,12 +55,7 @@ class ShowBase:
         # a little hacky, but we can't call it directly from within
         # a little hacky, but we can't call it directly from within
         # the TaskManager because he doesn't know about PStats (and
         # the TaskManager because he doesn't know about PStats (and
         # has to run before libpanda is even loaded).
         # has to run before libpanda is even loaded).
-        
-        # Temporary try..except for old Pandas.
-        try:
-            taskMgr.resumeFunc = PStatClient.resumeAfterPause
-        except:
-            pass
+        taskMgr.resumeFunc = PStatClient.resumeAfterPause
 
 
         fsmRedefine = self.config.GetBool('fsm-redefine', 0)
         fsmRedefine = self.config.GetBool('fsm-redefine', 0)
         State.FsmRedefine = fsmRedefine
         State.FsmRedefine = fsmRedefine
@@ -240,14 +235,9 @@ class ShowBase:
         is closed cleanly, so that we free system resources, restore
         is closed cleanly, so that we free system resources, restore
         the desktop and keyboard functionality, etc.
         the desktop and keyboard functionality, etc.
         """
         """
-
-        # temporary try..except for old pandas.
-        try:
-            self.win.closeWindow()
-            del self.win
-            del self.pipe
-        except:
-            pass
+        self.win.closeWindow()
+        del self.win
+        del self.pipe
 
 
         if self.oldexitfunc:
         if self.oldexitfunc:
             self.oldexitfunc()
             self.oldexitfunc()
@@ -309,11 +299,15 @@ class ShowBase:
     def loadSfx(self, name):
     def loadSfx(self, name):
         if (name and base.wantSfx):
         if (name and base.wantSfx):
             sound=self.sfxManager.getSound(name)
             sound=self.sfxManager.getSound(name)
+            if sound == None:
+                self.notify.warning("Could not load sound file %s." % name)
             return sound
             return sound
 
 
     def loadMusic(self, name):
     def loadMusic(self, name):
         if (name and base.wantMusic):
         if (name and base.wantMusic):
             sound=self.musicManager.getSound(name)
             sound=self.musicManager.getSound(name)
+            if sound == None:
+                self.notify.warning("Could not load music file %s." % name)
             return sound
             return sound
 
 
     def unloadSfx(self, sfx):
     def unloadSfx(self, sfx):