Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-03-02 12:23:48 +0000
committerStijn Buys <ingar@osirion.org>2008-03-02 12:23:48 +0000
commit81787e9004377016236865e95b95707ed6cf1d0b (patch)
treeb8a7bd0d51f97848ad98ec8c8f5e424de910df32 /src/core
parent1d45d8ecb4633f07a0ff163255dbedc3c3a72ac8 (diff)
initial (buggy) support for .map models
Diffstat (limited to 'src/core')
-rw-r--r--src/core/entity.cc13
-rw-r--r--src/core/entity.h4
-rw-r--r--src/core/gameinterface.cc2
3 files changed, 14 insertions, 5 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index a0da4ea..2fe381b 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -113,15 +113,19 @@ Entity::Entity(std::istream & is)
is >> s; // shape
is >> entity_radius;
is >> entity_direction;
+ entity_shape = (Shape) s ;
char c;
while ( (is.get(c)) && (c != '"'));
while ( (is.get(c)) && (c != '"'))
- n += c;
-
- entity_shape = (Shape) s ;
+ n += c;
entity_name = n;
+ while ( (is.get(c)) && (c != '"'));
+ while ( (is.get(c)) && (c != '"'))
+ n += c;
+ entity_modelname = n;
+
entity_created = true;
entity_destroyed = false;
entity_dirty = false;
@@ -144,7 +148,8 @@ void Entity::serialize(std::ostream & os) const
<< entity_shape << " "
<< entity_radius << " "
<< entity_direction << " "
- << "\"" << entity_name << "\"";
+ << "\"" << entity_name << "\" "
+ << "\"" << entity_modelname << "\"";
}
void Entity::serialize_client_update(std::ostream & os) const
diff --git a/src/core/entity.h b/src/core/entity.h
index 9c90ef9..d887bc1 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -61,6 +61,9 @@ public:
/// entity name (can not contain double qoutes ")
inline std::string const & name() { return entity_name; }
+ /// entity model name
+ inline std::string const & modelname() { return entity_modelname; }
+
/// dirty flag
inline bool dirty() const { return entity_dirty; }
@@ -123,6 +126,7 @@ public:
/* entity_ variables can be set by the module */
float entity_radius;
std::string entity_name;
+ std::string entity_modelname;
Shape entity_shape;
math::Vector3f entity_location;
math::Color entity_color;
diff --git a/src/core/gameinterface.cc b/src/core/gameinterface.cc
index 6f6a4ac..9aa50fc 100644
--- a/src/core/gameinterface.cc
+++ b/src/core/gameinterface.cc
@@ -64,7 +64,7 @@ GameInterface::~GameInterface()
// clear all game related objects
void GameInterface::clear()
{
- con_debug << "Clearing game data\n";
+ //con_debug << "Clearing game data\n";
// remove all entities
for (std::map<unsigned int, Entity*>::iterator it = Entity::registry.begin(); it != Entity::registry.end(); it++) {