Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2011-05-11 14:48:17 +0000
committerStijn Buys <ingar@osirion.org>2011-05-11 14:48:17 +0000
commit1c63cbf204b1d2c667ce9f821ccb197d0ffb0ac3 (patch)
treec2d0ff7cc4a8a264657abd0ac99017a5b664ecd2 /src/game/intro
parentbb0f860989f84b901f80017ae0139a3fc0446dc1 (diff)
Review of the main loop timer, converted timers from float to unsigned long,
corrected a number of timing bugs, improved client framerate stability.
Diffstat (limited to 'src/game/intro')
-rw-r--r--src/game/intro/convoy.cc6
-rw-r--r--src/game/intro/convoy.h4
2 files changed, 5 insertions, 5 deletions
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<Member *> Members;