Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/core/entity.cc4
-rw-r--r--src/core/entity.h14
-rw-r--r--src/core/parser.cc8
-rw-r--r--src/game/base/jumppoint.cc2
-rw-r--r--src/game/base/navpoint.cc2
-rw-r--r--src/game/example/example.cc8
-rw-r--r--src/game/example/spectator.cc2
-rw-r--r--src/game/intro/convoy.cc4
-rw-r--r--src/game/intro/intro.cc2
9 files changed, 27 insertions, 19 deletions
diff --git a/src/core/entity.cc b/src/core/entity.cc
index 8fde03a..7f48c08 100644
--- a/src/core/entity.cc
+++ b/src/core/entity.cc
@@ -1011,14 +1011,14 @@ EntityGlobe::EntityGlobe() : Entity()
{
render_texture = 0;
entity_rotationspeed = 0;
- entity_shape = Sphere;
+ set_shape(Sphere);
}
EntityGlobe::EntityGlobe(std::istream & is) : Entity(is)
{
render_texture = 0;
entity_rotationspeed = 0;
- entity_shape = Sphere;
+ set_shape(Sphere);
}
EntityGlobe::~EntityGlobe()
diff --git a/src/core/entity.h b/src/core/entity.h
index 954b261..48dd949 100644
--- a/src/core/entity.h
+++ b/src/core/entity.h
@@ -226,6 +226,11 @@ public:
/* ---- mutators -------------------------------------------------- */
+ /// assign shape
+ inline void set_shape(Shape shape) {
+ entity_shape = shape;
+ }
+
/// assign entity color
inline void set_color(const math::Color &color) {
entity_color.assign(color);
@@ -429,9 +434,6 @@ public:
/* entity_ variables can be set by the module */
- float entity_mass;
- float entity_speed;
- Shape entity_shape;
unsigned int entity_moduletypeid;
bool entity_created;
@@ -451,7 +453,11 @@ protected:
// the previous zone the entity belonged too
Zone* entity_oldzone;
+ float entity_mass;
+ float entity_speed;
+
private:
+
unsigned int entity_id;
unsigned int entity_flags;
@@ -464,6 +470,8 @@ private:
float entity_radius;
+ Shape entity_shape;
+
math::Color entity_color;
math::Color entity_color_second;
diff --git a/src/core/parser.cc b/src/core/parser.cc
index 8018bf7..3806b99 100644
--- a/src/core/parser.cc
+++ b/src/core/parser.cc
@@ -42,16 +42,16 @@ bool Parser::got_entity_key(filesystem::IniFile &inifile, core::Entity *entity)
if (inifile.got_key_string("shape", shapename)) {
if (shapename.compare("axis") == 0) {
- entity->entity_shape = core::Entity::Axis;
+ entity->set_shape(core::Entity::Axis);
return true;
} else if (shapename.compare("cube") == 0) {
- entity->entity_shape = core::Entity::Cube;
+ entity->set_shape(core::Entity::Cube);
return true;
} else if (shapename.compare("diamond") == 0) {
- entity->entity_shape = core::Entity::Diamond;
+ entity->set_shape(core::Entity::Diamond);
return true;
} else if (shapename.compare("sphere") == 0) {
- entity->entity_shape = core::Entity::Sphere;
+ entity->set_shape(core::Entity::Sphere);
return true;
} else {
con_warn << inifile.name() << " unknown shape '" << shapename << "' at line " << inifile.line() << std::endl;
diff --git a/src/game/base/jumppoint.cc b/src/game/base/jumppoint.cc
index 5b9a75f..82ed489 100644
--- a/src/game/base/jumppoint.cc
+++ b/src/game/base/jumppoint.cc
@@ -14,7 +14,7 @@ namespace game
JumpPoint::JumpPoint() : core::EntityDynamic()
{
- entity_shape = core::Entity::Diamond;
+ set_shape(core::Entity::Diamond);
get_color().assign(0.0f, 0.8f, 0.8f, 1.0f);
get_color_second().assign(0.6f, 1.0f);
set_radius(0.25f);
diff --git a/src/game/base/navpoint.cc b/src/game/base/navpoint.cc
index 2c76807..f7d6046 100644
--- a/src/game/base/navpoint.cc
+++ b/src/game/base/navpoint.cc
@@ -14,7 +14,7 @@ const Template *NavPoint::navpoint_template = 0;
NavPoint::NavPoint() : core::Entity()
{
- entity_shape = core::Entity::Diamond;
+ set_shape(core::Entity::Diamond);
get_color().assign(1.0f, 1.0f);
get_color_second().assign(0.6f, 1.0f);
set_radius(0.25f);
diff --git a/src/game/example/example.cc b/src/game/example/example.cc
index a6372da..7ad39b2 100644
--- a/src/game/example/example.cc
+++ b/src/game/example/example.cc
@@ -43,7 +43,7 @@ Example::Example() : core::Module("The Osirion Project Example", true)
core::Entity *cube = new core::Entity(); // a new entity
cube->set_label("cube");
cube->set_name("The Red Cube");
- cube->entity_shape = core::Entity::Cube; // set the shape to cube
+ cube->set_shape(core::Entity::Cube); // set the shape to cube
cube->get_location().assign(16, -8, 0); // set location
cube->get_color().assign(1, 0, 0); // set RGB color red
cube->set_radius(0.25f); // set radius, in game units
@@ -52,7 +52,7 @@ Example::Example() : core::Module("The Osirion Project Example", true)
core::Entity *sphere = new core::Entity(); // a new entity
sphere->set_label("sphere");
sphere->set_name("The Green Sphere");
- sphere->entity_shape = core::Entity::Sphere; // set the shape to sphere
+ sphere->set_shape(core::Entity::Sphere); // set the shape to sphere
sphere->get_location().assign(16, 0, 0); // set location
sphere->get_color().assign(0, 1, 0); // set RGB color green
cube->set_radius(0.25f); // set radius, in game units
@@ -61,7 +61,7 @@ Example::Example() : core::Module("The Osirion Project Example", true)
core::Entity *diamond = new core::Entity(); // a new entity
diamond->set_label("diamond");
diamond->set_name("The Blue Diamond");
- diamond->entity_shape = core::Entity::Diamond; // set the shape to cube
+ diamond->set_shape(core::Entity::Diamond); // set the shape to cube
diamond->get_location().assign(16, 8, 0); // set location
diamond->get_color().assign(0, 0, 1); // set RGB color blue
cube->set_radius(0.25f); // set radius, in game units
@@ -70,7 +70,7 @@ Example::Example() : core::Module("The Osirion Project Example", true)
core::Entity *axis = new core::Entity(); // a new entity
axis->set_label("origin");
axis->set_name("The Origin");
- axis->entity_shape = core::Entity::Axis; // set the shape to axis
+ axis->set_shape(core::Entity::Axis); // set the shape to axis
axis->get_location().assign(0, 0, 0); // set location
axis->get_color().assign(1); // set greyscale color white
axis->get_color_second().assign(0.5f, 0.0f, 0.5f); // set RGB secondary color
diff --git a/src/game/example/spectator.cc b/src/game/example/spectator.cc
index defc356..5fc7fc6 100644
--- a/src/game/example/spectator.cc
+++ b/src/game/example/spectator.cc
@@ -15,7 +15,7 @@ core::Cvar *Spectator::g_spectatorrotation = 0;
Spectator::Spectator(core::Player *owner) : core::EntityControlable()
{
// default properties
- entity_shape = core::Entity::Diamond;
+ set_shape(core::Entity::Diamond);
set_radius(0.25f);
// the spectator gets player color
diff --git a/src/game/intro/convoy.cc b/src/game/intro/convoy.cc
index b037b0b..f69dd13 100644
--- a/src/game/intro/convoy.cc
+++ b/src/game/intro/convoy.cc
@@ -42,7 +42,7 @@ Convoy::Convoy(core::Zone *zone) : core::EntityDynamic()
set_label("convoy");
set_name("Convoy");
- entity_speed = 1.0f;
+ set_speed(1.0f);
set_serverside();
}
@@ -67,7 +67,7 @@ void Convoy::add(const std::string &model)
member->get_color_second().assign(color_second());
member->entity_thrust = 1.0f;
- member->entity_speed = speed();
+ member->set_speed(speed());
member->get_location().assign(location());
d = ((float) convoy_members.size()) * 0.5f;
diff --git a/src/game/intro/intro.cc b/src/game/intro/intro.cc
index 8d5577b..2147d02 100644
--- a/src/game/intro/intro.cc
+++ b/src/game/intro/intro.cc
@@ -111,7 +111,7 @@ bool Intro::load_world()
convoy->get_axis().change_direction(f);
} else if (ini.got_key_float("speed", f)) {
- convoy->entity_speed = f;
+ convoy->set_speed(f);
} else if (ini.got_key_string("ship", strval)) {
convoy->add(strval);