diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/core.cc | 2 | ||||
-rw-r--r-- | src/core/entity.h | 5 | ||||
-rw-r--r-- | src/core/parser.cc | 7 |
3 files changed, 12 insertions, 2 deletions
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; |