[haxe] Port to 4.3 (WIP)

This commit is contained in:
Davide Tantillo 2025-06-05 15:06:37 +02:00
parent 4daeefd5cf
commit 47c687c870
19 changed files with 1043 additions and 1612 deletions

View File

@ -9,550 +9,6 @@ echo "Spine Runtimes path: $ROOT"
echo "Copying assets to runtimes..."
echo ""
echo "spine-libgdx"
rm "$ROOT/spine-libgdx/spine-libgdx-tests/assets/goblins/"*
cp -f ../goblins/export/*.json "$ROOT/spine-libgdx/spine-libgdx-tests/assets/goblins/"
cp -f ../goblins/export/*.skel "$ROOT/spine-libgdx/spine-libgdx-tests/assets/goblins/"
cp -f ../goblins/export/*-pma.* "$ROOT/spine-libgdx/spine-libgdx-tests/assets/goblins/"
rm "$ROOT/spine-libgdx/spine-libgdx-tests/assets/raptor/"*
cp -f ../raptor/export/*.json "$ROOT/spine-libgdx/spine-libgdx-tests/assets/raptor/"
cp -f ../raptor/export/*.skel "$ROOT/spine-libgdx/spine-libgdx-tests/assets/raptor/"
cp -f ../raptor/export/*-pma.* "$ROOT/spine-libgdx/spine-libgdx-tests/assets/raptor/"
rm "$ROOT/spine-libgdx/spine-libgdx-tests/assets/spineboy/"*
cp -f ../spineboy/export/*.json "$ROOT/spine-libgdx/spine-libgdx-tests/assets/spineboy/"
cp -r ../spineboy/export/*.skel "$ROOT/spine-libgdx/spine-libgdx-tests/assets/spineboy/"
cp -r ../spineboy/export/*-pma.* "$ROOT/spine-libgdx/spine-libgdx-tests/assets/spineboy/"
rm "$ROOT/spine-libgdx/spine-libgdx-tests/assets/coin/"*
cp -f ../coin/export/*.json "$ROOT/spine-libgdx/spine-libgdx-tests/assets/coin/"
cp -f ../coin/export/*.skel "$ROOT/spine-libgdx/spine-libgdx-tests/assets/coin/"
cp -f ../coin/export/*-pma.* "$ROOT/spine-libgdx/spine-libgdx-tests/assets/coin/"
rm -f "$ROOT/spine-libgdx/spine-libgdx-tests/assets/mix-and-match/"*
cp -f ../mix-and-match/export/*.json "$ROOT/spine-libgdx/spine-libgdx-tests/assets/mix-and-match/"
cp -f ../mix-and-match/export/*.skel "$ROOT/spine-libgdx/spine-libgdx-tests/assets/mix-and-match/"
cp -f ../mix-and-match/export/*-pma.* "$ROOT/spine-libgdx/spine-libgdx-tests/assets/mix-and-match/"
echo "spine-android"
rm "$ROOT/spine-android/app/src/main/assets/"*
cp -f ../celestial-circus/export/celestial-circus-pro.skel "$ROOT/spine-android/app/src/main/assets/"
cp -f ../celestial-circus/export/celestial-circus.atlas "$ROOT/spine-android/app/src/main/assets"
cp -f ../celestial-circus/export/celestial-circus.png "$ROOT/spine-android/app/src/main/assets"
cp -f ../dragon/export/dragon-ess.skel "$ROOT/spine-android/app/src/main/assets/"
cp -f ../dragon/export/dragon.atlas "$ROOT/spine-android/app/src/main/assets"
cp -f ../dragon/export/dragon.png "$ROOT/spine-android/app/src/main/assets"
cp -f ../dragon/export/dragon_2.png "$ROOT/spine-android/app/src/main/assets"
cp -f ../dragon/export/dragon_3.png "$ROOT/spine-android/app/src/main/assets"
cp -f ../dragon/export/dragon_4.png "$ROOT/spine-android/app/src/main/assets"
cp -f ../dragon/export/dragon_5.png "$ROOT/spine-android/app/src/main/assets"
cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-android/app/src/main/assets/"
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-android/app/src/main/assets/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-android/app/src/main/assets/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-android/app/src/main/assets/"
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-android/app/src/main/assets/"
cp -f ../spineboy/export/spineboy.atlas "$ROOT/spine-android/app/src/main/assets/"
cp -f ../spineboy/export/spineboy.png "$ROOT/spine-android/app/src/main/assets/"
rm -f "$ROOT/spine-libgdx/spine-libgdx-tests/assets/sack/"*
mkdir -p "$ROOT/spine-libgdx/spine-libgdx-tests/assets/sack/"
cp -f ../sack/export/sack-pro.json "$ROOT/spine-libgdx/spine-libgdx-tests/assets/sack/"
cp -f ../sack/export/sack-pro.skel "$ROOT/spine-libgdx/spine-libgdx-tests/assets/sack/"
cp -f ../sack/export/sack-pma.atlas "$ROOT/spine-libgdx/spine-libgdx-tests/assets/sack/"
cp -f ../sack/export/sack-pma.png "$ROOT/spine-libgdx/spine-libgdx-tests/assets/sack/"
rm -f "$ROOT/spine-libgdx/spine-libgdx-tests/assets/celestial-circus/"*
mkdir -p "$ROOT/spine-libgdx/spine-libgdx-tests/assets/celestial-circus/"
cp -f ../celestial-circus/export/* "$ROOT/spine-libgdx/spine-libgdx-tests/assets/celestial-circus/"
rm -f "$ROOT/spine-libgdx/spine-libgdx-tests/assets/snowglobe/"*
mkdir -p "$ROOT/spine-libgdx/spine-libgdx-tests/assets/snowglobe/"
cp -f ../snowglobe/export/* "$ROOT/spine-libgdx/spine-libgdx-tests/assets/snowglobe/"
rm -f "$ROOT/spine-libgdx/spine-libgdx-tests/assets/cloud-pot/"*
mkdir -p "$ROOT/spine-libgdx/spine-libgdx-tests/assets/cloud-pot/"
cp -f ../cloud-pot/export/* "$ROOT/spine-libgdx/spine-libgdx-tests/assets/cloud-pot/"
echo "spine-cocos2dx"
rm -rf "$ROOT/spine-cocos2dx/example/Resources/common/"*
cp -f ../dragon/export/dragon-ess.skel "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../dragon/export/dragon-pma.atlas "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../dragon/export/dragon-pma*.png "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../coin/export/coin-pro.skel "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../coin/export/coin.atlas "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../coin/export/coin.png "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../goblins/export/goblins-pro.json "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../goblins/export/goblins.atlas "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../goblins/export/goblins.png "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../raptor/export/raptor-pro.json "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../raptor/export/raptor.atlas "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../raptor/export/raptor.png "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../spineboy/export/spineboy.atlas "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../spineboy/export/spineboy.png "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../tank/export/tank-pro.skel "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../tank/export/tank.atlas "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../tank/export/tank.png "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../celestial-circus/export/celestial-circus-pro.skel "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../celestial-circus/export/celestial-circus.atlas "$ROOT/spine-cocos2dx/example/Resources/common/"
cp -f ../celestial-circus/export/celestial-circus.png "$ROOT/spine-cocos2dx/example/Resources/common/"
echo "spine-flutter"
rm -rf "$ROOT/spine-flutter/example/assets/"*
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-flutter/example/assets/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-flutter/example/assets/"
cp -f ../spineboy/export/spineboy.atlas "$ROOT/spine-flutter/example/assets/"
cp -f ../spineboy/export/spineboy.png "$ROOT/spine-flutter/example/assets/"
cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-flutter/example/assets/"
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-flutter/example/assets/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-flutter/example/assets/"
cp -f ../dragon/export/dragon-ess.skel "$ROOT/spine-flutter/example/assets/"
cp -f ../dragon/export/dragon.atlas "$ROOT/spine-flutter/example/assets/"
cp -f ../dragon/export/dragon.png "$ROOT/spine-flutter/example/assets/"
cp -f ../dragon/export/dragon_*.png "$ROOT/spine-flutter/example/assets/"
cp -f ../celestial-circus/export/celestial-circus-pro.skel "$ROOT/spine-flutter/example/assets/"
cp -f ../celestial-circus/export/celestial-circus.atlas "$ROOT/spine-flutter/example/assets/"
cp -f ../celestial-circus/export/celestial-circus.png "$ROOT/spine-flutter/example/assets/"
echo "spine-ios"
cp -f ../celestial-circus/export/celestial-circus-pro.skel "$ROOT/spine-ios/Example/Spine iOS Example/Assets/celestial/"
cp -f ../celestial-circus/export/celestial-circus-pma.atlas "$ROOT/spine-ios/Example/Spine iOS Example/Assets/celestial/"
cp -f ../celestial-circus/export/celestial-circus-pma.png "$ROOT/spine-ios/Example/Spine iOS Example/Assets/celestial/"
cp -f ../dragon/export/dragon-ess.skel "$ROOT/spine-ios/Example/Spine iOS Example/Assets/dragon/"
cp -f ../dragon/export/dragon.atlas "$ROOT/spine-ios/Example/Spine iOS Example/Assets/dragon/"
cp -f ../dragon/export/dragon.png "$ROOT/spine-ios/Example/Spine iOS Example/Assets/dragon/"
cp -f ../dragon/export/dragon_*.png "$ROOT/spine-ios/Example/Spine iOS Example/Assets/dragon/"
cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-ios/Example/Spine iOS Example/Assets/mixandmatch/"
cp -f ../mix-and-match/export/mix-and-match-pma.atlas "$ROOT/spine-ios/Example/Spine iOS Example/Assets/mixandmatch/"
cp -f ../mix-and-match/export/mix-and-match-pma.png "$ROOT/spine-ios/Example/Spine iOS Example/Assets/mixandmatch/"
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-ios/Example/Spine iOS Example/Assets/spineboy/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-ios/Example/Spine iOS Example/Assets/spineboy/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-ios/Example/Spine iOS Example/Assets/spineboy/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-ios/Example/Spine iOS Example/Assets/spineboy/"
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-ios/Example - Cocoapods/Spine iOS Example/spineboy/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-ios/Example - Cocoapods/Spine iOS Example/spineboy/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-ios/Example - Cocoapods/Spine iOS Example/spineboy/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-ios/Example - Cocoapods/Spine iOS Example/spineboy/"
echo "spine-godot"
rm -f "$ROOT"/spine-godot/example/assets/spineboy/*.atlas
rm -f "$ROOT"/spine-godot/example/assets/spineboy/*.png
rm -f "$ROOT"/spine-godot/example/assets/spineboy/*.spine-json
rm -f "$ROOT"/spine-godot/example/assets/spineboy/*.skel
rm -f "$ROOT"/spine-godot/example/assets/raptor/*.atlas
rm -f "$ROOT"/spine-godot/example/assets/raptor/*.png
rm -f "$ROOT"/spine-godot/example/assets/raptor/*.skel
rm -f "$ROOT"/spine-godot/example/assets/mix-and-match/*.atlas
rm -f "$ROOT"/spine-godot/example/assets/mix-and-match/*.png
rm -f "$ROOT"/spine-godot/example/assets/mix-and-match/*.spine-json
rm -f "$ROOT"/spine-godot/example/assets/mix-and-match/*.skel
rm -f "$ROOT"/spine-godot/example/assets/raggedyspineboy/*.atlas
rm -f "$ROOT"/spine-godot/example/assets/raggedyspineboy/*.png
rm -f "$ROOT"/spine-godot/example/assets/raggedyspineboy/*.spine-json
rm -f "$ROOT"/spine-godot/example/assets/celestial-circus/*.atlas
rm -f "$ROOT"/spine-godot/example/assets/celestial-circus/*.png
rm -f "$ROOT"/spine-godot/example/assets/celestial-circus/*.skel
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-godot/example/assets/spineboy/spineboy-pro.spine-json"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-godot/example/assets/spineboy/"
cp -f ../spineboy/export/spineboy.atlas "$ROOT/spine-godot/example/assets/spineboy/"
cp -f ../spineboy/export/spineboy.png "$ROOT/spine-godot/example/assets/spineboy/"
cp -f ../mix-and-match/export/mix-and-match-pro.json "$ROOT/spine-godot/example/assets/mix-and-match/mix-and-match-pro.spine-json"
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-godot/example/assets/mix-and-match/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-godot/example/assets/mix-and-match/"
cp -f ../raptor/export/raptor-pro.skel "$ROOT/spine-godot/example/assets/raptor/"
cp -f ../raptor/export/raptor.atlas "$ROOT/spine-godot/example/assets/raptor/"
cp -f ../raptor/export/raptor.png "$ROOT/spine-godot/example/assets/raptor/"
cp -f ../raptor/manual-maps/raptor-normals.png "$ROOT/spine-godot/example/assets/raptor/n_raptor.png"
cp -f ../raptor/manual-maps/light-sprite.png "$ROOT/spine-godot/example/assets/raptor/light-sprite.png"
cp -f ../celestial-circus/export/celestial-circus-pro.skel "$ROOT/spine-godot/example/assets/celestial-circus/celestial-circus.skel"
cp -f ../celestial-circus/export/celestial-circus.atlas "$ROOT/spine-godot/example/assets/celestial-circus/"
cp -f ../celestial-circus/export/celestial-circus.png "$ROOT/spine-godot/example/assets/celestial-circus/"
rm -f "$ROOT"/spine-godot/example-v4/assets/spineboy/*.atlas
rm -f "$ROOT"/spine-godot/example-v4/assets/spineboy/*.png
rm -f "$ROOT"/spine-godot/example-v4/assets/spineboy/*.spine-json
rm -f "$ROOT"/spine-godot/example-v4/assets/spineboy/*.skel
rm -f "$ROOT"/spine-godot/example-v4/assets/raptor/*.atlas
rm -f "$ROOT"/spine-godot/example-v4/assets/raptor/*.png
rm -f "$ROOT"/spine-godot/example-v4/assets/raptor/*.skel
rm -f "$ROOT"/spine-godot/example-v4/assets/mix-and-match/*.atlas
rm -f "$ROOT"/spine-godot/example-v4/assets/mix-and-match/*.png
rm -f "$ROOT"/spine-godot/example-v4/assets/mix-and-match/*.spine-json
rm -f "$ROOT"/spine-godot/example-v4/assets/mix-and-match/*.skel
rm -f "$ROOT"/spine-godot/example-v4/assets/raggedyspineboy/*.atlas
rm -f "$ROOT"/spine-godot/example-v4/assets/raggedyspineboy/*.png
rm -f "$ROOT"/spine-godot/example-v4/assets/raggedyspineboy/*.spine-json
rm -f "$ROOT"/spine-godot/example-v4/assets/celestial-circus/*.atlas
rm -f "$ROOT"/spine-godot/example-v4/assets/celestial-circus/*.png
rm -f "$ROOT"/spine-godot/example-v4/assets/celestial-circus/*.skel
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-godot/example-v4/assets/spineboy/spineboy-pro.spine-json"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-godot/example-v4/assets/spineboy/"
cp -f ../spineboy/export/spineboy.atlas "$ROOT/spine-godot/example-v4/assets/spineboy/"
cp -f ../spineboy/export/spineboy.png "$ROOT/spine-godot/example-v4/assets/spineboy/"
cp -f ../mix-and-match/export/mix-and-match-pro.json "$ROOT/spine-godot/example-v4/assets/mix-and-match/mix-and-match-pro.spine-json"
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-godot/example-v4/assets/mix-and-match/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-godot/example-v4/assets/mix-and-match/"
cp -f ../raptor/export/raptor-pro.skel "$ROOT/spine-godot/example-v4/assets/raptor/"
cp -f ../raptor/export/raptor.atlas "$ROOT/spine-godot/example-v4/assets/raptor/"
cp -f ../raptor/export/raptor.png "$ROOT/spine-godot/example-v4/assets/raptor/"
cp -f ../raptor/manual-maps/raptor-normals.png "$ROOT/spine-godot/example-v4/assets/raptor/n_raptor.png"
cp -f ../raptor/manual-maps/light-sprite.png "$ROOT/spine-godot/example-v4/assets/raptor/light-sprite.png"
cp -f ../celestial-circus/export/celestial-circus-pro.skel "$ROOT/spine-godot/example-v4/assets/celestial-circus/celestial-circus.skel"
cp -f ../celestial-circus/export/celestial-circus.atlas "$ROOT/spine-godot/example-v4/assets/celestial-circus/"
cp -f ../celestial-circus/export/celestial-circus.png "$ROOT/spine-godot/example-v4/assets/celestial-circus/"
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/spineboy/*.atlas
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/spineboy/*.png
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/spineboy/*.spine-json
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/spineboy/*.skel
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/raptor/*.atlas
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/raptor/*.png
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/raptor/*.skel
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/mix-and-match/*.atlas
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/mix-and-match/*.png
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/mix-and-match/*.spine-json
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/mix-and-match/*.skel
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/raggedyspineboy/*.atlas
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/raggedyspineboy/*.png
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/raggedyspineboy/*.spine-json
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/celestial-circus/*.atlas
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/celestial-circus/*.png
rm -f "$ROOT"/spine-godot/example-v4-csharp/assets/celestial-circus/*.skel
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-godot/example-v4-csharp/assets/spineboy/spineboy-pro.spine-json"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-godot/example-v4-csharp/assets/spineboy/"
cp -f ../spineboy/export/spineboy.atlas "$ROOT/spine-godot/example-v4-csharp/assets/spineboy/"
cp -f ../spineboy/export/spineboy.png "$ROOT/spine-godot/example-v4-csharp/assets/spineboy/"
cp -f ../mix-and-match/export/mix-and-match-pro.json "$ROOT/spine-godot/example-v4-csharp/assets/mix-and-match/mix-and-match-pro.spine-json"
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-godot/example-v4-csharp/assets/mix-and-match/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-godot/example-v4-csharp/assets/mix-and-match/"
cp -f ../raptor/export/raptor-pro.skel "$ROOT/spine-godot/example-v4-csharp/assets/raptor/"
cp -f ../raptor/export/raptor.atlas "$ROOT/spine-godot/example-v4-csharp/assets/raptor/"
cp -f ../raptor/export/raptor.png "$ROOT/spine-godot/example-v4-csharp/assets/raptor/"
cp -f ../raptor/manual-maps/raptor-normals.png "$ROOT/spine-godot/example-v4-csharp/assets/raptor/n_raptor.png"
cp -f ../raptor/manual-maps/light-sprite.png "$ROOT/spine-godot/example-v4-csharp/assets/raptor/light-sprite.png"
cp -f ../celestial-circus/export/celestial-circus-pro.skel "$ROOT/spine-godot/example-v4-csharp/assets/celestial-circus/celestial-circus.skel"
cp -f ../celestial-circus/export/celestial-circus.atlas "$ROOT/spine-godot/example-v4-csharp/assets/celestial-circus/"
cp -f ../celestial-circus/export/celestial-circus.png "$ROOT/spine-godot/example-v4-csharp/assets/celestial-circus/"
echo "spine-sdl"
rm -f "$ROOT/spine-sdl/data/"*
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-sdl/data/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-sdl/data/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-sdl/data/"
echo "spine-glfw"
rm -f "$ROOT/spine-glfw/data/"*
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-glfw/data/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-glfw/data/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-glfw/data/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-glfw/data/"
echo "spine-sfml-c"
rm "$ROOT/spine-sfml/c/data/"*
cp -f ../coin/export/coin-pro.json "$ROOT/spine-sfml/c/data/"
cp -f ../coin/export/coin-pro.skel "$ROOT/spine-sfml/c/data/"
cp -f ../coin/export/coin-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../coin/export/coin-pma.png "$ROOT/spine-sfml/c/data/"
cp -f ../dragon/export/dragon-ess.json "$ROOT/spine-sfml/c/data/"
cp -f ../dragon/export/dragon-ess.skel "$ROOT/spine-sfml/c/data/"
cp -f ../dragon/export/dragon-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../dragon/export/dragon-pma*.png "$ROOT/spine-sfml/c/data/"
cp -f ../goblins/export/goblins-pro.json "$ROOT/spine-sfml/c/data/"
cp -f ../goblins/export/goblins-pro.skel "$ROOT/spine-sfml/c/data/"
cp -f ../goblins/export/goblins-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../goblins/export/goblins-pma.png "$ROOT/spine-sfml/c/data/"
cp -f ../raptor/export/raptor-pro.json "$ROOT/spine-sfml/c/data/"
cp -f ../raptor/export/raptor-pro.skel "$ROOT/spine-sfml/c/data/"
cp -f ../raptor/export/raptor-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../raptor/export/raptor-pma.png "$ROOT/spine-sfml/c/data/"
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-sfml/c/data/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-sfml/c/data/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-sfml/c/data/"
cp -f ../tank/export/tank-pro.json "$ROOT/spine-sfml/c/data/"
cp -f ../tank/export/tank-pro.skel "$ROOT/spine-sfml/c/data/"
cp -f ../tank/export/tank-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../tank/export/tank-pma.png "$ROOT/spine-sfml/c/data/"
cp -f ../vine/export/vine-pro.json "$ROOT/spine-sfml/c/data/"
cp -f ../vine/export/vine-pro.skel "$ROOT/spine-sfml/c/data/"
cp -f ../vine/export/vine-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../vine/export/vine-pma.png "$ROOT/spine-sfml/c/data/"
cp -f ../stretchyman/export/stretchyman-pro.json "$ROOT/spine-sfml/c/data/"
cp -f ../stretchyman/export/stretchyman-pro.skel "$ROOT/spine-sfml/c/data/"
cp -f ../stretchyman/export/stretchyman-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../stretchyman/export/stretchyman-pma.png "$ROOT/spine-sfml/c/data/"
cp -f ../owl/export/owl-pro.json "$ROOT/spine-sfml/c/data/"
cp -f ../owl/export/owl-pro.skel "$ROOT/spine-sfml/c/data/"
cp -f ../owl/export/owl-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../owl/export/owl-pma.png "$ROOT/spine-sfml/c/data/"
cp -f ../mix-and-match/export/mix-and-match-pro.json "$ROOT/spine-sfml/c/data/"
cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-sfml/c/data/"
cp -f ../mix-and-match/export/mix-and-match-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../mix-and-match/export/mix-and-match-pma.png "$ROOT/spine-sfml/c/data/"
cp -f ../sack/export/sack-pro.json "$ROOT/spine-sfml/c/data/"
cp -f ../sack/export/sack-pro.skel "$ROOT/spine-sfml/c/data/"
cp -f ../sack/export/sack-pma.atlas "$ROOT/spine-sfml/c/data/"
cp -f ../sack/export/sack-pma.png "$ROOT/spine-sfml/c/data/"
cp -f ../celestial-circus/export/* "$ROOT/spine-sfml/c/data/"
cp -f ../snowglobe/export/* "$ROOT/spine-sfml/c/data/"
cp -f ../cloud-pot/export/* "$ROOT/spine-sfml/c/data/"
echo "spine-sfml-cpp"
rm "$ROOT/spine-sfml/cpp/data/"*
cp -f ../coin/export/coin-pro.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../coin/export/coin-pro.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../coin/export/coin-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../coin/export/coin-pma.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../dragon/export/dragon-ess.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../dragon/export/dragon-ess.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../dragon/export/dragon-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../dragon/export/dragon-pma*.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../goblins/export/goblins-pro.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../goblins/export/goblins-pro.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../goblins/export/goblins-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../goblins/export/goblins-pma.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../raptor/export/raptor-pro.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../raptor/export/raptor-pro.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../raptor/export/raptor-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../raptor/export/raptor-pma.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../tank/export/tank-pro.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../tank/export/tank-pro.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../tank/export/tank-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../tank/export/tank-pma.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../vine/export/vine-pro.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../vine/export/vine-pro.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../vine/export/vine-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../vine/export/vine-pma.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../stretchyman/export/stretchyman-pro.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../stretchyman/export/stretchyman-pro.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../stretchyman/export/stretchyman-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../stretchyman/export/stretchyman-pma.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../owl/export/owl-pro.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../owl/export/owl-pro.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../owl/export/owl-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../owl/export/owl-pma.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../mix-and-match/export/mix-and-match-pro.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../mix-and-match/export/mix-and-match-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../mix-and-match/export/mix-and-match-pma.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../sack/export/sack-pro.json "$ROOT/spine-sfml/cpp/data/"
cp -f ../sack/export/sack-pro.skel "$ROOT/spine-sfml/cpp/data/"
cp -f ../sack/export/sack-pma.atlas "$ROOT/spine-sfml/cpp/data/"
cp -f ../sack/export/sack-pma.png "$ROOT/spine-sfml/cpp/data/"
cp -f ../celestial-circus/export/* "$ROOT/spine-sfml/cpp/data/"
cp -f ../snowglobe/export/* "$ROOT/spine-sfml/cpp/data/"
cp -f ../cloud-pot/export/* "$ROOT/spine-sfml/cpp/data/"
echo "spine-ts"
rm "$ROOT/spine-ts/assets/"*
cp -f ../celestial-circus/export/celestial-circus-pro.json "$ROOT/spine-ts/assets/"
cp -f ../celestial-circus/export/celestial-circus-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../celestial-circus/export/celestial-circus-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../celestial-circus/export/celestial-circus-pma.png "$ROOT/spine-ts/assets/"
cp -f ../celestial-circus/export/celestial-circus.atlas "$ROOT/spine-ts/assets/"
cp -f ../celestial-circus/export/celestial-circus.png "$ROOT/spine-ts/assets/"
cp -f ../chibi-stickers/export/chibi-stickers.json "$ROOT/spine-ts/assets/"
cp -f ../chibi-stickers/export/chibi-stickers.skel "$ROOT/spine-ts/assets/"
cp -f ../chibi-stickers/export/chibi-stickers.atlas "$ROOT/spine-ts/assets/"
cp -f ../chibi-stickers/export/chibi-stickers-pma* "$ROOT/spine-ts/assets/"
cp -f ../cloud-pot/export/cloud-pot.skel "$ROOT/spine-ts/assets/"
cp -f ../cloud-pot/export/cloud-pot-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../cloud-pot/export/cloud-pot-pma.png "$ROOT/spine-ts/assets/"
cp -f ../cloud-pot/export/cloud-pot.atlas "$ROOT/spine-ts/assets/"
cp -f ../cloud-pot/export/cloud-pot.png "$ROOT/spine-ts/assets/"
cp -f ../coin/export/coin-pro.json "$ROOT/spine-ts/assets/"
cp -f ../coin/export/coin-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../coin/export/coin-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../coin/export/coin-pma.png "$ROOT/spine-ts/assets/"
cp -f ../dragon/export/dragon-ess.skel "$ROOT/spine-ts/assets/"
cp -f ../dragon/export/dragon-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../dragon/export/dragon-pma*.png "$ROOT/spine-ts/assets/"
cp -f ../goblins/export/goblins-pro.json "$ROOT/spine-ts/assets/"
cp -f ../goblins/export/goblins-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../goblins/export/goblins-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../goblins/export/goblins-pma.png "$ROOT/spine-ts/assets/"
cp -f ../mix-and-match/export/mix-and-match-pro.json "$ROOT/spine-ts/assets/"
cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../mix-and-match/export/mix-and-match-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../mix-and-match/export/mix-and-match-pma.png "$ROOT/spine-ts/assets/"
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-ts/assets/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-ts/assets/"
cp -f ../owl/export/owl-pro.json "$ROOT/spine-ts/assets/"
cp -f ../owl/export/owl-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../owl/export/owl-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../owl/export/owl-pma.png "$ROOT/spine-ts/assets/"
cp -f ../raptor/export/raptor-pro.json "$ROOT/spine-ts/assets/"
cp -f ../raptor/export/raptor-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../raptor/export/raptor-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../raptor/export/raptor-pma.png "$ROOT/spine-ts/assets/"
cp -f ../raptor/export/raptor.atlas "$ROOT/spine-ts/assets/"
cp -f ../raptor/export/raptor.png "$ROOT/spine-ts/assets/"
cp -f ../raptor/images/raptor-jaw-tooth.png "$ROOT/spine-ts/assets/"
cp -f ../sack/export/sack-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../sack/export/sack-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../sack/export/sack-pma.png "$ROOT/spine-ts/assets/"
cp -f ../sack/export/sack.atlas "$ROOT/spine-ts/assets/"
cp -f ../sack/export/sack.png "$ROOT/spine-ts/assets/"
cp -f ../snowglobe/export/snowglobe-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../snowglobe/export/snowglobe-pma* "$ROOT/spine-ts/assets/"
cp -f ../snowglobe/export/snowglobe* "$ROOT/spine-ts/assets/"
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-ts/assets/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../spineboy/export/spineboy-ess.json "$ROOT/spine-ts/assets/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-ts/assets/"
cp -f ../spineboy/export/spineboy.atlas "$ROOT/spine-ts/assets/"
cp -f ../spineboy/export/spineboy.png "$ROOT/spine-ts/assets/"
cp -f ../stretchyman/export/stretchyman-pro.json "$ROOT/spine-ts/assets/"
cp -f ../stretchyman/export/stretchyman-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../stretchyman/export/stretchyman-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../stretchyman/export/stretchyman-pma.png "$ROOT/spine-ts/assets/"
cp -f ../tank/export/tank-pro.json "$ROOT/spine-ts/assets/"
cp -f ../tank/export/tank-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../tank/export/tank-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../tank/export/tank-pma.png "$ROOT/spine-ts/assets/"
cp -f ../vine/export/vine-pro.json "$ROOT/spine-ts/assets/"
cp -f ../vine/export/vine-pro.skel "$ROOT/spine-ts/assets/"
cp -f ../vine/export/vine-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../vine/export/vine-pma.png "$ROOT/spine-ts/assets/"
cp -f ../windmill/export/windmill-ess.json "$ROOT/spine-ts/assets/"
cp -f ../windmill/export/windmill-pma.atlas "$ROOT/spine-ts/assets/"
cp -f ../windmill/export/windmill-pma.png "$ROOT/spine-ts/assets/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-ts/spine-phaser-v3/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-ts/spine-phaser-v3/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-ts/spine-phaser-v3/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-ts/spine-phaser-v4/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-ts/spine-phaser-v4/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-ts/spine-phaser-v4/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-ts/spine-pixi-v7/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-ts/spine-pixi-v7/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-ts/spine-pixi-v7/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-ts/spine-pixi-v8/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pma.atlas "$ROOT/spine-ts/spine-pixi-v8/example/typescript/assets/"
cp -f ../spineboy/export/spineboy-pma.png "$ROOT/spine-ts/spine-pixi-v8/example/typescript/assets/"
echo "spine-monogame"
rm "$ROOT/spine-monogame/spine-monogame-example/data/"*
cp -f ../coin/export/coin-pro.json "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../coin/export/coin-pro.skel "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../coin/export/coin.atlas "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../coin/export/coin.png "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../raptor/export/raptor-pro.json "$ROOT/spine-monogame/spine-monogame-example/data/"
# Note: normalmap need to be created manually. Thus we use a separately prepared atlas and
# diffuse map so that the maps always match. These atlas textures are copied to the target dir.
cp -f ../raptor/manual-maps/raptor.atlas "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../raptor/manual-maps/raptor.png "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../raptor/manual-maps/raptor-normals.png "$ROOT/spine-monogame/spine-monogame-example/data/raptor_normals.png"
cp -f ../spineboy/export/spineboy-pro.skel "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../spineboy/export/spineboy.atlas "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../spineboy/export/spineboy.png "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../tank/export/tank-pro.json "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../tank/export/tank.atlas "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../tank/export/tank.png "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../mix-and-match/export/mix-and-match-pro.json "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../celestial-circus/export/celestial-circus-pro.json "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../celestial-circus/export/celestial-circus.atlas "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../celestial-circus/export/celestial-circus.png "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../snowglobe/export/snowglobe-pro.skel "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../snowglobe/export/snowglobe.atlas "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../snowglobe/export/snowglobe.png "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../snowglobe/export/snowglobe_*.png "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../cloud-pot/export/cloud-pot.skel "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../cloud-pot/export/cloud-pot.atlas "$ROOT/spine-monogame/spine-monogame-example/data/"
cp -f ../cloud-pot/export/cloud-pot.png "$ROOT/spine-monogame/spine-monogame-example/data/"
echo "spine-haxe"
rm "$ROOT/spine-haxe/example/assets/"*
cp -f ../coin/export/coin-pro.json "$ROOT/spine-haxe/example/assets/"
@ -622,208 +78,6 @@ cp -f ../snowglobe/export/snowglobe-pro.json "$ROOT/spine-haxe/example/assets/"
cp -f ../snowglobe/export/snowglobe-pro.skel "$ROOT/spine-haxe/example/assets/"
cp -f ../snowglobe/export/snowglobe* "$ROOT/spine-haxe/example/assets/"
echo "spine-ue"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/Raptor/raptor.json"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/Raptor/raptor-pro.json"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/Raptor/raptor.atlas"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/Raptor/raptor.png"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/Spineboy/spineboy.json"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/Spineboy/spineboy-pro.json"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/Spineboy/spineboy.atlas"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/Spineboy/spineboy.png"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/mix-and-match/mix-and-match-pro.skel"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/mix-and-match/mix-and-match-pro-skeleton.skel"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/mix-and-match/mix-and-match-pro.atlas"
rm -f "$ROOT/spine-ue/Content/GettingStarted/Assets/mix-and-match/mix-and-match-pro.png"
cp -f ../raptor/export/raptor-pro.json "$ROOT/spine-ue/Content/GettingStarted/Assets/Raptor/raptor-pro.json"
cp -f ../raptor/export/raptor.atlas "$ROOT/spine-ue/Content/GettingStarted/Assets/Raptor/"
cp -f ../raptor/export/raptor.png "$ROOT/spine-ue/Content/GettingStarted/Assets/Raptor/"
cp -f ../spineboy/export/spineboy-pro.json "$ROOT/spine-ue/Content/GettingStarted/Assets/Spineboy/spineboy-pro.json"
cp -f ../spineboy/export/spineboy.atlas "$ROOT/spine-ue/Content/GettingStarted/Assets/Spineboy/"
cp -f ../spineboy/export/spineboy.png "$ROOT/spine-ue/Content/GettingStarted/Assets/Spineboy/"
cp -f ../mix-and-match/export/mix-and-match.png "$ROOT/spine-ue/Content/GettingStarted/Assets/mix-and-match/mix-and-match.png"
cp -f ../mix-and-match/export/mix-and-match.atlas "$ROOT/spine-ue/Content/GettingStarted/Assets/mix-and-match/mix-and-match.atlas"
cp -f ../mix-and-match/export/mix-and-match-pro.skel "$ROOT/spine-ue/Content/GettingStarted/Assets/mix-and-match/mix-and-match-pro.skel"
echo "spine-unity"
# Section of assets specific for the spine-unity runtime.
UNITY_SOURCE_DIR=../spine-unity
# On macOS, we need gsed for the -i switch to work. Check it's available
# and error out otherwise.
sed="sed"
if [[ $OSTYPE == 'darwin'* ]]; then
if [ ! -f "/opt/homebrew/bin/gsed" ]; then
echo "macOS sed detected. Please install GNU sed via brew install gnu-sed"
exit -1
fi
sed="/opt/homebrew/bin/gsed"
fi
# Do not delete everything in unity dirs, especially not .meta files.
# Note: We copy the files following the existing naming scheme (e.g. goblins.json instead of goblins-pro.json)
# to the unity assets directories. This requires to change the png file reference line in the atlas file.
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/Dragon"
cp -f ../dragon/export/dragon-ess.json "$UNITY_TARGET_DIR/dragon.json"
cp -f ../dragon/export/dragon-pma.atlas "$UNITY_TARGET_DIR/dragon.atlas.txt"
$sed -i "s/dragon-pma.png/dragon.png/g" "$UNITY_TARGET_DIR/dragon.atlas.txt"
$sed -i "s/dragon-pma_2.png/dragon2.png/g" "$UNITY_TARGET_DIR/dragon.atlas.txt"
$sed -i "s/dragon-pma_3.png/dragon3.png/g" "$UNITY_TARGET_DIR/dragon.atlas.txt"
$sed -i "s/dragon-pma_4.png/dragon4.png/g" "$UNITY_TARGET_DIR/dragon.atlas.txt"
$sed -i "s/dragon-pma_5.png/dragon5.png/g" "$UNITY_TARGET_DIR/dragon.atlas.txt"
cp -f ../dragon/export/dragon-pma.png "$UNITY_TARGET_DIR/dragon.png"
cp -f ../dragon/export/dragon-pma_2.png "$UNITY_TARGET_DIR/dragon2.png"
cp -f ../dragon/export/dragon-pma_3.png "$UNITY_TARGET_DIR/dragon3.png"
cp -f ../dragon/export/dragon-pma_4.png "$UNITY_TARGET_DIR/dragon4.png"
cp -f ../dragon/export/dragon-pma_5.png "$UNITY_TARGET_DIR/dragon5.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/Goblins"
cp -f ../goblins/export/goblins-pro.json "$UNITY_TARGET_DIR/goblins.json"
cp -f ../goblins/export/goblins-pma.atlas "$UNITY_TARGET_DIR/goblins.atlas.txt"
$sed -i 's/goblins-pma.png/goblins.png/g' "$UNITY_TARGET_DIR/goblins.atlas.txt"
cp -f ../goblins/export/goblins-pma.png "$UNITY_TARGET_DIR/goblins.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/Hero"
cp -f ../hero/export/hero-pro.json "$UNITY_TARGET_DIR/"
cp -f ../hero/export/hero-pma.atlas "$UNITY_TARGET_DIR/hero-pro.atlas.txt"
$sed -i 's/hero-pma.png/hero-pro.png/g' "$UNITY_TARGET_DIR/hero-pro.atlas.txt"
cp -f ../hero/export/hero-pma.png "$UNITY_TARGET_DIR/hero-pro.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/raptor-pro-and-mask"
cp -f ../raptor/export/raptor-pro.json "$UNITY_TARGET_DIR/raptor-pro.json"
cp -f ../raptor/export/raptor-pma.atlas "$UNITY_TARGET_DIR/raptor-pma.atlas.txt"
cp -f ../raptor/export/raptor-pma.png "$UNITY_TARGET_DIR/raptor-pma.png"
# URP packages
UNITY_TARGET_DIR="$ROOT/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Samples~/Examples/2D/Spine Skeletons/RaptorURP"
cp -f ../raptor/export/raptor-pro.json "$UNITY_TARGET_DIR/"
cp -f ../raptor/manual-maps/raptor.atlas "$UNITY_TARGET_DIR/raptor.atlas.txt"
cp -f ../raptor/manual-maps/raptor.png "$UNITY_TARGET_DIR/"
cp -f ../raptor/manual-maps/raptor-rim-mask.png "$UNITY_TARGET_DIR/"
UNITY_TARGET_DIR="$ROOT/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Samples~/Examples/3D/Spine Skeletons/RaptorURP"
cp -f ../raptor/export/raptor-pro.json "$UNITY_TARGET_DIR/"
cp -f ../raptor/export/raptor.atlas "$UNITY_TARGET_DIR/raptor.atlas.txt"
cp -f ../raptor/export/raptor.png "$UNITY_TARGET_DIR/"
UNITY_TARGET_DIR="$ROOT/spine-unity/Modules/com.esotericsoftware.spine.ui-toolkit/Samples~/Examples/Spine Skeletons/Raptor"
cp -f ../raptor/export/raptor-pro.json "$UNITY_TARGET_DIR/"
cp -f ../raptor/export/raptor.atlas "$UNITY_TARGET_DIR/raptor.atlas.txt"
cp -f ../raptor/export/raptor.png "$UNITY_TARGET_DIR/"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/spineboy-pro"
cp -f ../spineboy/export/spineboy-pro.json "$UNITY_TARGET_DIR/spineboy-pro.json"
cp -f ../spineboy/export/spineboy-pma.atlas "$UNITY_TARGET_DIR/spineboy-pro.atlas.txt"
$sed -i 's/spineboy-pma.png/spineboy-pro.png/g' "$UNITY_TARGET_DIR/spineboy-pro.atlas.txt"
cp -f ../spineboy/export/spineboy-pma.png "$UNITY_TARGET_DIR/spineboy-pro.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/mix-and-match"
cp -f ../mix-and-match/export/mix-and-match-pro.json "$UNITY_TARGET_DIR/"
cp -f ../mix-and-match/export/mix-and-match-pma.atlas "$UNITY_TARGET_DIR/mix-and-match-pma.atlas.txt"
cp -f ../mix-and-match/export/mix-and-match-pma.png "$UNITY_TARGET_DIR/"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/Stretchyman"
cp -f ../stretchyman/export/stretchyman-pro.json "$UNITY_TARGET_DIR/stretchyman.json"
# Note: normalmap and emissionmap need to be created manually. Thus we use a separately prepared
# atlas and diffuse map here so that the maps always match. These atlas textures are copied to the target dir.
cp -f ../stretchyman/manual-maps/stretchyman-pma.atlas "$UNITY_TARGET_DIR/stretchyman-diffuse-pma.atlas.txt"
$sed -i 's/stretchyman-pma.png/stretchyman-diffuse-pma.png/g' "$UNITY_TARGET_DIR/stretchyman-diffuse-pma.atlas.txt"
cp -f ../stretchyman/manual-maps/stretchyman-pma.png "$UNITY_TARGET_DIR/stretchyman-diffuse-pma.png"
cp -f ../stretchyman/manual-maps/stretchyman-normals.png "$UNITY_TARGET_DIR/"
cp -f ../stretchyman/manual-maps/stretchyman-emission.png "$UNITY_TARGET_DIR/"
# URP packages
UNITY_TARGET_DIR="$ROOT/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Samples~/Examples/2D/Spine Skeletons/StretchymanURP"
cp -f ../stretchyman/export/stretchyman-pro.json "$UNITY_TARGET_DIR/stretchyman.json"
cp -f ../stretchyman/manual-maps/stretchyman.atlas "$UNITY_TARGET_DIR/stretchyman.atlas.txt"
cp -f ../stretchyman/manual-maps/stretchyman.png "$UNITY_TARGET_DIR/"
cp -f ../stretchyman/manual-maps/stretchyman-normals.png "$UNITY_TARGET_DIR/"
cp -f ../stretchyman/manual-maps/stretchyman-emission.png "$UNITY_TARGET_DIR/"
cp -f ../stretchyman/manual-maps/stretchyman-rim-mask.png "$UNITY_TARGET_DIR/"
UNITY_TARGET_DIR="$ROOT/spine-unity/Modules/com.esotericsoftware.spine.urp-shaders/Samples~/Examples/3D/Spine Skeletons/StretchymanURP"
cp -f ../stretchyman/export/stretchyman-pro.json "$UNITY_TARGET_DIR/stretchyman.json"
cp -f ../stretchyman/manual-maps/stretchyman.atlas "$UNITY_TARGET_DIR/stretchyman.atlas.txt"
cp -f ../stretchyman/manual-maps/stretchyman.png "$UNITY_TARGET_DIR/"
cp -f ../stretchyman/manual-maps/stretchyman-normals.png "$UNITY_TARGET_DIR/"
cp -f ../stretchyman/manual-maps/stretchyman-emission.png "$UNITY_TARGET_DIR/"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/Eyes"
cp -f $UNITY_SOURCE_DIR/eyes/export/eyes.json "$UNITY_TARGET_DIR/eyes.json"
cp -f $UNITY_SOURCE_DIR/eyes/export/eyes-pma.atlas "$UNITY_TARGET_DIR/eyes.atlas.txt"
$sed -i 's/eyes-pma.png/eyes.png/g' "$UNITY_TARGET_DIR/eyes.atlas.txt"
cp -f $UNITY_SOURCE_DIR/eyes/export/eyes-pma.png "$UNITY_TARGET_DIR/eyes.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/FootSoldier"
cp -f $UNITY_SOURCE_DIR/footsoldier/export/footsoldier.json "$UNITY_TARGET_DIR/FootSoldier.json"
cp -f $UNITY_SOURCE_DIR/footsoldier/export/footsoldier-pma.atlas "$UNITY_TARGET_DIR/FS_White.atlas.txt"
$sed -i 's/footsoldier-pma.png/FS_White.png/g' "$UNITY_TARGET_DIR/FS_White.atlas.txt"
cp -f $UNITY_SOURCE_DIR/footsoldier/export/footsoldier-pma.png "$UNITY_TARGET_DIR/FS_White.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/Gauge"
cp -f $UNITY_SOURCE_DIR/gauge/export/gauge.json "$UNITY_TARGET_DIR/Gauge.json"
cp -f $UNITY_SOURCE_DIR/gauge/export/gauge-pma.atlas "$UNITY_TARGET_DIR/Gauge.atlas.txt"
$sed -i 's/gauge-pma.png/Gauge.png/g' "$UNITY_TARGET_DIR/Gauge.atlas.txt"
cp -f $UNITY_SOURCE_DIR/gauge/export/gauge-pma.png "$UNITY_TARGET_DIR/Gauge.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/Raptor"
cp -f $UNITY_SOURCE_DIR/raptor/export/raptor.json "$UNITY_TARGET_DIR/raptor.json"
cp -f $UNITY_SOURCE_DIR/raptor/export/raptor-pma.atlas "$UNITY_TARGET_DIR/raptor.atlas.txt"
$sed -i 's/raptor-pma.png/raptor.png/g' "$UNITY_TARGET_DIR/raptor.atlas.txt"
cp -f $UNITY_SOURCE_DIR/raptor/export/raptor-pma.png "$UNITY_TARGET_DIR/raptor.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/Raggedy Spineboy"
cp -f $UNITY_SOURCE_DIR/raggedyspineboy/export/raggedyspineboy.json "$UNITY_TARGET_DIR/raggedy spineboy.json"
cp -f $UNITY_SOURCE_DIR/raggedyspineboy/export/raggedyspineboy-pma.atlas "$UNITY_TARGET_DIR/Raggedy Spineboy.atlas.txt"
$sed -i 's/raggedyspineboy-pma.png/Raggedy Spineboy.png/g' "$UNITY_TARGET_DIR/Raggedy Spineboy.atlas.txt"
cp -f $UNITY_SOURCE_DIR/raggedyspineboy/export/raggedyspineboy-pma.png "$UNITY_TARGET_DIR/Raggedy Spineboy.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/spineboy-pro"
cp -f $UNITY_SOURCE_DIR/spineboy-pro/export/spineboy-pro.json "$UNITY_TARGET_DIR/spineboy-pro.json"
cp -f $UNITY_SOURCE_DIR/spineboy-pro/export/spineboy-pma.atlas "$UNITY_TARGET_DIR/spineboy-pro.atlas.txt"
$sed -i 's/spineboy-pma.png/spineboy-pro.png/g' "$UNITY_TARGET_DIR/spineboy-pro.atlas.txt"
cp -f $UNITY_SOURCE_DIR/spineboy-pro/export/spineboy-pma.png "$UNITY_TARGET_DIR/spineboy-pro.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/spineboy-unity"
cp -f $UNITY_SOURCE_DIR/spineboy-unity/export/spineboy-unity.json "$UNITY_TARGET_DIR/spineboy-unity.json"
cp -f $UNITY_SOURCE_DIR/spineboy-unity/export/spineboy-pma.atlas "$UNITY_TARGET_DIR/spineboy.atlas.txt"
$sed -i 's/spineboy-pma.png/spineboy.png/g' "$UNITY_TARGET_DIR/spineboy.atlas.txt"
cp -f $UNITY_SOURCE_DIR/spineboy-unity/export/spineboy-pma.png "$UNITY_TARGET_DIR/spineboy.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/Spineunitygirl"
cp -f $UNITY_SOURCE_DIR/spineunitygirl/export/doi.json "$UNITY_TARGET_DIR/Doi.json"
cp -f $UNITY_SOURCE_DIR/spineunitygirl/export/doi-pma.atlas "$UNITY_TARGET_DIR/Doi.atlas.txt"
$sed -i 's/doi-pma.png/Doi.png/g' "$UNITY_TARGET_DIR/Doi.atlas.txt"
cp -f $UNITY_SOURCE_DIR/spineunitygirl/export/doi-pma.png "$UNITY_TARGET_DIR/Doi.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/Whirlyblendmodes"
cp -f $UNITY_SOURCE_DIR/whirlyblendmodes/export/whirlyblendmodes.json "$UNITY_TARGET_DIR/whirlyblendmodes.json"
cp -f $UNITY_SOURCE_DIR/whirlyblendmodes/export/whirlyblendmodes-pma.atlas "$UNITY_TARGET_DIR/whirlyblendmodes.atlas.txt"
$sed -i 's/whirlyblendmodes-pma.png/whirlyblendmodes.png/g' "$UNITY_TARGET_DIR/whirlyblendmodes.atlas.txt"
cp -f $UNITY_SOURCE_DIR/whirlyblendmodes/export/whirlyblendmodes-pma.png "$UNITY_TARGET_DIR/whirlyblendmodes.png"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/celestial-circus"
cp -f ../celestial-circus/export/celestial-circus-pro.json "$UNITY_TARGET_DIR/"
cp -f ../celestial-circus/export/celestial-circus-pma.atlas "$UNITY_TARGET_DIR/celestial-circus-pma.atlas.txt"
cp -f ../celestial-circus/export/celestial-circus-pma*.png "$UNITY_TARGET_DIR/"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/snowglobe"
cp -f ../snowglobe/export/snowglobe-pro.skel "$UNITY_TARGET_DIR/snowglobe-pro.skel.bytes"
cp -f ../snowglobe/export/snowglobe-pma.atlas "$UNITY_TARGET_DIR/snowglobe-pma.atlas.txt"
cp -f ../snowglobe/export/snowglobe-pma*.png "$UNITY_TARGET_DIR/"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/cloud-pot"
cp -f ../cloud-pot/export/cloud-pot.skel "$UNITY_TARGET_DIR/cloud-pot.skel.bytes"
cp -f ../cloud-pot/export/cloud-pot-pma.atlas "$UNITY_TARGET_DIR/cloud-pot-pma.atlas.txt"
cp -f ../cloud-pot/export/cloud-pot-pma.png "$UNITY_TARGET_DIR/"
UNITY_TARGET_DIR="$ROOT/spine-unity/Assets/Spine Examples/Spine Skeletons/sack"
cp -f ../sack/export/sack-pro.skel "$UNITY_TARGET_DIR/sack-pro.skel.bytes"
cp -f ../sack/export/sack-pma.atlas "$UNITY_TARGET_DIR/sack-pma.atlas.txt"
cp -f ../sack/export/sack-pma.png "$UNITY_TARGET_DIR/"
echo "--"
echo "Note regarding spine-xna and spine-unity:"
echo "Some textures (normalmap, emission, rim-mask) need manual update."

View File

@ -80,7 +80,7 @@ class ControlBonesExample extends FlxState {
var radius = 6;
for (boneName in controlBoneNames) {
var bone = skeletonSprite.skeleton.findBone(boneName);
var point = [bone.worldX, bone.worldY];
var point = [bone.applied.worldX, bone.applied.worldY];
skeletonSprite.skeletonToHaxeWorldCoordinates(point);
var control = new FlxSprite();
control.makeGraphic(radius * 2, radius * 2, FlxColor.TRANSPARENT, true);
@ -99,8 +99,8 @@ class ControlBonesExample extends FlxState {
point[0] = control.x + radius;
point[1] = control.y + radius;
go.haxeWorldCoordinatesToBone(point, bone);
bone.x = point[0];
bone.y = point[1];
bone.pose.x = point[0];
bone.pose.y = point[1];
}
};

View File

@ -73,7 +73,7 @@ class EventsExample extends FlxState {
skeletonSprite.setBoundingBox();
skeletonSprite.screenCenter();
skeletonSprite.skeleton.setBonesToSetupPose();
skeletonSprite.skeleton.setupPoseBones();
add(skeletonSprite);
trackEntry.onEvent.add(

View File

@ -141,11 +141,11 @@ class FlixelState extends FlxState
var diff = .0;
spineSprite.afterUpdateWorldTransforms = spineSprite -> {
if (jumping) {
diff -= hip.y;
diff -= hip.pose.y;
spineSprite.offsetY -= diff;
spineSprite.y += diff;
}
diff = hip.y;
diff = hip.pose.y;
}
// adding spineboy to the stage

View File

@ -80,7 +80,7 @@ class ControlBonesExample extends Scene {
for (boneName in controlBoneNames) {
var bone = skeletonSprite.skeleton.findBone(boneName);
var point = [bone.worldX, bone.worldY];
var point = [bone.applied.worldX, bone.applied.worldY];
skeletonSprite.skeletonToHaxeWorldCoordinates(point);
var control:Canvas = new Canvas();
@ -104,8 +104,8 @@ class ControlBonesExample extends Scene {
point[0] = control.x;
point[1] = control.y;
go.haxeWorldCoordinatesToBone(point, bone);
bone.x = point[0];
bone.y = point[1];
bone.pose.x = point[0];
bone.pose.y = point[1];
}
};

View File

@ -87,19 +87,21 @@ class Color {
return this;
}
public function setFromRgba8888(value:Int):Void {
public function setFromRgba8888(value:Int):Color {
r = ((value & 0xff000000) >>> 24) / 255;
g = ((value & 0x00ff0000) >>> 16) / 255;
b = ((value & 0x0000ff00) >>> 8) / 255;
a = ((value & 0x000000ff)) / 255;
clamp();
return this;
}
public function setFromRgb888(value:Int):Void {
public function setFromRgb888(value:Int):Color {
r = ((value & 0x00ff0000) >>> 16) / 255;
g = ((value & 0x0000ff00) >>> 8) / 255;
b = ((value & 0x000000ff)) / 255;
clamp();
return this;
}
private function clamp():Color {

View File

@ -44,7 +44,7 @@ class Event {
public var time = 0.;
public var intValue = 0;
public var floatValue = 0;
public var floatValue = 0.;
public var stringValue:String;
public var volume = 1.;
public var balance = 0.;

View File

@ -207,7 +207,7 @@ class PathConstraint extends Constraint<PathConstraint, PathConstraintData, Path
private function computeWorldPositions(skeleton:Skeleton, path:PathAttachment, spacesCount:Int, tangents:Bool):Array<Float> {
var position = applied.position;
ArrayUtils.resize(positions, spacesCount * 3 + 2, 0);
var out:Array<Float> = positions, world:Array<Float>;
var out:Array<Float> = positions, world = new Array<Float>();
var closed = path.closed;
var verticesLength = path.worldVerticesLength, curveCount = Std.int(verticesLength / 6), prevCurve = NONE;

View File

@ -29,13 +29,16 @@
package spine;
import spine.animation.SliderMixTimeline;
import spine.animation.SliderTimeline;
import spine.TransformConstraintData;
import haxe.io.Bytes;
import StringTools;
import spine.animation.AlphaTimeline;
import spine.animation.Animation;
import spine.animation.AttachmentTimeline;
import spine.animation.BoneTimeline2;
import spine.animation.CurveTimeline1;
import spine.animation.CurveTimeline2;
import spine.animation.CurveTimeline;
import spine.animation.DeformTimeline;
import spine.animation.DrawOrderTimeline;
@ -113,6 +116,12 @@ class SkeletonBinary {
private static inline var SLOT_RGB2:Int = 4;
private static inline var SLOT_ALPHA:Int = 5;
private static inline var CONSTRAINT_IK = 0;
private static inline var CONSTRAINT_PATH = 1;
private static inline var CONSTRAINT_TRANSFORM = 2;
private static inline var CONSTRAINT_PHYSICS = 3;
private static inline var CONSTRAINT_SLIDER = 4;
private static inline var ATTACHMENT_DEFORM = 0;
private static inline var ATTACHMENT_SEQUENCE = 1;
@ -129,6 +138,9 @@ class SkeletonBinary {
private static inline var PHYSICS_MIX:Int = 7;
private static inline var PHYSICS_RESET:Int = 8;
private static inline var SLIDER_TIME = 0;
private static inline var SLIDER_MIX = 1;
private static inline var CURVE_LINEAR:Int = 0;
private static inline var CURVE_STEPPED:Int = 1;
private static inline var CURVE_BEZIER:Int = 2;
@ -172,161 +184,225 @@ class SkeletonBinary {
}
// Bones.
var bones = skeletonData.bones;
n = input.readInt(true);
for (i in 0...n) {
var boneName:String = input.readString();
var boneParent:BoneData = i == 0 ? null : skeletonData.bones[input.readInt(true)];
var boneData:BoneData = new BoneData(i, boneName, boneParent);
boneData.rotation = input.readFloat();
boneData.x = input.readFloat() * scale;
boneData.y = input.readFloat() * scale;
boneData.scaleX = input.readFloat();
boneData.scaleY = input.readFloat();
boneData.shearX = input.readFloat();
boneData.shearY = input.readFloat();
boneData.length = input.readFloat() * scale;
boneData.inherit = Inherit.values[input.readInt(true)];
boneData.skinRequired = input.readBoolean();
var boneName = input.readString();
var boneParent:BoneData = i == 0 ? null : bones[input.readInt(true)];
var data = new BoneData(i, boneName, boneParent);
var setup = data.setup;
setup.rotation = input.readFloat();
setup.x = input.readFloat() * scale;
setup.y = input.readFloat() * scale;
setup.scaleX = input.readFloat();
setup.scaleY = input.readFloat();
setup.shearX = input.readFloat();
setup.shearY = input.readFloat();
setup.inherit = Inherit.values[input.readInt(true)];
data.length = input.readFloat() * scale;
data.skinRequired = input.readBoolean();
if (nonessential) {
boneData.color.setFromRgba8888(input.readInt32());
boneData.icon = input.readString();
boneData.visible = input.readBoolean();
data.color.setFromRgba8888(input.readInt32());
data.icon = input.readString();
data.visible = input.readBoolean();
}
skeletonData.bones.push(boneData);
bones.push(data);
}
// Slots.
var slots = skeletonData.slots;
n = input.readInt(true);
for (i in 0...n) {
var slotName:String = input.readString();
var slotName = input.readString();
var slotBoneData:BoneData = skeletonData.bones[input.readInt(true)];
var slotData:SlotData = new SlotData(i, slotName, slotBoneData);
slotData.color.setFromRgba8888(input.readInt32());
var boneData = bones[input.readInt(true)];
var data = new SlotData(i, slotName, boneData);
data.setup.color.setFromRgba8888(input.readInt32());
var darkColor:Int = input.readInt32();
if (darkColor != -1) {
slotData.darkColor = new Color(0, 0, 0);
slotData.darkColor.setFromRgb888(darkColor);
var darkColor = input.readInt32();
if (darkColor != -1) data.setup.darkColor = new Color(0, 0, 0).setFromRgb888(darkColor);
data.attachmentName = input.readStringRef();
data.blendMode = BlendMode.values[input.readInt(true)];
if (nonessential) data.visible = input.readBoolean();
slots.push(data);
}
// Constraints.
var constraintCount = input.readInt(true);
var constraints = skeletonData.constraints;
for (i in 0...constraintCount) {
var name = input.readString();
var nn = input.readInt(true);
switch (input.readByte()) {
case CONSTRAINT_IK:
var data = new IkConstraintData(name);
var constraintBones = data.bones;
for (ii in 0...nn)
constraintBones.push(bones[input.readInt(true)]);
data.target = bones[input.readInt(true)];
var flags = input.readByte();
data.skinRequired = (flags & 1) != 0;
data.uniform = (flags & 2) != 0;
var setup = data.setup;
setup.bendDirection = (flags & 4) != 0 ? 1 : -1;
setup.compress = (flags & 8) != 0;
setup.stretch = (flags & 16) != 0;
if ((flags & 32) != 0) setup.mix = (flags & 64) != 0 ? input.readFloat() : 1;
if ((flags & 128) != 0) setup.softness = input.readFloat() * scale;
constraints[i] = data;
case CONSTRAINT_TRANSFORM:
var data = new TransformConstraintData(name);
var constraintBones = data.bones;
for (ii in 0...nn)
constraintBones.push(bones[input.readInt(true)]);
data.source = bones[input.readInt(true)];
var flags = input.readByte();
data.skinRequired = (flags & 1) != 0;
data.localSource = (flags & 2) != 0;
data.localTarget = (flags & 4) != 0;
data.additive = (flags & 8) != 0;
data.clamp = (flags & 16) != 0;
var froms = data.properties;
for (ii in 0...nn) {
var fromScale = 1.;
var from:FromProperty;
switch (input.readByte()) {
case 0: from = new FromRotate();
case 1:
fromScale = scale;
from = new FromX();
case 2:
fromScale = scale;
from = new FromY();
case 3: from = new FromScaleX();
case 4: from = new FromScaleY();
case 5: from = new FromShearY();
default: from = null;
}
from.offset = input.readFloat() * fromScale;
var tn = input.readByte();
var tos = from.to;
for (t in 0...tn) {
var toScale = 1.;
var to:ToProperty;
switch (input.readByte()) {
case 0: to = new ToRotate();
case 1:
toScale = scale;
to = new ToX();
case 2:
toScale = scale;
to = new ToY();
case 3: to = new ToScaleX();
case 4: to = new ToScaleY();
case 5: to = new ToShearY();
default: to = null;
}
to.offset = input.readFloat() * toScale;
to.max = input.readFloat() * toScale;
to.scale = input.readFloat() * toScale / fromScale;
tos[t] = to;
}
froms[ii] = from;
}
flags = input.readByte();
if ((flags & 1) != 0) data.offsets[0] = input.readFloat();
if ((flags & 2) != 0) data.offsets[1] = input.readFloat() * scale;
if ((flags & 4) != 0) data.offsets[2] = input.readFloat() * scale;
if ((flags & 8) != 0) data.offsets[3] = input.readFloat();
if ((flags & 16) != 0) data.offsets[4] = input.readFloat();
if ((flags & 32) != 0) data.offsets[5] = input.readFloat();
flags = input.readByte();
var setup = data.setup;
if ((flags & 1) != 0) setup.mixRotate = input.readFloat();
if ((flags & 2) != 0) setup.mixX = input.readFloat();
if ((flags & 4) != 0) setup.mixY = input.readFloat();
if ((flags & 8) != 0) setup.mixScaleX = input.readFloat();
if ((flags & 16) != 0) setup.mixScaleY = input.readFloat();
if ((flags & 32) != 0) setup.mixShearY = input.readFloat();
constraints[i] = data;
case CONSTRAINT_PATH:
var data = new PathConstraintData(name);
var constraintBones = data.bones;
for (ii in 0...nn)
constraintBones[ii] = bones[input.readInt(true)];
data.slot = slots[input.readInt(true)];
var flags = input.readByte();
data.skinRequired = (flags & 1) != 0;
data.positionMode = PositionMode.values[(flags >> 1) & 2];
data.spacingMode = SpacingMode.values[(flags >> 2) & 3];
data.rotateMode = RotateMode.values[(flags >> 4) & 3];
if ((flags & 128) != 0) data.offsetRotation = input.readFloat();
var setup = data.setup;
setup.position = input.readFloat();
if (data.positionMode == PositionMode.fixed) setup.position *= scale;
setup.spacing = input.readFloat();
if (data.spacingMode == SpacingMode.length || data.spacingMode == SpacingMode.fixed) setup.spacing *= scale;
setup.mixRotate = input.readFloat();
setup.mixX = input.readFloat();
setup.mixY = input.readFloat();
constraints[i] = data;
case CONSTRAINT_PHYSICS:
var data = new PhysicsConstraintData(name);
data.bone = bones[nn];
var flags = input.readByte();
data.skinRequired = (flags & 1) != 0;
if ((flags & 2) != 0) data.x = input.readFloat();
if ((flags & 4) != 0) data.y = input.readFloat();
if ((flags & 8) != 0) data.rotate = input.readFloat();
if ((flags & 16) != 0) data.scaleX = input.readFloat();
if ((flags & 32) != 0) data.shearX = input.readFloat();
data.limit = ((flags & 64) != 0 ? input.readFloat() : 5000) * scale;
data.step = .1 / input.readUnsignedByte();
var setup = data.setup;
setup.inertia = input.readFloat();
setup.strength = input.readFloat();
setup.damping = input.readFloat();
setup.massInverse = (flags & 128) != 0 ? input.readFloat() : 1;
setup.wind = input.readFloat();
setup.gravity = input.readFloat();
flags = input.readByte();
if ((flags & 1) != 0) data.inertiaGlobal = true;
if ((flags & 2) != 0) data.strengthGlobal = true;
if ((flags & 4) != 0) data.dampingGlobal = true;
if ((flags & 8) != 0) data.massGlobal = true;
if ((flags & 16) != 0) data.windGlobal = true;
if ((flags & 32) != 0) data.gravityGlobal = true;
if ((flags & 64) != 0) data.mixGlobal = true;
setup.mix = (flags & 128) != 0 ? input.readFloat() : 1;
constraints[i] = data;
case CONSTRAINT_SLIDER:
var data = new SliderData(name);
data.skinRequired = (nn & 1) != 0;
data.loop = (nn & 2) != 0;
data.additive = (nn & 4) != 0;
if ((nn & 8) != 0) data.setup.time = input.readFloat();
if ((nn & 16) != 0) data.setup.mix = (nn & 32) != 0 ? input.readFloat() : 1;
if ((nn & 64) != 0) {
data.local = (nn & 128) != 0;
data.bone = bones[input.readInt(true)];
var offset = input.readFloat();
switch (input.readByte()) {
case 0: data.property = new FromRotate();
case 1:
offset *= scale;
data.property = new FromX();
case 2:
offset *= scale;
data.property = new FromY();
case 3: data.property = new FromScaleX();
case 4: data.property = new FromScaleY();
case 5: data.property = new FromShearY();
default: data.property = null;
}
data.property.offset = offset;
data.scale = input.readFloat();
}
constraints[i] = data;
}
slotData.attachmentName = input.readStringRef();
slotData.blendMode = BlendMode.values[input.readInt(true)];
if (nonessential) slotData.visible = input.readBoolean();
skeletonData.slots.push(slotData);
}
// IK constraints.
n = input.readInt(true);
for (i in 0...n) {
var ikData:IkConstraintData = new IkConstraintData(input.readString());
ikData.order = input.readInt(true);
nn = input.readInt(true);
for (ii in 0...nn) {
ikData.bones.push(skeletonData.bones[input.readInt(true)]);
}
ikData.target = skeletonData.bones[input.readInt(true)];
var flags = input.readByte();
ikData.skinRequired = (flags & 1) != 0;
ikData.bendDirection = (flags & 2) != 0 ? 1 : -1;
ikData.compress = (flags & 4) != 0;
ikData.stretch = (flags & 8) != 0;
ikData.uniform = (flags & 16) != 0;
if ((flags & 32) != 0) ikData.mix = (flags & 64) != 0 ? input.readFloat() : 1;
if ((flags & 128) != 0) ikData.softness = input.readFloat() * scale;
skeletonData.ikConstraints.push(ikData);
}
// Transform constraints.
n = input.readInt(true);
for (i in 0...n) {
var transformData:TransformConstraintData = new TransformConstraintData(input.readString());
transformData.order = input.readInt(true);
nn = input.readInt(true);
for (ii in 0...nn) {
transformData.bones.push(skeletonData.bones[input.readInt(true)]);
}
transformData.target = skeletonData.bones[input.readInt(true)];
var flags = input.readByte();
transformData.skinRequired = (flags & 1) != 0;
transformData.local = (flags & 2) != 0;
transformData.relative = (flags & 4) != 0;
if ((flags & 8) != 0) transformData.offsetRotation = input.readFloat();
if ((flags & 16) != 0) transformData.offsetX = input.readFloat() * scale;
if ((flags & 32) != 0) transformData.offsetY = input.readFloat() * scale;
if ((flags & 64) != 0) transformData.offsetScaleX = input.readFloat();
if ((flags & 128) != 0) transformData.offsetScaleY = input.readFloat();
flags = input.readByte();
if ((flags & 1) != 0) transformData.offsetShearY = input.readFloat();
if ((flags & 2) != 0) transformData.mixRotate = input.readFloat();
if ((flags & 4) != 0) transformData.mixX = input.readFloat();
if ((flags & 8) != 0) transformData.mixY = input.readFloat();
if ((flags & 16) != 0) transformData.mixScaleX = input.readFloat();
if ((flags & 32) != 0) transformData.mixScaleY = input.readFloat();
if ((flags & 64) != 0) transformData.mixShearY = input.readFloat();
skeletonData.transformConstraints.push(transformData);
}
// Path constraints.
n = input.readInt(true);
for (i in 0...n) {
var pathData:PathConstraintData = new PathConstraintData(input.readString());
pathData.order = input.readInt(true);
pathData.skinRequired = input.readBoolean();
nn = input.readInt(true);
for (ii in 0...nn) {
pathData.bones.push(skeletonData.bones[input.readInt(true)]);
}
pathData.target = skeletonData.slots[input.readInt(true)];
var flags = input.readByte();
pathData.positionMode = PositionMode.values[flags & 1];
pathData.spacingMode = SpacingMode.values[(flags >> 1) & 3];
pathData.rotateMode = RotateMode.values[(flags >> 3) & 3];
if ((flags & 128) != 0) pathData.offsetRotation = input.readFloat();
pathData.position = input.readFloat();
if (pathData.positionMode == PositionMode.fixed)
pathData.position *= scale;
pathData.spacing = input.readFloat();
if (pathData.spacingMode == SpacingMode.length || pathData.spacingMode == SpacingMode.fixed)
pathData.spacing *= scale;
pathData.mixRotate = input.readFloat();
pathData.mixX = input.readFloat();
pathData.mixY = input.readFloat();
skeletonData.pathConstraints.push(pathData);
}
// Physics constraints.
n = input.readInt(true);
for (i in 0...n) {
var physicsData:PhysicsConstraintData = new PhysicsConstraintData(input.readString());
physicsData.order = input.readInt(true);
physicsData.bone = skeletonData.bones[input.readInt(true)];
var flags = input.readByte();
physicsData.skinRequired = (flags & 1) != 0;
if ((flags & 2) != 0) physicsData.x = input.readFloat();
if ((flags & 4) != 0) physicsData.y = input.readFloat();
if ((flags & 8) != 0) physicsData.rotate = input.readFloat();
if ((flags & 16) != 0) physicsData.scaleX = input.readFloat();
if ((flags & 32) != 0) physicsData.shearX = input.readFloat();
physicsData.limit = ((flags & 64) != 0 ? input.readFloat() : 5000) * scale;
physicsData.step = 1 / input.readUnsignedByte();
physicsData.inertia = input.readFloat();
physicsData.strength = input.readFloat();
physicsData.damping = input.readFloat();
physicsData.massInverse = (flags & 128) != 0 ? input.readFloat() : 1;
physicsData.wind = input.readFloat();
physicsData.gravity = input.readFloat();
flags = input.readByte();
if ((flags & 1) != 0) physicsData.inertiaGlobal = true;
if ((flags & 2) != 0) physicsData.strengthGlobal = true;
if ((flags & 4) != 0) physicsData.dampingGlobal = true;
if ((flags & 8) != 0) physicsData.massGlobal = true;
if ((flags & 16) != 0) physicsData.windGlobal = true;
if ((flags & 32) != 0) physicsData.gravityGlobal = true;
if ((flags & 64) != 0) physicsData.mixGlobal = true;
physicsData.mix = (flags & 128) != 0 ? input.readFloat() : 1;
skeletonData.physicsConstraints.push(physicsData);
}
// Default skin.
var defaultSkin:Skin = readSkin(input, skeletonData, true, nonessential);
@ -374,16 +450,22 @@ class SkeletonBinary {
}
// Animations.
var animations = skeletonData.animations;
n = input.readInt(true);
for (i in 0...n) {
skeletonData.animations.push(readAnimation(input, input.readString(), skeletonData));
}
for (i in 0...n)
animations[i] = readAnimation(input, input.readString(), skeletonData);
for (i in 0...constraintCount)
if (Std.isOfType(constraints[i], SliderData)){
var data = cast(constraints[i], SliderData);
data.animation = animations[input.readInt(true)];
};
return skeletonData;
}
private function readSkin(input:BinaryInput, skeletonData:SkeletonData, defaultSkin:Bool, nonessential:Bool):Skin {
var skin:Skin = null;
var slotCount:Int = 0;
var slotCount = 0;
if (defaultSkin) {
slotCount = input.readInt(true);
@ -392,24 +474,21 @@ class SkeletonBinary {
skin = new Skin("default");
} else {
skin = new Skin(input.readString());
if (nonessential) skin.color.setFromRgba8888(input.readInt32());
skin.bones.resize(input.readInt(true));
for (i in 0...skin.bones.length) {
skin.bones[i] = skeletonData.bones[input.readInt(true)];
}
for (i in 0...input.readInt(true)) {
skin.constraints.push(skeletonData.ikConstraints[input.readInt(true)]);
}
for (i in 0...input.readInt(true)) {
skin.constraints.push(skeletonData.transformConstraints[input.readInt(true)]);
}
for (i in 0...input.readInt(true)) {
skin.constraints.push(skeletonData.pathConstraints[input.readInt(true)]);
}
for (i in 0...input.readInt(true)) {
skin.constraints.push(skeletonData.physicsConstraints[input.readInt(true)]);
}
if (nonessential) skin.color.setFromRgba8888(input.readInt32());
var n:Int;
var from1 = skeletonData.bones;
var to1 = skin.bones;
to1.resize(n = input.readInt(true));
for (i in 0...n)
to1[i] = from1[input.readInt(true)];
var from2 = skeletonData.constraints;
var to2 = skin.constraints;
to2.resize(n = input.readInt(true));
for (i in 0...n)
to2[i] = from2[input.readInt(true)];
slotCount = input.readInt(true);
}
@ -451,9 +530,7 @@ class SkeletonBinary {
var mesh:MeshAttachment;
var flags = input.readByte();
var name:String = (flags & 8) != 0 ? input.readStringRef() : attachmentName;
if (name == null)
throw new SpineException("Attachment name must not be null");
var name = (flags & 8) != 0 ? input.readStringRef() : attachmentName;
switch (AttachmentType.values[flags & 7]) {
case AttachmentType.region:
path = (flags & 16) != 0 ? input.readStringRef() : null;
@ -926,26 +1003,19 @@ class SkeletonBinary {
}
bezierCount = input.readInt(true);
switch (timelineType) {
case BONE_ROTATE:
timelines.push(readTimeline(input, new RotateTimeline(frameCount, bezierCount, boneIndex), 1));
case BONE_TRANSLATE:
timelines.push(readTimeline2(input, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale));
case BONE_TRANSLATEX:
timelines.push(readTimeline(input, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale));
case BONE_TRANSLATEY:
timelines.push(readTimeline(input, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale));
case BONE_SCALE:
timelines.push(readTimeline2(input, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1));
case BONE_SCALEX:
timelines.push(readTimeline(input, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1));
case BONE_SCALEY:
timelines.push(readTimeline(input, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1));
case BONE_SHEAR:
timelines.push(readTimeline2(input, new ShearTimeline(frameCount, bezierCount, boneIndex), 1));
case BONE_SHEARX:
timelines.push(readTimeline(input, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1));
case BONE_SHEARY:
timelines.push(readTimeline(input, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1));
case BONE_ROTATE: readTimeline(input, timelines, new RotateTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_TRANSLATE: //
readTimeline2(input, timelines, new TranslateTimeline(frameCount, bezierCount, boneIndex), scale);
case BONE_TRANSLATEX: //
readTimeline(input, timelines, new TranslateXTimeline(frameCount, bezierCount, boneIndex), scale);
case BONE_TRANSLATEY: //
readTimeline(input, timelines, new TranslateYTimeline(frameCount, bezierCount, boneIndex), scale);
case BONE_SCALE: readTimeline2(input, timelines, new ScaleTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SCALEX: readTimeline(input, timelines, new ScaleXTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SCALEY: readTimeline(input, timelines, new ScaleYTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SHEAR: readTimeline2(input, timelines, new ShearTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SHEARX: readTimeline(input, timelines, new ShearXTimeline(frameCount, bezierCount, boneIndex), 1);
case BONE_SHEARY: readTimeline(input, timelines, new ShearYTimeline(frameCount, bezierCount, boneIndex), 1);
}
}
}
@ -1018,8 +1088,7 @@ class SkeletonBinary {
mixScaleY2:Float = input.readFloat(),
mixShearY2:Float = input.readFloat();
switch (input.readByte()) {
case CURVE_STEPPED:
transformTimeline.setStepped(frame);
case CURVE_STEPPED: transformTimeline.setStepped(frame);
case CURVE_BEZIER:
setBezier(input, transformTimeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);
setBezier(input, transformTimeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);
@ -1045,17 +1114,17 @@ class SkeletonBinary {
// Path constraint timelines.
for (i in 0...input.readInt(true)) {
index = input.readInt(true);
var data:PathConstraintData = skeletonData.pathConstraints[index];
var data = cast(skeletonData.constraints[index], PathConstraintData);
for (ii in 0...input.readInt(true)) {
var type:Int = input.readByte(), frameCount:Int = input.readInt(true), bezierCount:Int = input.readInt(true);
switch (type) {
case PATH_POSITION:
timelines.push(readTimeline(input, new PathConstraintPositionTimeline(frameCount, bezierCount, index),
data.positionMode == PositionMode.fixed ? scale : 1));
readTimeline(input, timelines, new PathConstraintPositionTimeline(frameCount, bezierCount, index),
data.positionMode == PositionMode.fixed ? scale : 1);
case PATH_SPACING:
timelines.push(readTimeline(input, new PathConstraintSpacingTimeline(frameCount, bezierCount, index),
readTimeline(input, timelines, new PathConstraintSpacingTimeline(frameCount, bezierCount, index),
data.spacingMode == SpacingMode.length
|| data.spacingMode == SpacingMode.fixed ? scale : 1));
|| data.spacingMode == SpacingMode.fixed ? scale : 1);
case PATH_MIX:
var mixTimeline:PathConstraintMixTimeline = new PathConstraintMixTimeline(frameCount, bezierCount, index);
time = input.readFloat();
@ -1075,8 +1144,7 @@ class SkeletonBinary {
mixX2 = input.readFloat();
mixY2 = input.readFloat();
switch (input.readByte()) {
case CURVE_STEPPED:
mixTimeline.setStepped(frame);
case CURVE_STEPPED: mixTimeline.setStepped(frame);
case CURVE_BEZIER:
setBezier(input, mixTimeline, bezier++, frame, 0, time, time2, mixRotate, mixRotate2, 1);
setBezier(input, mixTimeline, bezier++, frame, 1, time, time2, mixX, mixX2, 1);
@ -1107,28 +1175,33 @@ class SkeletonBinary {
continue;
}
var bezierCount = input.readInt(true);
var timeline:CurveTimeline1;
switch (type) {
case PHYSICS_INERTIA:
timelines.push(readTimeline(input, new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, constraintIndex), 1));
break;
case PHYSICS_STRENGTH:
timelines.push(readTimeline(input, new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, constraintIndex), 1));
break;
case PHYSICS_DAMPING:
timelines.push(readTimeline(input, new PhysicsConstraintDampingTimeline(frameCount, bezierCount, constraintIndex), 1));
break;
case PHYSICS_MASS:
timelines.push(readTimeline(input, new PhysicsConstraintMassTimeline(frameCount, bezierCount, constraintIndex), 1));
break;
case PHYSICS_WIND:
timelines.push(readTimeline(input, new PhysicsConstraintWindTimeline(frameCount, bezierCount, constraintIndex), 1));
break;
case PHYSICS_GRAVITY:
timelines.push(readTimeline(input, new PhysicsConstraintGravityTimeline(frameCount, bezierCount, constraintIndex), 1));
break;
case PHYSICS_MIX:
timelines.push(readTimeline(input, new PhysicsConstraintMixTimeline(frameCount, bezierCount, constraintIndex), 1));
case PHYSICS_INERTIA: timeline = new PhysicsConstraintInertiaTimeline(frameCount, bezierCount, constraintIndex);
case PHYSICS_STRENGTH: timeline = new PhysicsConstraintStrengthTimeline(frameCount, bezierCount, constraintIndex);
case PHYSICS_DAMPING: timeline = new PhysicsConstraintDampingTimeline(frameCount, bezierCount, constraintIndex);
case PHYSICS_MASS: timeline = new PhysicsConstraintMassTimeline(frameCount, bezierCount, constraintIndex);
case PHYSICS_WIND: timeline = new PhysicsConstraintWindTimeline(frameCount, bezierCount, constraintIndex);
case PHYSICS_GRAVITY: timeline = new PhysicsConstraintGravityTimeline(frameCount, bezierCount, constraintIndex);
case PHYSICS_MIX: timeline = new PhysicsConstraintMixTimeline(frameCount, bezierCount, constraintIndex);
default: throw new SpineException("Unknown physics timeline type: " + type);
}
readTimeline(input, timelines, timeline, 1);
}
}
// Slider timelines.
for (i in 0...input.readInt(true)) {
var index = input.readInt(true);
for (ii in 0...input.readInt(true)) {
var type = input.readByte(), frameCount = input.readInt(true), bezierCount = input.readInt(true);
var timeline:CurveTimeline1;
switch (type) {
case SLIDER_TIME: timeline = new SliderTimeline(frameCount, bezierCount, index);
case SLIDER_MIX: timeline = new SliderMixTimeline(frameCount, bezierCount, index);
default: throw new SpineException("Unknown slider timeline type: " + type);
}
readTimeline(input, timelines, timeline, 1);
}
}
@ -1196,10 +1269,8 @@ class SkeletonBinary {
break;
time2 = input.readFloat();
switch (input.readByte()) {
case CURVE_STEPPED:
deformTimeline.setStepped(frame);
case CURVE_BEZIER:
SkeletonBinary.setBezier(input, deformTimeline, bezier++, frame, 0, time, time2, 0, 1, 1);
case CURVE_STEPPED: deformTimeline.setStepped(frame);
case CURVE_BEZIER: SkeletonBinary.setBezier(input, deformTimeline, bezier++, frame, 0, time, time2, 0, 1, 1);
}
time = time2;
@ -1284,13 +1355,12 @@ class SkeletonBinary {
}
var duration:Float = 0;
for (i in 0...timelines.length) {
for (i in 0...timelines.length)
duration = Math.max(duration, timelines[i].getDuration());
}
return new Animation(name, timelines, duration);
}
static private function readTimeline(input:BinaryInput, timeline:CurveTimeline1, scale:Float):CurveTimeline1 {
static private function readTimeline(input:BinaryInput, timelines:Array<Timeline>, timeline:CurveTimeline1, scale:Float) {
var time:Float = input.readFloat(),
value:Float = input.readFloat() * scale;
@ -1305,20 +1375,18 @@ class SkeletonBinary {
var time2:Float = input.readFloat(),
value2:Float = input.readFloat() * scale;
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
case CURVE_BEZIER:
setBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);
case CURVE_STEPPED: timeline.setStepped(frame);
case CURVE_BEZIER: setBezier(input, timeline, bezier++, frame, 0, time, time2, value, value2, scale);
}
time = time2;
value = value2;
frame++;
}
return timeline;
timelines.push(timeline);
}
static private function readTimeline2(input:BinaryInput, timeline:CurveTimeline2, scale:Float):CurveTimeline2 {
static private function readTimeline2(input:BinaryInput, timelines:Array<Timeline>, timeline:BoneTimeline2, scale:Float) {
var time:Float = input.readFloat(),
value1:Float = input.readFloat() * scale,
value2:Float = input.readFloat() * scale;
@ -1335,8 +1403,7 @@ class SkeletonBinary {
nvalue1:Float = input.readFloat() * scale,
nvalue2:Float = input.readFloat() * scale;
switch (input.readByte()) {
case CURVE_STEPPED:
timeline.setStepped(frame);
case CURVE_STEPPED: timeline.setStepped(frame);
case CURVE_BEZIER:
setBezier(input, timeline, bezier++, frame, 0, time, time2, value1, nvalue1, scale);
setBezier(input, timeline, bezier++, frame, 1, time, time2, value2, nvalue2, scale);
@ -1347,7 +1414,7 @@ class SkeletonBinary {
frame++;
}
return timeline;
timelines.push(timeline);
}
static private function setBezier(input:BinaryInput, timeline:CurveTimeline, bezier:Int, frame:Int, value:Float, time1:Float, time2:Float, value1:Float,

View File

@ -196,12 +196,12 @@ class SkeletonData {
// --- Constraints.
public function findConstraint<T:ConstraintData<Dynamic, Dynamic>>(constraintName:String, type:Class<T>):Null<T> {
public function findConstraint<T:ConstraintData<Dynamic, Dynamic>>(constraintName:String, type:Class<T>):T {
if (constraintName == null) throw new SpineException("constraintName cannot be null.");
if (type == null) throw new SpineException("type cannot be null.");
for (constraint in constraints) {
if (Std.is(constraint, type) && constraint.name == constraintName)
if (Std.isOfType(constraint, type) && constraint.name == constraintName)
return Std.downcast(constraint, type);
}
return null;

File diff suppressed because it is too large Load Diff

View File

@ -45,7 +45,7 @@ class Skin {
public final attachments:Array<StringMap<Attachment>> = new Array<StringMap<Attachment>>();
public final bones:Array<BoneData> = new Array<BoneData>();
public final constraints = new Array<ConstraintData<Dynamic, Pose<Any>>>();
public final constraints = new Array<ConstraintData<Dynamic, Dynamic>>();
/** The color of the skin as it was in Spine, or a default color if nonessential data was not exported. */
public final color:Color = new Color(0.99607843, 0.61960787, 0.30980393, 1); // fe9e4fff

View File

@ -29,6 +29,12 @@
package spine;
import spine.animation.ConstraintTimeline;
import spine.animation.PhysicsConstraintTimeline;
import spine.animation.SlotTimeline;
import spine.animation.MixDirection;
import spine.animation.MixBlend;
/** Stores the setup pose for a {@link PhysicsConstraint}.
* <p>
* See <a href="https://esotericsoftware.com/spine-physics-constraints">Physics constraints</a> in the Spine User Guide. */
@ -39,9 +45,9 @@ class Slider extends Constraint<Slider, SliderData, SliderPose> {
public function new (data:SliderData, skeleton:Skeleton) {
super(data, new SliderPose(), new SliderPose());
if (skeleton == null) throw new IllegalArgumentException("skeleton cannot be null.");
if (skeleton == null) throw new SpineException("skeleton cannot be null.");
if (data.bone != null) bone = skeleton.bones.items[data.bone.index];
if (data.bone != null) bone = skeleton.bones[data.bone.index];
}
public function copy (skeleton:Skeleton) {
@ -67,7 +73,7 @@ class Slider extends Constraint<Slider, SliderData, SliderPose> {
var bones = skeleton.bones;
var indices = animation.bones;
var i = 0, n = animation.bones.size;
var i = 0, n = animation.bones.length;
while (i < n)
bones[indices[i++]].applied.modifyLocal(skeleton);
@ -77,7 +83,7 @@ class Slider extends Constraint<Slider, SliderData, SliderPose> {
function sort (skeleton:Skeleton) {
if (bone != null && !data.local) skeleton.sortBone(bone);
skeleton.updateCache.add(this);
skeleton._updateCache.push(this);
var bones = skeleton.bones;
var indices = data.animation.bones;
@ -97,15 +103,16 @@ class Slider extends Constraint<Slider, SliderData, SliderPose> {
var i = 0, n = data.animation.timelines.length;
while (i < n) {
var t = timelines[i++];
if (std.isOfType(t, SlotTimeline))
if (Std.isOfType(t, SlotTimeline))
skeleton.constrained(slots[cast(t, SlotTimeline).getSlotIndex()]);
else if (std.isOfType(t, PhysicsConstraintTimeline)) {
if (cast(t, PhysicsConstraintTimeline).constraintIndex == -1) {
else if (Std.isOfType(t, PhysicsConstraintTimeline)) {
var timeline = cast(t, PhysicsConstraintTimeline);
if (timeline.constraintIndex == -1) {
for (ii in 0...physicsCount)
skeleton.constrained(physics[ii]);
} else
skeleton.constrained(constraints[timeline.constraintIndex]);
} else if (std.isOfType(t, ConstraintTimeline)) //
} else if (Std.isOfType(t, ConstraintTimeline)) //
skeleton.constrained(constraints[cast(t, ConstraintTimeline).getConstraintIndex()]);
}
}

View File

@ -31,6 +31,9 @@
package spine;
import spine.TransformConstraintData.FromProperty;
import spine.animation.Animation;
/** Stores the setup pose for a PhysicsConstraint.
*
* See <a href="https://esotericsoftware.com/spine-physics-constraints">Physics constraints</a> in the Spine User Guide. */

View File

@ -34,6 +34,9 @@ class SliderPose implements Pose<SliderPose> {
public var time = 0.;
public var mix = 0.;
public function new () {
}
public function set (pose:SliderPose) {
time = pose.time;
mix = pose.mix;

View File

@ -152,6 +152,9 @@ class TransformConstraintData extends ConstraintData<TransformConstraint, Transf
/** Source property for a {@link TransformConstraint}. */
abstract class FromProperty {
public function new () {
}
/** The value of this property that corresponds to ToProperty.offset. */
public var offset:Float;
@ -164,6 +167,9 @@ abstract class FromProperty {
/** Constrained property for a TransformConstraint. */
abstract class ToProperty {
public function new () {
}
/** The value of this property that corresponds to FromProperty.offset. */
public var offset:Float;

View File

@ -261,7 +261,7 @@ class AnimationState {
if (Std.isOfType(timeline, AttachmentTimeline)) {
applyAttachmentTimeline(cast(timeline, AttachmentTimeline), skeleton, applyTime, blend, attachments);
} else {
timeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, MixDirection.mixIn);
timeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, blend, MixDirection.mixIn, false);
}
}
} else {
@ -281,7 +281,7 @@ class AnimationState {
} else if (Std.isOfType(timeline, AttachmentTimeline)) {
this.applyAttachmentTimeline(cast(timeline, AttachmentTimeline), skeleton, applyTime, blend, attachments);
} else {
timeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, MixDirection.mixIn);
timeline.apply(skeleton, animationLast, applyTime, applyEvents, alpha, timelineBlend, MixDirection.mixIn, false);
}
}
}
@ -344,7 +344,7 @@ class AnimationState {
if (blend == MixBlend.add) {
for (timeline in timelines) {
timeline.apply(skeleton, animationLast, applyTime, applyEvents, alphaMix, blend, MixDirection.mixOut);
timeline.apply(skeleton, animationLast, applyTime, applyEvents, alphaMix, blend, MixDirection.mixOut, false);
}
} else {
var timelineMode:Array<Int> = from.timelineMode;
@ -391,7 +391,7 @@ class AnimationState {
} else {
if (drawOrder && Std.isOfType(timeline, DrawOrderTimeline) && timelineBlend == MixBlend.setup)
direction = MixDirection.mixIn;
timeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction);
timeline.apply(skeleton, animationLast, applyTime, events, alpha, timelineBlend, direction, false);
}
}
}

View File

@ -116,7 +116,7 @@ class SkeletonSprite extends FlxObject
public function getAnimationBounds(animation:Animation, clip:Bool = true): lime.math.Rectangle {
var clipper = clip ? SkeletonSprite.clipper : null;
skeleton.setToSetupPose();
skeleton.setupPose();
var steps = 100, time = 0.;
var stepTime = animation.duration != 0 ? animation.duration / steps : 0;
@ -124,7 +124,7 @@ class SkeletonSprite extends FlxObject
var bounds = new lime.math.Rectangle();
for (i in 0...steps) {
animation.apply(skeleton, time , time, false, [], 1, MixBlend.setup, MixDirection.mixIn);
animation.apply(skeleton, time , time, false, [], 1, MixBlend.setup, MixDirection.mixIn, false);
skeleton.updateWorldTransform(Physics.update);
bounds = skeleton.getBounds(clipper);
@ -206,8 +206,10 @@ class SkeletonSprite extends FlxObject
}
var worldVertices:Array<Float> = _tempVertices;
if (Std.isOfType(slot.attachment, RegionAttachment)) {
var region:RegionAttachment = cast(slot.attachment, RegionAttachment);
var pose = slot.pose;
var attachment = pose.attachment;
if (Std.isOfType(attachment, RegionAttachment)) {
var region:RegionAttachment = cast(attachment, RegionAttachment);
numVertices = 4;
numFloats = clippedVertexSize << 2;
if (numFloats > worldVertices.length) {
@ -220,23 +222,23 @@ class SkeletonSprite extends FlxObject
triangles = QUAD_INDICES;
uvs = region.uvs;
attachmentColor = region.color;
} else if (Std.isOfType(slot.attachment, MeshAttachment)) {
var meshAttachment:MeshAttachment = cast(slot.attachment, MeshAttachment);
} else if (Std.isOfType(attachment, MeshAttachment)) {
var meshAttachment:MeshAttachment = cast(attachment, MeshAttachment);
numVertices = meshAttachment.worldVerticesLength >> 1;
numFloats = numVertices * clippedVertexSize; // 8 for now because I'm excluding clipping
if (numFloats > worldVertices.length) {
worldVertices.resize(numFloats);
}
meshAttachment.computeWorldVertices(slot, 0, meshAttachment.worldVerticesLength, worldVertices, 0, clippedVertexSize);
meshAttachment.computeWorldVertices(skeleton, slot, 0, meshAttachment.worldVerticesLength, worldVertices, 0, clippedVertexSize);
mesh = getFlixelMeshFromRendererAttachment(meshAttachment);
mesh.graphic = meshAttachment.region.texture;
triangles = meshAttachment.triangles;
uvs = meshAttachment.uvs;
attachmentColor = meshAttachment.color;
} else if (Std.isOfType(slot.attachment, ClippingAttachment)) {
var clip:ClippingAttachment = cast(slot.attachment, ClippingAttachment);
clipper.clipStart(slot, clip);
} else if (Std.isOfType(attachment, ClippingAttachment)) {
var clip:ClippingAttachment = cast(attachment, ClippingAttachment);
clipper.clipStart(skeleton, slot, clip);
continue;
} else {
clipper.clipEnd(slot);
@ -247,12 +249,12 @@ class SkeletonSprite extends FlxObject
// cannot use directly mesh.color.setRGBFloat otherwise the setter won't be called and transfor color not set
mesh.color = FlxColor.fromRGBFloat(
skeleton.color.r * slot.color.r * attachmentColor.r * color.redFloat,
skeleton.color.g * slot.color.g * attachmentColor.g * color.greenFloat,
skeleton.color.b * slot.color.b * attachmentColor.b * color.blueFloat,
skeleton.color.r * pose.color.r * attachmentColor.r * color.redFloat,
skeleton.color.g * pose.color.g * attachmentColor.g * color.greenFloat,
skeleton.color.b * pose.color.b * attachmentColor.b * color.blueFloat,
1
);
mesh.alpha = skeleton.color.a * slot.color.a * attachmentColor.a * alpha;
mesh.alpha = skeleton.color.a * pose.color.a * attachmentColor.a * alpha;
if (clipper.isClipping()) {
clipper.clipTriangles(worldVertices, triangles, triangles.length, uvs);
@ -356,10 +358,11 @@ class SkeletonSprite extends FlxObject
public function haxeWorldCoordinatesToBone(point:Array<Float>, bone: Bone):Void {
this.haxeWorldCoordinatesToSkeleton(point);
if (bone.parent != null) {
bone.parent.worldToLocal(point);
var parentBone = bone.parent;
if (parentBone != null) {
parentBone.applied.worldToLocal(point);
} else {
bone.worldToLocal(point);
bone.applied.worldToLocal(point);
}
}

View File

@ -116,8 +116,10 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
}
var worldVertices:Array<Float> = _tempVertices;
if (Std.isOfType(slot.attachment, RegionAttachment)) {
var region:RegionAttachment = cast(slot.attachment, RegionAttachment);
var pose = slot.pose;
var attachment = pose.attachment;
if (Std.isOfType(pose, RegionAttachment)) {
var region:RegionAttachment = cast(pose, RegionAttachment);
verticesLength = 8;
verticesCount = verticesLength >> 1;
if (worldVertices.length < verticesLength)
@ -144,13 +146,13 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
indexData = mesh.getIndexData();
attachmentColor = region.color;
uvs = region.uvs;
} else if (Std.isOfType(slot.attachment, MeshAttachment)) {
var meshAttachment:MeshAttachment = cast(slot.attachment, MeshAttachment);
} else if (Std.isOfType(pose, MeshAttachment)) {
var meshAttachment:MeshAttachment = cast(pose, MeshAttachment);
verticesLength = meshAttachment.worldVerticesLength;
verticesCount = verticesLength >> 1;
if (worldVertices.length < verticesLength)
worldVertices.resize(verticesLength);
meshAttachment.computeWorldVertices(slot, 0, meshAttachment.worldVerticesLength, worldVertices, 0, 2);
meshAttachment.computeWorldVertices(skeleton, slot, 0, meshAttachment.worldVerticesLength, worldVertices, 0, 2);
mesh = null;
if (Std.isOfType(meshAttachment.rendererObject, SkeletonMesh)) {
@ -173,26 +175,26 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
indexData = mesh.getIndexData();
attachmentColor = meshAttachment.color;
uvs = meshAttachment.uvs;
} else if (Std.isOfType(slot.attachment, ClippingAttachment)) {
var clip:ClippingAttachment = cast(slot.attachment, ClippingAttachment);
clipper.clipStart(slot, clip);
} else if (Std.isOfType(pose, ClippingAttachment)) {
var clip:ClippingAttachment = cast(pose, ClippingAttachment);
clipper.clipStart(skeleton, slot, clip);
continue;
} else {
clipper.clipEnd(slot);
continue;
}
a = slot.color.a * attachmentColor.a;
a = pose.color.a * attachmentColor.a;
if (a == 0) {
clipper.clipEnd(slot);
continue;
}
rgb = Color.rgb(Std.int(r * slot.color.r * attachmentColor.r), Std.int(g * slot.color.g * attachmentColor.g),
Std.int(b * slot.color.b * attachmentColor.b));
if (slot.darkColor == null) {
rgb = Color.rgb(Std.int(r * pose.color.r * attachmentColor.r), Std.int(g * pose.color.g * attachmentColor.g),
Std.int(b * pose.color.b * attachmentColor.b));
if (pose.darkColor == null) {
dark = Color.rgb(0, 0, 0);
} else {
dark = Color.rgb(Std.int(slot.darkColor.r * 255), Std.int(slot.darkColor.g * 255), Std.int(slot.darkColor.b * 255));
dark = Color.rgb(Std.int(pose.darkColor.r * 255), Std.int(pose.darkColor.g * 255), Std.int(pose.darkColor.b * 255));
}
if (clipper.isClipping()) {
@ -249,12 +251,13 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
var empty:Bool = true;
for (i in 0...slots.length) {
var slot:Slot = slots[i];
var attachment:Attachment = slot.attachment;
var pose = slot.pose;
var attachment = pose.attachment;
if (attachment == null)
continue;
var verticesLength:Int;
if (Std.isOfType(attachment, RegionAttachment)) {
var region:RegionAttachment = cast(slot.attachment, RegionAttachment);
var region:RegionAttachment = cast(attachment, RegionAttachment);
verticesLength = 8;
region.computeWorldVertices(slot, worldVertices, 0, 2);
} else if (Std.isOfType(attachment, MeshAttachment)) {
@ -262,7 +265,7 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
verticesLength = mesh.worldVerticesLength;
if (worldVertices.length < verticesLength)
worldVertices.resize(verticesLength);
mesh.computeWorldVertices(slot, 0, verticesLength, worldVertices, 0, 2);
mesh.computeWorldVertices(skeleton, slot, 0, verticesLength, worldVertices, 0, 2);
} else {
continue;
}
@ -324,7 +327,7 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
public function getAnimationBounds(animation:Animation, clip:Bool = true): Rectangle {
var clipper = clip ? SkeletonSprite.clipper : null;
_skeleton.setToSetupPose();
_skeleton.setupPose();
var steps = 100, time = 0.;
var stepTime = animation.duration != 0 ? animation.duration / steps : 0;
@ -332,7 +335,7 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
var bound:lime.math.Rectangle;
for (i in 0...steps) {
animation.apply(_skeleton, time , time, false, [], 1, MixBlend.setup, MixDirection.mixIn);
animation.apply(_skeleton, time , time, false, [], 1, MixBlend.setup, MixDirection.mixIn, false);
_skeleton.updateWorldTransform(Physics.update);
bound = _skeleton.getBounds(clipper);
@ -412,10 +415,11 @@ class SkeletonSprite extends DisplayObject implements IAnimatable {
public function haxeWorldCoordinatesToBone(point:Array<Float>, bone: Bone):Void {
this.haxeWorldCoordinatesToSkeleton(point);
if (bone.parent != null) {
bone.parent.worldToLocal(point);
var parentBone = bone.parent;
if (parentBone != null) {
parentBone.applied.worldToLocal(point);
} else {
bone.worldToLocal(point);
bone.applied.worldToLocal(point);
}
}