|
Fission FSN
|

Directories | |
| src | |
| tests | |
fsSpine is an optional, renderer-neutral animation provider backed by spine-cpp. Enable it in a game's root CMakeLists.txt before Fission is configured:
The project generator carries this setting into generated options.cmake. The adapter requires Spine 4.2. Its default runtime is the unmodified 4.2 runtime bundled with Axmol. Set FISSION_SPINE_RUNTIME_ROOT to use a 4.2 runtime from another location; configuration fails early for other versions.
Export JSON data using a base name ending in .spine. For an animation named hero, keep these files together:
Every atlas page named by hero.spine.atlas is resolved relative to the atlas file. Multiple texture pages are supported. Atlas premultiplied-alpha settings and Spine normal, additive, multiply, and screen blend modes are honoured. Atlas nearest/linear filtering and clamp/repeat wrapping are also applied. Mipmapped filters currently use their nearest or linear non-mipmapped equivalent because Fission does not generate texture mipmaps.
An event whose audio path (or, failing that, whose name) ends in an audio extension plays that file through the audio manager when it fires, and is still delivered to animationEventCallbackSet. A bare filename (slamSceneDoor.mp3) is looked up beside the .spine.json; a path with a directory (audio/sfx/doorClose.mp3) is taken from the assets root. Files are cached at load. Volume and balance are not applied.
Spine 4.2 has no per-animation loop flag, so the data carries it: an animation loops when it keys an event named loop (define the event once in the skeleton, then key it anywhere on the animation, at any time). Animations without the marker play once and hold their last frame. The marker is read at load and is never delivered to animationEventCallbackSet. The play, queue and track calls take no loop argument; loopingGet() reports the data's answer.
The standard fsCAnimatingSpriteComponent also discovers entity-prefixed files using the existing convention, for example ANM-hero.spine.json. Animation selection, queued and multi-track playback, speed, start offset, cross-fade duration, skins, slot attachments, tinting, hit tests, transforms, and visibility use the existing Fission animating-sprite API. Pass an empty skin name to skinSet to restore the default skin, or an empty attachment name to attachmentSet to clear a slot. animationEventCallbackSet receives lifecycle and authored Spine events as renderer-neutral fsSAnimationEvent values.
Binary .skel files are not currently supported. Adding them requires a binary-safe Fission resource-reading API; fsIFile::strGetFromFile is suitable only for the current JSON and atlas inputs.
Use of the Spine runtime remains subject to the Spine Runtimes License Agreement included with the selected runtime.
The repository includes a metadata-only Spine 4.2 fixture and a standalone, headless runtime smoke test: