From 002cc1b5e0bece87c5aafd8dee580f063881e10c Mon Sep 17 00:00:00 2001 From: James Turk Date: Sun, 13 May 2007 15:18:37 +0000 Subject: [PATCH] fixed a /0 bug --- src/Application.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Application.cpp b/src/Application.cpp index df7d561..bc8b672 100644 --- a/src/Application.cpp +++ b/src/Application.cpp @@ -5,7 +5,7 @@ // James Turk (jpt2433@rit.edu) // // Version: -// $Id: Application.cpp,v 1.31 2005/11/15 02:59:08 cozman Exp $ +// $Id: Application.cpp,v 1.32 2007/05/13 15:18:37 cozman Exp $ #include "Application.hpp" @@ -118,7 +118,11 @@ void Application::update() { frameIndex = 0; } - elapsedTime_ = frameTimes_[frameIndex] = curTime-lastUpdate_; + + elapsedTime_ = curTime-lastUpdate_; + if(frameTimes_.size() > 0) { + frameTimes_[frameIndex] = elapsedTime_; + } lastUpdate_ = curTime;