mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
small fixes
This commit is contained in:
parent
66f371f259
commit
35e77c0d01
@ -43,7 +43,11 @@ class Loader(DirectObject):
|
|||||||
# special methods
|
# special methods
|
||||||
def __init__(self, base):
|
def __init__(self, base):
|
||||||
self.base = 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)
|
self.hook = "async_loader_%s" % (Loader.loaderIndex)
|
||||||
Loader.loaderIndex += 1
|
Loader.loaderIndex += 1
|
||||||
|
@ -44,22 +44,6 @@ import OnScreenDebug
|
|||||||
|
|
||||||
__builtin__.FADE_SORT_INDEX = 1000
|
__builtin__.FADE_SORT_INDEX = 1000
|
||||||
__builtin__.NO_FADE_SORT_INDEX = 2000
|
__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
|
# Now ShowBase is a DirectObject. We need this so ShowBase can hang
|
||||||
@ -183,9 +167,9 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
|
|
||||||
self.hidden = NodePath('hidden')
|
self.hidden = NodePath('hidden')
|
||||||
|
|
||||||
# We need a graphics engine to manage the actual rendering.
|
# Temporary hasattr for old pandas.
|
||||||
if want_fifothreads:
|
if hasattr(GraphicsEngine, 'getGlobalPtr'):
|
||||||
self.graphicsEngine = HackGraphicsEngine()
|
self.graphicsEngine = GraphicsEngine.getGlobalPtr()
|
||||||
else:
|
else:
|
||||||
self.graphicsEngine = GraphicsEngine()
|
self.graphicsEngine = GraphicsEngine()
|
||||||
|
|
||||||
|
@ -377,7 +377,7 @@ class TaskManager:
|
|||||||
# Set the clock to have last frame's time in case we were
|
# Set the clock to have last frame's time in case we were
|
||||||
# Paused at the prompt for a long time
|
# Paused at the prompt for a long time
|
||||||
t = self.globalClock.getFrameTime()
|
t = self.globalClock.getFrameTime()
|
||||||
timeDelta = t - globalClock.getRealTime()
|
timeDelta = t - self.globalClock.getRealTime()
|
||||||
self.globalClock.setRealTime(t)
|
self.globalClock.setRealTime(t)
|
||||||
messenger.send("resetClock", [timeDelta])
|
messenger.send("resetClock", [timeDelta])
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user