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>2009-01-26 20:19:10 +0000
committerStijn Buys <ingar@osirion.org>2009-01-26 20:19:10 +0000
commitc99a440e6fb1edf35e280f4df8ba22600e490535 (patch)
tree9c39358c234e1629bc0cb2e4b5a2685f562663c9 /src/client/hud.cc
parent597b3e0921dd24fa5e224377da4754da93a782c1 (diff)
removed View class
Diffstat (limited to 'src/client/hud.cc')
-rw-r--r--src/client/hud.cc39
1 files changed, 15 insertions, 24 deletions
diff --git a/src/client/hud.cc b/src/client/hud.cc
index c10ffa8..beeefd3 100644
--- a/src/client/hud.cc
+++ b/src/client/hud.cc
@@ -228,14 +228,6 @@ void HUD::draw()
Text::setfont("gui", 12, 18);
Text::setcolor('N'); //set normal color
- // draw player info
- std::stringstream playerinfostr;
- playerinfostr << "^B" << core::localplayer()->name() << '\n'
- <<"^B" << core::localcontrol()->name() << '\n' << "^N"
- << "credits: " << core::localplayer()->credits();
-
- Text::draw(Text::fontwidth() * 0.5f, Text::fontheight()*8+4, playerinfostr);
-
if(core::localplayer()->view()) {
Text::setcolor('N'); //set normal color
@@ -281,14 +273,12 @@ void HUD::draw()
core::Entity *target = targets::current();
std::stringstream strdistance;
- float d = 0;
- float y = 1.0f;
if (target) {
std::stringstream strtarget;
strtarget << "^B" << target->name() << "\n^B";
- d = math::distance(core::localcontrol()->location(), target->location())
+ float d = math::distance(core::localcontrol()->location(), target->location())
- target->radius() - core::localcontrol()->radius();
if (d > 0 ) {
@@ -313,28 +303,29 @@ void HUD::draw()
strtarget << " --";
}
strtarget << '\n';
- Text::draw(render::State::width() - 4-Text::fontwidth()*32, render::State::height() - Text::fontheight()*2 -4, strtarget);
- y += 2.0f;
+ Text::draw(width() - 4-Text::fontwidth()*30, height() - Text::fontheight()*2 -4, strtarget);
}
- Text::setcolor('N'); //set normal color
- Text::draw(render::State::width()-4-Text::fontwidth()*32, render::State::height()-Text::fontheight()*y-4, core::localcontrol()->zone()->name());
+ // draw player info
+ std::stringstream playerinfostr;
+ playerinfostr <<"^B" << core::localcontrol()->name() << '\n' << "^Ncredits: " << core::localplayer()->credits();
+ Text::draw(width() - 4-Text::fontwidth()*52, height() - Text::fontheight()*2 -4, playerinfostr);
Textures::bind("bitmaps/hud/thruster_base"); // 316 x 32 bitmap
gl::color(1, 1, 1, 1);
gl::begin(gl::Quads);
glTexCoord2f(0, 0);
- gl::vertex(4, render::State::height() - 4 - 32, 0);
+ gl::vertex(4, height() - 4 - 32, 0);
glTexCoord2f(1, 0);
- gl::vertex(4 + 316, render::State::height() - 4 - 32, 0);
+ gl::vertex(4 + 316, height() - 4 - 32, 0);
glTexCoord2f(1, 1);
- gl::vertex(4 + 316, render::State::height() - 4 , 0);
+ gl::vertex(4 + 316, height() - 4 , 0);
glTexCoord2f(0, 1);
- gl::vertex(4, render::State::height() - 4 , 0);
+ gl::vertex(4, height() - 4 , 0);
gl::end();
@@ -357,16 +348,16 @@ void HUD::draw()
Textures::bind("bitmaps/hud/thruster_indicator"); // 316 x 32 bitmap
gl::begin(gl::Quads);
glTexCoord2f(0, 0);
- gl::vertex(4, render::State::height() - 4 - 32, 0);
+ gl::vertex(4, height() - 4 - 32, 0);
glTexCoord2f(u, 0);
- gl::vertex(4.0f + u * 316.0f, render::State::height() - 4 - 32, 0);
+ gl::vertex(4.0f + u * 316.0f, height() - 4 - 32, 0);
glTexCoord2f(u, 1);
- gl::vertex(4.0f + u * 316.0f, render::State::height() - 4 , 0);
+ gl::vertex(4.0f + u * 316.0f, height() - 4 , 0);
glTexCoord2f(0, 1);
- gl::vertex(4, render::State::height() - 4 , 0);
+ gl::vertex(4, height() - 4 , 0);
gl::end();
}
@@ -376,7 +367,7 @@ void HUD::draw()
std::stringstream speedstr;
speedstr << "^B" << roundf(core::localcontrol()->speed() * 100.0f);
- Text::draw( 316+4+10, render::State::height() - 6 -16 - render::Text::fontwidth() /2, speedstr);
+ Text::draw( 316+4+10, height() - 6 -16 - render::Text::fontwidth() /2, speedstr);
Text::setfont("gui", 12, 18);
Text::setcolor('N'); //set normal color