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>2008-02-10 17:54:53 +0000
committerStijn Buys <ingar@osirion.org>2008-02-10 17:54:53 +0000
commit825d5a44bd312772c53fdaa8924e4009cfb320a3 (patch)
treea222232dee96bfe391eba819b1a18693db5bb3a4 /src/render
parent31959bc355c471c573828bf63932850e46c4b5bc (diff)
more entity updates
Diffstat (limited to 'src/render')
-rw-r--r--src/render/box.cc49
-rw-r--r--src/render/box.h3
-rw-r--r--src/render/tga.cc2
3 files changed, 29 insertions, 25 deletions
diff --git a/src/render/box.cc b/src/render/box.cc
index 8819a40..79f62f7 100644
--- a/src/render/box.cc
+++ b/src/render/box.cc
@@ -17,6 +17,7 @@ Box::Box(Vector3f const & tl, Vector3f const &br) :
{
topcolor = Color::White();
bottomcolor= Color::White() * 0.7f;
+ radius = 1.0f;
}
Box::Box(const Box & other)
@@ -52,47 +53,47 @@ void Box::draw()
// top
color(topcolor);
- vertex(v2);
- vertex(v1);
- vertex(v5);
- vertex(v6);
+ vertex(radius*v2);
+ vertex(radius*v1);
+ vertex(radius*v5);
+ vertex(radius*v6);
// sides
color(bottomcolor);
- vertex(v0);
+ vertex(radius*v0);
color(topcolor);
- vertex(v1);
- vertex(v2);
+ vertex(radius*v1);
+ vertex(radius*v2);
color(bottomcolor);
- vertex(v3);
+ vertex(radius*v3);
- vertex(v3);
+ vertex(radius*v3);
color(topcolor);
- vertex(v2);
- vertex(v6);
+ vertex(radius*v2);
+ vertex(radius*v6);
color(bottomcolor);
- vertex(v7);
+ vertex(radius*v7);
- vertex(v4);
+ vertex(radius*v4);
color(topcolor);
- vertex(v5);
- vertex(v1);
+ vertex(radius*v5);
+ vertex(radius*v1);
color(bottomcolor);
- vertex(v0);
+ vertex(radius*v0);
- vertex(v7);
+ vertex(radius*v7);
color(topcolor);
- vertex(v6);
- vertex(v5);
+ vertex(radius*v6);
+ vertex(radius*v5);
color(bottomcolor);
- vertex(v4);
+ vertex(radius*v4);
// bottom
color(bottomcolor);
- vertex(v4);
- vertex(v0);
- vertex(v3);
- vertex(v7);
+ vertex(radius*v4);
+ vertex(radius*v0);
+ vertex(radius*v3);
+ vertex(radius*v7);
end();
diff --git a/src/render/box.h b/src/render/box.h
index 9552b78..ceab8ec 100644
--- a/src/render/box.h
+++ b/src/render/box.h
@@ -36,6 +36,9 @@ public:
math::Color topcolor;
/// bottom color
math::Color bottomcolor;
+
+ /// size factor
+ float radius;
};
}
diff --git a/src/render/tga.cc b/src/render/tga.cc
index 18236fa..5802edf 100644
--- a/src/render/tga.cc
+++ b/src/render/tga.cc
@@ -168,7 +168,7 @@ TGA::image *TGA::load(const char *filename)
}
}
}
- delete[] pColors;
+ delete pColors;
}
filesystem::close(f);