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>2012-12-24 00:04:28 +0000
committerStijn Buys <ingar@osirion.org>2012-12-24 00:04:28 +0000
commit2b54cd13579abe2b277e305b7c5cd2eff78d82cd (patch)
treeaebcc895c817bc721bb8f8541e39f814aa82851a /src/client
parenta565dbb1982fe45d90fae1cbfc03e2cc058ebf6f (diff)
Added blinking effect to thrust indiciater if state is ImpulseInitiate or JumpInitiate.
Diffstat (limited to 'src/client')
-rw-r--r--src/client/hudenginestatus.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/client/hudenginestatus.cc b/src/client/hudenginestatus.cc
index 04b6f63..6b55344 100644
--- a/src/client/hudenginestatus.cc
+++ b/src/client/hudenginestatus.cc
@@ -33,13 +33,24 @@ void HUDEngineStatus::draw()
s[1] -= 2.0f * padding;
// thrust
+ const float blink_t = core::application()->time() * 2.0f;
std::ostringstream thruststr;
- if (core::localcontrol()->state() == core::Entity::Normal) {
- thruststr << "^B" << roundf(core::localcontrol()->thrust() * 100.0f) << "%";
- } else {
- thruststr << "^B--";
+ switch(core::localcontrol()->state()) {
+ case core::Entity::Normal:
+ thruststr << "^B" << roundf(core::localcontrol()->thrust() * 100.0f) << "%";
+ break;
+ case core::Entity::ImpulseInitiate:
+ case core::Entity::JumpInitiate:
+
+ if ((blink_t - floorf(blink_t)) < 0.5f) {
+ thruststr << "^B--";
+ }
+ break;
+ default:
+ thruststr << "^B--";
+ break;
}
-
+
// speed
std::ostringstream speedstr;
speedstr << "^B" << roundf(core::localcontrol()->speed() * 100.0f);