diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/render/Makefile.am | 4 | ||||
-rw-r--r-- | src/render/draw.cc | 8 | ||||
-rw-r--r-- | src/render/dust.cc | 9 | ||||
-rw-r--r-- | src/render/dust.h | 2 |
4 files changed, 12 insertions, 11 deletions
diff --git a/src/render/Makefile.am b/src/render/Makefile.am index 3e3c0c8..27ad8bb 100644 --- a/src/render/Makefile.am +++ b/src/render/Makefile.am @@ -12,6 +12,4 @@ librender_la_LIBADD = $(top_builddir)/src/math/libmath.la librender_la_SOURCES = camera.cc draw.cc dust.cc gl.cc image.cc jpgfile.cc \ pngfile.cc render.cc text.cc textures.cc tga.cc noinst_HEADERS = camera.h draw.h dust.h gl.h image.h render.h text.h textures.h \ - tga.h -_SOURCES = pngfile.h -_SOURCES = jpgfile.h + tga.h pngfile.h jpgfile.h diff --git a/src/render/draw.cc b/src/render/draw.cc index 415a56c..8bf694f 100644 --- a/src/render/draw.cc +++ b/src/render/draw.cc @@ -45,8 +45,8 @@ const float drawfxdistance = 64.0f; const float farplane = 1016.0f; core::Zone *zone = 0; - -float zone_light[4]; +float zone_light[4]; // locaton of the zone light +math::Color zone_color; // color of the zone light bool has_zone_light = false; typedef std::map<float, core::EntityGlobe *> Globes; @@ -66,6 +66,7 @@ void pass_prepare(float seconds) // reset light state gl::disable(GL_LIGHT1); has_zone_light = false; + zone_color.assign(1.0); // clear current list of globes globes_list.clear(); @@ -168,6 +169,7 @@ void pass_prepare(float seconds) for (size_t i=0; i <3; i++) { zone_light[i] = globe->location()[i]; + zone_color[i] = globe->color()[i]; diffuse_light[i] = globe->color()[i] * 0.4; } zone_light[3] = 1.0f; @@ -1082,7 +1084,7 @@ void draw(float seconds) gl::depthmask(GL_FALSE); // disable depth buffer writing draw_pass_spacegrid(); // draw the blue spacegrid - Dust::draw(); // draw spacedust + Dust::draw(zone_color); // draw spacedust draw_pass_model_fx(seconds); // draw entity lights and engines diff --git a/src/render/dust.cc b/src/render/dust.cc index ad337b3..81d40fb 100644 --- a/src/render/dust.cc +++ b/src/render/dust.cc @@ -55,7 +55,7 @@ void Dust::reset() } } -void Dust::draw() +void Dust::draw(math::Color const &dustcolor) { float alpha = 0.0f; float traillength = 0.0f; @@ -91,9 +91,9 @@ void Dust::draw() return; } - alpha = math::max(core::localcontrol()->movement(), core::localcontrol()->speed()); + alpha = math::max(core::localcontrol()->movement()*0.5f, core::localcontrol()->speed()); math::clamp(alpha, 0.0f, 1.0f); - alpha = 0.2f + alpha * 0.8f; + alpha = 0.2f + alpha * 0.7f; if (!dust) { con_debug << " generating dust..." << std::endl; @@ -107,7 +107,8 @@ void Dust::draw() } } - math::Color color(1.0f, alpha); + math::Color color(dustcolor); + color.a = alpha; traillength = math::max(math::max(core::localcontrol()->movement(), core::localcontrol()->speed()), 0.5f); traillength = traillength * TRAILLENGHT / LOWSPEEDLIMIT; diff --git a/src/render/dust.h b/src/render/dust.h index 6a4b455..4a3b7bd 100644 --- a/src/render/dust.h +++ b/src/render/dust.h @@ -19,7 +19,7 @@ public: static void shutdown(); - static void draw(); + static void draw(math::Color const &dustcolor); static void reset(); }; |