Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--doc/installation.html4
-rw-r--r--src/model/asefile.h5
-rw-r--r--src/model/mapfile.cc1
-rw-r--r--src/model/parts.cc1
-rw-r--r--src/model/parts.h9
-rw-r--r--src/render/draw.cc20
6 files changed, 35 insertions, 5 deletions
diff --git a/doc/installation.html b/doc/installation.html
index 7640057..a1fa0b9 100644
--- a/doc/installation.html
+++ b/doc/installation.html
@@ -19,7 +19,7 @@
either download a package from the website, or you
can obtain the source code and compile it yourself.
<ul>
- <li><a href="system_requirements">System Requirements</a>
+ <li><a href="#system_requirements">System Requirements</a>
<li><a href="#packages">Using packages</a>
<li><a href="#building_from_source">Building from source code</a>
<li><a href="#gtkradiant">GtkRadiant 1.5.0 support files (optional)</a>
@@ -85,7 +85,7 @@
the version number. Enter the new subdirectory.
<div class="code">
tar jxvf osirion-latest.tar.bz2<br>
-cd osirion-0.1_258-linux
+cd osirion-linux-669
</div>
<p>
Dowload the game data package:<br>
diff --git a/src/model/asefile.h b/src/model/asefile.h
index dc1516b..c792a9d 100644
--- a/src/model/asefile.h
+++ b/src/model/asefile.h
@@ -86,7 +86,10 @@ private:
inline const std::string &name() const { return asefile_name; }
- inline const bool is_open() const { return asefile_ifs.is_open(); }
+ inline bool is_open()
+ {
+ return asefile_ifs.is_open();
+ }
std::string asefile_name;
diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc
index 385f986..271af06 100644
--- a/src/model/mapfile.cc
+++ b/src/model/mapfile.cc
@@ -1031,6 +1031,7 @@ Model * MapFile::load(std::string const &name)
} else if (mapfile.got_key_int("spawnflags", u)) {
light->light_strobe = spawnflag_isset(u, 1);
light->light_entity = spawnflag_isset(u, 2);
+ light->light_engine = spawnflag_isset(u, 4);
} else if (mapfile.got_key_float("light", light->light_radius)) {
light->light_radius *= LIGHTSCALE;
diff --git a/src/model/parts.cc b/src/model/parts.cc
index a4a2d1e..d4ff20b 100644
--- a/src/model/parts.cc
+++ b/src/model/parts.cc
@@ -21,6 +21,7 @@ Light::Light() :
light_offset = 0.0f;
light_time = 0.5f;
light_flare = 0;
+ light_engine = 0;
render_texture = 0;
}
diff --git a/src/model/parts.h b/src/model/parts.h
index 8593147..3e5e74f 100644
--- a/src/model/parts.h
+++ b/src/model/parts.h
@@ -31,7 +31,7 @@ class Light
public:
Light();
- Light(const math::Vector3f & location, const math::Color & color, bool strobe=false);
+ Light(const math::Vector3f & location, const math::Color & color, bool strobe=false, bool engine=false);
~Light();
@@ -86,6 +86,12 @@ public:
{
return light_flare;
}
+
+ /// true if this light has engine activation
+ inline const bool engine() const
+ {
+ return light_engine;
+ }
/// render texture number
inline size_t texture() const
@@ -97,6 +103,7 @@ public:
math::Color light_color;
bool light_strobe;
bool light_entity;
+ bool light_engine;
float light_radius;
float light_frequency;
float light_offset;
diff --git a/src/render/draw.cc b/src/render/draw.cc
index da8c8d3..150356c 100644
--- a/src/render/draw.cc
+++ b/src/render/draw.cc
@@ -904,6 +904,17 @@ void draw_pass_model_fx(float elapsed)
for (model::Model::Lights::iterator lit = entity->model()->lights().begin(); lit != entity->model()->lights().end(); lit++) {
light = (*lit);
+ // engine flares
+ thrust = 1.0f;
+ if (light->engine() && ( entity->type() == core::Entity::Controlable)) {
+ core::EntityControlable *ec = static_cast<core::EntityControlable *>(entity);
+ if ((ec->state() == core::Entity::ImpulseInitiate) || (ec->state() == core::Entity::Impulse)) {
+ thrust = 1.0f;
+ } else {
+ thrust = ec->thrust();
+ }
+ }
+
// strobe frequency
t = 1.0f;
if (light->strobe())
@@ -919,12 +930,17 @@ void draw_pass_model_fx(float elapsed)
gl::begin(gl::Quads);
}
+ // default alpha is 0.8
+ a = 0.8f;
if (light->entity()) {
color.assign(entity->color());
+ } else if (light->engine()) {
+ color.assign(entity->model()->enginecolor());
+ a *= thrust;
} else {
color.assign(light->color());
}
- color.a = 0.8;
+ color.a = a;
gl::color(color);
glTexCoord2f(0,1);
@@ -995,6 +1011,8 @@ void draw_pass_model_fx(float elapsed)
a = math::absf( dotproduct(flare_axis.forward(), Camera::axis().forward()));
if (a > 0.1f) {
+
+ // alpha decreases as the viewing angle increases
a = a - 0.1f;
if (flare->entity()) {
color.assign(entity->color());