MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / callback

Method callback

Source/Node/Spine.cpp:50–82  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

48 : _owner(owner) { }
49
50void Spine::SpineListener::callback(spine::AnimationState* state, spine::EventType type, spine::TrackEntry* entry, spine::Event* event) {
51 spine::String empty;
52 const spine::String& name = entry ? entry->getAnimation().getName() : empty;
53 Slice animationName{name.buffer(), name.length()};
54 switch (type) {
55 case spine::EventType_End:
56 if (_owner->_currentAnimationName == animationName) {
57 _owner->_currentAnimationName.clear();
58 }
59 break;
60 case spine::EventType_Event: {
61 const auto& name = event->getData().getName();
62 _owner->emit(Slice{name.buffer(), name.length()}, s_cast<Playable*>(_owner));
63 break;
64 }
65 case spine::EventType_Complete:
66 _owner->emit("AnimationEnd"_slice, animationName.toString(), s_cast<Playable*>(_owner));
67 _owner->_lastCompletedAnimationName = animationName.toString();
68 if (_owner->_currentAnimationName == animationName) {
69 _owner->_currentAnimationName.clear();
70 }
71 break;
72 case spine::EventType_Interrupt:
73 _owner->_lastCompletedAnimationName.clear();
74 if (_owner->_currentAnimationName == animationName) {
75 _owner->_currentAnimationName.clear();
76 }
77 break;
78 case spine::EventType_Start:
79 case spine::EventType_Dispose:
80 break;
81 }
82}
83
84Spine::Spine(String spineStr)
85 : _skeletonData(SharedSkeletonCache.load(spineStr))

Callers 15

removeRefMethod · 0.80
runJobMethod · 0.80
cancelMethod · 0.80
SDL_SetHintWithPriorityFunction · 0.80
SDL_ResetHintFunction · 0.80
SDL_ResetHintsFunction · 0.80
device_eventFunction · 0.80
output_callbackFunction · 0.80
input_callbackFunction · 0.80
SDL_PushEventFunction · 0.80
SDL_TimerThreadFunction · 0.80

Calls 8

getAnimationMethod · 0.80
bufferMethod · 0.80
getNameMethod · 0.65
clearMethod · 0.65
toStringMethod · 0.65
lengthMethod · 0.45
getDataMethod · 0.45
emitMethod · 0.45

Tested by

no test coverage detected