*** empty log message ***

This commit is contained in:
David Rose 2000-12-08 21:49:21 +00:00
parent 20987630f3
commit b8d81e561e

View File

@ -22,10 +22,6 @@ def getTimeFrame():
# Ask for the time last frame # Ask for the time last frame
t = globalClock.getTime() t = globalClock.getTime()
# Set the clock to have last frame's time in case we were
# Paused at the prompt for a long time
globalClock.setTime(t)
# Get the new frame count # Get the new frame count
f = globalClock.getFrameCount() f = globalClock.getFrameCount()
@ -259,16 +255,24 @@ class TaskManager:
return len(self.taskList) return len(self.taskList)
def run(self): def run(self):
# Set the clock to have last frame's time in case we were
# Paused at the prompt for a long time
t = globalClock.getTime()
globalClock.setTime(t)
self.running = 1 self.running = 1
while self.running: while self.running:
try: try:
startTime = time.time() startTime = globalClock.getRealTime()
self.step() self.step()
finishTime = time.time() finishTime = globalClock.getRealTime()
# Max out the frame rate so we do not starve the cpu # Max out the frame rate so we do not starve the cpu
if (maxFps > 0): if (maxFps > 0):
dt = finishTime - startTime dt = finishTime - startTime
time.sleep(max(0, (1.0/maxFps)-dt)) length = (1.0/maxFps)-dt
if (length > 0):
time.sleep(length)
except KeyboardInterrupt: except KeyboardInterrupt:
self.stop() self.stop()
except: except: