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-02-24 19:13:27 +0000
committerStijn Buys <ingar@osirion.org>2009-02-24 19:13:27 +0000
commit53faab4c1d692fed7c7ecfedea57fc457bf61e80 (patch)
treed5dab7709dd4dc5409ab0e62920bb4d62790a90a /src/client/map.cc
parent0e96454c70e56de5cefa38ab1b5dc46196238d07 (diff)
Replaced 'The Osirion Project' with 'Project::OSiRioN' in messages,
added g_collision cflag to facillitate future development, added ShowOnMap entity flag
Diffstat (limited to 'src/client/map.cc')
-rw-r--r--src/client/map.cc16
1 files changed, 10 insertions, 6 deletions
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();