diff --git a/.rive_head b/.rive_head index 2e50f1fb..e1220dc1 100644 --- a/.rive_head +++ b/.rive_head @@ -1 +1 @@ -df9c651a1cf45ef795de0b7242156e290a4cf499 +f96c86fcc800a1fa2bec3e97be00cab395ea838d diff --git a/wasm/src/bindings.cpp b/wasm/src/bindings.cpp index e9d2b2e7..b6d58ff8 100644 --- a/wasm/src/bindings.cpp +++ b/wasm/src/bindings.cpp @@ -425,7 +425,7 @@ EMSCRIPTEN_BINDINGS(RiveWASM) select_overload(&rive::LinearAnimationInstance::time), select_overload(&rive::LinearAnimationInstance::time)) .property("didLoop", &rive::LinearAnimationInstance::didLoop) - .function("advance", &rive::LinearAnimationInstance::advance) + .function("advance", select_overload(&rive::LinearAnimationInstance::advance)) .function("apply", &rive::LinearAnimationInstance::apply, allow_raw_pointers()); class_>("StateMachine"); @@ -447,18 +447,20 @@ EMSCRIPTEN_BINDINGS(RiveWASM) optional_override([](rive::StateMachineInstance& self, double x, double y) { self.pointerUp(rive::Vec2D((float)x, (float)y)); })) - .function("firedEventCount", &rive::StateMachineInstance::firedEventCount) + .function("reportedEventCount", &rive::StateMachineInstance::reportedEventCount) .function( - "firedEventAt", + "reportedEventAt", optional_override([](rive::StateMachineInstance& self, size_t index) -> emscripten::val { - const rive::Event* event = self.firedEventAt(index); - if (event == nullptr) + const rive::EventReport report = self.reportedEventAt(index); + if (report.event() == nullptr) { return emscripten::val::undefined(); } + rive::Event* event = report.event(); emscripten::val eventObject = emscripten::val::object(); eventObject.set("name", event->name()); + eventObject.set("delay", report.secondsDelay()); if (event->is()) { auto urlEvent = event->as(); diff --git a/wasm/submodules/rive-cpp b/wasm/submodules/rive-cpp index 5e8642f6..bc7a03a8 160000 --- a/wasm/submodules/rive-cpp +++ b/wasm/submodules/rive-cpp @@ -1 +1 @@ -Subproject commit 5e8642f6c0bdf60727e1be4711452e362c9559f8 +Subproject commit bc7a03a8826b67b64fc47c876837075f9ff3be40