diff options
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/classes.cc | 6 | ||||
-rw-r--r-- | src/model/classes.h | 13 | ||||
-rw-r--r-- | src/model/map.cc | 9 |
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(); } |