Fix use of many builtins
This commit is contained in:
parent
090e912ce6
commit
03c8d4c009
|
|
@ -3,6 +3,7 @@
|
|||
__all__ = ['Actor']
|
||||
|
||||
from panda3d.core import *
|
||||
from panda3d.core import Loader as PandaLoader
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.directnotify import DirectNotifyGlobal
|
||||
import types
|
||||
|
|
@ -160,6 +161,8 @@ class Actor(DirectObject, NodePath):
|
|||
# initialize our NodePath essence
|
||||
NodePath.__init__(self)
|
||||
|
||||
self.loader = PandaLoader.getGlobalPtr()
|
||||
|
||||
# Set the mergeLODBundles flag. If this is true, all
|
||||
# different LOD's will be merged into a single common bundle
|
||||
# (joint hierarchy). All LOD's will thereafter share the same
|
||||
|
|
@ -1901,14 +1904,22 @@ class Actor(DirectObject, NodePath):
|
|||
loaderOptions = LoaderOptions(loaderOptions)
|
||||
loaderOptions.setFlags(loaderOptions.getFlags() & ~LoaderOptions.LFNoRamCache)
|
||||
|
||||
if okMissing is not None:
|
||||
if okMissing:
|
||||
loaderOptions.setFlags(loaderOptions.getFlags() & ~LoaderOptions.LFReportErrors)
|
||||
else:
|
||||
loaderOptions.setFlags(loaderOptions.getFlags() | LoaderOptions.LFReportErrors)
|
||||
|
||||
# Pass loaderOptions to specify that we want to
|
||||
# get the skeleton model. This only matters to model
|
||||
# files (like .mb) for which we can choose to extract
|
||||
# either the skeleton or animation, or neither.
|
||||
model = loader.loadModel(modelPath, loaderOptions = loaderOptions, okMissing = okMissing)
|
||||
model = self.loader.loadSync(Filename(modelPath), loaderOptions)
|
||||
if model is not None:
|
||||
model = NodePath(model)
|
||||
|
||||
if (model == None):
|
||||
raise StandardError, "Could not load Actor model %s" % (modelPath)
|
||||
raise IOError("Could not load Actor model %s" % (modelPath))
|
||||
|
||||
if (model.node().isOfType(Character.getClassType())):
|
||||
bundleNP = model
|
||||
|
|
@ -2370,7 +2381,7 @@ class Actor(DirectObject, NodePath):
|
|||
# operation that will complete in the background, but if so it
|
||||
# will still return a usable AnimControl.
|
||||
animControl = bundle.loadBindAnim(
|
||||
loader.loader, Filename(anim.filename), -1,
|
||||
self.loader, Filename(anim.filename), -1,
|
||||
subpartDef.subset, allowAsyncBind and self.allowAsyncBind)
|
||||
|
||||
if not animControl:
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ class DirectDialog(DirectFrame):
|
|||
('fadeScreen', 0, None),
|
||||
('command', None, None),
|
||||
('extraArgs', [], None),
|
||||
('sortOrder', NO_FADE_SORT_INDEX, None),
|
||||
('sortOrder', DGG.NO_FADE_SORT_INDEX, None),
|
||||
)
|
||||
# Merge keyword options with default options
|
||||
self.defineoptions(kw, optiondefs, dynamicGroups = ("button",))
|
||||
|
|
|
|||
|
|
@ -87,6 +87,9 @@ IMAGE_SORT_INDEX = 10
|
|||
GEOM_SORT_INDEX = 20
|
||||
TEXT_SORT_INDEX = 30
|
||||
|
||||
FADE_SORT_INDEX = 1000
|
||||
NO_FADE_SORT_INDEX = 2000
|
||||
|
||||
# Handy conventions for organizing top-level gui objects in loose buckets.
|
||||
BACKGROUND_SORT_INDEX = -100
|
||||
MIDGROUND_SORT_INDEX = 0
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ class DirectWaitBar(DirectFrame):
|
|||
('barColor', (1, 0, 0, 1), self.setBarColor),
|
||||
('barTexture', None, self.setBarTexture),
|
||||
('barRelief', DGG.FLAT, self.setBarRelief),
|
||||
('sortOrder', NO_FADE_SORT_INDEX, None),
|
||||
('sortOrder', DGG.NO_FADE_SORT_INDEX, None),
|
||||
)
|
||||
if 'text' in kw:
|
||||
textoptiondefs = (
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ __all__ = ['Interval']
|
|||
from direct.directnotify.DirectNotifyGlobal import directNotify
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
from direct.task.Task import Task, TaskManager
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from panda3d.core import *
|
||||
from panda3d.direct import *
|
||||
from direct.extensions_native import CInterval_extensions
|
||||
|
|
@ -289,13 +290,13 @@ class Interval(DirectObject):
|
|||
self.__endT = endT
|
||||
self.__endTAtEnd = 0
|
||||
|
||||
self.__clockStart = globalClock.getFrameTime()
|
||||
self.__clockStart = ClockObject.getGlobalClock().getFrameTime()
|
||||
self.__playRate = playRate
|
||||
self.__doLoop = doLoop
|
||||
self.__loopCount = 0
|
||||
|
||||
def setupResume(self):
|
||||
now = globalClock.getFrameTime()
|
||||
now = ClockObject.getGlobalClock().getFrameTime()
|
||||
if self.__playRate > 0:
|
||||
self.__clockStart = now - ((self.getT() - self.__startT) / self.__playRate)
|
||||
elif self.__playRate < 0:
|
||||
|
|
@ -303,7 +304,7 @@ class Interval(DirectObject):
|
|||
self.__loopCount = 0
|
||||
|
||||
def stepPlay(self):
|
||||
now = globalClock.getFrameTime()
|
||||
now = ClockObject.getGlobalClock().getFrameTime()
|
||||
if self.__playRate >= 0:
|
||||
t = (now - self.__clockStart) * self.__playRate + self.__startT
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ __all__ = ['BufferViewer']
|
|||
|
||||
from panda3d.core import *
|
||||
from direct.task import Task
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from direct.showbase.DirectObject import DirectObject
|
||||
import math
|
||||
|
|
@ -11,7 +12,7 @@ import math
|
|||
class BufferViewer(DirectObject):
|
||||
notify = directNotify.newCategory('BufferViewer')
|
||||
|
||||
def __init__(self):
|
||||
def __init__(self, win, parent):
|
||||
"""Access: private. Constructor."""
|
||||
self.enabled = 0
|
||||
size = ConfigVariableDouble('buffer-viewer-size', '0 0')
|
||||
|
|
@ -23,13 +24,14 @@ class BufferViewer(DirectObject):
|
|||
self.exclude = "none"
|
||||
self.cullbin = "fixed"
|
||||
self.cullsort = 10000
|
||||
self.renderParent = render2d
|
||||
self.win = win
|
||||
self.engine = GraphicsEngine.getGlobalPtr()
|
||||
self.renderParent = parent
|
||||
self.cards = []
|
||||
self.cardindex = 0
|
||||
self.cardmaker = CardMaker("cubemaker")
|
||||
self.cardmaker.setFrame(-1,1,-1,1)
|
||||
self.task = 0
|
||||
self.window = 0
|
||||
self.dirty = 1
|
||||
self.accept("render-texture-targets-changed", self.refreshReadout)
|
||||
if (ConfigVariableBool("show-buffers", 0).getValue()):
|
||||
|
|
@ -198,7 +200,7 @@ class BufferViewer(DirectObject):
|
|||
win = x.getWindow(iwin)
|
||||
self.analyzeTextureSet(win, set)
|
||||
elif (x=="all"):
|
||||
self.analyzeTextureSet(base.graphicsEngine, set)
|
||||
self.analyzeTextureSet(self.engine, set)
|
||||
else: return
|
||||
|
||||
|
||||
|
|
@ -279,8 +281,8 @@ class BufferViewer(DirectObject):
|
|||
# Generate a list of cards and the corresponding windows.
|
||||
cards = []
|
||||
wins = []
|
||||
for iwin in range(base.graphicsEngine.getNumWindows()):
|
||||
win = base.graphicsEngine.getWindow(iwin)
|
||||
for iwin in range(self.engine.getNumWindows()):
|
||||
win = self.engine.getWindow(iwin)
|
||||
for itex in range(win.countTextures()):
|
||||
tex = win.getTexture(itex)
|
||||
if (tex in include) and (tex not in exclude):
|
||||
|
|
@ -358,16 +360,16 @@ class BufferViewer(DirectObject):
|
|||
bordersize = 4.0
|
||||
|
||||
if (float(self.sizex)==0.0) and (float(self.sizey)==0.0):
|
||||
sizey = int(0.4266666667 * base.win.getYSize())
|
||||
sizey = int(0.4266666667 * self.win.getYSize())
|
||||
sizex = (sizey * aspectx) // aspecty
|
||||
v_sizey = (base.win.getYSize() - (rows-1) - (rows*2)) // rows
|
||||
v_sizey = (self.win.getYSize() - (rows-1) - (rows*2)) // rows
|
||||
v_sizex = (v_sizey * aspectx) // aspecty
|
||||
if (v_sizey < sizey) or (v_sizex < sizex):
|
||||
sizey = v_sizey
|
||||
sizex = v_sizex
|
||||
|
||||
adjustment = 2
|
||||
h_sizex = float (base.win.getXSize() - adjustment) / float (cols)
|
||||
h_sizex = float (self.win.getXSize() - adjustment) / float (cols)
|
||||
|
||||
h_sizex -= bordersize
|
||||
if (h_sizex < 1.0):
|
||||
|
|
@ -378,16 +380,16 @@ class BufferViewer(DirectObject):
|
|||
sizey = h_sizey
|
||||
sizex = h_sizex
|
||||
else:
|
||||
sizex = int(self.sizex * 0.5 * base.win.getXSize())
|
||||
sizey = int(self.sizey * 0.5 * base.win.getYSize())
|
||||
sizex = int(self.sizex * 0.5 * self.win.getXSize())
|
||||
sizey = int(self.sizey * 0.5 * self.win.getYSize())
|
||||
if (sizex == 0): sizex = (sizey*aspectx) // aspecty
|
||||
if (sizey == 0): sizey = (sizex*aspecty) // aspectx
|
||||
|
||||
# Convert from pixels to render2d-units.
|
||||
fsizex = (2.0 * sizex) / float(base.win.getXSize())
|
||||
fsizey = (2.0 * sizey) / float(base.win.getYSize())
|
||||
fpixelx = 2.0 / float(base.win.getXSize())
|
||||
fpixely = 2.0 / float(base.win.getYSize())
|
||||
fsizex = (2.0 * sizex) / float(self.win.getXSize())
|
||||
fsizey = (2.0 * sizey) / float(self.win.getYSize())
|
||||
fpixelx = 2.0 / float(self.win.getXSize())
|
||||
fpixely = 2.0 / float(self.win.getYSize())
|
||||
|
||||
# Choose directional offsets
|
||||
if (self.position == "llcorner"):
|
||||
|
|
|
|||
|
|
@ -7,15 +7,12 @@ from MessengerGlobal import *
|
|||
from direct.directnotify.DirectNotifyGlobal import *
|
||||
from direct.task.TaskManagerGlobal import taskMgr
|
||||
from panda3d.core import PStatCollector, EventQueue, EventHandler
|
||||
from panda3d.core import ConfigVariableBool
|
||||
|
||||
class EventManager:
|
||||
|
||||
notify = None
|
||||
|
||||
# delayed import, since this is imported by the Toontown Launcher
|
||||
# before the complete PandaModules have been downloaded.
|
||||
PStatCollector = None
|
||||
|
||||
def __init__(self, eventQueue = None):
|
||||
"""
|
||||
Create a C++ event queue and handler
|
||||
|
|
@ -27,15 +24,12 @@ class EventManager:
|
|||
self.eventQueue = eventQueue
|
||||
self.eventHandler = None
|
||||
|
||||
self._wantPstats = None # no config at this point
|
||||
self._wantPstats = ConfigVariableBool('pstats-eventmanager', False)
|
||||
|
||||
def doEvents(self):
|
||||
"""
|
||||
Process all the events on the C++ event queue
|
||||
"""
|
||||
if self._wantPstats is None:
|
||||
self._wantPstats = config.GetBool('pstats-eventmanager', 0)
|
||||
EventManager.PStatCollector = PStatCollector
|
||||
# use different methods for handling events with and without pstats tracking
|
||||
# for efficiency
|
||||
if self._wantPstats:
|
||||
|
|
@ -141,10 +135,10 @@ class EventManager:
|
|||
hyphen = name.find('-')
|
||||
if hyphen >= 0:
|
||||
name = name[0:hyphen]
|
||||
pstatCollector = EventManager.PStatCollector('App:Show code:eventManager:' + name)
|
||||
pstatCollector = PStatCollector('App:Show code:eventManager:' + name)
|
||||
pstatCollector.start()
|
||||
if self.eventHandler:
|
||||
cppPstatCollector = EventManager.PStatCollector(
|
||||
cppPstatCollector = PStatCollector(
|
||||
'App:Show code:eventManager:' + name + ':C++')
|
||||
|
||||
if paramList:
|
||||
|
|
|
|||
|
|
@ -9,8 +9,10 @@ from direct.gui import OnscreenText
|
|||
from direct.directtools import DirectUtil
|
||||
|
||||
class OnScreenDebug:
|
||||
|
||||
enabled = ConfigVariableBool("on-screen-debug-enabled", False)
|
||||
|
||||
def __init__(self):
|
||||
self.enabled = config.GetBool("on-screen-debug-enabled", 0)
|
||||
self.onScreenText = None
|
||||
self.frame = 0
|
||||
self.text = ""
|
||||
|
|
@ -20,17 +22,17 @@ class OnScreenDebug:
|
|||
if self.onScreenText:
|
||||
return
|
||||
|
||||
fontPath = config.GetString("on-screen-debug-font", "cmtt12")
|
||||
fontScale = config.GetFloat("on-screen-debug-font-scale", 0.05)
|
||||
fontPath = ConfigVariableString("on-screen-debug-font", "cmtt12").value
|
||||
fontScale = ConfigVariableDouble("on-screen-debug-font-scale", 0.05).value
|
||||
|
||||
color = {
|
||||
"black": Vec4(0, 0, 0, 1),
|
||||
"white": Vec4(1, 1, 1, 1),
|
||||
}
|
||||
fgColor = color[config.GetString("on-screen-debug-fg-color", "white")]
|
||||
bgColor = color[config.GetString("on-screen-debug-bg-color", "black")]
|
||||
fgColor.setW(config.GetFloat("on-screen-debug-fg-alpha", 0.85))
|
||||
bgColor.setW(config.GetFloat("on-screen-debug-bg-alpha", 0.85))
|
||||
fgColor = color[ConfigVariableString("on-screen-debug-fg-color", "white").value]
|
||||
bgColor = color[ConfigVariableString("on-screen-debug-bg-color", "black").value]
|
||||
fgColor.setW(ConfigVariableDouble("on-screen-debug-fg-alpha", 0.85).value)
|
||||
bgColor.setW(ConfigVariableDouble("on-screen-debug-bg-alpha", 0.85).value)
|
||||
|
||||
font = loader.loadFont(fontPath)
|
||||
if not font.isValid():
|
||||
|
|
|
|||
|
|
@ -2614,14 +2614,10 @@ class HierarchyException(Exception):
|
|||
# __dev__ is not defined at import time, call this after it's defined
|
||||
def recordFunctorCreationStacks():
|
||||
global Functor
|
||||
from panda3d.direct import get_config_showbase
|
||||
config = get_config_showbase()
|
||||
# off by default, very slow
|
||||
if __dev__ and config.GetBool('record-functor-creation-stacks', 0):
|
||||
if not hasattr(Functor, '_functorCreationStacksRecorded'):
|
||||
Functor = recordCreationStackStr(Functor)
|
||||
Functor._functorCreationStacksRecorded = True
|
||||
Functor.__call__ = Functor._exceptionLoggedCreationStack__call__
|
||||
if not hasattr(Functor, '_functorCreationStacksRecorded'):
|
||||
Functor = recordCreationStackStr(Functor)
|
||||
Functor._functorCreationStacksRecorded = True
|
||||
Functor.__call__ = Functor._exceptionLoggedCreationStack__call__
|
||||
|
||||
def formatTimeCompact(seconds):
|
||||
# returns string in format '1d3h22m43s'
|
||||
|
|
|
|||
|
|
@ -44,9 +44,6 @@ if __debug__:
|
|||
import OnScreenDebug
|
||||
import AppRunnerGlobal
|
||||
|
||||
builtins.FADE_SORT_INDEX = 1000
|
||||
builtins.NO_FADE_SORT_INDEX = 2000
|
||||
|
||||
def legacyRun():
|
||||
builtins.base.notify.warning("run() is deprecated, use base.run() instead")
|
||||
builtins.base.run()
|
||||
|
|
@ -331,7 +328,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||
# assigned to a single CPU
|
||||
autoAffinity = self.config.GetBool('auto-single-cpu-affinity', 0)
|
||||
affinity = None
|
||||
if autoAffinity and ('clientIndex' in builtins.__dict__):
|
||||
if autoAffinity and hasattr(builtins, 'clientIndex'):
|
||||
affinity = abs(int(builtins.clientIndex))
|
||||
else:
|
||||
affinity = self.config.GetInt('client-cpu-affinity', -1)
|
||||
|
|
@ -342,7 +339,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||
TrueClock.getGlobalPtr().setCpuAffinity(1 << (affinity % 32))
|
||||
|
||||
# Make sure we're not making more than one ShowBase.
|
||||
if 'base' in builtins.__dict__:
|
||||
if hasattr(builtins, 'base'):
|
||||
raise StandardError, "Attempt to spawn multiple ShowBase instances!"
|
||||
|
||||
# DO NOT ADD TO THIS LIST. We're trying to phase out the use of
|
||||
|
|
@ -374,24 +371,26 @@ class ShowBase(DirectObject.DirectObject):
|
|||
builtins.wantUberdog = self.config.GetBool('want-uberdog', 1)
|
||||
if __debug__:
|
||||
builtins.deltaProfiler = DeltaProfiler.DeltaProfiler("ShowBase")
|
||||
builtins.onScreenDebug = OnScreenDebug.OnScreenDebug()
|
||||
self.onScreenDebug = OnScreenDebug.OnScreenDebug()
|
||||
builtins.onScreenDebug = self.onScreenDebug
|
||||
|
||||
if self.wantRender2dp:
|
||||
builtins.render2dp = self.render2dp
|
||||
builtins.aspect2dp = self.aspect2dp
|
||||
builtins.pixel2dp = self.pixel2dp
|
||||
|
||||
if __dev__:
|
||||
ShowBase.notify.debug('__dev__ == %s' % __dev__)
|
||||
if self.__dev__:
|
||||
ShowBase.notify.debug('__dev__ == %s' % self.__dev__)
|
||||
else:
|
||||
ShowBase.notify.info('__dev__ == %s' % __dev__)
|
||||
ShowBase.notify.info('__dev__ == %s' % self.__dev__)
|
||||
|
||||
self.createBaseAudioManagers()
|
||||
|
||||
# set up recording of Functor creation stacks in __dev__
|
||||
PythonUtil.recordFunctorCreationStacks()
|
||||
if self.__dev__ and self.config.GetBool('record-functor-creation-stacks', False):
|
||||
PythonUtil.recordFunctorCreationStacks()
|
||||
|
||||
if __dev__ or self.config.GetBool('want-e3-hacks', False):
|
||||
if self.__dev__ or self.config.GetBool('want-e3-hacks', False):
|
||||
if self.config.GetBool('track-gui-items', True):
|
||||
# dict of guiId to gui item, for tracking down leaks
|
||||
self.guiItems = {}
|
||||
|
|
@ -432,9 +431,10 @@ class ShowBase(DirectObject.DirectObject):
|
|||
|
||||
# Offscreen buffer viewing utility.
|
||||
# This needs to be allocated even if the viewer is off.
|
||||
self.bufferViewer = BufferViewer()
|
||||
if self.wantRender2dp:
|
||||
self.bufferViewer.setRenderParent(self.render2dp)
|
||||
self.bufferViewer = BufferViewer(self.win, self.render2dp)
|
||||
else:
|
||||
self.bufferViewer = BufferViewer(self.win, self.render2d)
|
||||
|
||||
if self.windowType != 'none':
|
||||
if fStartDirect: # [gjeon] if this is False let them start direct manually
|
||||
|
|
@ -1886,7 +1886,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||
def __igLoop(self, state):
|
||||
# We render the watch variables for the onScreenDebug as soon
|
||||
# as we reasonably can before the renderFrame().
|
||||
onScreenDebug.render()
|
||||
self.onScreenDebug.render()
|
||||
|
||||
if self.recorder:
|
||||
self.recorder.recordFrame()
|
||||
|
|
@ -1900,7 +1900,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||
|
||||
# We clear the text buffer for the onScreenDebug as soon
|
||||
# as we reasonably can after the renderFrame().
|
||||
onScreenDebug.clear()
|
||||
self.onScreenDebug.clear()
|
||||
|
||||
if self.recorder:
|
||||
self.recorder.playFrame()
|
||||
|
|
@ -1925,12 +1925,11 @@ class ShowBase(DirectObject.DirectObject):
|
|||
def __igLoopSync(self, state):
|
||||
# We render the watch variables for the onScreenDebug as soon
|
||||
# as we reasonably can before the renderFrame().
|
||||
onScreenDebug.render()
|
||||
self.onScreenDebug.render()
|
||||
|
||||
if self.recorder:
|
||||
self.recorder.recordFrame()
|
||||
|
||||
|
||||
self.cluster.collectData()
|
||||
|
||||
# Finally, render the frame.
|
||||
|
|
@ -1942,7 +1941,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||
|
||||
# We clear the text buffer for the onScreenDebug as soon
|
||||
# as we reasonably can after the renderFrame().
|
||||
onScreenDebug.clear()
|
||||
self.onScreenDebug.clear()
|
||||
|
||||
if self.recorder:
|
||||
self.recorder.playFrame()
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ __all__ = ['Transitions']
|
|||
|
||||
from panda3d.core import *
|
||||
from direct.gui.DirectGui import *
|
||||
from direct.gui import DirectGuiGlobals as DGG
|
||||
from direct.interval.LerpInterval import LerpColorScaleInterval, LerpColorInterval, LerpScaleInterval, LerpPosInterval
|
||||
from direct.interval.MetaInterval import Sequence, Parallel
|
||||
from direct.interval.FunctionInterval import Func
|
||||
|
|
@ -91,7 +92,7 @@ class Transitions:
|
|||
"""
|
||||
#self.noTransitions() masad: this creates a one frame pop, is it necessary?
|
||||
self.loadFade()
|
||||
transitionIval = Sequence(Func(self.fade.reparentTo, aspect2d, FADE_SORT_INDEX),
|
||||
transitionIval = Sequence(Func(self.fade.reparentTo, aspect2d, DGG.FADE_SORT_INDEX),
|
||||
Func(self.fade.showThrough), # in case aspect2d is hidden for some reason
|
||||
self.lerpFunc(self.fade, t,
|
||||
self.alphaOff,
|
||||
|
|
@ -112,7 +113,7 @@ class Transitions:
|
|||
self.noTransitions()
|
||||
self.loadFade()
|
||||
|
||||
transitionIval = Sequence(Func(self.fade.reparentTo,aspect2d,FADE_SORT_INDEX),
|
||||
transitionIval = Sequence(Func(self.fade.reparentTo,aspect2d,DGG.FADE_SORT_INDEX),
|
||||
Func(self.fade.showThrough), # in case aspect2d is hidden for some reason
|
||||
self.lerpFunc(self.fade, t,
|
||||
self.alphaOn,
|
||||
|
|
@ -164,7 +165,7 @@ class Transitions:
|
|||
# Fade out immediately with no lerp
|
||||
self.noTransitions()
|
||||
self.loadFade()
|
||||
self.fade.reparentTo(aspect2d, FADE_SORT_INDEX)
|
||||
self.fade.reparentTo(aspect2d, DGG.FADE_SORT_INDEX)
|
||||
self.fade.setColor(self.alphaOn)
|
||||
elif ConfigVariableBool('no-loading-screen', False):
|
||||
if finishIval:
|
||||
|
|
@ -188,7 +189,7 @@ class Transitions:
|
|||
#print "transitiosn: fadeScreen"
|
||||
self.noTransitions()
|
||||
self.loadFade()
|
||||
self.fade.reparentTo(aspect2d, FADE_SORT_INDEX)
|
||||
self.fade.reparentTo(aspect2d, DGG.FADE_SORT_INDEX)
|
||||
self.fade.setColor(self.alphaOn[0],
|
||||
self.alphaOn[1],
|
||||
self.alphaOn[2],
|
||||
|
|
@ -203,7 +204,7 @@ class Transitions:
|
|||
#print "transitiosn: fadeScreenColor"
|
||||
self.noTransitions()
|
||||
self.loadFade()
|
||||
self.fade.reparentTo(aspect2d, FADE_SORT_INDEX)
|
||||
self.fade.reparentTo(aspect2d, DGG.FADE_SORT_INDEX)
|
||||
self.fade.setColor(color)
|
||||
|
||||
def noFade(self):
|
||||
|
|
@ -245,7 +246,7 @@ class Transitions:
|
|||
if (t == 0):
|
||||
self.iris.detachNode()
|
||||
else:
|
||||
self.iris.reparentTo(aspect2d, FADE_SORT_INDEX)
|
||||
self.iris.reparentTo(aspect2d, DGG.FADE_SORT_INDEX)
|
||||
|
||||
self.transitionIval = Sequence(LerpScaleInterval(self.iris, t,
|
||||
scale = 0.18,
|
||||
|
|
@ -272,7 +273,7 @@ class Transitions:
|
|||
self.iris.detachNode()
|
||||
self.fadeOut(0)
|
||||
else:
|
||||
self.iris.reparentTo(aspect2d, FADE_SORT_INDEX)
|
||||
self.iris.reparentTo(aspect2d, DGG.FADE_SORT_INDEX)
|
||||
|
||||
self.transitionIval = Sequence(LerpScaleInterval(self.iris, t,
|
||||
scale = 0.01,
|
||||
|
|
|
|||
|
|
@ -707,12 +707,12 @@ class TaskManager:
|
|||
def _getRandomTask(self):
|
||||
# Figure out when the next frame is likely to expire, so we
|
||||
# won't grab any tasks that are sleeping for a long time.
|
||||
now = globalClock.getFrameTime()
|
||||
avgFrameRate = globalClock.getAverageFrameRate()
|
||||
now = self.globalClock.getFrameTime()
|
||||
avgFrameRate = self.globalClock.getAverageFrameRate()
|
||||
if avgFrameRate < .00001:
|
||||
avgFrameDur = 0.
|
||||
else:
|
||||
avgFrameDur = (1. / globalClock.getAverageFrameRate())
|
||||
avgFrameDur = (1. / self.globalClock.getAverageFrameRate())
|
||||
next = now + avgFrameDur
|
||||
|
||||
# Now grab a task at random, until we find one that we like.
|
||||
|
|
|
|||
Loading…
Reference in New Issue