small fixes

This commit is contained in:
David Rose 2008-10-03 22:59:51 +00:00
parent 66f371f259
commit 35e77c0d01
3 changed files with 9 additions and 21 deletions

View File

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

View File

@ -45,22 +45,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
# hooks on messages, particularly on window-event. This doesn't
@ -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()

View File

@ -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])