Found it. I was taking a reference to a function pointer that was on the stack.
This commit is contained in:
parent
2484802d93
commit
2cef58be69
1 changed files with 2 additions and 2 deletions
|
|
@ -122,7 +122,7 @@ namespace scene {
|
||||||
|
|
||||||
void Engine::animate_actor(const std::string& actor) {
|
void Engine::animate_actor(const std::string& actor) {
|
||||||
auto& config = actor_config(actor);
|
auto& config = actor_config(actor);
|
||||||
config.anim.play();
|
if(!config.anim.playing) config.anim.play();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Engine::play_animations() {
|
void Engine::play_animations() {
|
||||||
|
|
@ -179,7 +179,7 @@ namespace scene {
|
||||||
|
|
||||||
void Engine::set_end_cb(std::function<void()> cb) {
|
void Engine::set_end_cb(std::function<void()> cb) {
|
||||||
for(auto& actor : $actors) {
|
for(auto& actor : $actors) {
|
||||||
actor.anim.onLoop = [&](auto& seq, auto& tr) -> bool {
|
actor.anim.onLoop = [=](auto& seq, auto& tr) -> bool {
|
||||||
seq.current = tr.toggled ? seq.frame_count - 1 : 0;
|
seq.current = tr.toggled ? seq.frame_count - 1 : 0;
|
||||||
cb();
|
cb();
|
||||||
return tr.looped;
|
return tr.looped;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue