From 1c63cbf204b1d2c667ce9f821ccb197d0ffb0ac3 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 11 May 2011 14:48:17 +0000 Subject: Review of the main loop timer, converted timers from float to unsigned long, corrected a number of timing bugs, improved client framerate stability. --- src/game/intro/convoy.cc | 6 +++--- src/game/intro/convoy.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/game/intro') diff --git a/src/game/intro/convoy.cc b/src/game/intro/convoy.cc index 118bdee..8a436bb 100644 --- a/src/game/intro/convoy.cc +++ b/src/game/intro/convoy.cc @@ -30,9 +30,9 @@ Member::~Member() { } -void Member::frame(float seconds) +void Member::frame(const unsigned long elapsed) { - get_location() += axis().forward() * speed() * thrust() * seconds; + get_location() += axis().forward() * speed() * thrust() * ((float) elapsed / 1000.0f); } /* ---- class Convoy ----------------------------------------------- */ @@ -82,7 +82,7 @@ void Convoy::add(const std::string &modelname) member->get_axis().assign(axis()); } -void Convoy::frame(float seconds) +void Convoy::frame(const unsigned long elapsed) { for (Members::iterator it = convoy_members.begin(); it != convoy_members.end();) { Member *member = (*it); diff --git a/src/game/intro/convoy.h b/src/game/intro/convoy.h index 22e3f7c..127db5e 100644 --- a/src/game/intro/convoy.h +++ b/src/game/intro/convoy.h @@ -23,7 +23,7 @@ public: Member(std::string const &modelname); ~Member(); - void frame(float seconds); + void frame(const unsigned long elapsed); }; /* ---- class Convoy ----------------------------------------------- */ @@ -37,7 +37,7 @@ public: void add(const char *modelname); void add(const std::string &modelname); - virtual void frame(float seconds); + virtual void frame(const unsigned long elapsed); private: typedef std::list Members; -- cgit v1.2.3