Changed TimedCommand::process to also take the time delta as one of its parameters.

pull/3/head
Chris Laurel 2001-03-27 09:02:43 +00:00
parent 7f9d2d4ec9
commit 64d4d74f8d
1 changed files with 5 additions and 4 deletions

View File

@ -28,17 +28,18 @@ bool Execution::tick(double dt)
{
Command* cmd = *currentCommand;
if (dt >= cmd->getDuration() - commandTime)
double timeLeft = cmd->getDuration() - commandTime;
if (dt >= timeLeft)
{
cmd->process(sim, renderer, cmd->getDuration());
dt -= cmd->getDuration() - commandTime;
cmd->process(sim, renderer, cmd->getDuration(), timeLeft);
dt -= timeLeft;
commandTime = 0.0;
currentCommand++;
}
else
{
commandTime += dt;
cmd->process(sim, renderer, commandTime);
cmd->process(sim, renderer, commandTime, dt);
dt = 0.0;
}
}