From 53faab4c1d692fed7c7ecfedea57fc457bf61e80 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 24 Feb 2009 19:13:27 +0000 Subject: Replaced 'The Osirion Project' with 'Project::OSiRioN' in messages, added g_collision cflag to facillitate future development, added ShowOnMap entity flag --- src/client/map.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'src/client/map.cc') diff --git a/src/client/map.cc b/src/client/map.cc index 35fb6d1..f366b40 100644 --- a/src/client/map.cc +++ b/src/client/map.cc @@ -7,7 +7,6 @@ #include "core/application.h" #include "client/map.h" -#include "client/targets.h" #include "client/input.h" #include "ui/paint.h" #include "render/gl.h" @@ -20,6 +19,9 @@ Map::Map(ui::Widget *parent) : ui::Window(parent) set_label("map"); set_border(true); set_background(true); + + map_target = 0; + map_hover = 0; hide(); } @@ -31,7 +33,7 @@ void Map::hide() { ui::Window::hide(); map_hover = 0; - + map_target = 0; } void Map::toggle() @@ -100,7 +102,7 @@ void Map::draw() bool has_icon = false; bool draw_icon = true; - if ((entity->model()) || (entity->type() == core::Entity::Globe)) { + if (entity->flag_is_set(core::Entity::ShowOnMap)) { has_icon = true; if ((entity->type() == core::Entity::Dynamic) || (entity->type() == core::Entity::Controlable)) { @@ -116,7 +118,7 @@ void Map::draw() } } - if (entity == targets::current()) { + if (entity == map_target) { if (core::application()->time() - floorf(core::application()->time()) < 0.5f) { draw_icon = false; } @@ -134,7 +136,7 @@ void Map::draw() if (draw_icon) { if (entity->type() == core::Entity::Globe) { - if ((entity->flags() & core::Entity::Bright) == core::Entity::Bright) { + if (entity->flag_is_set(core::Entity::Bright)) { if (texture_current != texture_bright) { gl::end(); texture_current = render::Textures::bind(texture_bright); @@ -180,8 +182,10 @@ void Map::draw() bool Map::on_keypress(const int key, const unsigned int modifier) { if ((hover()) && (key == 512 + SDL_BUTTON_LEFT)) { - targets::select_target(hover()); + //targets::select_target(hover()); + //TODO set map target return true; + } else if (key == SDLK_ESCAPE) { if (visible()) { hide(); -- cgit v1.2.3