]> git.tdb.fi Git - libs/demoscene.git/blobdiff - source/sequencer.cpp
Dynamically check for AnimatedObject in Animate
[libs/demoscene.git] / source / sequencer.cpp
index eeb41d20da6865b72eb0ab0c5097ad1a0805600a..5aa0823897749227b0a51b08bb44454da752fccb 100644 (file)
@@ -7,7 +7,9 @@
 #include "stage.h"
 
 using namespace std;
-using namespace Msp;
+
+namespace Msp {
+namespace DemoScene {
 
 Sequencer::Sequencer(float bpm):
        started(false),
@@ -159,7 +161,7 @@ void Sequencer::Loader::instant(float beat)
 
 void Sequencer::Loader::segment(float start, float end)
 {
-       SegmentLoader ldr(obj, start, end);
+       SegmentLoader ldr(obj, start, end, demo);
        load_sub_with(ldr);
 }
 
@@ -169,7 +171,7 @@ Sequencer::ActionDefLoader::ActionDefLoader(Sequencer &s, Demo &d):
        demo(d)
 {
        for(const auto &t: obj.action_types)
-               add(t.first, t.second->get_loader_func());
+               add(t.first, t.second->get_def_loader_func());
 }
 
 void Sequencer::ActionDefLoader::finished()
@@ -179,15 +181,21 @@ void Sequencer::ActionDefLoader::finished()
 }
 
 
-Sequencer::SegmentLoader::SegmentLoader(Sequencer &s, float b, float e):
+Sequencer::SegmentLoader::SegmentLoader(Sequencer &s, float b, float e, Demo &d):
        ObjectLoader<Sequencer>(s),
        start_beat(b),
-       end_beat(e)
+       end_beat(e),
+       demo(d)
 {
        add("apply", &SegmentLoader::apply);
+       for(const auto &t: obj.action_types)
+               add(t.first, t.second->get_loader_func());
 }
 
 void Sequencer::SegmentLoader::apply(const string &n)
 {
        obj.add_action(*get_item(obj.named_actions, n), start_beat, end_beat);
 }
+
+} // namespace DemoScene
+} // namespace Msp