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/core/core.cc | 2 +- src/core/entity.h | 5 ++++- src/core/parser.cc | 7 +++++++ 3 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/core.cc b/src/core/core.cc index f511ee7..5984061 100644 --- a/src/core/core.cc +++ b/src/core/core.cc @@ -12,7 +12,7 @@ namespace core { -std::string core_name("The Osirion Project"); +std::string core_name("Project::OSiRiON"); std::string core_version(VERSION); const std::string &name() diff --git a/src/core/entity.h b/src/core/entity.h index bd26abe..596a701 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -39,7 +39,7 @@ class Entity public: /// Entity flags - enum Flags {Static=1, Solid=2, Bright=4, Dockable=8}; + enum Flags {Static=1, Solid=2, Bright=4, Dockable=8, ShowOnMap=16}; /// Entity type constants enum Type {Default=0, Dynamic=1, Controlable=2, Globe=3}; @@ -76,6 +76,9 @@ public: /// entity flags inline unsigned int flags() const { return entity_flags; } + /// returns true of a flag is set + inline bool flag_is_set(const Flags flag) const { return ((entity_flags & (unsigned int)flag) == (unsigned int)flag); } + /// entity label (can not contain double quotes ") inline std::string const & label() { return entity_label; } diff --git a/src/core/parser.cc b/src/core/parser.cc index 1b35592..2cf0e39 100644 --- a/src/core/parser.cc +++ b/src/core/parser.cc @@ -18,6 +18,7 @@ bool Parser::got_entity_key(filesystem::IniFile &inifile, core::Entity *entity) float direction; float pitch; float roll; + bool blnval; if (inifile.got_key_string("shape", shapename)) { @@ -47,6 +48,12 @@ bool Parser::got_entity_key(filesystem::IniFile &inifile, core::Entity *entity) } else if (inifile.got_key_string("model", strval)) { entity->set_modelname(strval); return true; + } else if (inifile.got_key_bool("showonmap", blnval)) { + if (blnval) + entity->set_flag(Entity::ShowOnMap); + else + entity->unset_flag(Entity::ShowOnMap); + return true; } else if (inifile.got_key_angle("direction", direction)) { entity->axis().change_direction(direction); return true; -- cgit v1.2.3