From a743791e624590e0b41229f28f940db5272b60ba Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 7 Aug 2008 23:27:42 +0000 Subject: rotating planets, navpoints, network protocol updates, entity event state --- src/client/targets.cc | 16 +++++++++++++--- src/client/view.cc | 29 +++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 9 deletions(-) (limited to 'src/client') diff --git a/src/client/targets.cc b/src/client/targets.cc index b913d55..f922199 100644 --- a/src/client/targets.cc +++ b/src/client/targets.cc @@ -369,7 +369,12 @@ void draw_entity_offscreen_target(core::Entity *entity, bool is_active_target) glVertex3f(cx, cy-r+2, 0); render::gl::end(); - render::gl::color(1, 1, 1, 1); + if (entity->type() == core::Entity::Controlable) { + render::gl::color(0, 1, 0, 1); + } else { + render::gl::color(1, 1, 1, 1); + } + render::gl::begin(render::gl::LineLoop); glVertex3f(cx+r, cy, 0); glVertex3f(cx, cy+r, 0); @@ -415,7 +420,7 @@ void draw_entity_target(core::Entity *entity, bool is_active_target) r *= 0.5; render::gl::disable(GL_TEXTURE_2D); - + // outer square shadow render::gl::color(0, 0, 0, 1); render::gl::begin(render::gl::LineLoop); glVertex3f(cx+r, cy+2, 0); @@ -424,7 +429,12 @@ void draw_entity_target(core::Entity *entity, bool is_active_target) glVertex3f(cx, cy-r+2, 0); render::gl::end(); - render::gl::color(1, 1, 1, 1); + if (entity->type() == core::Entity::Controlable) { + render::gl::color(0, 1, 0, 1); + } else { + render::gl::color(1, 1, 1, 1); + } + // outer square0 render::gl::begin(render::gl::LineLoop); glVertex3f(cx+r, cy, 0); glVertex3f(cx, cy+r, 0); diff --git a/src/client/view.cc b/src/client/view.cc index 5879728..eef3920 100644 --- a/src/client/view.cc +++ b/src/client/view.cc @@ -170,15 +170,32 @@ void draw_status() status << "^Nspeed ^B" << std::setfill(' ') << std::setw(5) << std::fixed << std::setprecision(2) << core::localcontrol()->speed(); - Text::draw(4, video::height - Text::fontheight() -4, status); + Text::draw(4, video::height - Text::fontheight()-4, status); + + unsigned int state = core::localcontrol()->eventstate(); + if (state) { + std::stringstream statestr; + statestr.clear(); + if (state == core::Entity::ImpulseInitiate) { + statestr << "^FInitializing kinetic impulse drive " << core::localcontrol()->timer(); + } else if (state == core::Entity::Impulse) { + statestr << "^FKinetic impulse"; + } else if (state == core::Entity::JumpInitiate) { + statestr << "^FInitializing hyperspace jump drive "<< core::localcontrol()->timer(); + } else if (state == core::Entity::Jump) { + statestr << "^FJumping..."; + } + + Text::draw(4, video::height - Text::fontheight()*2-4, statestr); + } if (draw_location->value()) { std::stringstream location; - location << "^Nloc ^B" << std::fixed << std::setprecision(2) << std::setfill(' ') << - std::setw(7) << core::localcontrol()->location().x << " " << - std::setw(7) << core::localcontrol()->location().y << " " << - std::setw(7) << core::localcontrol()->location().z; - Text::draw(4, video::height - Text::fontheight()*2 -4, location); + location << std::fixed << std::setprecision(2) + << "^Nx:^B" << core::localcontrol()->location().x << " " + << "^Ny:^B" << core::localcontrol()->location().y << " " + << "^Nz:^B" << core::localcontrol()->location().z << '\n'; + Text::draw(4, video::height - Text::fontheight()*3 -4, location); } float y = 1.0f; -- cgit v1.2.3