removed static const Material::white (had a problem with C++ since the order that the static const constructors were being called in was not correct according to the order that the code depended on them), made Shape constructor use a common default material instead of recreating one every time

git-svn-id: svn://anubis/fart/trunk@174 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
Josh Holtrop committed 2009-03-02 00:17:56 +00:00
1 parent 6a649ecac7
commit 84f6b04cd7
4 files changed
+12 -10

No files matched your search

+9 -1
View File
@@ -5,10 +5,18 @@
#include <utility>
using namespace std;
static refptr<Material> default_material;
static bool default_material_initialized = false;
Shape::Shape()
{
m_transparency = 0.0;
m_material = new Material(Material::white);
if (default_material_initialized == false)
{
default_material = new Material();
default_material_initialized = true;
}
m_material = default_material;
}
Shape::~Shape()