From 825d5a44bd312772c53fdaa8924e4009cfb320a3 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 10 Feb 2008 17:54:53 +0000 Subject: more entity updates --- src/render/box.cc | 49 +++++++++++++++++++++++++------------------------ src/render/box.h | 3 +++ src/render/tga.cc | 2 +- 3 files changed, 29 insertions(+), 25 deletions(-) (limited to 'src/render') 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); -- cgit v1.2.3