Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
Loading...
Searching...
No Matches
SpineRuntimeCpp.cpp
Go to the documentation of this file.
1// SPDX-License-Identifier: Apache-2.0
2// SPDX-FileCopyrightText: Copyright (c) 2024-present ESEngine Team
27
28#include "./SpineRuntime.hpp"
29
30#include <spine/spine.h>
31#include <spine/PhysicsConstraintData.h>
32#include <spine/SkeletonRenderer.h>
33
34#include <vector>
35
36#ifndef ES_SPINE_VERSION
37#error "ES_SPINE_VERSION must name the vendored spine-cpp release (43)."
38#endif
39
40namespace sp = ::spine;
41
42// spine-cpp asks its host for the allocator it should use, the way spine-c asks for
43// its file and texture hooks. The default one is malloc/free, which is what the
44// module wants: on the web its heap is the wasm heap, and on a device the host's
45// allocator already routes through the engine's arena.
46sp::SpineExtension* spine::getDefaultExtension() {
47 return new sp::DefaultSpineExtension();
48}
49
50namespace es::ES_SPINE_NS {
51
52namespace {
53
59class UnloadedTextures : public sp::TextureLoader {
60public:
61 void load(sp::AtlasPage& page, const sp::String& path) override {
62 (void)page;
63 (void)path;
64 }
65 void unload(void* texture) override { (void)texture; }
66};
67
68EventSink g_eventSink = nullptr;
69
71sp::SkeletonRenderer g_renderer;
72
73int blendModeOf(sp::BlendMode mode) {
74 switch (mode) {
75 case sp::BlendMode_Additive: return 1;
76 case sp::BlendMode_Multiply: return 2;
77 case sp::BlendMode_Screen: return 3;
78 default: return 0;
79 }
80}
81
82const char* cstr(const sp::String& text) {
83 return text.buffer();
84}
85
86} // namespace
87
88// =============================================================================
89// Resources
90// =============================================================================
91
92struct Skeleton {
93 UnloadedTextures loader;
94 sp::Atlas* atlas = nullptr;
95 sp::SkeletonData* data = nullptr;
96 sp::AnimationStateData* stateData = nullptr;
97
100 std::vector<void*> premultiplied;
101
102 Skeleton() = default;
103 Skeleton(const Skeleton&) = delete;
104 Skeleton& operator=(const Skeleton&) = delete;
105
106 // The atlas unloads its pages through the loader, so it goes first.
108 delete stateData;
109 delete data;
110 delete atlas;
111 }
112
113 bool isPremultiplied(void* texture) const {
114 for (void* t : premultiplied) {
115 if (t == texture) return true;
116 }
117 return false;
118 }
119};
120
121struct Instance {
122 Skeleton* owner = nullptr;
123 sp::Skeleton* skeleton = nullptr;
124 sp::AnimationState* state = nullptr;
125
126 Instance() = default;
127 Instance(const Instance&) = delete;
128 Instance& operator=(const Instance&) = delete;
129
131 delete state;
132 delete skeleton;
133 }
134};
135
136void destroy(Skeleton* skeleton) { delete skeleton; }
137void destroy(Instance* instance) { delete instance; }
138
139Skeleton* loadSkeleton(const void* skeletonData, int length,
140 const char* atlasText, int atlasLength,
141 bool binary, std::string& error) {
142 auto skeleton = std::make_unique<Skeleton>();
143
144 skeleton->atlas = new sp::Atlas(atlasText, atlasLength, "", &skeleton->loader);
145 if (skeleton->atlas->getPages().size() == 0) {
146 error = "Failed to create atlas (invalid atlas text or no pages)";
147 return nullptr;
148 }
149
150 if (binary) {
151 sp::SkeletonBinary reader(*skeleton->atlas);
152 reader.setScale(1.0f);
153 skeleton->data = reader.readSkeletonData(
154 static_cast<const unsigned char*>(skeletonData), length);
155 if (!skeleton->data) error = cstr(reader.getError());
156 } else {
157 sp::SkeletonJson reader(*skeleton->atlas);
158 reader.setScale(1.0f);
159 skeleton->data = reader.readSkeletonData(static_cast<const char*>(skeletonData));
160 if (!skeleton->data) error = cstr(reader.getError());
161 }
162
163 if (!skeleton->data) return nullptr;
164
165 skeleton->stateData = new sp::AnimationStateData(*skeleton->data);
166 skeleton->stateData->setDefaultMix(0.2f);
167 return skeleton.release();
168}
169
170int atlasPageCount(const Skeleton* skeleton) {
171 if (!skeleton) return 0;
172 return static_cast<int>(skeleton->atlas->getPages().size());
173}
174
175const char* atlasPageName(const Skeleton* skeleton, int page) {
176 if (!skeleton || page < 0 || page >= atlasPageCount(skeleton)) return nullptr;
177 return cstr(skeleton->atlas->getPages()[page]->name);
178}
179
180void setAtlasPageTexture(Skeleton* skeleton, int page, uint32_t texture, int width, int height) {
181 if (!skeleton || page < 0 || page >= atlasPageCount(skeleton)) return;
182
183 sp::AtlasPage* target = skeleton->atlas->getPages()[page];
184 void* handle = reinterpret_cast<void*>(static_cast<uintptr_t>(texture));
185 target->texture = handle;
186 target->width = width;
187 target->height = height;
188
189 // Regions copied the page's texture when the atlas parsed, which was before the
190 // SDK had one to give; attachments read it from the region, so refresh them.
191 sp::Array<sp::AtlasRegion*>& regions = skeleton->atlas->getRegions();
192 for (size_t i = 0; i < regions.size(); ++i) {
193 if (regions[i]->getPage() == target) regions[i]->setRendererObject(handle);
194 }
195
196 if (target->pma && !skeleton->isPremultiplied(handle)) {
197 skeleton->premultiplied.push_back(handle);
198 }
199}
200
201void setDefaultMix(Skeleton* skeleton, float seconds) {
202 if (skeleton) skeleton->stateData->setDefaultMix(seconds);
203}
204
205void setMixDuration(Skeleton* skeleton, const char* from, const char* to, float seconds) {
206 if (!skeleton) return;
207 sp::Animation* a = skeleton->data->findAnimation(from);
208 sp::Animation* b = skeleton->data->findAnimation(to);
209 if (a && b) skeleton->stateData->setMix(*a, *b, seconds);
210}
211
212// =============================================================================
213// Instances
214// =============================================================================
215
216Instance* createInstance(Skeleton* skeleton) {
217 if (!skeleton) return nullptr;
218
219 auto instance = std::make_unique<Instance>();
220 instance->owner = skeleton;
221 instance->skeleton = new sp::Skeleton(*skeleton->data);
222 instance->state = new sp::AnimationState(*skeleton->stateData);
223
224 instance->skeleton->setupPose();
225 instance->skeleton->updateWorldTransform(sp::Physics_Update);
226 return instance.release();
227}
228
229void advanceAndApply(Instance* instance, float dt) {
230 if (!instance) return;
231 instance->state->update(dt);
232 instance->state->apply(*instance->skeleton);
233}
234
235void materializeWorldPose(Instance* instance, float dt) {
236 if (!instance) return;
237 instance->skeleton->update(dt);
238 instance->skeleton->updateWorldTransform(sp::Physics_Update);
239}
240
241void update(Instance* instance, float dt) {
242 advanceAndApply(instance, dt);
243 materializeWorldPose(instance, dt);
244}
245
246float animationDuration(const Skeleton* skeleton, const char* animation) {
247 if (!skeleton || !skeleton->data) return -1.0f;
248 sp::Animation* found = skeleton->data->findAnimation(animation);
249 return found ? found->getDuration() : -1.0f;
250}
251
252bool requiresContinuousWorldPose(const Skeleton* skeleton) {
253 if (!skeleton || !skeleton->data) return false;
254 // 4.3 keeps one constraint list and tells them apart by spine's own RTTI,
255 // which is what this build has instead of the compiler's.
256 sp::Array<sp::ConstraintData*>& constraints = skeleton->data->getConstraints();
257 for (size_t i = 0; i < constraints.size(); ++i) {
258 if (constraints[i]->getRTTI().instanceOf(sp::PhysicsConstraintData::rtti)) return true;
259 }
260 return false;
261}
262
263void setToSetupPose(Instance* instance) {
264 if (!instance) return;
265 instance->state->clearTracks();
266 // 4.3 renamed it; this file is the 4.3 backend.
267 instance->skeleton->setupPose();
268}
269
270bool playAnimation(Instance* instance, const char* animation, bool loop, int track) {
271 if (!instance) return false;
272 // setAnimation takes a reference and asserts on a missing name, so look first.
273 sp::Animation* found = instance->skeleton->getData().findAnimation(animation);
274 if (!found) return false;
275 instance->state->setAnimation(static_cast<size_t>(track), *found, loop);
276 return true;
277}
278
279bool addAnimation(Instance* instance, const char* animation, bool loop, float delay, int track) {
280 if (!instance) return false;
281 sp::Animation* found = instance->skeleton->getData().findAnimation(animation);
282 if (!found) return false;
283 instance->state->addAnimation(static_cast<size_t>(track), *found, loop, delay);
284 return true;
285}
286
287void setSkin(Instance* instance, const char* skin) {
288 if (!instance) return;
289 if (!skin || skin[0] == '\0') {
290 instance->skeleton->setSkin(static_cast<sp::Skin*>(nullptr));
291 } else {
292 sp::Skin* found = instance->skeleton->getData().findSkin(skin);
293 if (!found) return;
294 instance->skeleton->setSkin(found);
295 }
296 instance->skeleton->setupPoseSlots();
297}
298
299void setTrackAlpha(Instance* instance, int track, float alpha) {
300 if (!instance) return;
301 sp::TrackEntry* entry = instance->state->getTrack(static_cast<size_t>(track));
302 if (entry) entry->setAlpha(alpha);
303}
304
305void setEventSink(EventSink sink) {
306 g_eventSink = sink;
307}
308
309namespace {
310
312EventKind kindOf(sp::EventType type) {
313 switch (type) {
314 case sp::EventType_Start: return EventKind::Start;
315 case sp::EventType_Interrupt: return EventKind::Interrupt;
316 case sp::EventType_End: return EventKind::End;
317 case sp::EventType_Complete: return EventKind::Complete;
318 case sp::EventType_Dispose: return EventKind::Dispose;
319 default: return EventKind::Event;
320 }
321}
322
323void eventListener(sp::AnimationState* state, sp::EventType type,
324 sp::TrackEntry* entry, sp::Event* event, void* userData) {
325 (void)state;
326 (void)userData;
327 if (!g_eventSink) return;
328
329 Event out;
330 out.source = state;
331 out.kind = kindOf(type);
332 out.track = entry ? static_cast<int>(entry->getTrackIndex()) : 0;
333 if (entry) out.animation = cstr(entry->getAnimation().getName());
334 if (type == sp::EventType_Event && event) {
335 out.floatValue = event->getFloat();
336 out.intValue = event->getInt();
337 out.name = cstr(event->getData().getName());
338 out.stringValue = cstr(event->getString());
339 }
340 g_eventSink(out);
341}
342
343} // namespace
344
345const void* eventSource(Instance* instance) {
346 return instance ? instance->state : nullptr;
347}
348
349void enableEvents(Instance* instance) {
350 if (instance) instance->state->setListener(eventListener);
351}
352
353// =============================================================================
354// Queries
355// =============================================================================
356
357int animationCount(const Instance* instance) {
358 if (!instance) return 0;
359 return static_cast<int>(instance->skeleton->getData().getAnimations().size());
360}
361
362const char* animationName(const Instance* instance, int index) {
363 if (!instance || index < 0 || index >= animationCount(instance)) return nullptr;
364 return cstr(instance->skeleton->getData().getAnimations()[index]->getName());
365}
366
367int skinCount(const Instance* instance) {
368 if (!instance) return 0;
369 return static_cast<int>(instance->skeleton->getData().getSkins().size());
370}
371
372const char* skinName(const Instance* instance, int index) {
373 if (!instance || index < 0 || index >= skinCount(instance)) return nullptr;
374 return cstr(instance->skeleton->getData().getSkins()[index]->getName());
375}
376
377bool bonePosition(const Instance* instance, const char* bone, float* x, float* y) {
378 if (!instance) return false;
379 sp::Bone* found = instance->skeleton->findBone(bone);
380 if (!found) return false;
381 // The applied pose is what rendering used — constraints included.
382 *x = found->getAppliedPose().getWorldX();
383 *y = found->getAppliedPose().getWorldY();
384 return true;
385}
386
387bool boneRotation(const Instance* instance, const char* bone, float* degrees) {
388 if (!instance) return false;
389 sp::Bone* found = instance->skeleton->findBone(bone);
390 if (!found) return false;
391 *degrees = found->getAppliedPose().getWorldRotationX();
392 return true;
393}
394
395int boneCount(const Instance* instance) {
396 return instance ? static_cast<int>(instance->skeleton->getBones().size()) : 0;
397}
398
399const char* boneName(const Instance* instance, int index) {
400 if (!instance || index < 0 || index >= boneCount(instance)) return nullptr;
401 return cstr(instance->skeleton->getBones()[index]->getData().getName());
402}
403
404int boneParent(const Instance* instance, int index) {
405 if (!instance || index < 0 || index >= boneCount(instance)) return -1;
406 sp::Bone* parent = instance->skeleton->getBones()[index]->getParent();
407 return parent ? parent->getData().getIndex() : -1;
408}
409
410bool bonePose(const Instance* instance, int index, float* x, float* y, float* degrees, float* length) {
411 if (!instance || index < 0 || index >= boneCount(instance)) return false;
412 sp::Bone* b = instance->skeleton->getBones()[index];
413 *x = b->getAppliedPose().getWorldX();
414 *y = b->getAppliedPose().getWorldY();
415 *degrees = b->getAppliedPose().getWorldRotationX();
416 *length = b->getData().getLength();
417 return true;
418}
419
420void bounds(const Instance* instance, float* x, float* y, float* width, float* height) {
421 *x = *y = *width = *height = 0.0f;
422 if (!instance) return;
423 instance->skeleton->getBounds(*x, *y, *width, *height);
424}
425
426namespace {
427
428bool isKind(sp::Constraint* constraint, ConstraintKind kind) {
429 switch (kind) {
430 case ConstraintKind::Ik: return constraint->getRTTI().isExactly(sp::IkConstraint::rtti);
431 case ConstraintKind::Transform:
432 return constraint->getRTTI().isExactly(sp::TransformConstraint::rtti);
433 case ConstraintKind::Path: return constraint->getRTTI().isExactly(sp::PathConstraint::rtti);
434 }
435 return false;
436}
437
438} // namespace
439
440int constraintCount(const Instance* instance, ConstraintKind kind) {
441 if (!instance) return 0;
442 sp::Array<sp::Constraint*>& constraints = instance->skeleton->getConstraints();
443 int count = 0;
444 for (size_t i = 0; i < constraints.size(); ++i) {
445 if (isKind(constraints[i], kind)) ++count;
446 }
447 return count;
448}
449
450const char* constraintName(const Instance* instance, ConstraintKind kind, int index) {
451 if (!instance || index < 0) return nullptr;
452 sp::Array<sp::Constraint*>& constraints = instance->skeleton->getConstraints();
453 int seen = 0;
454 for (size_t i = 0; i < constraints.size(); ++i) {
455 if (!isKind(constraints[i], kind)) continue;
456 if (seen == index) return cstr(constraints[i]->getData().getName());
457 ++seen;
458 }
459 return nullptr;
460}
461
462bool transformMix(const Instance* instance, const char* name, TransformMix* out) {
463 if (!instance) return false;
464 auto* c = instance->skeleton->findConstraint<sp::TransformConstraint>(name);
465 if (!c) return false;
466 out->rotate = c->getPose().getMixRotate();
467 out->x = c->getPose().getMixX();
468 out->y = c->getPose().getMixY();
469 out->scaleX = c->getPose().getMixScaleX();
470 out->scaleY = c->getPose().getMixScaleY();
471 out->shearY = c->getPose().getMixShearY();
472 return true;
473}
474
475bool setTransformMix(Instance* instance, const char* name, const TransformMix& mix) {
476 if (!instance) return false;
477 auto* c = instance->skeleton->findConstraint<sp::TransformConstraint>(name);
478 if (!c) return false;
479 c->getPose().setMixRotate(mix.rotate);
480 c->getPose().setMixX(mix.x);
481 c->getPose().setMixY(mix.y);
482 c->getPose().setMixScaleX(mix.scaleX);
483 c->getPose().setMixScaleY(mix.scaleY);
484 c->getPose().setMixShearY(mix.shearY);
485 return true;
486}
487
488bool pathMix(const Instance* instance, const char* name, PathMix* out) {
489 if (!instance) return false;
490 auto* c = instance->skeleton->findConstraint<sp::PathConstraint>(name);
491 if (!c) return false;
492 out->position = c->getPose().getPosition();
493 out->spacing = c->getPose().getSpacing();
494 out->rotate = c->getPose().getMixRotate();
495 out->x = c->getPose().getMixX();
496 out->y = c->getPose().getMixY();
497 return true;
498}
499
500bool setPathMix(Instance* instance, const char* name, const PathMix& mix) {
501 if (!instance) return false;
502 auto* c = instance->skeleton->findConstraint<sp::PathConstraint>(name);
503 if (!c) return false;
504 c->getPose().setPosition(mix.position);
505 c->getPose().setSpacing(mix.spacing);
506 c->getPose().setMixRotate(mix.rotate);
507 c->getPose().setMixX(mix.x);
508 c->getPose().setMixY(mix.y);
509 return true;
510}
511
512// =============================================================================
513// Posing
514// =============================================================================
515
516bool setAttachment(Instance* instance, const char* slot, const char* attachment) {
517 if (!instance) return false;
518 sp::Slot* found = instance->skeleton->findSlot(slot);
519 if (!found) return false;
520
521 if (!attachment || attachment[0] == '\0') {
522 found->getPose().setAttachment(nullptr);
523 return true;
524 }
525
526 sp::Attachment* wanted = instance->skeleton->getAttachment(found->getData().getIndex(), attachment);
527 if (!wanted) return false;
528 found->getPose().setAttachment(wanted);
529 return true;
530}
531
532bool setIkTarget(Instance* instance, const char* constraint, float x, float y, float mix) {
533 if (!instance) return false;
534 auto* c = instance->skeleton->findConstraint<sp::IkConstraint>(constraint);
535 if (!c) return false;
536 c->getTarget().getPose().setX(x);
537 c->getTarget().getPose().setY(y);
538 c->getPose().setMix(mix);
539 return true;
540}
541
542bool setSlotColor(Instance* instance, const char* slot, float r, float g, float b, float a) {
543 if (!instance) return false;
544 sp::Slot* found = instance->skeleton->findSlot(slot);
545 if (!found) return false;
546 found->getPose().getColor().set(r, g, b, a);
547 return true;
548}
549
550bool setSkeletonColor(Instance* instance, float r, float g, float b, float a) {
551 if (!instance) return false;
552 instance->skeleton->getColor().set(r, g, b, a);
553 return true;
554}
555
556// =============================================================================
557// Geometry
558// =============================================================================
559
560void render(Instance* instance, TriangleSink& sink, bool clipping) {
561 if (!instance) return;
562
563 // SkeletonRenderer always clips; when the caller asked for no clipping there is
564 // nothing to turn off, so the flag only matters to backends that clip by hand.
565 (void)clipping;
566
567 for (sp::RenderCommand* command = g_renderer.render(*instance->skeleton);
568 command != nullptr; command = command->next) {
569 if (command->numVertices <= 0 || command->numIndices <= 0) continue;
570
571 // Every vertex of a command carries the same colour: the renderer writes one
572 // colour per attachment and only merges commands whose colours already match.
573 const uint32_t packed = command->colors[0];
574 float rgba[4] = {
575 static_cast<float>((packed >> 16) & 0xFF) / 255.0f,
576 static_cast<float>((packed >> 8) & 0xFF) / 255.0f,
577 static_cast<float>(packed & 0xFF) / 255.0f,
578 static_cast<float>((packed >> 24) & 0xFF) / 255.0f,
579 };
580
581 // Both consequences of premultiplied artwork, from the one rule the C
582 // backend also reads (SpineRuntime.hpp): the blend code gains a twin for
583 // two of the four modes, and the tint carries its alpha for ALL of them.
584 const bool pma = instance->owner->isPremultiplied(command->texture);
585 sink.setPremultipliedColor(pma);
586 premultiplyTint(rgba, pma);
587
588 sink.emit(command->positions, command->uvs, command->numVertices,
589 command->indices, command->numIndices,
590 static_cast<uint32_t>(reinterpret_cast<uintptr_t>(command->texture)),
591 blendForPage(blendModeOf(command->blendMode), pma), rgba);
592 }
593}
594
598bool renderStage(Instance*, TriangleSink&, bool, int, ProbeCounts*) {
599 return false;
600}
601
602bool poseStage(Instance*, float, int, PoseCounts*) {
603 return false;
604}
605
606bool clipStorage(ClipStorage*) {
607 return false;
608}
609
610bool renderCounted(Instance*, TriangleSink&, bool, ProbeCounts*) {
611 return false;
612}
613
614bool clipStartStage(Instance*, int, ClipStartCounts*) {
615 return false;
616}
617
618bool skeletonBounds(const Skeleton*, float*, float*, float*, float*) {
619 return false;
620}
621
622int version() {
623 return ES_SPINE_VERSION;
624}
625
626} // namespace es::ES_SPINE_NS
What a vendored Spine runtime owes the module, and nothing more.
bool renderCounted(Instance *instance, TriangleSink &sink, bool clipping, ProbeCounts *counts)
int atlasPageCount(const Skeleton *skeleton)
void(*)(const Event &) EventSink
The module is a singleton, so its collector is process-wide rather than per instance.
bool bonePose(const Instance *instance, int index, float *x, float *y, float *degrees, float *length)
void advanceAndApply(Instance *instance, float dt)
bool playAnimation(Instance *instance, const char *animation, bool loop, int track)
const void * eventSource(Instance *instance)
bool pathMix(const Instance *instance, const char *name, PathMix *out)
void premultiplyTint(float rgba[4], bool pagePremultiplied)
bool clipStorage(ClipStorage *out)
int boneParent(const Instance *instance, int index)
void update(Instance *instance, float dt)
const char * skinName(const Instance *instance, int index)
bool boneRotation(const Instance *instance, const char *bone, float *degrees)
void enableEvents(Instance *instance)
void setDefaultMix(Skeleton *skeleton, float seconds)
int boneCount(const Instance *instance)
bool transformMix(const Instance *instance, const char *name, TransformMix *out)
float animationDuration(const Skeleton *skeleton, const char *animation)
bool setSkeletonColor(Instance *instance, float r, float g, float b, float a)
Skeleton * loadSkeleton(const void *skeletonData, int length, const char *atlasText, int atlasLength, bool binary, std::string &error)
void setTrackAlpha(Instance *instance, int track, float alpha)
int blendForPage(int slotBlend, bool pagePremultiplied)
The blend code to emit for a slot's mode on a page of the given kind (see above).
const char * boneName(const Instance *instance, int index)
const char * constraintName(const Instance *instance, ConstraintKind kind, int index)
void setEventSink(EventSink sink)
const char * atlasPageName(const Skeleton *skeleton, int page)
bool skeletonBounds(const Skeleton *skeleton, float *x, float *y, float *width, float *height)
void setAtlasPageTexture(Skeleton *skeleton, int page, uint32_t texture, int width, int height)
bool poseStage(Instance *instance, float dt, int stage, PoseCounts *counts)
void bounds(const Instance *instance, float *x, float *y, float *width, float *height)
bool setPathMix(Instance *instance, const char *name, const PathMix &mix)
int skinCount(const Instance *instance)
const char * animationName(const Instance *instance, int index)
bool addAnimation(Instance *instance, const char *animation, bool loop, float delay, int track)
bool clipStartStage(Instance *instance, int stage, ClipStartCounts *counts)
bool setAttachment(Instance *instance, const char *slot, const char *attachment)
bool bonePosition(const Instance *instance, const char *bone, float *x, float *y)
bool setSlotColor(Instance *instance, const char *slot, float r, float g, float b, float a)
bool setTransformMix(Instance *instance, const char *name, const TransformMix &mix)
void setSkin(Instance *instance, const char *skin)
void render(Instance *instance, TriangleSink &sink, bool clipping)
int constraintCount(const Instance *instance, ConstraintKind kind)
Instance * createInstance(Skeleton *skeleton)
void setToSetupPose(Instance *instance)
void setMixDuration(Skeleton *skeleton, const char *from, const char *to, float seconds)
bool setIkTarget(Instance *instance, const char *constraint, float x, float y, float mix)
int animationCount(const Instance *instance)
void materializeWorldPose(Instance *instance, float dt)
bool renderStage(Instance *instance, TriangleSink &sink, bool clipping, int stage, ProbeCounts *counts)
bool requiresContinuousWorldPose(const Skeleton *skeleton)
auto sink(SignalType &signal)
Create a sink for a signal.
Definition Sink.hpp:175
Instance & operator=(const Instance &)=delete
spAnimationState * state
Instance(const Instance &)=delete
bool isPremultiplied(void *texture) const
UnloadedTextures loader
Skeleton & operator=(const Skeleton &)=delete
spSkeletonData * data
spAnimationStateData * stateData
Skeleton(const Skeleton &)=delete
std::vector< void * > premultiplied