]> git.tdb.fi Git - libs/gl.git/commitdiff
Use ObjectInstance instead of AnimatedObject in Scene loader
authorMikko Rasa <tdb@tdb.fi>
Wed, 14 Apr 2021 15:28:04 +0000 (18:28 +0300)
committerMikko Rasa <tdb@tdb.fi>
Wed, 14 Apr 2021 15:28:04 +0000 (18:28 +0300)
Since ObjectInstance has a matrix now, there's no need to use
AnimatedObject here.  I may add another statement to include objects
with actual animations later.

source/render/scene.cpp

index dd611536bf605ab8b53708e60831ba342560e54b..b8cdc04516191226b76fd9a89f16b65721106b70 100644 (file)
@@ -1,6 +1,6 @@
 #include <msp/datafile/collection.h>
-#include "animatedobject.h"
 #include "camera.h"
+#include "objectinstance.h"
 #include "orderedscene.h"
 #include "renderer.h"
 #include "scene.h"
@@ -120,12 +120,12 @@ void Scene::Loader::object(const string &n)
 
 void Scene::Loader::object_tagged(const string &n, const string &t)
 {
-       RefPtr<AnimatedObject> anob = new AnimatedObject(get_collection().get<GL::Object>(n));
-       load_sub(*anob);
-       obj.add(*anob);
+       RefPtr<ObjectInstance> inst = new ObjectInstance(get_collection().get<GL::Object>(n));
+       load_sub(*inst);
+       obj.add(*inst);
        if(content && !t.empty())
-               (*content)[t] = anob.get();
-       obj.owned_data.push_back(anob.release());
+               (*content)[t] = inst.get();
+       obj.owned_data.push_back(inst.release());
 }