Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/map.cc16
-rw-r--r--src/client/map.h4
2 files changed, 14 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();
diff --git a/src/client/map.h b/src/client/map.h
index d75024a..2b1bacf 100644
--- a/src/client/map.h
+++ b/src/client/map.h
@@ -8,6 +8,7 @@
#define __INCLUDED_CLIENT_MAP_H__
#include "ui/window.h"
+#include "core/entity.h"
namespace client {
@@ -32,6 +33,8 @@ protected:
virtual void draw();
size_t map_hover;
+
+ core::Entity *map_target;
};
@@ -39,3 +42,4 @@ protected:
#endif // __INCLUDED_CLIENT_MAP_H__
+