]> git.tdb.fi Git - libs/gl.git/blobdiff - source/render/object.cpp
Use constructor delegation instead of init functions when possible
[libs/gl.git] / source / render / object.cpp
index 8a3963eebe992f9db802184b5f20b9d86b461ab7..34eebec782472880484179df7cf2175303086bab 100644 (file)
@@ -2,12 +2,9 @@
 #include <msp/fs/utils.h>
 #include <msp/strings/format.h>
 #include "error.h"
-#include "material.h"
 #include "mesh.h"
 #include "object.h"
 #include "objectinstance.h"
-#include "program.h"
-#include "programdata.h"
 #include "renderer.h"
 #include "resourcemanager.h"
 #include "technique.h"
@@ -17,7 +14,7 @@ using namespace std;
 namespace Msp {
 namespace GL {
 
-Matrix Object::identity_matrix;
+const Matrix Object::identity_matrix;
 
 Object::Object():
        lods(1),
@@ -191,19 +188,8 @@ void Object::resource_removed(Resource &res)
 }
 
 
-Object::Loader::Loader(Object &o):
-       LodLoader(o, 0, 0)
-{
-       init();
-}
-
-Object::Loader::Loader(Object &o, Collection &c):
-       LodLoader(o, 0, &c)
-{
-       init();
-}
-
-void Object::Loader::init()
+Object::Loader::Loader(Object &o, Collection *c):
+       LodLoader(o, 0, c)
 {
        add("bounding_sphere_hint", &Loader::bounding_sphere_hint);
        add("level_of_detail", &Loader::level_of_detail);