Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-01-12 20:25:28 +0000
committerStijn Buys <ingar@osirion.org>2009-01-12 20:25:28 +0000
commit784e5c24d505aab001ae398cd53b039baed59f1f (patch)
tree5af692e35848cacff27c8ad529c4042b26b2d020 /src/model
parentc55945a1e81f5e49ef706cb3d0d37f17dbb84709 (diff)
radius key for fx_particles, overrules the script value
Diffstat (limited to 'src/model')
-rw-r--r--src/model/classes.cc6
-rw-r--r--src/model/classes.h13
-rw-r--r--src/model/map.cc9
3 files changed, 22 insertions, 6 deletions
diff --git a/src/model/classes.cc b/src/model/classes.cc
index b601a42..07a36f3 100644
--- a/src/model/classes.cc
+++ b/src/model/classes.cc
@@ -54,6 +54,7 @@ Particles::Particles() :
{
particles_entity = false;
particles_engine = false;
+ particles_radius = 0.0f;
}
Particles::Particles(math::Vector3f const & location) :
@@ -64,6 +65,11 @@ Particles::Particles(math::Vector3f const & location) :
Particles::~Particles()
{}
+void Particles::set_radius(const float radius)
+{
+ particles_radius = radius;
+}
+
/* ---- class Dock ------------------------------------------------- */
Dock::Dock()
diff --git a/src/model/classes.h b/src/model/classes.h
index f853da8..c6bf3b1 100644
--- a/src/model/classes.h
+++ b/src/model/classes.h
@@ -154,6 +154,8 @@ public:
Particles(const math::Vector3f & location);
~Particles();
+ void set_radius(const float radius);
+
inline const math::Vector3f & location() const
{
return particles_location;
@@ -169,21 +171,28 @@ public:
return particles_script;
}
- inline bool entity() const
+ inline const bool entity() const
{
return particles_entity;
}
- inline bool engine() const
+ inline const bool engine() const
{
return particles_engine;
}
+
+ inline const float radius() const
+ {
+ return particles_radius;
+ }
std::string particles_script;
math::Vector3f particles_location;
math::Axis particles_axis;
bool particles_entity;
bool particles_engine;
+
+ float particles_radius;
};
/* ---- class Dock ------------------------------------------------- */
diff --git a/src/model/map.cc b/src/model/map.cc
index 955410f..a59d2ff 100644
--- a/src/model/map.cc
+++ b/src/model/map.cc
@@ -836,6 +836,7 @@ Model * Map::load(std::string const &name)
unsigned int u;
float angle;
+ float r;
while (mapfile.getline()) {
@@ -1094,10 +1095,10 @@ Model * Map::load(std::string const &name)
} else if (mapfile.got_key_int("spawnflags", u)) {
particles->particles_entity = spawnflag_isset(u, 2);
particles->particles_engine = spawnflag_isset(u, 4);
-/*
- } else if (mapfile.got_key_float("radius", particles->particles_radius)) {
- particles->particles_radius *= LIGHTSCALE;
-*/
+
+ } else if (mapfile.got_key_float("radius", r)) {
+ particles->set_radius(r * LIGHTSCALE);
+
} else if (mapfile.got_key()) {
mapfile.unknown_key();
}