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/engine.cc4
-rw-r--r--src/model/engine.h20
-rw-r--r--src/model/map.cc23
-rw-r--r--src/model/model.cc4
-rw-r--r--src/model/model.h7
5 files changed, 38 insertions, 20 deletions
diff --git a/src/model/engine.cc b/src/model/engine.cc
index eb4198a..706de15 100644
--- a/src/model/engine.cc
+++ b/src/model/engine.cc
@@ -18,7 +18,9 @@ Engine::Engine() :
{
engine_radius = 1.0f;
engine_flare = 0;
- engine_color.assign(1.0f, 0.0f, 0.0f , 1.0f);
+
+ engine_notrail = false;
+ engine_noflare = false;
}
Engine::Engine(math::Vector3f const & location) :
diff --git a/src/model/engine.h b/src/model/engine.h
index c3e6064..724c060 100644
--- a/src/model/engine.h
+++ b/src/model/engine.h
@@ -27,11 +27,6 @@ public:
return engine_location;
}
- inline math::Color const & color() const
- {
- return engine_color;
- }
-
inline float radius() const
{
return engine_radius;
@@ -46,11 +41,24 @@ public:
{
return render_texture;
}
+
+ inline bool noflare() const
+ {
+ return engine_noflare;
+ }
+
+ inline bool notrail() const
+ {
+ return engine_notrail;
+ }
math::Vector3f engine_location;
float engine_radius;
- math::Color engine_color;
unsigned int engine_flare;
+
+
+ bool engine_noflare;
+ bool engine_notrail;
unsigned int render_texture;
};
diff --git a/src/model/map.cc b/src/model/map.cc
index 377ed0d..62604ea 100644
--- a/src/model/map.cc
+++ b/src/model/map.cc
@@ -805,6 +805,8 @@ Model * Map::load(std::string const &name)
if (mapfile.got_key_int("enginesound", u)) {
model->model_enginesound = u;
continue;
+ } else if (mapfile.got_key_color("enginecolor", model->model_enginecolor) ==0) {
+ continue;
}
} else if (mapfile.got_classname("light")) {
@@ -896,18 +898,17 @@ Model * Map::load(std::string const &name)
if (mapfile.got_key_vector3f("origin", engine->engine_location)) {
engine->engine_location *= SCALE;
continue;
-
- } else if (mapfile.got_key_color("_color", engine->engine_color)) {
- continue;
-
+
} else if (mapfile.got_key_float("radius", engine->engine_radius)) {
engine->engine_radius /= 100.0f;
continue;
- } else if (mapfile.got_key_int("flare", engine->engine_flare)) {
+ } else if (mapfile.got_key_int("flare", engine->engine_flare)) {
continue;
- } else if (mapfile.got_key_color("_color", engine->engine_color)) {
+ } else if (mapfile.got_key_int("spawnflags", u)) {
+ engine->engine_noflare = spawnflag_isset(u, 1);
+ engine->engine_notrail = spawnflag_isset(u, 2);
continue;
}
}
@@ -915,15 +916,15 @@ Model * Map::load(std::string const &name)
mapfile.close();
- con_debug << " " << mapfile.name() << " " << mapfile.map_materials.size() << " mat " <<
- mapfile.map_brushes << " brushes " <<
- mapfile.map_faces << "/" << mapfile.map_faces_detail << " faces/detail " << std::endl;
+ con_debug << " " << mapfile.name() << " " << mapfile.map_materials.size() << " mat " <<
+ mapfile.map_brushes << " brushes " <<
+ mapfile.map_faces << "/" << mapfile.map_faces_detail << " faces/detail " << std::endl;
mapfile.load_fragments(model);
con_debug << " " << mapfile.name() << " " << model->fragments().size() << " frags " <<
- model->model_tris_count << "/" << model->model_tris_detail_count << " tris/detail " <<
- model->model_quad_count << "/" << model->model_quad_detail_count << " quads/detail" << std::endl;
+ model->model_tris_count << "/" << model->model_tris_detail_count << " tris/detail " <<
+ model->model_quad_count << "/" << model->model_quad_detail_count << " quads/detail" << std::endl;
mapfile.clear_materials();
diff --git a/src/model/model.cc b/src/model/model.cc
index 101895b..3fa0cc0 100644
--- a/src/model/model.cc
+++ b/src/model/model.cc
@@ -16,7 +16,9 @@ namespace model
Model::Registry Model::model_registry;
Model::Model(std::string const & name) :
- model_name(name)
+ model_enginecolor(1.0f, 0.0f, 0.0f),
+ model_name(name)
+
{
model_radius = 0.5f;
model_enginesound = 0;
diff --git a/src/model/model.h b/src/model/model.h
index 552d7dd..47728cb 100644
--- a/src/model/model.h
+++ b/src/model/model.h
@@ -95,10 +95,13 @@ public:
}
/// engine sound loop for this model
- inline unsigned int & enginesound()
+ inline unsigned int enginesound() const
{
return model_enginesound;
}
+
+ /// engine color for this model
+ inline math::Color const & enginecolor() const { return model_enginecolor; }
/// add a light to the model
void add_light(Light *light);
@@ -115,6 +118,8 @@ public:
math::Vector3f model_minbbox;
unsigned int model_enginesound;
+
+ math::Color model_enginecolor;
/* ---- static functions for the Model registry -------------------- */