Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
committerStijn Buys <ingar@osirion.org>2009-08-18 09:24:15 +0000
commitf030154fe727e25a2afe1f78b3998c2d2dba95e4 (patch)
treecd92baf9e4fa8a136523b9eb570e9811846c9250 /src/render/dust.cc
parent5636fad174f0bcff857c357c394c4cc8d424b302 (diff)
astyle cleanup, corrects not loading of material textures
Diffstat (limited to 'src/render/dust.cc')
-rw-r--r--src/render/dust.cc18
1 files changed, 9 insertions, 9 deletions
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);
}