David Rose 17 年 前
コミット
35e77c0d01

+ 5 - 1
direct/src/showbase/Loader.py

@@ -43,7 +43,11 @@ class Loader(DirectObject):
     # special methods
     def __init__(self, base):
         self.base = base
-        self.loader = PandaLoader()
+        # Temporary hasattr for old Pandas.
+        if hasattr(PandaLoader, 'getGlobalPtr'):
+            self.loader = PandaLoader.getGlobalPtr()
+        else:
+            self.loader = PandaLoader()
 
         self.hook = "async_loader_%s" % (Loader.loaderIndex)
         Loader.loaderIndex += 1

+ 3 - 19
direct/src/showbase/ShowBase.py

@@ -44,22 +44,6 @@ import OnScreenDebug
 
 __builtin__.FADE_SORT_INDEX = 1000
 __builtin__.NO_FADE_SORT_INDEX = 2000
-
-####################################################
-## expermential use of  inter-frame yielding...
-## 
-##  this needs to be remove and problem cleared if we adopt this model..
-##
-####################################################
-want_fifothreads = config.GetBool("want-fifothreads", 0)
-if want_fifothreads:
-    class HackGraphicsEngine(GraphicsEngine):    
-        def renderFrame(self):
-            if isinstance(Thread.getCurrentThread(), MainThread):
-                    GraphicsEngine.renderFrame(self)
-            else:
-                print 'renderFrame Not Main Thread %s' % (repr(Thread.getCurrentThread()))
-                
     
 
 # Now ShowBase is a DirectObject.  We need this so ShowBase can hang
@@ -183,9 +167,9 @@ class ShowBase(DirectObject.DirectObject):
 
         self.hidden = NodePath('hidden')
 
-        # We need a graphics engine to manage the actual rendering.
-        if want_fifothreads:
-            self.graphicsEngine = HackGraphicsEngine()
+        # Temporary hasattr for old pandas.
+        if hasattr(GraphicsEngine, 'getGlobalPtr'):
+            self.graphicsEngine = GraphicsEngine.getGlobalPtr()
         else:
             self.graphicsEngine = GraphicsEngine()
 

+ 1 - 1
direct/src/task/TaskNew.py

@@ -377,7 +377,7 @@ class TaskManager:
         # Set the clock to have last frame's time in case we were
         # Paused at the prompt for a long time
         t = self.globalClock.getFrameTime()
-        timeDelta = t - globalClock.getRealTime()
+        timeDelta = t - self.globalClock.getRealTime()
         self.globalClock.setRealTime(t)
         messenger.send("resetClock", [timeDelta])