mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-02 09:52:27 -04:00
renamed some tasks
This commit is contained in:
parent
2b5d0ddb8e
commit
69e62652de
@ -177,9 +177,9 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
|
|
||||||
# This is a placeholder for a CollisionTraverser. If someone
|
# This is a placeholder for a CollisionTraverser. If someone
|
||||||
# stores a CollisionTraverser pointer here, we'll traverse it
|
# stores a CollisionTraverser pointer here, we'll traverse it
|
||||||
# in the collisionloop task.
|
# in the collisionLoop task.
|
||||||
self.shadowTrav = 0
|
self.shadowTrav = 0
|
||||||
# in the collisionloop task.
|
# in the collisionLoop task.
|
||||||
self.cTrav = 0
|
self.cTrav = 0
|
||||||
# Ditto for an AppTraverser.
|
# Ditto for an AppTraverser.
|
||||||
self.appTrav = 0
|
self.appTrav = 0
|
||||||
@ -730,10 +730,8 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
scene = None,
|
scene = None,
|
||||||
displayRegion = (0, 1, 0, 1), aspectRatio = None):
|
displayRegion = (0, 1, 0, 1), aspectRatio = None):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
Makes a new 3-d camera associated with the indicated window,
|
Makes a new 3-d camera associated with the indicated window,
|
||||||
and creates a display region in the indicated subrectangle.
|
and creates a display region in the indicated subrectangle.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if chan == None:
|
if chan == None:
|
||||||
chan = win.getChannel(0)
|
chan = win.getChannel(0)
|
||||||
@ -1151,14 +1149,14 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.cTrav.resetPrevTransform(self.render)
|
self.cTrav.resetPrevTransform(self.render)
|
||||||
return Task.cont
|
return Task.cont
|
||||||
|
|
||||||
def dataloop(self, state):
|
def dataLoop(self, state):
|
||||||
# traverse the data graph. This reads all the control
|
# traverse the data graph. This reads all the control
|
||||||
# inputs (from the mouse and keyboard, for instance) and also
|
# inputs (from the mouse and keyboard, for instance) and also
|
||||||
# directly acts upon them (for instance, to move the avatar).
|
# directly acts upon them (for instance, to move the avatar).
|
||||||
self.dgTrav.traverse(self.dataRootNode)
|
self.dgTrav.traverse(self.dataRootNode)
|
||||||
return Task.cont
|
return Task.cont
|
||||||
|
|
||||||
def ivalloop(self, state):
|
def ivalLoop(self, state):
|
||||||
# Execute all intervals in the global ivalMgr.
|
# Execute all intervals in the global ivalMgr.
|
||||||
ivalMgr.step()
|
ivalMgr.step()
|
||||||
return Task.cont
|
return Task.cont
|
||||||
@ -1170,7 +1168,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.shadowTrav.traverse(self.render)
|
self.shadowTrav.traverse(self.render)
|
||||||
return Task.cont
|
return Task.cont
|
||||||
|
|
||||||
def collisionloop(self, state):
|
def collisionLoop(self, state):
|
||||||
# run the collision traversal if we have a
|
# run the collision traversal if we have a
|
||||||
# CollisionTraverser set.
|
# CollisionTraverser set.
|
||||||
if self.cTrav:
|
if self.cTrav:
|
||||||
@ -1179,7 +1177,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.appTrav.traverse(self.render)
|
self.appTrav.traverse(self.render)
|
||||||
return Task.cont
|
return Task.cont
|
||||||
|
|
||||||
def igloop(self, state):
|
def igLoop(self, state):
|
||||||
if __debug__:
|
if __debug__:
|
||||||
# We render the watch variables for the onScreenDebug as soon
|
# We render the watch variables for the onScreenDebug as soon
|
||||||
# as we reasonably can before the renderFrame().
|
# as we reasonably can before the renderFrame().
|
||||||
@ -1203,7 +1201,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
|
|
||||||
if self.mainWinMinimized:
|
if self.mainWinMinimized:
|
||||||
# If the main window is minimized, slow down the app a bit
|
# If the main window is minimized, slow down the app a bit
|
||||||
# by sleeping here in igloop so we don't use all available
|
# by sleeping here in igLoop so we don't use all available
|
||||||
# CPU needlessly.
|
# CPU needlessly.
|
||||||
|
|
||||||
# Note: this isn't quite right if multiple windows are
|
# Note: this isn't quite right if multiple windows are
|
||||||
@ -1227,31 +1225,31 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.shutdown()
|
self.shutdown()
|
||||||
# resetPrevTransform goes at the very beginning of the frame.
|
# resetPrevTransform goes at the very beginning of the frame.
|
||||||
self.taskMgr.add(self.resetPrevTransform, 'resetPrevTransform', priority = -51)
|
self.taskMgr.add(self.resetPrevTransform, 'resetPrevTransform', priority = -51)
|
||||||
# give the dataloop task a reasonably "early" priority,
|
# give the dataLoop task a reasonably "early" priority,
|
||||||
# so that it will get run before most tasks
|
# so that it will get run before most tasks
|
||||||
self.taskMgr.add(self.dataloop, 'dataloop', priority = -50)
|
self.taskMgr.add(self.dataLoop, 'dataLoop', priority = -50)
|
||||||
# spawn the ivalloop with a later priority, so that it will
|
# spawn the ivalLoop with a later priority, so that it will
|
||||||
# run after most tasks, but before igloop.
|
# run after most tasks, but before igLoop.
|
||||||
self.taskMgr.add(self.ivalloop, 'ivalloop', priority = 20)
|
self.taskMgr.add(self.ivalLoop, 'ivalLoop', priority = 20)
|
||||||
# make the collisionloop task run before igloop,
|
# make the collisionLoop task run before igLoop,
|
||||||
# but leave enough room for the app to insert tasks
|
# but leave enough room for the app to insert tasks
|
||||||
# between collisionloop and igloop
|
# between collisionLoop and igLoop
|
||||||
self.taskMgr.add(self.collisionloop, 'collisionloop', priority = 30)
|
self.taskMgr.add(self.collisionLoop, 'collisionLoop', priority = 30)
|
||||||
# do the shadowCollisionLoop after the collisionloop and
|
# do the shadowCollisionLoop after the collisionLoop and
|
||||||
# befor the igloop:
|
# befor the igLoop:
|
||||||
self.taskMgr.add(self.shadowCollisionLoop, 'shadowCollisionLoop', priority = 34)
|
self.taskMgr.add(self.shadowCollisionLoop, 'shadowCollisionLoop', priority = 34)
|
||||||
# give the igloop task a reasonably "late" priority,
|
# give the igLoop task a reasonably "late" priority,
|
||||||
# so that it will get run after most tasks
|
# so that it will get run after most tasks
|
||||||
self.taskMgr.add(self.igloop, 'igloop', priority = 50)
|
self.taskMgr.add(self.igLoop, 'igLoop', priority = 50)
|
||||||
self.eventMgr.restart()
|
self.eventMgr.restart()
|
||||||
|
|
||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
self.taskMgr.remove('igloop')
|
self.taskMgr.remove('igLoop')
|
||||||
self.taskMgr.remove('shadowCollisionLoop')
|
self.taskMgr.remove('shadowCollisionLoop')
|
||||||
self.taskMgr.remove('collisionloop')
|
self.taskMgr.remove('collisionLoop')
|
||||||
self.taskMgr.remove('dataloop')
|
self.taskMgr.remove('dataLoop')
|
||||||
self.taskMgr.remove('resetPrevTransform')
|
self.taskMgr.remove('resetPrevTransform')
|
||||||
self.taskMgr.remove('ivalloop')
|
self.taskMgr.remove('ivalLoop')
|
||||||
self.eventMgr.shutdown()
|
self.eventMgr.shutdown()
|
||||||
|
|
||||||
def getBackgroundColor(self, win = None):
|
def getBackgroundColor(self, win = None):
|
||||||
@ -1614,7 +1612,7 @@ class ShowBase(DirectObject.DirectObject):
|
|||||||
self.wantTk = fWantTk
|
self.wantTk = fWantTk
|
||||||
if self.wantTk:
|
if self.wantTk:
|
||||||
import TkGlobal
|
import TkGlobal
|
||||||
taskMgr.remove('tkloop')
|
taskMgr.remove('tkLoop')
|
||||||
TkGlobal.spawnTkLoop()
|
TkGlobal.spawnTkLoop()
|
||||||
|
|
||||||
def startDirect(self, fWantDirect = 1, fWantTk = 1):
|
def startDirect(self, fWantDirect = 1, fWantTk = 1):
|
||||||
|
@ -178,11 +178,11 @@ class TaskManagerWidget(PandaObject):
|
|||||||
if self.currentTask:
|
if self.currentTask:
|
||||||
name = self.currentTask.name
|
name = self.currentTask.name
|
||||||
ok = 1
|
ok = 1
|
||||||
if ((name == 'dataloop') or
|
if ((name == 'dataLoop') or
|
||||||
(name == 'resetPrevTransform') or
|
(name == 'resetPrevTransform') or
|
||||||
(name == 'tkloop') or
|
(name == 'tkLoop') or
|
||||||
(name == 'eventManager') or
|
(name == 'eventManager') or
|
||||||
(name == 'igloop')):
|
(name == 'igLoop')):
|
||||||
from tkMessageBox import askokcancel
|
from tkMessageBox import askokcancel
|
||||||
ok = askokcancel('TaskManagerControls',
|
ok = askokcancel('TaskManagerControls',
|
||||||
'Remove: %s?' % name,
|
'Remove: %s?' % name,
|
||||||
@ -195,11 +195,11 @@ class TaskManagerWidget(PandaObject):
|
|||||||
def removeMatchingTasks(self):
|
def removeMatchingTasks(self):
|
||||||
name = self.taskListBox.getcurselection()[0]
|
name = self.taskListBox.getcurselection()[0]
|
||||||
ok = 1
|
ok = 1
|
||||||
if ((name == 'dataloop') or
|
if ((name == 'dataLoop') or
|
||||||
(name == 'resetPrevTransform') or
|
(name == 'resetPrevTransform') or
|
||||||
(name == 'tkloop') or
|
(name == 'tkLoop') or
|
||||||
(name == 'eventManager') or
|
(name == 'eventManager') or
|
||||||
(name == 'igloop')):
|
(name == 'igLoop')):
|
||||||
from tkMessageBox import askokcancel
|
from tkMessageBox import askokcancel
|
||||||
ok = askokcancel('TaskManagerControls',
|
ok = askokcancel('TaskManagerControls',
|
||||||
'Remove tasks named: %s?' % name,
|
'Remove tasks named: %s?' % name,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user