Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/model')
-rw-r--r--src/model/light.cc4
-rw-r--r--src/model/light.h4
-rw-r--r--src/model/map.cc8
3 files changed, 14 insertions, 2 deletions
diff --git a/src/model/light.cc b/src/model/light.cc
index f9f6b5c..f391a44 100644
--- a/src/model/light.cc
+++ b/src/model/light.cc
@@ -12,6 +12,7 @@ Light::Light() :
light_location(),
light_color(1.0f, 1.0f, 1.0f)
{
+ light_entity = false;
light_strobe = false;
light_radius = 1.0f;
light_frequency = 1.0f;
@@ -21,6 +22,7 @@ Light::Light() :
render_texture = 0;
}
+/*
Light::Light(math::Vector3f const & location, math::Color const & color, bool strobe) :
light_location(location),
light_color(color)
@@ -33,7 +35,7 @@ Light::Light(math::Vector3f const & location, math::Color const & color, bool st
light_flare = 0;
render_texture = 0;
}
-
+*/
Light::~Light()
{}
diff --git a/src/model/light.h b/src/model/light.h
index 9605497..b834623 100644
--- a/src/model/light.h
+++ b/src/model/light.h
@@ -29,6 +29,9 @@ public:
/// true if this is a strobe light
inline bool strobe() const { return light_strobe; }
+ /// true if this light has entity color
+ inline bool entity() const { return light_entity; }
+
/// size if the light, default is 1.0f
inline float radius() const { return light_radius; }
@@ -50,6 +53,7 @@ public:
math::Vector3f light_location;
math::Color light_color;
bool light_strobe;
+ bool light_entity;
float light_radius;
float light_frequency;
float light_offset;
diff --git a/src/model/map.cc b/src/model/map.cc
index 8b70b95..618db79 100644
--- a/src/model/map.cc
+++ b/src/model/map.cc
@@ -14,6 +14,11 @@
namespace model {
+// function to test spawnflags
+inline bool spawnflag_isset(unsigned int spawnflags, unsigned int flag) {
+ return ((spawnflags & flag) == flag);
+}
+
Model * Map::load(std::string const &name)
{
// open the .map file
@@ -49,7 +54,8 @@ Model * Map::load(std::string const &name)
continue;
} else if (mapfile.got_key_int("spawnflags", u)) {
- light->light_strobe = ((u & 1) == 1);
+ light->light_strobe = spawnflag_isset(u, 1);
+ light->light_entity = spawnflag_isset(u, 2);
} else if (mapfile.got_key_float("light", light->light_radius)) {
light->light_radius /= 100.0f;