From f030154fe727e25a2afe1f78b3998c2d2dba95e4 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 18 Aug 2009 09:24:15 +0000 Subject: astyle cleanup, corrects not loading of material textures --- src/render/dust.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/render/dust.cc') diff --git a/src/render/dust.cc b/src/render/dust.cc index a975e5f..cb8d84d 100644 --- a/src/render/dust.cc +++ b/src/render/dust.cc @@ -68,7 +68,7 @@ void Dust::draw(math::Color const &dustcolor) dustsize = 0; return; } - + if ((size_t) r_dustsize->value() != dustsize) { con_debug << " changing dust size..." << std::endl; if (dust) { @@ -77,7 +77,7 @@ void Dust::draw(math::Color const &dustcolor) } dustsize = (size_t) r_dustsize->value(); } - + if (dustsize <= 0) { if (dust) { free(dust); @@ -96,16 +96,16 @@ void Dust::draw(math::Color const &dustcolor) if (!dust) { con_debug << " generating dust..." << std::endl; - dust = (float *) malloc(sizeof(float) * dustsize* 3); + dust = (float *) malloc(sizeof(float) * dustsize * 3); for (size_t i = 0; i < dustsize; i++) { - dust[i*3] = core::localcontrol()->location().x() + (math::randomf(2) - 1) * (DUSTDISTANCE + core::localcontrol()->radius() * 2.0f); + dust[i*3] = core::localcontrol()->location().x() + (math::randomf(2) - 1) * (DUSTDISTANCE + core::localcontrol()->radius() * 2.0f); dust[i*3+1] = core::localcontrol()->location().y() + (math::randomf(2) - 1) * (DUSTDISTANCE + core::localcontrol()->radius() * 2.0f); dust[i*3+2] = core::localcontrol()->location().z() + (math::randomf(2) - 1) * (DUSTDISTANCE + core::localcontrol()->radius() * 2.0f); } } - - + + traillength = math::max(math::max(core::localcontrol()->movement(), core::localcontrol()->speed() * 0.5f), 0.5f); traillength = traillength * TRAILLENGHT / LOWSPEEDLIMIT; @@ -113,7 +113,7 @@ void Dust::draw(math::Color const &dustcolor) alpha = math::max(core::localcontrol()->movement(), core::localcontrol()->speed() * 0.5f); math::clamp(alpha, 0.0f, 1.0f); color.a = 0.25f * alpha; - + gl::begin(gl::Lines); gl::color(color); math::Vector3f v; @@ -127,11 +127,11 @@ void Dust::draw(math::Color const &dustcolor) if (dsquare > (2.0f * core::localcontrol()->radius() + DUSTDISTANCE)*(2.0f * core::localcontrol()->radius() + DUSTDISTANCE)) { for (size_t j = 0; j < 3; j++) { - dust[i*3+j] = core::localcontrol()->location()[j] + (math::randomf(2) - 1) * (DUSTDISTANCE + core::localcontrol()->radius() * 2.0f); + dust[i*3+j] = core::localcontrol()->location()[j] + (math::randomf(2) - 1) * (DUSTDISTANCE + core::localcontrol()->radius() * 2.0f); v[j] = dust[i*3+j] - core::localcontrol()->axis().forward()[j] * traillength; } } - + glVertex3fv(&dust[i*3]); gl::vertex(v); } -- cgit v1.2.3