]> git.tdb.fi Git - libs/demoscene.git/blobdiff - source/sequencer.cpp
Allow specifying one-off actions inside segments
[libs/demoscene.git] / source / sequencer.cpp
index eeb41d20da6865b72eb0ab0c5097ad1a0805600a..0297c4397ff254bf30d26d95a44f4ec7909a1122 100644 (file)
@@ -159,7 +159,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 +169,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,12 +179,15 @@ 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)