├── .gitignore ├── 3rdparty ├── bgfx │ ├── bin │ │ ├── shaderc_osx │ │ ├── shaderc_win.exe │ │ ├── texturecDebug_win.exe │ │ ├── texturec_osx │ │ ├── texturec_win.exe │ │ ├── texturev_osx │ │ └── texturev_win.exe │ ├── include │ │ ├── bgfx.h │ │ ├── bgfx_shader.sh │ │ ├── bgfxdefines.h │ │ ├── bgfxplatform.h │ │ └── platform.h │ ├── libs │ │ ├── android_armv7a │ │ │ ├── libbgfxDebug.a │ │ │ ├── libbgfxRelease.a │ │ │ ├── libbimgDebug.a │ │ │ ├── libbimgRelease.a │ │ │ ├── libbxDebug.a │ │ │ └── libbxRelease.a │ │ ├── emscripten │ │ │ ├── libbgfxDebug.a │ │ │ ├── libbgfxRelease.a │ │ │ ├── libbimgDebug.a │ │ │ ├── libbimgRelease.a │ │ │ ├── libbxDebug.a │ │ │ └── libbxRelease.a │ │ ├── ios_arm │ │ │ ├── libbgfxDebug.a │ │ │ ├── libbgfxDebug_32.a │ │ │ ├── libbgfxRelease.a │ │ │ ├── libbgfxRelease_32.a │ │ │ ├── libbimgDebug_32.a │ │ │ ├── libbimgRelease_32.a │ │ │ ├── libbxDebug_32.a │ │ │ └── libbxRelease_32.a │ │ ├── ios_arm64 │ │ │ ├── libbgfxDebug.a │ │ │ ├── libbgfxDebug_64.a │ │ │ ├── libbgfxRelease.a │ │ │ ├── libbgfxRelease_64.a │ │ │ ├── libbimgDebug_64.a │ │ │ ├── libbimgRelease_64.a │ │ │ ├── libbxDebug_64.a │ │ │ └── libbxRelease_64.a │ │ ├── ios_simulator │ │ │ ├── libbgfxDebug.a │ │ │ ├── libbgfxRelease.a │ │ │ ├── libbimgDebug.a │ │ │ ├── libbimgRelease.a │ │ │ ├── libbxDebug.a │ │ │ └── libbxRelease.a │ │ ├── osx_x64 │ │ │ ├── libbgfxDebug.a │ │ │ ├── libbgfxRelease.a │ │ │ ├── libbimgDebug.a │ │ │ ├── libbimgRelease.a │ │ │ ├── libbxDebug.a │ │ │ └── libbxRelease.a │ │ └── vs2015_x64 │ │ │ ├── bgfxDebug.lib │ │ │ ├── bgfxDebug.pdb │ │ │ ├── bgfxRelease.lib │ │ │ ├── bgfxRelease.pdb │ │ │ ├── bimgDebug.lib │ │ │ ├── bimgDebug.pdb │ │ │ ├── bimgRelease.lib │ │ │ ├── bimgRelease.pdb │ │ │ ├── bxDebug.lib │ │ │ ├── bxDebug.pdb │ │ │ ├── bxRelease.lib │ │ │ └── bxRelease.pdb │ └── readme.md ├── bin2c │ ├── bin2c │ └── bin2c.exe ├── entrypoint │ ├── entrypoint.h │ ├── entrypoint_android.c │ ├── entrypoint_config.h │ ├── entrypoint_emscripten.c │ ├── entrypoint_ios.h │ ├── entrypoint_ios.m │ ├── entrypoint_osx.m │ └── entrypoint_win.c ├── fmod │ └── readme.md ├── fontstash │ └── fontstash.h ├── gb │ ├── gb.c │ └── gb_math.h ├── jsmn │ ├── jsmn.c │ └── jsmn.h ├── klib │ └── khash.h ├── libyaml │ ├── include │ │ ├── config.h │ │ └── yaml.h │ └── src │ │ ├── api.c │ │ ├── dumper.c │ │ ├── emitter.c │ │ ├── loader.c │ │ ├── parser.c │ │ ├── reader.c │ │ ├── scanner.c │ │ ├── writer.c │ │ └── yaml_private.h ├── nativefonts │ ├── dwrite_c.h │ ├── nativefonts.h │ ├── nativefonts_coretext.c │ └── nativefonts_dwrite.cpp ├── spine-c │ ├── LICENSE │ ├── README.md │ ├── include │ │ └── spine │ │ │ ├── Animation.h │ │ │ ├── AnimationState.h │ │ │ ├── AnimationStateData.h │ │ │ ├── Atlas.h │ │ │ ├── AtlasAttachmentLoader.h │ │ │ ├── Attachment.h │ │ │ ├── AttachmentLoader.h │ │ │ ├── Bone.h │ │ │ ├── BoneData.h │ │ │ ├── BoundingBoxAttachment.h │ │ │ ├── Event.h │ │ │ ├── EventData.h │ │ │ ├── IkConstraint.h │ │ │ ├── IkConstraintData.h │ │ │ ├── MeshAttachment.h │ │ │ ├── PathAttachment.h │ │ │ ├── PathConstraint.h │ │ │ ├── PathConstraintData.h │ │ │ ├── RegionAttachment.h │ │ │ ├── Skeleton.h │ │ │ ├── SkeletonBinary.h │ │ │ ├── SkeletonBounds.h │ │ │ ├── SkeletonData.h │ │ │ ├── SkeletonJson.h │ │ │ ├── Skin.h │ │ │ ├── Slot.h │ │ │ ├── SlotData.h │ │ │ ├── TransformConstraint.h │ │ │ ├── TransformConstraintData.h │ │ │ ├── VertexAttachment.h │ │ │ ├── extension.h │ │ │ └── spine.h │ └── src │ │ └── spine │ │ ├── Animation.c │ │ ├── AnimationState.c │ │ ├── AnimationStateData.c │ │ ├── Atlas.c │ │ ├── AtlasAttachmentLoader.c │ │ ├── Attachment.c │ │ ├── AttachmentLoader.c │ │ ├── Bone.c │ │ ├── BoneData.c │ │ ├── BoundingBoxAttachment.c │ │ ├── Event.c │ │ ├── EventData.c │ │ ├── IkConstraint.c │ │ ├── IkConstraintData.c │ │ ├── Json.c │ │ ├── Json.h │ │ ├── MeshAttachment.c │ │ ├── PathAttachment.c │ │ ├── PathConstraint.c │ │ ├── PathConstraintData.c │ │ ├── RegionAttachment.c │ │ ├── Skeleton.c │ │ ├── SkeletonBinary.c │ │ ├── SkeletonBounds.c │ │ ├── SkeletonData.c │ │ ├── SkeletonJson.c │ │ ├── Skin.c │ │ ├── Slot.c │ │ ├── SlotData.c │ │ ├── TransformConstraint.c │ │ ├── TransformConstraintData.c │ │ ├── VertexAttachment.c │ │ ├── extension.c │ │ └── kvec.h ├── stb │ ├── stb.c │ ├── stb_image.h │ ├── stb_image_write.h │ ├── stb_rect_pack.h │ └── stb_truetype.h ├── tinycthread │ ├── tinycthread.c │ └── tinycthread.h └── tlsf │ ├── tlsf.c │ └── tlsf.h ├── CMakeLists.txt ├── examples └── 00-helloworld │ └── main.c ├── license ├── readme.md ├── src ├── _missing_texture.png ├── buttons.c ├── buttons.h ├── filesystem.c ├── filesystem.h ├── filesystem_android.c ├── filesystem_ios.m ├── helpers │ ├── dict.c │ ├── dict.h │ ├── khash_uuid.h │ ├── pool.h │ ├── portable.c │ ├── portable.h │ ├── pstrstream.c │ └── pstrstream.h ├── physics.c ├── physics.h ├── physics_debug.c ├── physics_debug.h ├── render.c ├── render.h ├── render_9slice.c ├── render_9slice.h ├── render_batch.c ├── render_batch.h ├── render_text.c ├── render_text.h ├── scene.c ├── scene.h ├── scrollview.c ├── scrollview.h ├── shaders │ ├── tex_color.fs │ ├── tex_color.vs │ └── varying.def.sc ├── sound.c ├── sound.h ├── spine.c ├── spine.h ├── transforms.c ├── transforms.h ├── window.c └── window.h └── tools ├── emscripten-template └── index.html ├── localization_csv_to_c.py ├── requirements.txt └── slice.py /.gitignore: -------------------------------------------------------------------------------- 1 | src/shaders/*.h 2 | src/_missing_texture.ktx 3 | src/_missing_texture.h 4 | .build/ 5 | -------------------------------------------------------------------------------- /3rdparty/bgfx/bin/shaderc_osx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/bin/shaderc_osx -------------------------------------------------------------------------------- /3rdparty/bgfx/bin/shaderc_win.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/bin/shaderc_win.exe -------------------------------------------------------------------------------- /3rdparty/bgfx/bin/texturecDebug_win.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/bin/texturecDebug_win.exe -------------------------------------------------------------------------------- /3rdparty/bgfx/bin/texturec_osx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/bin/texturec_osx -------------------------------------------------------------------------------- /3rdparty/bgfx/bin/texturec_win.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/bin/texturec_win.exe -------------------------------------------------------------------------------- /3rdparty/bgfx/bin/texturev_osx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/bin/texturev_osx -------------------------------------------------------------------------------- /3rdparty/bgfx/bin/texturev_win.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/bin/texturev_win.exe -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/android_armv7a/libbgfxDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/android_armv7a/libbgfxDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/android_armv7a/libbgfxRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/android_armv7a/libbgfxRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/android_armv7a/libbimgDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/android_armv7a/libbimgDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/android_armv7a/libbimgRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/android_armv7a/libbimgRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/android_armv7a/libbxDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/android_armv7a/libbxDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/android_armv7a/libbxRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/android_armv7a/libbxRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/emscripten/libbgfxDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/emscripten/libbgfxDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/emscripten/libbgfxRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/emscripten/libbgfxRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/emscripten/libbimgDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/emscripten/libbimgDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/emscripten/libbimgRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/emscripten/libbimgRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/emscripten/libbxDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/emscripten/libbxDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/emscripten/libbxRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/emscripten/libbxRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm/libbgfxDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm/libbgfxDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm/libbgfxDebug_32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm/libbgfxDebug_32.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm/libbgfxRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm/libbgfxRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm/libbgfxRelease_32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm/libbgfxRelease_32.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm/libbimgDebug_32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm/libbimgDebug_32.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm/libbimgRelease_32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm/libbimgRelease_32.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm/libbxDebug_32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm/libbxDebug_32.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm/libbxRelease_32.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm/libbxRelease_32.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm64/libbgfxDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm64/libbgfxDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm64/libbgfxDebug_64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm64/libbgfxDebug_64.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm64/libbgfxRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm64/libbgfxRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm64/libbgfxRelease_64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm64/libbgfxRelease_64.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm64/libbimgDebug_64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm64/libbimgDebug_64.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm64/libbimgRelease_64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm64/libbimgRelease_64.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm64/libbxDebug_64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm64/libbxDebug_64.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_arm64/libbxRelease_64.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_arm64/libbxRelease_64.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_simulator/libbgfxDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_simulator/libbgfxDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_simulator/libbgfxRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_simulator/libbgfxRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_simulator/libbimgDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_simulator/libbimgDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_simulator/libbimgRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_simulator/libbimgRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_simulator/libbxDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_simulator/libbxDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/ios_simulator/libbxRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/ios_simulator/libbxRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/osx_x64/libbgfxDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/osx_x64/libbgfxDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/osx_x64/libbgfxRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/osx_x64/libbgfxRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/osx_x64/libbimgDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/osx_x64/libbimgDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/osx_x64/libbimgRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/osx_x64/libbimgRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/osx_x64/libbxDebug.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/osx_x64/libbxDebug.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/osx_x64/libbxRelease.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/osx_x64/libbxRelease.a -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bgfxDebug.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bgfxDebug.lib -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bgfxDebug.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bgfxDebug.pdb -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bgfxRelease.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bgfxRelease.lib -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bgfxRelease.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bgfxRelease.pdb -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bimgDebug.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bimgDebug.lib -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bimgDebug.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bimgDebug.pdb -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bimgRelease.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bimgRelease.lib -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bimgRelease.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bimgRelease.pdb -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bxDebug.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bxDebug.lib -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bxDebug.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bxDebug.pdb -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bxRelease.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bxRelease.lib -------------------------------------------------------------------------------- /3rdparty/bgfx/libs/vs2015_x64/bxRelease.pdb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bgfx/libs/vs2015_x64/bxRelease.pdb -------------------------------------------------------------------------------- /3rdparty/bgfx/readme.md: -------------------------------------------------------------------------------- 1 | # BGFX 2 | 3 | We use a prebuilt libs here: 4 | 5 | - bgfx commit `f52fbccb2fb557dee98102848e8a19c3b70a25fe` 6 | - bx commit `462a5969c22a7294cc865805dcdcae5d37428537` 7 | - bimg commit `1117bb0d003d6b80558a88ff457a7ed471b87216` 8 | 9 | We have minor changes in headers to put everything into one include folder because we only need C99 headers. -------------------------------------------------------------------------------- /3rdparty/bin2c/bin2c.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/3rdparty/bin2c/bin2c.exe -------------------------------------------------------------------------------- /3rdparty/entrypoint/entrypoint_config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // configuration for entrypoint lib 4 | 5 | // ----------------------------------------------------------------------------- 6 | // general 7 | 8 | #define ENTRYPOINT_PROVIDE_TIME 9 | #define ENTRYPOINT_PROVIDE_LOG 10 | #define ENTRYPOINT_PROVIDE_INPUT 11 | 12 | // ----------------------------------------------------------------------------- 13 | // detailed configs 14 | #define ENTRYPOINT_MAX_MULTITOUCH 16 15 | 16 | // ----------------------------------------------------------------------------- 17 | // Windows 18 | 19 | // adds an additional linker flags to use windows subsystem, aka don't create console window 20 | //#define ENTRYPOINT_WINDOWS_SUBSYSTEM 21 | 22 | // forces WinMain 23 | //#define ENTRYPOINT_WINDOWS_WINMAIN 24 | 25 | // if we use WinMain we need Shell32.lib and calloc to get argc/argv, disable this if you don't need them 26 | //#define ENTRYPOINT_WINDOWS_NEED_ARGS 27 | 28 | // add stuff to the linker options, disable this if you plan to provide all flags by yourself 29 | #define ENTRYPOINT_WINDOWS_LINKER_OPT 30 | 31 | // this will be called before following parameters are used 32 | // you might want to use this to read some config file or something 33 | #define ENTRYPOINT_WINDOWS_PREPARE_PARAMS {} 34 | #define ENTRYPOINT_WINDOWS_CLASS L"entrypoint" 35 | #define ENTRYPOINT_WINDOWS_TITLE L"test window" 36 | #define ENTRYPOINT_WINDOWS_WIDTH 1024 37 | #define ENTRYPOINT_WINDOWS_HEIGHT 768 38 | 39 | #define ENTRYPOINT_WINDOWS_MIN_WIDTH 128 40 | #define ENTRYPOINT_WINDOWS_MIN_HEIGHT 128 41 | 42 | // usually not needed for games, but good option for non games to fill empty areas during resize 43 | //#define ENTRYPOINT_WINDOWS_DO_WMPAINT 44 | 45 | // ----------------------------------------------------------------------------- 46 | // macOS 47 | 48 | #define ENTRYPOINT_MACOS_PREPARE_PARAMS {} 49 | #define ENTRYPOINT_MACOS_TITLE @"test window" 50 | #define ENTRYPOINT_MACOS_WIDTH 1024 51 | #define ENTRYPOINT_MACOS_HEIGHT 768 52 | #define ENTRYPOINT_MACOS_START_X 20 53 | #define ENTRYPOINT_MACOS_START_Y 20 54 | 55 | // disable this if you don't want retina support 56 | //#define ENTRYPOINT_MACOS_RETINA 57 | 58 | // ----------------------------------------------------------------------------- 59 | // iOS 60 | 61 | // if you wish we can provide an app delegate for you, it will have UIWindow->UIViewController->UIView with your game 62 | // and the name of app delegate class will be EntryPointAppDelegate 63 | // but please remember that you will need to provide either launch image or launch storyboard to get proper size viewport 64 | // otherwise iOS will think like this is iPhone4 app and will limit your screensize 65 | #define ENTRYPOINT_IOS_APPDELEGATE 66 | 67 | // if you would like we can define a main for you, just please provide us with your app delegate class name as a string 68 | #define ENTRYPOINT_IOS_MAIN 69 | #define ENTRYPOINT_IOS_MAIN_APPDELEGATE_CLASSNAME @"EntryPointAppDelegate" 70 | 71 | // disable this if you don't want retina support 72 | #define ENTRYPOINT_IOS_RETINA 73 | 74 | // disable this if you don't need accelerometer 75 | // WARNING: Remember to fill NSMotionUsageDescription in your Info.plist! 76 | #define ENTRYPOINT_IOS_CM_ACCELEROMETER 77 | #define ENTRYPOINT_IOS_CM_ACCELEROMETER_FREQ 60 // in Hertz 78 | 79 | // ----------------------------------------------------------------------------- 80 | // Android 81 | 82 | #define ENTRYPOINT_ANDROID_PREPARE_PARAMS {} 83 | 84 | // this is used in ep_log to provide a correct log tag 85 | #define ENTRYPOINT_ANDROID_LOG_TAG "EntryPoint" 86 | 87 | // ----------------------------------------------------------------------------- 88 | -------------------------------------------------------------------------------- /3rdparty/entrypoint/entrypoint_ios.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // iOS is a bit different here 4 | // 5 | // indeed we could go SDL way and create everything for you 6 | // but this is exactly why SDL is so bad on iOS - there is more to an app than just OpenGL view 7 | // 8 | // instead what we provide here is a UIView that you can use inside your storyboard/xib/code 9 | // this should allow more easy integration of your code with iOS specific parts like ads/popups/etc 10 | // 11 | // also please note, only one view instance should be used (which is a most common scenario anyway) 12 | 13 | #import 14 | #import 15 | #include "entrypoint_config.h" 16 | 17 | #if defined(ENTRYPOINT_IOS_CM_ACCELEROMETER) 18 | #define ENTRYPOINT_IOS_CM 19 | #endif 20 | 21 | @interface EntryPointView : UIView 22 | 23 | #ifdef ENTRYPOINT_IOS_CM 24 | @property(nonatomic, strong) CMMotionManager * motionManager; 25 | #endif 26 | 27 | @end 28 | 29 | #ifdef ENTRYPOINT_IOS_APPDELEGATE 30 | 31 | @interface EntryPointViewController : UIViewController 32 | @property (strong, nonatomic) EntryPointView * view; 33 | @end 34 | 35 | @interface EntryPointAppDelegate : UIResponder 36 | @property (strong, nonatomic) UIWindow * window; 37 | @end 38 | 39 | #endif 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | // call this functions from app delegate or whatever other place where you decide when your game should be running or not 46 | void ep_anim_start(); 47 | void ep_anim_stop(); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | -------------------------------------------------------------------------------- /3rdparty/fmod/readme.md: -------------------------------------------------------------------------------- 1 | If you want FMOD support you need to put files like this: 2 | 3 | fmod\bin\fmod64.dll 4 | fmod\bin\fmodL64.dll 5 | fmod\bin\fmodstudio64.dll 6 | fmod\bin\fmodstudioL64.dll 7 | fmod\include\fmod.h 8 | fmod\include\fmod_codec.h 9 | fmod\include\fmod_common.h 10 | fmod\include\fmod_dsp.h 11 | fmod\include\fmod_dsp_effects.h 12 | fmod\include\fmod_errors.h 13 | fmod\include\fmod_output.h 14 | fmod\include\fmod_studio.h 15 | fmod\include\fmod_studio_common.h 16 | fmod\libs\android\fmod.jar 17 | fmod\libs\android\arm64-v8a\libfmod.so 18 | fmod\libs\android\arm64-v8a\libfmodstudio.so 19 | fmod\libs\android\armeabi\libfmod.so 20 | fmod\libs\android\armeabi\libfmodstudio.so 21 | fmod\libs\android\armeabi-v7a\libfmod.so 22 | fmod\libs\android\armeabi-v7a\libfmodstudio.so 23 | fmod\libs\android\x86\libfmod.so 24 | fmod\libs\android\x86\libfmodstudio.so 25 | fmod\libs\ios\libfmodL_iphoneos.a 26 | fmod\libs\ios\libfmodstudioL_iphoneos.a 27 | fmod\libs\ios\libfmodstudio_iphoneos.a 28 | fmod\libs\ios\libfmod_iphoneos.a 29 | fmod\libs\osx\libfmod.dylib 30 | fmod\libs\osx\libfmodL.dylib 31 | fmod\libs\osx\libfmodstudio.dylib 32 | fmod\libs\osx\libfmodstudioL.dylib 33 | fmod\libs\vs2015_x64\fmod64_vc.lib 34 | fmod\libs\vs2015_x64\fmodL64_vc.lib 35 | fmod\libs\vs2015_x64\fmodstudio64_vc.lib 36 | fmod\libs\vs2015_x64\fmodstudioL64_vc.lib 37 | 38 | -------------------------------------------------------------------------------- /3rdparty/gb/gb.c: -------------------------------------------------------------------------------- 1 | 2 | #define GB_MATH_IMPLEMENTATION 3 | #include 4 | -------------------------------------------------------------------------------- /3rdparty/jsmn/jsmn.h: -------------------------------------------------------------------------------- 1 | #ifndef __JSMN_H_ 2 | #define __JSMN_H_ 3 | 4 | #include 5 | 6 | #define JSMN_STRICT 7 | 8 | #ifdef __cplusplus 9 | extern "C" { 10 | #endif 11 | 12 | /** 13 | * JSON type identifier. Basic types are: 14 | * o Object 15 | * o Array 16 | * o String 17 | * o Other primitive: number, boolean (true/false) or null 18 | */ 19 | typedef enum { 20 | JSMN_UNDEFINED = 0, 21 | JSMN_OBJECT = 1, 22 | JSMN_ARRAY = 2, 23 | JSMN_STRING = 3, 24 | JSMN_PRIMITIVE = 4 25 | } jsmntype_t; 26 | 27 | enum jsmnerr { 28 | /* Not enough tokens were provided */ 29 | JSMN_ERROR_NOMEM = -1, 30 | /* Invalid character inside JSON string */ 31 | JSMN_ERROR_INVAL = -2, 32 | /* The string is not a full JSON packet, more bytes expected */ 33 | JSMN_ERROR_PART = -3 34 | }; 35 | 36 | /** 37 | * JSON token description. 38 | * @param type type (object, array, string etc.) 39 | * @param start start position in JSON data string 40 | * @param end end position in JSON data string 41 | */ 42 | typedef struct { 43 | jsmntype_t type; 44 | int start; 45 | int end; 46 | int size; 47 | #ifdef JSMN_PARENT_LINKS 48 | int parent; 49 | #endif 50 | } jsmntok_t; 51 | 52 | /** 53 | * JSON parser. Contains an array of token blocks available. Also stores 54 | * the string being parsed now and current position in that string 55 | */ 56 | typedef struct { 57 | unsigned int pos; /* offset in the JSON string */ 58 | unsigned int toknext; /* next token to allocate */ 59 | int toksuper; /* superior token node, e.g parent object or array */ 60 | } jsmn_parser; 61 | 62 | /** 63 | * Create JSON parser over an array of tokens 64 | */ 65 | void jsmn_init(jsmn_parser *parser); 66 | 67 | /** 68 | * Run JSON parser. It parses a JSON data string into and array of tokens, each describing 69 | * a single JSON object. 70 | */ 71 | int jsmn_parse(jsmn_parser *parser, const char *js, size_t len, 72 | jsmntok_t *tokens, unsigned int num_tokens); 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* __JSMN_H_ */ 79 | -------------------------------------------------------------------------------- /3rdparty/libyaml/include/config.h: -------------------------------------------------------------------------------- 1 | #define YAML_VERSION_MAJOR 0 2 | #define YAML_VERSION_MINOR 1 3 | #define YAML_VERSION_PATCH 5 4 | #define YAML_VERSION_STRING "0.1.5" 5 | -------------------------------------------------------------------------------- /3rdparty/nativefonts/nativefonts.h: -------------------------------------------------------------------------------- 1 | // nativefonts 2 | // MIT license 3 | // 4 | // codestyle : 5 | // - C99 6 | // - 80 columns max 7 | // - tab = 4 spaces 8 | // - snake_case 9 | 10 | #pragma once 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | #ifdef __cplusplus 17 | extern "C" { 18 | #endif 19 | 20 | // --------------------------------------------------------------- configuration 21 | 22 | // todo proper config 23 | #ifdef _WIN32 24 | #define NF_PLATFORM_DWRITE 25 | #endif 26 | #ifdef __APPLE__ 27 | #define NF_PLATFORM_CORETEXT 28 | #endif 29 | 30 | #ifndef NF_MAX_WIDTH 31 | #define NF_MAX_WIDTH 2048 32 | #endif 33 | 34 | #ifndef NF_MAX_HEIGHT 35 | #define NF_MAX_HEIGHT 2048 36 | #endif 37 | 38 | #ifndef NF_ERROR 39 | #define NF_ERROR(msg, ...) fprintf(stderr, msg, __VA_ARGS__) 40 | #endif 41 | 42 | // ------------------------------------------------------------- font parameters 43 | typedef enum { 44 | NF_WEIGHT_NORMAL = 0, 45 | NF_WEIGHT_BOLD, 46 | NF_WEIGHT_LIGHT, 47 | NF_WEIGHT_MAX = 0xff 48 | } nf_font_weight_t; 49 | 50 | typedef enum { 51 | NF_STYLE_NORMAL = 0, 52 | NF_STYLE_OBLIQUE, 53 | NF_STYLE_ITALIC, 54 | NF_STYLE_MAX = 0xff 55 | } nf_font_style_t; 56 | 57 | typedef enum { 58 | NF_STRETCH_NORMAL = 0, 59 | NF_STRETCH_EXPANDED, 60 | NF_STRETCH_CONDENSED, 61 | NF_STRETCH_MAX = 0xff 62 | } nf_font_stretch_t; 63 | 64 | typedef struct { 65 | float size_in_pt; 66 | nf_font_weight_t weight; 67 | nf_font_style_t style; 68 | nf_font_stretch_t stretch; 69 | } nf_font_params_t; 70 | 71 | // ---------------------------------------------------------- system information 72 | typedef enum { 73 | NF_BITMAP_B8G8R8A8_UNORM_PMA = 0, 74 | } nf_bitmap_t; 75 | 76 | typedef struct { 77 | nf_bitmap_t bitmap; 78 | uint16_t max_width; 79 | uint16_t max_height; 80 | float ppi_x; 81 | float ppi_y; 82 | } nf_system_info_t; 83 | 84 | // --------------------------------------------------------------- text features 85 | typedef enum { 86 | // emphasis 87 | NF_FEATURE_BOLD = 0, 88 | NF_FEATURE_UNDERLINE, 89 | NF_FEATURE_ITALIC, 90 | 91 | // TODO more effects 92 | 93 | // wrapping, by default text is wrapped 94 | NF_FEATURE_WRAP, 95 | NF_FEATURE_NO_WRAP, 96 | 97 | // align features are applied to whole text 98 | // defaults are left, left 99 | NF_FEATURE_ALIGN_LEFT, 100 | NF_FEATURE_ALIGN_CENTER, 101 | NF_FEATURE_ALIGN_RIGHT, 102 | NF_FEATURE_ALIGN_JUSTIFIED, 103 | NF_FEATURE_ALIGN_PARAGRAPH_LEFT, 104 | NF_FEATURE_ALIGN_PARAGRAPH_CENTER, 105 | NF_FEATURE_ALIGN_PARAGRAPH_RIGHT, 106 | 107 | // antialiasing is applied to whole text 108 | NF_FEATURE_AA_DISABLED, 109 | // default on Windows, greyscale uses BGRA as premultiplied alpha 110 | NF_FEATURE_AA_WIN_GREYSCALE, 111 | // cleartype will not use alpha channel, so treat bitmap as BGR 112 | NF_FEATURE_AA_WIN_CLEARTYPE, 113 | 114 | // ppi is applied to whole text 115 | // default is system defined, see system info 116 | NF_FEATURE_PPI, 117 | 118 | // color is applied to whole text (TODO?) 119 | NF_FEATURE_COLOR_BG, // default is 0,0,0,0 120 | NF_FEATURE_COLOR_TEXT, // default is 1,1,1,1 121 | 122 | NF_FEATURE_MAX = 0xff 123 | } nf_feature_type_t; 124 | 125 | typedef struct { 126 | nf_feature_type_t type; 127 | union 128 | { 129 | struct { size_t start, end; } range; 130 | struct { float r, g, b, a; } color; 131 | struct { float x, y; } ppi; 132 | }; 133 | } nf_feature_t; 134 | 135 | // ---------------------------------------------------------------- bounding box 136 | 137 | typedef struct { 138 | uint16_t x; 139 | uint16_t y; 140 | uint16_t w; 141 | uint16_t h; 142 | } nf_aabb_t; 143 | 144 | // ------------------------------------------------------------------- functions 145 | typedef uintptr_t nf_font_t; 146 | 147 | nf_system_info_t nf_system_info(); 148 | 149 | // returns 0 on error 150 | nf_font_t nf_font(const char * font_name, nf_font_params_t params); 151 | void nf_free(nf_font_t font); 152 | 153 | // return < 0 on error 154 | int nf_print( 155 | void * bitmap, uint16_t w, uint16_t h, 156 | nf_font_t font, 157 | nf_feature_t * features, size_t features_count, 158 | nf_aabb_t * result_rect, 159 | const char * text); 160 | 161 | #ifdef __cplusplus 162 | } 163 | #endif 164 | -------------------------------------------------------------------------------- /3rdparty/spine-c/LICENSE: -------------------------------------------------------------------------------- 1 | Spine Runtimes Software License 2 | Version 2.3 3 | 4 | Copyright (c) 2013-2015, Esoteric Software 5 | All rights reserved. 6 | 7 | You are granted a perpetual, non-exclusive, non-sublicensable and 8 | non-transferable license to use, install, execute and perform the Spine 9 | Runtimes Software (the "Software") and derivative works solely for personal 10 | or internal use. Without the written permission of Esoteric Software (see 11 | Section 2 of the Spine Software License Agreement), you may not (a) modify, 12 | translate, adapt or otherwise create derivative works, improvements of the 13 | Software or develop new applications using the Software or (b) remove, 14 | delete, alter or obscure any trademarks or any copyright, trademark, patent 15 | or other intellectual property or proprietary rights notices on or in the 16 | Software, including any copy thereof. Redistributions in binary or source 17 | form must include this license and terms. 18 | 19 | THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 20 | IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 21 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 22 | EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 24 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 25 | OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 26 | WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 27 | OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 28 | ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /3rdparty/spine-c/README.md: -------------------------------------------------------------------------------- 1 | # spine-c 2 | 3 | The spine-c runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using ANSI C. It does not perform rendering but can be extended to enable Spine animations for other C-based projects, including C++ or Objective-C projects. 4 | 5 | For a pure C++ API, you may consider the third party Spine runtime [Chobolabs/spine-cpp](https://github.com/Chobolabs/spine-cpp). 6 | 7 | ## Licensing 8 | 9 | This Spine Runtime may only be used for personal or internal use, typically to evaluate Spine before purchasing. If you would like to incorporate a Spine Runtime into your applications, distribute software containing a Spine Runtime, or modify a Spine Runtime, then you will need a valid [Spine license](https://esotericsoftware.com/spine-purchase). Please see the [Spine Runtimes Software License](https://github.com/EsotericSoftware/spine-runtimes/blob/master/LICENSE) for detailed information. 10 | 11 | The Spine Runtimes are developed with the intent to be used with data exported from Spine. By purchasing Spine, `Section 2` of the [Spine Software License](https://esotericsoftware.com/files/license.txt) grants the right to create and distribute derivative works of the Spine Runtimes. 12 | 13 | ## Spine version 14 | 15 | spine-c works with data exported from the latest version of Spine. 16 | 17 | spine-c supports all Spine features. 18 | 19 | ## Setup 20 | 21 | 1. Download the Spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it [as a zip](https://github.com/EsotericSoftware/spine-runtimes/archive/master.zip). 22 | 1. Open the `spine-c.sln` Visual C++ 2010 Express project file. For other IDEs, you will need to create a new project and import the source. 23 | 24 | Alternatively, the contents of the `spine-c/src` and `spine-c/include` directories can be copied into your project. Be sure your header search is configured to find the contents of the `spine-c/include` directory. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files. 25 | 26 | If `SPINE_SHORT_NAMES` is defined, the `sp` prefix for all structs and functions is optional. Only use this if the spine-c names won't cause a conflict. 27 | 28 | ## Extension 29 | 30 | Extending spine-c requires implementing three methods: 31 | 32 | - `_spAtlasPage_createTexture` Loads a texture and stores it and its size in the `void* rendererObject`, `width` and `height` fields of an `spAtlasPage` struct. 33 | - `_spAtlasPage_disposeTexture` Disposes of a texture loaded with `_spAtlasPage_createTexture`. 34 | - `_spUtil_readFile` Reads a file. If this doesn't need to be customized, `_readFile` is provided which reads a file using `fopen`. 35 | 36 | With these implemented, the spine-c API can then be used to load Spine animation data. Rendering is done by enumerating the slots for a skeleton and rendering the attachment for each slot. Each attachment has a `rendererObject` field that is set when the attachment is loaded. 37 | 38 | For example, `AtlasAttachmentLoader` is typically used to load attachments when using a Spine texture atlas. When `AtlasAttachmentLoader` loads a `RegionAttachment`, the attachment's `void* rendererObject` is set to an `AtlasRegion`. Rendering code can then obtain the `AtlasRegion` from the attachment, get the `AtlasPage` it belongs to, and get the page's `void* rendererObject`. This is the renderer specific texture object set by `_spAtlasPage_createTexture`. Attachment loading can be [customized](http://esotericsoftware.com/spine-using-runtimes/#attachmentloader) if not using `AtlasAttachmentLoader` or to provider different renderer specific data. 39 | 40 | [spine-sfml](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml/src/spine/spine-sfml.cpp#L39) serves as a simple example of extending spine-c. 41 | 42 | spine-c uses an OOP style of programming where each "class" is made up of a struct and a number of functions prefixed with the struct name. More detals about how this works are available in [extension.h](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-c/include/spine/extension.h#L2). This mechanism allows you to provide your own implementations for `spAttachmentLoader`, `spAttachment` and `spTimeline`, if necessary. 43 | 44 | ## Runtimes extending spine-c 45 | 46 | - [spine-cocos2d-iphone](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2d-iphone) 47 | - [spine-cocos2dx](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-cocos2dx) 48 | - [spine-sfml](https://github.com/EsotericSoftware/spine-runtimes/blob/master/spine-sfml) 49 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/AnimationStateData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_ANIMATIONSTATEDATA_H_ 33 | #define SPINE_ANIMATIONSTATEDATA_H_ 34 | 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | typedef struct spAnimationStateData { 43 | spSkeletonData* const skeletonData; 44 | float defaultMix; 45 | const void* const entries; 46 | 47 | #ifdef __cplusplus 48 | spAnimationStateData() : 49 | skeletonData(0), 50 | defaultMix(0), 51 | entries(0) { 52 | } 53 | #endif 54 | } spAnimationStateData; 55 | 56 | spAnimationStateData* spAnimationStateData_create (spSkeletonData* skeletonData); 57 | void spAnimationStateData_dispose (spAnimationStateData* self); 58 | 59 | void spAnimationStateData_setMixByName (spAnimationStateData* self, const char* fromName, const char* toName, float duration); 60 | void spAnimationStateData_setMix (spAnimationStateData* self, spAnimation* from, spAnimation* to, float duration); 61 | /* Returns 0 if there is no mixing between the animations. */ 62 | float spAnimationStateData_getMix (spAnimationStateData* self, spAnimation* from, spAnimation* to); 63 | 64 | #ifdef SPINE_SHORT_NAMES 65 | typedef spAnimationStateData AnimationStateData; 66 | #define AnimationStateData_create(...) spAnimationStateData_create(__VA_ARGS__) 67 | #define AnimationStateData_dispose(...) spAnimationStateData_dispose(__VA_ARGS__) 68 | #define AnimationStateData_setMixByName(...) spAnimationStateData_setMixByName(__VA_ARGS__) 69 | #define AnimationStateData_setMix(...) spAnimationStateData_setMix(__VA_ARGS__) 70 | #define AnimationStateData_getMix(...) spAnimationStateData_getMix(__VA_ARGS__) 71 | #endif 72 | 73 | #ifdef __cplusplus 74 | } 75 | #endif 76 | 77 | #endif /* SPINE_ANIMATIONSTATEDATA_H_ */ 78 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/AtlasAttachmentLoader.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_ATLASATTACHMENTLOADER_H_ 33 | #define SPINE_ATLASATTACHMENTLOADER_H_ 34 | 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | typedef struct spAtlasAttachmentLoader { 43 | spAttachmentLoader super; 44 | spAtlas* atlas; 45 | } spAtlasAttachmentLoader; 46 | 47 | spAtlasAttachmentLoader* spAtlasAttachmentLoader_create (spAtlas* atlas); 48 | 49 | #ifdef SPINE_SHORT_NAMES 50 | typedef spAtlasAttachmentLoader AtlasAttachmentLoader; 51 | #define AtlasAttachmentLoader_create(...) spAtlasAttachmentLoader_create(__VA_ARGS__) 52 | #endif 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif /* SPINE_ATLASATTACHMENTLOADER_H_ */ 59 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/Attachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_ATTACHMENT_H_ 33 | #define SPINE_ATTACHMENT_H_ 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | struct spAttachmentLoader; 40 | 41 | typedef enum { 42 | SP_ATTACHMENT_REGION, 43 | SP_ATTACHMENT_BOUNDING_BOX, 44 | SP_ATTACHMENT_MESH, 45 | SP_ATTACHMENT_LINKED_MESH, 46 | SP_ATTACHMENT_PATH 47 | } spAttachmentType; 48 | 49 | typedef struct spAttachment { 50 | const char* const name; 51 | const spAttachmentType type; 52 | const void* const vtable; 53 | struct spAttachmentLoader* attachmentLoader; 54 | 55 | #ifdef __cplusplus 56 | spAttachment() : 57 | name(0), 58 | type(SP_ATTACHMENT_REGION), 59 | vtable(0) { 60 | } 61 | #endif 62 | } spAttachment; 63 | 64 | void spAttachment_dispose (spAttachment* self); 65 | 66 | #ifdef SPINE_SHORT_NAMES 67 | typedef spAttachmentType AttachmentType; 68 | #define ATTACHMENT_REGION SP_ATTACHMENT_REGION 69 | #define ATTACHMENT_BOUNDING_BOX SP_ATTACHMENT_BOUNDING_BOX 70 | #define ATTACHMENT_MESH SP_ATTACHMENT_MESH 71 | #define ATTACHMENT_LINKED_MESH SP_ATTACHMENT_LINKED_MESH 72 | typedef spAttachment Attachment; 73 | #define Attachment_dispose(...) spAttachment_dispose(__VA_ARGS__) 74 | #endif 75 | 76 | #ifdef __cplusplus 77 | } 78 | #endif 79 | 80 | #endif /* SPINE_ATTACHMENT_H_ */ 81 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/AttachmentLoader.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_ATTACHMENTLOADER_H_ 33 | #define SPINE_ATTACHMENTLOADER_H_ 34 | 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | typedef struct spAttachmentLoader { 43 | const char* error1; 44 | const char* error2; 45 | 46 | const void* const vtable; 47 | #ifdef __cplusplus 48 | spAttachmentLoader () : 49 | error1(0), 50 | error2(0), 51 | vtable(0) { 52 | } 53 | #endif 54 | } spAttachmentLoader; 55 | 56 | void spAttachmentLoader_dispose (spAttachmentLoader* self); 57 | 58 | /* Called to create each attachment. Returns 0 to not load an attachment. If 0 is returned and _spAttachmentLoader_setError was 59 | * called, an error occurred. */ 60 | spAttachment* spAttachmentLoader_createAttachment (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name, 61 | const char* path); 62 | /* Called after the attachment has been fully configured. */ 63 | void spAttachmentLoader_configureAttachment (spAttachmentLoader* self, spAttachment* attachment); 64 | /* Called just before the attachment is disposed. This can release allocations made in spAttachmentLoader_configureAttachment. */ 65 | void spAttachmentLoader_disposeAttachment (spAttachmentLoader* self, spAttachment* attachment); 66 | 67 | #ifdef SPINE_SHORT_NAMES 68 | typedef spAttachmentLoader AttachmentLoader; 69 | #define AttachmentLoader_dispose(...) spAttachmentLoader_dispose(__VA_ARGS__) 70 | #define AttachmentLoader_createAttachment(...) spAttachmentLoader_createAttachment(__VA_ARGS__) 71 | #define AttachmentLoader_configureAttachment(...) spAttachmentLoader_configureAttachment(__VA_ARGS__) 72 | #define AttachmentLoader_disposeAttachment(...) spAttachmentLoader_disposeAttachment(__VA_ARGS__) 73 | #endif 74 | 75 | #ifdef __cplusplus 76 | } 77 | #endif 78 | 79 | #endif /* SPINE_ATTACHMENTLOADER_H_ */ 80 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/BoneData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_BONEDATA_H_ 33 | #define SPINE_BONEDATA_H_ 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | typedef struct spBoneData spBoneData; 40 | struct spBoneData { 41 | const int index; 42 | const char* const name; 43 | spBoneData* const parent; 44 | float length; 45 | float x, y, rotation, scaleX, scaleY, shearX, shearY; 46 | int/*bool*/inheritRotation, inheritScale; 47 | 48 | #ifdef __cplusplus 49 | spBoneData() : 50 | index(0), 51 | name(0), 52 | parent(0), 53 | length(0), 54 | x(0), y(0), 55 | rotation(0), 56 | scaleX(0), scaleY(0), 57 | shearX(0), shearY(0), 58 | inheritRotation(0), inheritScale(0) { 59 | } 60 | #endif 61 | }; 62 | 63 | spBoneData* spBoneData_create (int index, const char* name, spBoneData* parent); 64 | void spBoneData_dispose (spBoneData* self); 65 | 66 | #ifdef SPINE_SHORT_NAMES 67 | typedef spBoneData BoneData; 68 | #define BoneData_create(...) spBoneData_create(__VA_ARGS__) 69 | #define BoneData_dispose(...) spBoneData_dispose(__VA_ARGS__) 70 | #endif 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif /* SPINE_BONEDATA_H_ */ 77 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/BoundingBoxAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_BOUNDINGBOXATTACHMENT_H_ 33 | #define SPINE_BOUNDINGBOXATTACHMENT_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef struct spBoundingBoxAttachment { 45 | spVertexAttachment super; 46 | } spBoundingBoxAttachment; 47 | 48 | spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name); 49 | void spBoundingBoxAttachment_computeWorldVertices (spBoundingBoxAttachment* self, spSlot* slot, float* worldVertices); 50 | 51 | #ifdef SPINE_SHORT_NAMES 52 | typedef spBoundingBoxAttachment BoundingBoxAttachment; 53 | #define BoundingBoxAttachment_create(...) spBoundingBoxAttachment_create(__VA_ARGS__) 54 | #define BoundingBoxAttachment_computeWorldVertices(...) spBoundingBoxAttachment_computeWorldVertices(__VA_ARGS__) 55 | #endif 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* SPINE_BOUNDINGBOXATTACHMENT_H_ */ 62 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/Event.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_EVENT_H_ 33 | #define SPINE_EVENT_H_ 34 | 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef struct spEvent { 42 | spEventData* const data; 43 | float const time; 44 | int intValue; 45 | float floatValue; 46 | const char* stringValue; 47 | 48 | #ifdef __cplusplus 49 | spEvent() : 50 | data(0), 51 | time(0), 52 | intValue(0), 53 | floatValue(0), 54 | stringValue(0) { 55 | } 56 | #endif 57 | } spEvent; 58 | 59 | spEvent* spEvent_create (float time, spEventData* data); 60 | void spEvent_dispose (spEvent* self); 61 | 62 | #ifdef SPINE_SHORT_NAMES 63 | typedef spEvent Event; 64 | #define Event_create(...) spEvent_create(__VA_ARGS__) 65 | #define Event_dispose(...) spEvent_dispose(__VA_ARGS__) 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* SPINE_EVENT_H_ */ 73 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/EventData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_EVENTDATA_H_ 33 | #define SPINE_EVENTDATA_H_ 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | typedef struct spEventData { 40 | const char* const name; 41 | int intValue; 42 | float floatValue; 43 | const char* stringValue; 44 | 45 | #ifdef __cplusplus 46 | spEventData() : 47 | name(0), 48 | intValue(0), 49 | floatValue(0), 50 | stringValue(0) { 51 | } 52 | #endif 53 | } spEventData; 54 | 55 | spEventData* spEventData_create (const char* name); 56 | void spEventData_dispose (spEventData* self); 57 | 58 | #ifdef SPINE_SHORT_NAMES 59 | typedef spEventData EventData; 60 | #define EventData_create(...) spEventData_create(__VA_ARGS__) 61 | #define EventData_dispose(...) spEventData_dispose(__VA_ARGS__) 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* SPINE_EVENTDATA_H_ */ 69 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/IkConstraint.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_IKCONSTRAINT_H_ 33 | #define SPINE_IKCONSTRAINT_H_ 34 | 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | struct spSkeleton; 43 | 44 | typedef struct spIkConstraint { 45 | spIkConstraintData* const data; 46 | 47 | int bonesCount; 48 | spBone** bones; 49 | 50 | spBone* target; 51 | int bendDirection; 52 | float mix; 53 | 54 | int level; 55 | 56 | #ifdef __cplusplus 57 | spIkConstraint() : 58 | data(0), 59 | bonesCount(0), 60 | bones(0), 61 | target(0), 62 | bendDirection(0), 63 | mix(0), 64 | level(0) { 65 | } 66 | #endif 67 | } spIkConstraint; 68 | 69 | spIkConstraint* spIkConstraint_create (spIkConstraintData* data, const struct spSkeleton* skeleton); 70 | void spIkConstraint_dispose (spIkConstraint* self); 71 | 72 | void spIkConstraint_apply (spIkConstraint* self); 73 | 74 | void spIkConstraint_apply1 (spBone* bone, float targetX, float targetY, float alpha); 75 | void spIkConstraint_apply2 (spBone* parent, spBone* child, float targetX, float targetY, int bendDirection, float alpha); 76 | 77 | #ifdef SPINE_SHORT_NAMES 78 | typedef spIkConstraint IkConstraint; 79 | #define IkConstraint_create(...) spIkConstraint_create(__VA_ARGS__) 80 | #define IkConstraint_dispose(...) spIkConstraint_dispose(__VA_ARGS__) 81 | #define IkConstraint_apply(...) spIkConstraint_apply(__VA_ARGS__) 82 | #define IkConstraint_apply1(...) spIkConstraint_apply1(__VA_ARGS__) 83 | #define IkConstraint_apply2(...) spIkConstraint_apply2(__VA_ARGS__) 84 | #endif 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif /* SPINE_IKCONSTRAINT_H_ */ 91 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/IkConstraintData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_IKCONSTRAINTDATA_H_ 33 | #define SPINE_IKCONSTRAINTDATA_H_ 34 | 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef struct spIkConstraintData { 42 | const char* const name; 43 | 44 | int bonesCount; 45 | spBoneData** bones; 46 | 47 | spBoneData* target; 48 | int bendDirection; 49 | float mix; 50 | 51 | #ifdef __cplusplus 52 | spIkConstraintData() : 53 | name(0), 54 | bonesCount(0), 55 | bones(0), 56 | target(0), 57 | bendDirection(0), 58 | mix(0) { 59 | } 60 | #endif 61 | } spIkConstraintData; 62 | 63 | spIkConstraintData* spIkConstraintData_create (const char* name); 64 | void spIkConstraintData_dispose (spIkConstraintData* self); 65 | 66 | #ifdef SPINE_SHORT_NAMES 67 | typedef spIkConstraintData IkConstraintData; 68 | #define IkConstraintData_create(...) spIkConstraintData_create(__VA_ARGS__) 69 | #define IkConstraintData_dispose(...) spIkConstraintData_dispose(__VA_ARGS__) 70 | #endif 71 | 72 | #ifdef __cplusplus 73 | } 74 | #endif 75 | 76 | #endif /* SPINE_IKCONSTRAINTDATA_H_ */ 77 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/MeshAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_MESHATTACHMENT_H_ 33 | #define SPINE_MESHATTACHMENT_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef struct spMeshAttachment spMeshAttachment; 45 | struct spMeshAttachment { 46 | spVertexAttachment super; 47 | 48 | void* rendererObject; 49 | int regionOffsetX, regionOffsetY; /* Pixels stripped from the bottom left, unrotated. */ 50 | int regionWidth, regionHeight; /* Unrotated, stripped pixel size. */ 51 | int regionOriginalWidth, regionOriginalHeight; /* Unrotated, unstripped pixel size. */ 52 | float regionU, regionV, regionU2, regionV2; 53 | int/*bool*/regionRotate; 54 | 55 | const char* path; 56 | 57 | float* regionUVs; 58 | float* uvs; 59 | 60 | int trianglesCount; 61 | unsigned short* triangles; 62 | 63 | float r, g, b, a; 64 | 65 | int hullLength; 66 | 67 | spMeshAttachment* const parentMesh; 68 | int/*bool*/inheritDeform; 69 | 70 | /* Nonessential. */ 71 | int edgesCount; 72 | int* edges; 73 | float width, height; 74 | }; 75 | 76 | spMeshAttachment* spMeshAttachment_create (const char* name); 77 | void spMeshAttachment_updateUVs (spMeshAttachment* self); 78 | void spMeshAttachment_computeWorldVertices (spMeshAttachment* self, spSlot* slot, float* worldVertices); 79 | void spMeshAttachment_setParentMesh (spMeshAttachment* self, spMeshAttachment* parentMesh); 80 | 81 | #ifdef SPINE_SHORT_NAMES 82 | typedef spMeshAttachment MeshAttachment; 83 | #define MeshAttachment_create(...) spMeshAttachment_create(__VA_ARGS__) 84 | #define MeshAttachment_updateUVs(...) spMeshAttachment_updateUVs(__VA_ARGS__) 85 | #define MeshAttachment_computeWorldVertices(...) spMeshAttachment_computeWorldVertices(__VA_ARGS__) 86 | #define MeshAttachment_setParentMesh(...) spMeshAttachment_setParentMesh(__VA_ARGS__) 87 | #endif 88 | 89 | #ifdef __cplusplus 90 | } 91 | #endif 92 | 93 | #endif /* SPINE_MESHATTACHMENT_H_ */ 94 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/PathAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_PATHATTACHMENT_H_ 33 | #define SPINE_PATHATTACHMENT_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef struct spPathAttachment { 45 | spVertexAttachment super; 46 | int lengthsLength; 47 | float* lengths; 48 | int/*bool*/ closed, constantSpeed; 49 | } spPathAttachment; 50 | 51 | spPathAttachment* spPathAttachment_create (const char* name); 52 | void spPathAttachment_computeWorldVertices (spPathAttachment* self, spSlot* slot, float* worldVertices); 53 | void spPathAttachment_computeWorldVertices1 (spPathAttachment* self, spSlot* slot, int start, int count, float* worldVertices, int offset); 54 | 55 | #ifdef SPINE_SHORT_NAMES 56 | typedef spPathAttachment PathAttachment; 57 | #define PathAttachment_create(...) spPathAttachment_create(__VA_ARGS__) 58 | #define PathAttachment_computeWorldVertices(...) spPathAttachment_computeWorldVertices(__VA_ARGS__) 59 | #endif 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* SPINE_PATHATTACHMENT_H_ */ 66 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/PathConstraint.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_PATHCONSTRAINT_H_ 33 | #define SPINE_PATHCONSTRAINT_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | #include "PathAttachment.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | struct spSkeleton; 45 | 46 | typedef struct spPathConstraint { 47 | spPathConstraintData* const data; 48 | int bonesCount; 49 | spBone** const bones; 50 | spSlot* target; 51 | float position, spacing, rotateMix, translateMix; 52 | 53 | int spacesCount; 54 | float* spaces; 55 | 56 | int positionsCount; 57 | float* positions; 58 | 59 | int worldCount; 60 | float* world; 61 | 62 | int curvesCount; 63 | float* curves; 64 | 65 | int lengthsCount; 66 | float* lengths; 67 | 68 | float segments[10]; 69 | 70 | #ifdef __cplusplus 71 | spPathConstraint() : 72 | data(0), 73 | bonesCount(0), 74 | bones(0), 75 | target(0), 76 | position(0), 77 | spacing(0), 78 | rotateMix(0), 79 | translateMix(0), 80 | spacesCount(0), 81 | spaces(0), 82 | positionsCount(0), 83 | positions(0), 84 | worldCount(0), 85 | world(0), 86 | curvesCount(0), 87 | curves(0), 88 | lengthsCount(0), 89 | lengths(0) { 90 | } 91 | #endif 92 | } spPathConstraint; 93 | 94 | #define SP_PATHCONSTRAINT_ 95 | 96 | spPathConstraint* spPathConstraint_create (spPathConstraintData* data, const struct spSkeleton* skeleton); 97 | void spPathConstraint_dispose (spPathConstraint* self); 98 | 99 | void spPathConstraint_apply (spPathConstraint* self); 100 | float* spPathConstraint_computeWorldPositions(spPathConstraint* self, spPathAttachment* path, int spacesCount, int/*bool*/ tangents, int/*bool*/percentPosition, int/**/percentSpacing); 101 | 102 | #ifdef SPINE_SHORT_NAMES 103 | typedef spPathConstraint PathConstraint; 104 | #define PathConstraint_create(...) spPathConstraint_create(__VA_ARGS__) 105 | #define PathConstraint_dispose(...) spPathConstraint_dispose(__VA_ARGS__) 106 | #define PathConstraint_apply(...) spPathConstraint_apply(__VA_ARGS__) 107 | #endif 108 | 109 | #ifdef __cplusplus 110 | } 111 | #endif 112 | 113 | #endif /* SPINE_PATHCONSTRAINT_H_ */ 114 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/PathConstraintData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_PATHCONSTRAINTDATA_H_ 33 | #define SPINE_PATHCONSTRAINTDATA_H_ 34 | 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | typedef enum { 43 | SP_POSITION_MODE_FIXED, SP_POSITION_MODE_PERCENT 44 | } spPositionMode; 45 | 46 | typedef enum { 47 | SP_SPACING_MODE_LENGTH, SP_SPACING_MODE_FIXED, SP_SPACING_MODE_PERCENT 48 | } spSpacingMode; 49 | 50 | typedef enum { 51 | SP_ROTATE_MODE_TANGENT, SP_ROTATE_MODE_CHAIN, SP_ROTATE_MODE_CHAIN_SCALE 52 | } spRotateMode; 53 | 54 | typedef struct spPathConstraintData { 55 | const char* const name; 56 | int bonesCount; 57 | spBoneData** const bones; 58 | spSlotData* target; 59 | spPositionMode positionMode; 60 | spSpacingMode spacingMode; 61 | spRotateMode rotateMode; 62 | float offsetRotation; 63 | float position, spacing, rotateMix, translateMix; 64 | 65 | #ifdef __cplusplus 66 | spPathConstraintData() : 67 | name(0), 68 | bonesCount(0), 69 | bones(0), 70 | target(0), 71 | positionMode(SP_POSITION_MODE_FIXED), 72 | spacingMode(SP_SPACING_MODE_LENGTH), 73 | rotateMode(SP_ROTATE_MODE_TANGENT), 74 | offsetRotation(0), 75 | position(0), 76 | spacing(0), 77 | rotateMix(0), 78 | translateMix(0) { 79 | } 80 | #endif 81 | } spPathConstraintData; 82 | 83 | spPathConstraintData* spPathConstraintData_create (const char* name); 84 | void spPathConstraintData_dispose (spPathConstraintData* self); 85 | 86 | #ifdef SPINE_SHORT_NAMES 87 | typedef spPathConstraintData PathConstraintData; 88 | #define PathConstraintData_create(...) spPathConstraintData_create(__VA_ARGS__) 89 | #define PathConstraintData_dispose(...) spPathConstraintData_dispose(__VA_ARGS__) 90 | #endif 91 | 92 | #ifdef __cplusplus 93 | } 94 | #endif 95 | 96 | #endif /* SPINE_PATHCONSTRAINTDATA_H_ */ 97 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/RegionAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_REGIONATTACHMENT_H_ 33 | #define SPINE_REGIONATTACHMENT_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | typedef enum { 44 | SP_VERTEX_X1 = 0, SP_VERTEX_Y1, SP_VERTEX_X2, SP_VERTEX_Y2, SP_VERTEX_X3, SP_VERTEX_Y3, SP_VERTEX_X4, SP_VERTEX_Y4 45 | } spVertexIndex; 46 | 47 | typedef struct spRegionAttachment { 48 | spAttachment super; 49 | const char* path; 50 | float x, y, scaleX, scaleY, rotation, width, height; 51 | float r, g, b, a; 52 | 53 | void* rendererObject; 54 | int regionOffsetX, regionOffsetY; /* Pixels stripped from the bottom left, unrotated. */ 55 | int regionWidth, regionHeight; /* Unrotated, stripped pixel size. */ 56 | int regionOriginalWidth, regionOriginalHeight; /* Unrotated, unstripped pixel size. */ 57 | 58 | float offset[8]; 59 | float uvs[8]; 60 | } spRegionAttachment; 61 | 62 | spRegionAttachment* spRegionAttachment_create (const char* name); 63 | void spRegionAttachment_setUVs (spRegionAttachment* self, float u, float v, float u2, float v2, int/*bool*/rotate); 64 | void spRegionAttachment_updateOffset (spRegionAttachment* self); 65 | void spRegionAttachment_computeWorldVertices (spRegionAttachment* self, spBone* bone, float* vertices); 66 | 67 | #ifdef SPINE_SHORT_NAMES 68 | typedef spVertexIndex VertexIndex; 69 | #define VERTEX_X1 SP_VERTEX_X1 70 | #define VERTEX_Y1 SP_VERTEX_Y1 71 | #define VERTEX_X2 SP_VERTEX_X2 72 | #define VERTEX_Y2 SP_VERTEX_Y2 73 | #define VERTEX_X3 SP_VERTEX_X3 74 | #define VERTEX_Y3 SP_VERTEX_Y3 75 | #define VERTEX_X4 SP_VERTEX_X4 76 | #define VERTEX_Y4 SP_VERTEX_Y4 77 | typedef spRegionAttachment RegionAttachment; 78 | #define RegionAttachment_create(...) spRegionAttachment_create(__VA_ARGS__) 79 | #define RegionAttachment_setUVs(...) spRegionAttachment_setUVs(__VA_ARGS__) 80 | #define RegionAttachment_updateOffset(...) spRegionAttachment_updateOffset(__VA_ARGS__) 81 | #define RegionAttachment_computeWorldVertices(...) spRegionAttachment_computeWorldVertices(__VA_ARGS__) 82 | #endif 83 | 84 | #ifdef __cplusplus 85 | } 86 | #endif 87 | 88 | #endif /* SPINE_REGIONATTACHMENT_H_ */ 89 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/SkeletonBinary.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2016, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_SKELETONBINARY_H_ 33 | #define SPINE_SKELETONBINARY_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | struct spAtlasAttachmentLoader; 45 | 46 | typedef struct spSkeletonBinary { 47 | float scale; 48 | spAttachmentLoader* attachmentLoader; 49 | const char* const error; 50 | } spSkeletonBinary; 51 | 52 | spSkeletonBinary* spSkeletonBinary_createWithLoader (spAttachmentLoader* attachmentLoader); 53 | spSkeletonBinary* spSkeletonBinary_create (spAtlas* atlas); 54 | void spSkeletonBinary_dispose (spSkeletonBinary* self); 55 | 56 | spSkeletonData* spSkeletonBinary_readSkeletonData (spSkeletonBinary* self, const unsigned char* binary, const int length); 57 | spSkeletonData* spSkeletonBinary_readSkeletonDataFile (spSkeletonBinary* self, const char* path); 58 | 59 | #ifdef SPINE_SHORT_NAMES 60 | typedef spSkeletonBinary SkeletonBinary; 61 | #define SkeletonBinary_createWithLoader(...) spSkeletonBinary_createWithLoader(__VA_ARGS__) 62 | #define SkeletonBinary_create(...) spSkeletonBinary_create(__VA_ARGS__) 63 | #define SkeletonBinary_dispose(...) spSkeletonBinary_dispose(__VA_ARGS__) 64 | #define SkeletonBinary_readSkeletonData(...) spSkeletonBinary_readSkeletonData(__VA_ARGS__) 65 | #define SkeletonBinary_readSkeletonDataFile(...) spSkeletonBinary_readSkeletonDataFile(__VA_ARGS__) 66 | #endif 67 | 68 | #ifdef __cplusplus 69 | } 70 | #endif 71 | 72 | #endif /* SPINE_SKELETONBINARY_H_ */ 73 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/SkeletonJson.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_SKELETONJSON_H_ 33 | #define SPINE_SKELETONJSON_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | 41 | #ifdef __cplusplus 42 | extern "C" { 43 | #endif 44 | 45 | struct spAtlasAttachmentLoader; 46 | 47 | typedef struct spSkeletonJson { 48 | float scale; 49 | spAttachmentLoader* attachmentLoader; 50 | const char* const error; 51 | } spSkeletonJson; 52 | 53 | spSkeletonJson* spSkeletonJson_createWithLoader (spAttachmentLoader* attachmentLoader); 54 | spSkeletonJson* spSkeletonJson_create (spAtlas* atlas); 55 | void spSkeletonJson_dispose (spSkeletonJson* self); 56 | 57 | spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const char* json); 58 | spSkeletonData* spSkeletonJson_readSkeletonDataFile (spSkeletonJson* self, const char* path); 59 | 60 | #ifdef SPINE_SHORT_NAMES 61 | typedef spSkeletonJson SkeletonJson; 62 | #define SkeletonJson_createWithLoader(...) spSkeletonJson_createWithLoader(__VA_ARGS__) 63 | #define SkeletonJson_create(...) spSkeletonJson_create(__VA_ARGS__) 64 | #define SkeletonJson_dispose(...) spSkeletonJson_dispose(__VA_ARGS__) 65 | #define SkeletonJson_readSkeletonData(...) spSkeletonJson_readSkeletonData(__VA_ARGS__) 66 | #define SkeletonJson_readSkeletonDataFile(...) spSkeletonJson_readSkeletonDataFile(__VA_ARGS__) 67 | #endif 68 | 69 | #ifdef __cplusplus 70 | } 71 | #endif 72 | 73 | #endif /* SPINE_SKELETONJSON_H_ */ 74 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/Skin.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_SKIN_H_ 33 | #define SPINE_SKIN_H_ 34 | 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | struct spSkeleton; 42 | 43 | typedef struct spSkin { 44 | const char* const name; 45 | 46 | #ifdef __cplusplus 47 | spSkin() : 48 | name(0) { 49 | } 50 | #endif 51 | } spSkin; 52 | 53 | /* Private structs, needed by Skeleton */ 54 | typedef struct _Entry _Entry; 55 | struct _Entry { 56 | int slotIndex; 57 | const char* name; 58 | spAttachment* attachment; 59 | _Entry* next; 60 | }; 61 | 62 | typedef struct { 63 | spSkin super; 64 | _Entry* entries; 65 | } _spSkin; 66 | 67 | spSkin* spSkin_create (const char* name); 68 | void spSkin_dispose (spSkin* self); 69 | 70 | /* The Skin owns the attachment. */ 71 | void spSkin_addAttachment (spSkin* self, int slotIndex, const char* name, spAttachment* attachment); 72 | /* Returns 0 if the attachment was not found. */ 73 | spAttachment* spSkin_getAttachment (const spSkin* self, int slotIndex, const char* name); 74 | 75 | /* Returns 0 if the slot or attachment was not found. */ 76 | const char* spSkin_getAttachmentName (const spSkin* self, int slotIndex, int attachmentIndex); 77 | 78 | /** Attach each attachment in this skin if the corresponding attachment in oldSkin is currently attached. */ 79 | void spSkin_attachAll (const spSkin* self, struct spSkeleton* skeleton, const spSkin* oldspSkin); 80 | 81 | #ifdef SPINE_SHORT_NAMES 82 | typedef spSkin Skin; 83 | #define Skin_create(...) spSkin_create(__VA_ARGS__) 84 | #define Skin_dispose(...) spSkin_dispose(__VA_ARGS__) 85 | #define Skin_addAttachment(...) spSkin_addAttachment(__VA_ARGS__) 86 | #define Skin_getAttachment(...) spSkin_getAttachment(__VA_ARGS__) 87 | #define Skin_getAttachmentName(...) spSkin_getAttachmentName(__VA_ARGS__) 88 | #define Skin_attachAll(...) spSkin_attachAll(__VA_ARGS__) 89 | #endif 90 | 91 | #ifdef __cplusplus 92 | } 93 | #endif 94 | 95 | #endif /* SPINE_SKIN_H_ */ 96 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/Slot.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_SLOT_H_ 33 | #define SPINE_SLOT_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | typedef struct spSlot { 44 | spSlotData* const data; 45 | spBone* const bone; 46 | float r, g, b, a; 47 | spAttachment* const attachment; 48 | 49 | int attachmentVerticesCapacity; 50 | int attachmentVerticesCount; 51 | float* attachmentVertices; 52 | 53 | #ifdef __cplusplus 54 | spSlot() : 55 | data(0), 56 | bone(0), 57 | r(0), g(0), b(0), a(0), 58 | attachment(0), 59 | attachmentVerticesCapacity(0), 60 | attachmentVerticesCount(0), 61 | attachmentVertices(0) { 62 | } 63 | #endif 64 | } spSlot; 65 | 66 | spSlot* spSlot_create (spSlotData* data, spBone* bone); 67 | void spSlot_dispose (spSlot* self); 68 | 69 | /* @param attachment May be 0 to clear the attachment for the slot. */ 70 | void spSlot_setAttachment (spSlot* self, spAttachment* attachment); 71 | 72 | void spSlot_setAttachmentTime (spSlot* self, float time); 73 | float spSlot_getAttachmentTime (const spSlot* self); 74 | 75 | void spSlot_setToSetupPose (spSlot* self); 76 | 77 | #ifdef SPINE_SHORT_NAMES 78 | typedef spSlot Slot; 79 | #define Slot_create(...) spSlot_create(__VA_ARGS__) 80 | #define Slot_dispose(...) spSlot_dispose(__VA_ARGS__) 81 | #define Slot_setAttachment(...) spSlot_setAttachment(__VA_ARGS__) 82 | #define Slot_setAttachmentTime(...) spSlot_setAttachmentTime(__VA_ARGS__) 83 | #define Slot_getAttachmentTime(...) spSlot_getAttachmentTime(__VA_ARGS__) 84 | #define Slot_setToSetupPose(...) spSlot_setToSetupPose(__VA_ARGS__) 85 | #endif 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif /* SPINE_SLOT_H_ */ 92 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/SlotData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_SLOTDATA_H_ 33 | #define SPINE_SLOTDATA_H_ 34 | 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef enum { 42 | SP_BLEND_MODE_NORMAL, SP_BLEND_MODE_ADDITIVE, SP_BLEND_MODE_MULTIPLY, SP_BLEND_MODE_SCREEN 43 | } spBlendMode; 44 | 45 | typedef struct spSlotData { 46 | const int index; 47 | const char* const name; 48 | const spBoneData* const boneData; 49 | const char* attachmentName; 50 | float r, g, b, a; 51 | spBlendMode blendMode; 52 | 53 | #ifdef __cplusplus 54 | spSlotData() : 55 | index(0), 56 | name(0), 57 | boneData(0), 58 | attachmentName(0), 59 | r(0), g(0), b(0), a(0), 60 | blendMode(SP_BLEND_MODE_NORMAL) { 61 | } 62 | #endif 63 | } spSlotData; 64 | 65 | spSlotData* spSlotData_create (const int index, const char* name, spBoneData* boneData); 66 | void spSlotData_dispose (spSlotData* self); 67 | 68 | /* @param attachmentName May be 0 for no setup pose attachment. */ 69 | void spSlotData_setAttachmentName (spSlotData* self, const char* attachmentName); 70 | 71 | #ifdef SPINE_SHORT_NAMES 72 | typedef spBlendMode BlendMode; 73 | #define BLEND_MODE_NORMAL SP_BLEND_MODE_NORMAL 74 | #define BLEND_MODE_ADDITIVE SP_BLEND_MODE_ADDITIVE 75 | #define BLEND_MODE_MULTIPLY SP_BLEND_MODE_MULTIPLY 76 | #define BLEND_MODE_SCREEN SP_BLEND_MODE_SCREEN 77 | typedef spSlotData SlotData; 78 | #define SlotData_create(...) spSlotData_create(__VA_ARGS__) 79 | #define SlotData_dispose(...) spSlotData_dispose(__VA_ARGS__) 80 | #define SlotData_setAttachmentName(...) spSlotData_setAttachmentName(__VA_ARGS__) 81 | #endif 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | #endif /* SPINE_SLOTDATA_H_ */ 88 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/TransformConstraint.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_TRANSFORMCONSTRAINT_H_ 33 | #define SPINE_TRANSFORMCONSTRAINT_H_ 34 | 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | struct spSkeleton; 43 | 44 | typedef struct spTransformConstraint { 45 | spTransformConstraintData* const data; 46 | int bonesCount; 47 | spBone** const bones; 48 | spBone* target; 49 | float rotateMix, translateMix, scaleMix, shearMix; 50 | 51 | #ifdef __cplusplus 52 | spTransformConstraint() : 53 | data(0), 54 | bonesCount(0), 55 | bones(0), 56 | target(0), 57 | rotateMix(0), 58 | translateMix(0), 59 | scaleMix(0), 60 | shearMix(0) { 61 | } 62 | #endif 63 | } spTransformConstraint; 64 | 65 | spTransformConstraint* spTransformConstraint_create (spTransformConstraintData* data, const struct spSkeleton* skeleton); 66 | void spTransformConstraint_dispose (spTransformConstraint* self); 67 | 68 | void spTransformConstraint_apply (spTransformConstraint* self); 69 | 70 | #ifdef SPINE_SHORT_NAMES 71 | typedef spTransformConstraint TransformConstraint; 72 | #define TransformConstraint_create(...) spTransformConstraint_create(__VA_ARGS__) 73 | #define TransformConstraint_dispose(...) spTransformConstraint_dispose(__VA_ARGS__) 74 | #define TransformConstraint_apply(...) spTransformConstraint_apply(__VA_ARGS__) 75 | #endif 76 | 77 | #ifdef __cplusplus 78 | } 79 | #endif 80 | 81 | #endif /* SPINE_TRANSFORMCONSTRAINT_H_ */ 82 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/TransformConstraintData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_TRANSFORMCONSTRAINTDATA_H_ 33 | #define SPINE_TRANSFORMCONSTRAINTDATA_H_ 34 | 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef struct spTransformConstraintData { 42 | const char* const name; 43 | int bonesCount; 44 | spBoneData** const bones; 45 | spBoneData* target; 46 | float rotateMix, translateMix, scaleMix, shearMix; 47 | float offsetRotation, offsetX, offsetY, offsetScaleX, offsetScaleY, offsetShearY; 48 | 49 | #ifdef __cplusplus 50 | spTransformConstraintData() : 51 | name(0), 52 | bonesCount(0), 53 | bones(0), 54 | target(0), 55 | rotateMix(0), 56 | translateMix(0), 57 | scaleMix(0), 58 | shearMix(0), 59 | offsetRotation(0), 60 | offsetX(0), 61 | offsetY(0), 62 | offsetScaleX(0), 63 | offsetScaleY(0), 64 | offsetShearY(0) { 65 | } 66 | #endif 67 | } spTransformConstraintData; 68 | 69 | spTransformConstraintData* spTransformConstraintData_create (const char* name); 70 | void spTransformConstraintData_dispose (spTransformConstraintData* self); 71 | 72 | #ifdef SPINE_SHORT_NAMES 73 | typedef spTransformConstraintData TransformConstraintData; 74 | #define TransformConstraintData_create(...) spTransformConstraintData_create(__VA_ARGS__) 75 | #define TransformConstraintData_dispose(...) spTransformConstraintData_dispose(__VA_ARGS__) 76 | #endif 77 | 78 | #ifdef __cplusplus 79 | } 80 | #endif 81 | 82 | #endif /* SPINE_TRANSFORMCONSTRAINTDATA_H_ */ 83 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/VertexAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_VERTEXATTACHMENT_H_ 33 | #define SPINE_VERTEXATTACHMENT_H_ 34 | 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | typedef struct spVertexAttachment spVertexAttachment; 43 | struct spVertexAttachment { 44 | spAttachment super; 45 | 46 | int bonesCount; 47 | int* bones; 48 | 49 | int verticesCount; 50 | float* vertices; 51 | 52 | int worldVerticesLength; 53 | }; 54 | 55 | void spVertexAttachment_computeWorldVertices (spVertexAttachment* self, spSlot* slot, float* worldVertices); 56 | void spVertexAttachment_computeWorldVertices1 (spVertexAttachment* self, int start, int count, spSlot* slot, float* worldVertices, int offset); 57 | 58 | #ifdef SPINE_SHORT_NAMES 59 | typedef spVertexAttachment VertexAttachment; 60 | #define VertexAttachment_computeWorldVertices(...) spVertexAttachment_computeWorldVertices(__VA_ARGS__) 61 | #define VertexAttachment_computeWorldVertices1(...) spVertexAttachment_computeWorldVertices1(__VA_ARGS__) 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* SPINE_VERTEXATTACHMENT_H_ */ 69 | -------------------------------------------------------------------------------- /3rdparty/spine-c/include/spine/spine.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #ifndef SPINE_SPINE_H_ 33 | #define SPINE_SPINE_H_ 34 | 35 | #include 36 | #include 37 | #include 38 | #include 39 | #include 40 | #include 41 | #include 42 | #include 43 | #include 44 | #include 45 | #include 46 | #include 47 | #include 48 | #include 49 | #include 50 | #include 51 | #include 52 | #include 53 | #include 54 | #include 55 | #include 56 | #include 57 | #include 58 | 59 | #endif /* SPINE_SPINE_H_ */ 60 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/AtlasAttachmentLoader.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | spAttachment* _spAtlasAttachmentLoader_createAttachment (spAttachmentLoader* loader, spSkin* skin, spAttachmentType type, 36 | const char* name, const char* path) { 37 | spAtlasAttachmentLoader* self = SUB_CAST(spAtlasAttachmentLoader, loader); 38 | switch (type) { 39 | case SP_ATTACHMENT_REGION: { 40 | spRegionAttachment* attachment; 41 | spAtlasRegion* region = spAtlas_findRegion(self->atlas, path); 42 | if (!region) { 43 | _spAttachmentLoader_setError(loader, "Region not found: ", path); 44 | return 0; 45 | } 46 | attachment = spRegionAttachment_create(name); 47 | attachment->rendererObject = region; 48 | spRegionAttachment_setUVs(attachment, region->u, region->v, region->u2, region->v2, region->rotate); 49 | attachment->regionOffsetX = region->offsetX; 50 | attachment->regionOffsetY = region->offsetY; 51 | attachment->regionWidth = region->width; 52 | attachment->regionHeight = region->height; 53 | attachment->regionOriginalWidth = region->originalWidth; 54 | attachment->regionOriginalHeight = region->originalHeight; 55 | return SUPER(attachment); 56 | } 57 | case SP_ATTACHMENT_MESH: 58 | case SP_ATTACHMENT_LINKED_MESH: { 59 | spMeshAttachment* attachment; 60 | spAtlasRegion* region = spAtlas_findRegion(self->atlas, path); 61 | if (!region) { 62 | _spAttachmentLoader_setError(loader, "Region not found: ", path); 63 | return 0; 64 | } 65 | attachment = spMeshAttachment_create(name); 66 | attachment->rendererObject = region; 67 | attachment->regionU = region->u; 68 | attachment->regionV = region->v; 69 | attachment->regionU2 = region->u2; 70 | attachment->regionV2 = region->v2; 71 | attachment->regionRotate = region->rotate; 72 | attachment->regionOffsetX = region->offsetX; 73 | attachment->regionOffsetY = region->offsetY; 74 | attachment->regionWidth = region->width; 75 | attachment->regionHeight = region->height; 76 | attachment->regionOriginalWidth = region->originalWidth; 77 | attachment->regionOriginalHeight = region->originalHeight; 78 | return SUPER(SUPER(attachment)); 79 | } 80 | case SP_ATTACHMENT_BOUNDING_BOX: 81 | return SUPER(SUPER(spBoundingBoxAttachment_create(name))); 82 | case SP_ATTACHMENT_PATH: 83 | return SUPER(SUPER(spPathAttachment_create(name))); 84 | default: 85 | _spAttachmentLoader_setUnknownTypeError(loader, type); 86 | return 0; 87 | } 88 | 89 | UNUSED(skin); 90 | } 91 | 92 | spAtlasAttachmentLoader* spAtlasAttachmentLoader_create (spAtlas* atlas) { 93 | spAtlasAttachmentLoader* self = NEW(spAtlasAttachmentLoader); 94 | _spAttachmentLoader_init(SUPER(self), _spAttachmentLoader_deinit, _spAtlasAttachmentLoader_createAttachment, 0, 0); 95 | self->atlas = atlas; 96 | return self; 97 | } 98 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/Attachment.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | #include 35 | 36 | typedef struct _spAttachmentVtable { 37 | void (*dispose) (spAttachment* self); 38 | } _spAttachmentVtable; 39 | 40 | void _spAttachment_init (spAttachment* self, const char* name, spAttachmentType type, /**/ 41 | void (*dispose) (spAttachment* self)) { 42 | 43 | CONST_CAST(_spAttachmentVtable*, self->vtable) = NEW(_spAttachmentVtable); 44 | VTABLE(spAttachment, self) ->dispose = dispose; 45 | 46 | MALLOC_STR(self->name, name); 47 | CONST_CAST(spAttachmentType, self->type) = type; 48 | } 49 | 50 | void _spAttachment_deinit (spAttachment* self) { 51 | if (self->attachmentLoader) spAttachmentLoader_disposeAttachment(self->attachmentLoader, self); 52 | FREE(self->vtable); 53 | FREE(self->name); 54 | } 55 | 56 | void spAttachment_dispose (spAttachment* self) { 57 | VTABLE(spAttachment, self) ->dispose(self); 58 | } 59 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/BoneData.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | spBoneData* spBoneData_create (int index, const char* name, spBoneData* parent) { 36 | spBoneData* self = NEW(spBoneData); 37 | CONST_CAST(int, self->index) = index; 38 | MALLOC_STR(self->name, name); 39 | CONST_CAST(spBoneData*, self->parent) = parent; 40 | self->scaleX = 1; 41 | self->scaleY = 1; 42 | self->inheritRotation = 1; 43 | self->inheritScale = 1; 44 | return self; 45 | } 46 | 47 | void spBoneData_dispose (spBoneData* self) { 48 | FREE(self->name); 49 | FREE(self); 50 | } 51 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/BoundingBoxAttachment.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | void _spBoundingBoxAttachment_dispose (spAttachment* attachment) { 36 | spBoundingBoxAttachment* self = SUB_CAST(spBoundingBoxAttachment, attachment); 37 | 38 | _spVertexAttachment_deinit(SUPER(self)); 39 | 40 | FREE(self); 41 | } 42 | 43 | spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name) { 44 | spBoundingBoxAttachment* self = NEW(spBoundingBoxAttachment); 45 | _spAttachment_init(SUPER(SUPER(self)), name, SP_ATTACHMENT_BOUNDING_BOX, _spBoundingBoxAttachment_dispose); 46 | return self; 47 | } 48 | 49 | void spBoundingBoxAttachment_computeWorldVertices (spBoundingBoxAttachment* self, spSlot* slot, float* worldVertices) { 50 | spVertexAttachment_computeWorldVertices(SUPER(self), slot, worldVertices); 51 | } 52 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/Event.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | spEvent* spEvent_create (float time, spEventData* data) { 36 | spEvent* self = NEW(spEvent); 37 | CONST_CAST(spEventData*, self->data) = data; 38 | CONST_CAST(float, self->time) = time; 39 | return self; 40 | } 41 | 42 | void spEvent_dispose (spEvent* self) { 43 | FREE(self->stringValue); 44 | FREE(self); 45 | } 46 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/EventData.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | spEventData* spEventData_create (const char* name) { 36 | spEventData* self = NEW(spEventData); 37 | MALLOC_STR(self->name, name); 38 | return self; 39 | } 40 | 41 | void spEventData_dispose (spEventData* self) { 42 | FREE(self->stringValue); 43 | FREE(self->name); 44 | FREE(self); 45 | } 46 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/IkConstraintData.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | spIkConstraintData* spIkConstraintData_create (const char* name) { 36 | spIkConstraintData* self = NEW(spIkConstraintData); 37 | MALLOC_STR(self->name, name); 38 | self->bendDirection = 1; 39 | self->mix = 1; 40 | return self; 41 | } 42 | 43 | void spIkConstraintData_dispose (spIkConstraintData* self) { 44 | FREE(self->name); 45 | FREE(self->bones); 46 | FREE(self); 47 | } 48 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/Json.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2009 Dave Gamble 3 | 4 | Permission is hereby granted, dispose of charge, to any person obtaining a copy 5 | of this software and associated documentation files (the "Software"), to deal 6 | in the Software without restriction, including without limitation the rights 7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 8 | copies of the Software, and to permit persons to whom the Software is 9 | furnished to do so, subject to the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be included in 12 | all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 20 | THE SOFTWARE. 21 | */ 22 | 23 | /* Esoteric Software: Removed everything except parsing, shorter method names, more get methods, double to float, formatted. */ 24 | 25 | #ifndef SPINE_JSON_H_ 26 | #define SPINE_JSON_H_ 27 | 28 | #ifdef __cplusplus 29 | extern "C" { 30 | #endif 31 | 32 | /* Json Types: */ 33 | #define Json_False 0 34 | #define Json_True 1 35 | #define Json_NULL 2 36 | #define Json_Number 3 37 | #define Json_String 4 38 | #define Json_Array 5 39 | #define Json_Object 6 40 | 41 | #ifndef SPINE_JSON_HAVE_PREV 42 | /* Spine doesn't use the "prev" link in the Json sibling lists. */ 43 | #define SPINE_JSON_HAVE_PREV 0 44 | #endif 45 | 46 | /* The Json structure: */ 47 | typedef struct Json { 48 | struct Json* next; 49 | #if SPINE_JSON_HAVE_PREV 50 | struct Json* prev; /* next/prev allow you to walk array/object chains. Alternatively, use getSize/getItem */ 51 | #endif 52 | struct Json* child; /* An array or object item will have a child pointer pointing to a chain of the items in the array/object. */ 53 | 54 | int type; /* The type of the item, as above. */ 55 | int size; /* The number of children. */ 56 | 57 | const char* valueString; /* The item's string, if type==Json_String */ 58 | int valueInt; /* The item's number, if type==Json_Number */ 59 | float valueFloat; /* The item's number, if type==Json_Number */ 60 | 61 | const char* name; /* The item's name string, if this item is the child of, or is in the list of subitems of an object. */ 62 | } Json; 63 | 64 | /* Supply a block of JSON, and this returns a Json object you can interrogate. Call Json_dispose when finished. */ 65 | Json* Json_create (const char* value); 66 | 67 | /* Delete a Json entity and all subentities. */ 68 | void Json_dispose (Json* json); 69 | 70 | /* Get item "string" from object. Case insensitive. */ 71 | Json* Json_getItem (Json* json, const char* string); 72 | const char* Json_getString (Json* json, const char* name, const char* defaultValue); 73 | float Json_getFloat (Json* json, const char* name, float defaultValue); 74 | int Json_getInt (Json* json, const char* name, int defaultValue); 75 | 76 | /* For analysing failed parses. This returns a pointer to the parse error. You'll probably need to look a few chars back to make sense of it. Defined when Json_create() returns 0. 0 when Json_create() succeeds. */ 77 | const char* Json_getError (void); 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif /* SPINE_JSON_H_ */ 84 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/PathAttachment.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | void _spPathAttachment_dispose (spAttachment* attachment) { 36 | spPathAttachment* self = SUB_CAST(spPathAttachment, attachment); 37 | 38 | _spVertexAttachment_deinit(SUPER(self)); 39 | 40 | FREE(self->lengths); 41 | FREE(self); 42 | } 43 | 44 | spPathAttachment* spPathAttachment_create (const char* name) { 45 | spPathAttachment* self = NEW(spPathAttachment); 46 | _spAttachment_init(SUPER(SUPER(self)), name, SP_ATTACHMENT_PATH, _spPathAttachment_dispose); 47 | return self; 48 | } 49 | 50 | void spPathAttachment_computeWorldVertices (spPathAttachment* self, spSlot* slot, float* worldVertices) { 51 | spVertexAttachment_computeWorldVertices(SUPER(self), slot, worldVertices); 52 | } 53 | 54 | void spPathAttachment_computeWorldVertices1 (spPathAttachment* self, spSlot* slot, int start, int count, float* worldVertices, int offset) { 55 | spVertexAttachment_computeWorldVertices1(SUPER(self), start, count, slot, worldVertices, offset); 56 | } 57 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/PathConstraintData.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | spPathConstraintData* spPathConstraintData_create (const char* name) { 36 | spPathConstraintData* self = NEW(spPathConstraintData); 37 | MALLOC_STR(self->name, name); 38 | return self; 39 | } 40 | 41 | void spPathConstraintData_dispose (spPathConstraintData* self) { 42 | FREE(self->name); 43 | FREE(self->bones); 44 | FREE(self); 45 | } 46 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/Skin.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | _Entry* _Entry_create (int slotIndex, const char* name, spAttachment* attachment) { 36 | _Entry* self = NEW(_Entry); 37 | self->slotIndex = slotIndex; 38 | MALLOC_STR(self->name, name); 39 | self->attachment = attachment; 40 | return self; 41 | } 42 | 43 | void _Entry_dispose (_Entry* self) { 44 | spAttachment_dispose(self->attachment); 45 | FREE(self->name); 46 | FREE(self); 47 | } 48 | 49 | /**/ 50 | 51 | spSkin* spSkin_create (const char* name) { 52 | spSkin* self = SUPER(NEW(_spSkin)); 53 | MALLOC_STR(self->name, name); 54 | return self; 55 | } 56 | 57 | void spSkin_dispose (spSkin* self) { 58 | _Entry* entry = SUB_CAST(_spSkin, self)->entries; 59 | while (entry) { 60 | _Entry* nextEntry = entry->next; 61 | _Entry_dispose(entry); 62 | entry = nextEntry; 63 | } 64 | 65 | FREE(self->name); 66 | FREE(self); 67 | } 68 | 69 | void spSkin_addAttachment (spSkin* self, int slotIndex, const char* name, spAttachment* attachment) { 70 | _Entry* newEntry = _Entry_create(slotIndex, name, attachment); 71 | newEntry->next = SUB_CAST(_spSkin, self)->entries; 72 | SUB_CAST(_spSkin, self)->entries = newEntry; 73 | } 74 | 75 | spAttachment* spSkin_getAttachment (const spSkin* self, int slotIndex, const char* name) { 76 | const _Entry* entry = SUB_CAST(_spSkin, self)->entries; 77 | while (entry) { 78 | if (entry->slotIndex == slotIndex && strcmp(entry->name, name) == 0) return entry->attachment; 79 | entry = entry->next; 80 | } 81 | return 0; 82 | } 83 | 84 | const char* spSkin_getAttachmentName (const spSkin* self, int slotIndex, int attachmentIndex) { 85 | const _Entry* entry = SUB_CAST(_spSkin, self)->entries; 86 | int i = 0; 87 | while (entry) { 88 | if (entry->slotIndex == slotIndex) { 89 | if (i == attachmentIndex) return entry->name; 90 | i++; 91 | } 92 | entry = entry->next; 93 | } 94 | return 0; 95 | } 96 | 97 | void spSkin_attachAll (const spSkin* self, spSkeleton* skeleton, const spSkin* oldSkin) { 98 | const _Entry *entry = SUB_CAST(_spSkin, oldSkin)->entries; 99 | while (entry) { 100 | spSlot *slot = skeleton->slots[entry->slotIndex]; 101 | if (slot->attachment == entry->attachment) { 102 | spAttachment *attachment = spSkin_getAttachment(self, entry->slotIndex, entry->name); 103 | if (attachment) spSlot_setAttachment(slot, attachment); 104 | } 105 | entry = entry->next; 106 | } 107 | } 108 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/Slot.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | typedef struct { 36 | spSlot super; 37 | float attachmentTime; 38 | } _spSlot; 39 | 40 | spSlot* spSlot_create (spSlotData* data, spBone* bone) { 41 | spSlot* self = SUPER(NEW(_spSlot)); 42 | CONST_CAST(spSlotData*, self->data) = data; 43 | CONST_CAST(spBone*, self->bone) = bone; 44 | spSlot_setToSetupPose(self); 45 | return self; 46 | } 47 | 48 | void spSlot_dispose (spSlot* self) { 49 | FREE(self->attachmentVertices); 50 | FREE(self); 51 | } 52 | 53 | void spSlot_setAttachment (spSlot* self, spAttachment* attachment) { 54 | if (attachment == self->attachment) return; 55 | CONST_CAST(spAttachment*, self->attachment) = attachment; 56 | SUB_CAST(_spSlot, self)->attachmentTime = self->bone->skeleton->time; 57 | self->attachmentVerticesCount = 0; 58 | } 59 | 60 | void spSlot_setAttachmentTime (spSlot* self, float time) { 61 | SUB_CAST(_spSlot, self)->attachmentTime = self->bone->skeleton->time - time; 62 | } 63 | 64 | float spSlot_getAttachmentTime (const spSlot* self) { 65 | return self->bone->skeleton->time - SUB_CAST(_spSlot, self) ->attachmentTime; 66 | } 67 | 68 | void spSlot_setToSetupPose (spSlot* self) { 69 | self->r = self->data->r; 70 | self->g = self->data->g; 71 | self->b = self->data->b; 72 | self->a = self->data->a; 73 | 74 | if (!self->data->attachmentName) 75 | spSlot_setAttachment(self, 0); 76 | else { 77 | spAttachment* attachment = spSkeleton_getAttachmentForSlotIndex( 78 | self->bone->skeleton, self->data->index, self->data->attachmentName); 79 | CONST_CAST(spAttachment*, self->attachment) = 0; 80 | spSlot_setAttachment(self, attachment); 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/SlotData.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | spSlotData* spSlotData_create (const int index, const char* name, spBoneData* boneData) { 36 | spSlotData* self = NEW(spSlotData); 37 | CONST_CAST(int, self->index) = index; 38 | MALLOC_STR(self->name, name); 39 | CONST_CAST(spBoneData*, self->boneData) = boneData; 40 | self->r = 1; 41 | self->g = 1; 42 | self->b = 1; 43 | self->a = 1; 44 | return self; 45 | } 46 | 47 | void spSlotData_dispose (spSlotData* self) { 48 | FREE(self->name); 49 | FREE(self->attachmentName); 50 | FREE(self); 51 | } 52 | 53 | void spSlotData_setAttachmentName (spSlotData* self, const char* attachmentName) { 54 | FREE(self->attachmentName); 55 | if (attachmentName) 56 | MALLOC_STR(self->attachmentName, attachmentName); 57 | else 58 | CONST_CAST(char*, self->attachmentName) = 0; 59 | } 60 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/TransformConstraintData.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | spTransformConstraintData* spTransformConstraintData_create (const char* name) { 36 | spTransformConstraintData* self = NEW(spTransformConstraintData); 37 | MALLOC_STR(self->name, name); 38 | return self; 39 | } 40 | 41 | void spTransformConstraintData_dispose (spTransformConstraintData* self) { 42 | FREE(self->name); 43 | FREE(self->bones); 44 | FREE(self); 45 | } 46 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/extension.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License 3 | * Version 2.3 4 | * 5 | * Copyright (c) 2013-2015, Esoteric Software 6 | * All rights reserved. 7 | * 8 | * You are granted a perpetual, non-exclusive, non-sublicensable and 9 | * non-transferable license to use, install, execute and perform the Spine 10 | * Runtimes Software (the "Software") and derivative works solely for personal 11 | * or internal use. Without the written permission of Esoteric Software (see 12 | * Section 2 of the Spine Software License Agreement), you may not (a) modify, 13 | * translate, adapt or otherwise create derivative works, improvements of the 14 | * Software or develop new applications using the Software or (b) remove, 15 | * delete, alter or obscure any trademarks or any copyright, trademark, patent 16 | * or other intellectual property or proprietary rights notices on or in the 17 | * Software, including any copy thereof. Redistributions in binary or source 18 | * form must include this license and terms. 19 | * 20 | * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR 21 | * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | *****************************************************************************/ 31 | 32 | #include 33 | #include 34 | 35 | static void* (*mallocFunc) (size_t size) = malloc; 36 | static void* (*debugMallocFunc) (size_t size, const char* file, int line) = NULL; 37 | static void (*freeFunc) (void* ptr) = free; 38 | 39 | void* _malloc (size_t size, const char* file, int line) { 40 | if(debugMallocFunc) 41 | return debugMallocFunc(size, file, line); 42 | 43 | return mallocFunc(size); 44 | } 45 | void* _calloc (size_t num, size_t size, const char* file, int line) { 46 | void* ptr = _malloc(num * size, file, line); 47 | if (ptr) memset(ptr, 0, num * size); 48 | return ptr; 49 | } 50 | void _free (void* ptr) { 51 | freeFunc(ptr); 52 | } 53 | 54 | void _setDebugMalloc(void* (*malloc) (size_t size, const char* file, int line)) { 55 | debugMallocFunc = malloc; 56 | } 57 | 58 | void _setMalloc (void* (*malloc) (size_t size)) { 59 | mallocFunc = malloc; 60 | } 61 | void _setFree (void (*free) (void* ptr)) { 62 | freeFunc = free; 63 | } 64 | 65 | char* _readFile (const char* path, int* length) { 66 | char *data; 67 | FILE *file = fopen(path, "rb"); 68 | if (!file) return 0; 69 | 70 | fseek(file, 0, SEEK_END); 71 | *length = (int)ftell(file); 72 | fseek(file, 0, SEEK_SET); 73 | 74 | data = MALLOC(char, *length); 75 | fread(data, 1, *length, file); 76 | fclose(file); 77 | 78 | return data; 79 | } 80 | -------------------------------------------------------------------------------- /3rdparty/spine-c/src/spine/kvec.h: -------------------------------------------------------------------------------- 1 | /* The MIT License 2 | 3 | Copyright (c) 2008, by Attractive Chaos 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining 6 | a copy of this software and associated documentation files (the 7 | "Software"), to deal in the Software without restriction, including 8 | without limitation the rights to use, copy, modify, merge, publish, 9 | distribute, sublicense, and/or sell copies of the Software, and to 10 | permit persons to whom the Software is furnished to do so, subject to 11 | the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be 14 | included in all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS 20 | BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 21 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 22 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | */ 25 | 26 | /* 27 | An example: 28 | 29 | #include "kvec.h" 30 | int main() { 31 | kvec_t(int) array; 32 | kv_init(array); 33 | kv_push(int, array, 10); // append 34 | kv_a(int, array, 20) = 5; // dynamic 35 | kv_A(array, 20) = 4; // static 36 | kv_destroy(array); 37 | return 0; 38 | } 39 | */ 40 | 41 | /* 42 | 2008-09-22 (0.1.0): 43 | 44 | * The initial version. 45 | 46 | */ 47 | 48 | #ifndef AC_KVEC_H 49 | #define AC_KVEC_H 50 | 51 | #include 52 | 53 | #define kv_roundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) 54 | 55 | #define kvec_t(type) struct { size_t n, m; type *a; } 56 | #define kv_init(v) ((v).n = (v).m = 0, (v).a = 0) 57 | #define kv_destroy(v) free((v).a) 58 | #define kv_A(v, i) ((v).a[(i)]) 59 | #define kv_array(v) ((v).a) 60 | #define kv_pop(v) ((v).a[--(v).n]) 61 | #define kv_size(v) ((v).n) 62 | #define kv_max(v) ((v).m) 63 | 64 | #define kv_resize(type, v, s) ((v).m = (s), (v).a = (type*)realloc((v).a, sizeof(type) * (v).m)) 65 | #define kv_trim(type, v) (kv_resize(type, (v), kv_size(v))) 66 | 67 | #define kv_copy(type, v1, v0) do { \ 68 | if ((v1).m < (v0).n) kv_resize(type, v1, (v0).n); \ 69 | (v1).n = (v0).n; \ 70 | memcpy((v1).a, (v0).a, sizeof(type) * (v0).n); \ 71 | } while (0) \ 72 | 73 | #define kv_push(type, v, x) do { \ 74 | if ((v).n == (v).m) { \ 75 | (v).m = (v).m? (v).m<<1 : 2; \ 76 | (v).a = (type*)realloc((v).a, sizeof(type) * (v).m); \ 77 | } \ 78 | (v).a[(v).n++] = (x); \ 79 | } while (0) 80 | 81 | #define kv_pushp(type, v) (((v).n == (v).m)? \ 82 | ((v).m = ((v).m? (v).m<<1 : 2), \ 83 | (v).a = (type*)realloc((v).a, sizeof(type) * (v).m), 0) \ 84 | : 0), ((v).a + ((v).n++)) 85 | 86 | #define kv_a(type, v, i) (((v).m <= (size_t)(i)? \ 87 | ((v).m = (v).n = (i) + 1, kv_roundup32((v).m), \ 88 | (v).a = (type*)realloc((v).a, sizeof(type) * (v).m), 0) \ 89 | : (v).n <= (size_t)(i)? (v).n = (i) + 1 \ 90 | : 0), (v).a[(i)]) 91 | 92 | #endif 93 | -------------------------------------------------------------------------------- /3rdparty/stb/stb.c: -------------------------------------------------------------------------------- 1 | 2 | #ifdef __APPLE__ 3 | #include 4 | #if TARGET_OS_IOS 5 | #define STBI_NEON 6 | #endif 7 | #endif 8 | 9 | #define STBI_ONLY_PNG 10 | #define STB_IMAGE_IMPLEMENTATION 11 | #include 12 | 13 | //#define STB_IMAGE_WRITE_IMPLEMENTATION 14 | //#define STBI_WRITE_NO_STDIO // don't use this one 15 | //#include 16 | 17 | #define STB_RECT_PACK_IMPLEMENTATION 18 | #include 19 | -------------------------------------------------------------------------------- /3rdparty/tlsf/tlsf.h: -------------------------------------------------------------------------------- 1 | #ifndef INCLUDED_tlsf 2 | #define INCLUDED_tlsf 3 | 4 | /* 5 | ** Two Level Segregated Fit memory allocator, version 3.1. 6 | ** Written by Matthew Conte 7 | ** http://tlsf.baisoku.org 8 | ** 9 | ** Based on the original documentation by Miguel Masmano: 10 | ** http://www.gii.upv.es/tlsf/main/docs 11 | ** 12 | ** This implementation was written to the specification 13 | ** of the document, therefore no GPL restrictions apply. 14 | ** 15 | ** Copyright (c) 2006-2016, Matthew Conte 16 | ** All rights reserved. 17 | ** 18 | ** Redistribution and use in source and binary forms, with or without 19 | ** modification, are permitted provided that the following conditions are met: 20 | ** * Redistributions of source code must retain the above copyright 21 | ** notice, this list of conditions and the following disclaimer. 22 | ** * Redistributions in binary form must reproduce the above copyright 23 | ** notice, this list of conditions and the following disclaimer in the 24 | ** documentation and/or other materials provided with the distribution. 25 | ** * Neither the name of the copyright holder nor the 26 | ** names of its contributors may be used to endorse or promote products 27 | ** derived from this software without specific prior written permission. 28 | ** 29 | ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 30 | ** ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 31 | ** WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 32 | ** DISCLAIMED. IN NO EVENT SHALL MATTHEW CONTE BE LIABLE FOR ANY 33 | ** DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 34 | ** (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 35 | ** LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 36 | ** ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 37 | ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 38 | ** SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 39 | */ 40 | 41 | #include 42 | 43 | #if defined(__cplusplus) 44 | extern "C" { 45 | #endif 46 | 47 | /* tlsf_t: a TLSF structure. Can contain 1 to N pools. */ 48 | /* pool_t: a block of memory that TLSF can manage. */ 49 | typedef void* tlsf_t; 50 | typedef void* pool_t; 51 | 52 | /* Create/destroy a memory pool. */ 53 | tlsf_t tlsf_create(void* mem); 54 | tlsf_t tlsf_create_with_pool(void* mem, size_t bytes); 55 | void tlsf_destroy(tlsf_t tlsf); 56 | pool_t tlsf_get_pool(tlsf_t tlsf); 57 | 58 | /* Add/remove memory pools. */ 59 | pool_t tlsf_add_pool(tlsf_t tlsf, void* mem, size_t bytes); 60 | void tlsf_remove_pool(tlsf_t tlsf, pool_t pool); 61 | 62 | /* malloc/memalign/realloc/free replacements. */ 63 | void* tlsf_malloc(tlsf_t tlsf, size_t bytes); 64 | void* tlsf_memalign(tlsf_t tlsf, size_t align, size_t bytes); 65 | void* tlsf_realloc(tlsf_t tlsf, void* ptr, size_t size); 66 | void tlsf_free(tlsf_t tlsf, void* ptr); 67 | 68 | /* Returns internal block size, not original request size */ 69 | size_t tlsf_block_size(void* ptr); 70 | 71 | /* Overheads/limits of internal structures. */ 72 | size_t tlsf_size(void); 73 | size_t tlsf_align_size(void); 74 | size_t tlsf_block_size_min(void); 75 | size_t tlsf_block_size_max(void); 76 | size_t tlsf_pool_overhead(void); 77 | size_t tlsf_alloc_overhead(void); 78 | 79 | /* Debugging. */ 80 | typedef void (*tlsf_walker)(void* ptr, size_t size, int used, void* user); 81 | void tlsf_walk_pool(pool_t pool, tlsf_walker walker, void* user); 82 | /* Returns nonzero if any internal consistency check fails. */ 83 | int tlsf_check(tlsf_t tlsf); 84 | int tlsf_check_pool(pool_t pool); 85 | 86 | #if defined(__cplusplus) 87 | }; 88 | #endif 89 | 90 | #endif 91 | -------------------------------------------------------------------------------- /examples/00-helloworld/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | tex_t test; 7 | 8 | int32_t game_init(int32_t argc, char * argv[]) 9 | { 10 | w_dbg(DBG_TEXT); 11 | test = r_load("some_invalid_random_file_which_shouldn't exists.png", TEX_FLAGS_NONE); // so we get the missing texture 12 | return 0; 13 | } 14 | 15 | int32_t game_deinit() 16 | { 17 | r_free(test); 18 | return 0; 19 | } 20 | 21 | int32_t game_might_unload() 22 | { 23 | return 0; 24 | } 25 | 26 | int32_t game_update(uint16_t w, uint16_t h, float dt) 27 | { 28 | if(ep_kdown(EK_ESCAPE)) // TODO only for debug 29 | return 1; 30 | 31 | static bool dbg_stats = false; 32 | if(ep_khit(EK_F1)) 33 | { 34 | dbg_stats = !dbg_stats; 35 | w_dbg(DBG_TEXT | (dbg_stats ? DBG_STATS : 0)); 36 | } 37 | 38 | return 0; 39 | } 40 | 41 | int32_t game_render(uint16_t w, uint16_t h, float dt) 42 | { 43 | r_viewport(0, 0, w, h, r_coloru(32, 32, 32, 255)); 44 | 45 | bgfx_dbg_text_clear(0, false); 46 | bgfx_dbg_text_printf(1, 0, 0x0f, "dt %ims", (uint32_t)(dt * 1000.0f)); 47 | bgfx_dbg_text_printf(1, 1, 0x0f, "%6.1f %6.1f %i", w_mx(), w_my(), w_mtouch()); 48 | bgfx_dbg_text_printf(50, 1, 0x0f, "why, hello there!"); 49 | 50 | tr_set_parent_world(tr_identity()); 51 | tr_set_world(tr_identity()); 52 | 53 | static float deg = 0.0f; 54 | deg += 360.0f * dt; 55 | r_render_sprite(test, 0.0f, 0.0f, deg, 1.0f, 1.0f); 56 | 57 | r_frame_end(); 58 | 59 | return 0; 60 | } 61 | -------------------------------------------------------------------------------- /license: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 BeardsVibe, Dmytro Ivanov 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # leengine 2 | 3 | A very simplistic WIP 2D engine based on [BGFX](https://github.com/bkaradzic/bgfx) and others. 4 | 5 | 6 | -------------------------------------------------------------------------------- /src/_missing_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/beardsvibe/leengine/78fa3d7780252e5e83812fd2bc15f218169d9207/src/_missing_texture.png -------------------------------------------------------------------------------- /src/buttons.c: -------------------------------------------------------------------------------- 1 | #include "buttons.h" 2 | 3 | static struct 4 | { 5 | bool is_mouse_inside_any_button; 6 | bool started_button_press[MAX_FINGERS]; 7 | } ctx = {0}; 8 | 9 | static bool is_in_sprite(scene_t * scene, scene_entity_t * ent, gbVec2 mouse) 10 | { 11 | if(!ent->visible) 12 | return false; 13 | 14 | #if 1 15 | scene_entities_list_t all_sprites = scene_get_entities_for_prefix(scene, ent->name); 16 | gbRect2 r = sprites_AABB(&all_sprites, false); 17 | 18 | //#ifdef __APPLE__ 19 | gbVec2 mid = gb_vec2(r.pos.x + r.dim.x / 2.0f, r.pos.y + r.dim.y / 2.0f); 20 | if(r.dim.x < 100.0f) 21 | r.dim.x = 100.0f; 22 | if(r.dim.y < 100.0f) 23 | r.dim.y = 100.0f; 24 | r.pos.x = mid.x - r.dim.x / 2.0f; 25 | r.pos.y = mid.y - r.dim.y / 2.0f; 26 | //#endif 27 | 28 | #else 29 | gbVec2 rs = gb_vec2(ent->sx * ent->start_w, ent->sy * ent->start_h); 30 | 31 | //#ifdef __APPLE__ 32 | // TODO for buttons 33 | if(rs.x < 100.0f) 34 | rs.x = 100.0f; 35 | if(rs.y < 100.0f) 36 | rs.y = 100.0f; 37 | //#endif 38 | 39 | gbRect2 r = gb_rect2(gb_vec2(ent->x - rs.x / 2.0f, ent->y - rs.y / 2.0f), rs); 40 | #endif 41 | return gb_rect2_contains_vec2(r, mouse) ? true : false; 42 | } 43 | 44 | void _buttons_at_frame_start() 45 | { 46 | ctx.is_mouse_inside_any_button = false; 47 | } 48 | 49 | bool is_mouse_inside_any_button() 50 | { 51 | return ctx.is_mouse_inside_any_button; 52 | } 53 | 54 | bool button_update(scene_t * scene, scene_button_t * btn, size_t index, fingers_t fingers, bool is_active) 55 | { 56 | bool result = false; 57 | 58 | if(fingers.hit[0]) 59 | { 60 | bool was = btn->mouse_in; 61 | bool now = is_in_sprite(scene, btn->enabled, fingers.pos[0]); 62 | 63 | if(!was && now) 64 | { 65 | btn->mouse_in = true; 66 | btn->is_pressed = true; 67 | btn->btn_index = index; 68 | //ep_log("pressed on %s:%u\n", btn->name, (uint32_t)index); 69 | } 70 | } 71 | else if(fingers.touch[0]) 72 | { 73 | if(btn->is_pressed && btn->btn_index == index) 74 | { 75 | btn->mouse_in = is_in_sprite(scene, btn->enabled, fingers.pos[0]); 76 | } 77 | } 78 | else if(btn->is_pressed && btn->btn_index == index) 79 | { 80 | if(btn->mouse_in && btn->is_pressed) 81 | { 82 | // hit 83 | result = true; 84 | } 85 | btn->mouse_in = false; 86 | btn->is_pressed = false; 87 | btn->btn_index = -1; 88 | } 89 | 90 | if(btn->enabled) 91 | btn->enabled->visible &= !btn->is_pressed && (!is_active || !btn->activated); 92 | if(btn->disabled) 93 | btn->disabled->visible = false; 94 | if(btn->touched) 95 | btn->touched->visible &= btn->is_pressed; 96 | if(btn->activated) 97 | btn->activated->visible &= !btn->is_pressed && is_active; 98 | 99 | return result; 100 | } 101 | -------------------------------------------------------------------------------- /src/buttons.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "scene.h" 4 | #include "window.h" 5 | 6 | // called internally 7 | void _buttons_at_frame_start(); 8 | 9 | bool is_mouse_inside_any_button(); 10 | bool button_update(scene_t * scene, scene_button_t * btn, size_t index, fingers_t fingers, bool is_active); 11 | -------------------------------------------------------------------------------- /src/filesystem.c: -------------------------------------------------------------------------------- 1 | #define ENTRYPOINT_CTX 2 | #include "entrypoint.h" 3 | #include "filesystem.h" 4 | #include "portable.h" 5 | 6 | #ifdef EMSCRIPTEN 7 | #include 8 | #endif 9 | 10 | #if (!defined(__APPLE__) || !TARGET_OS_IOS) && (!defined(__ANDROID__)) 11 | FILE * fsopen(const char * filename, const char * mode) 12 | { 13 | #ifdef EMSCRIPTEN 14 | // TODO remove this hack 15 | if(memcmp(filename, "res/", 4) == 0) 16 | filename = filename + 4; 17 | else 18 | printf("looks like your file '%s' is not in res, this is not currently supported on emscripten :(\n", filename); 19 | #endif 20 | return fopen(filename, mode); 21 | } 22 | void _fs_path(const char * filename, char * buf, size_t size) 23 | { 24 | #ifdef EMSCRIPTEN 25 | // TODO remove this hack 26 | if(memcmp(filename, "res/", 4) == 0) 27 | filename = filename + 4; 28 | else 29 | printf("looks like your file '%s' is not in res, this is not currently supported on emscripten :(\n", filename); 30 | #endif 31 | strlcpy(buf, filename, size); 32 | } 33 | 34 | FILE * fsopen_gamesave(const char * filename, const char * mode) 35 | { 36 | #ifdef EMSCRIPTEN 37 | return NULL; 38 | #else 39 | return fopen(filename, mode); 40 | #endif 41 | } 42 | #endif 43 | 44 | STBIDEF stbi_uc * stbi_fsload(char const *filename, int *x, int *y, int *comp, int req_comp) 45 | { 46 | FILE * f = fsopen(filename, "rb"); 47 | if(!f) 48 | return NULL; 49 | stbi_uc * result = stbi_load_from_file(f,x,y,comp,req_comp); 50 | fclose(f); 51 | return result; 52 | } 53 | 54 | static void _write_to_fsopen(void * context, void * data, int size) 55 | { 56 | FILE * f = fsopen((const char*)context, "wb"); 57 | if(f) 58 | { 59 | fwrite(data, 1, size, f); 60 | fclose(f); 61 | } 62 | } 63 | 64 | //STBIWDEF int stbi_write_png_fs(char const * filename, int w, int h, int comp, const void * data, int stride_in_bytes) 65 | //{ 66 | // return stbi_write_png_to_func(_write_to_fsopen, (void*)filename, w, h, comp, data, stride_in_bytes); 67 | //} 68 | -------------------------------------------------------------------------------- /src/filesystem.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // ----------------------------------------------------------------------------- 4 | 5 | #include 6 | 7 | // please use this instead of fopen 8 | // because files might be in a different place than you expect 9 | // on some platforms this might end up doing fmemopen or similar 10 | FILE * fsopen(const char * filename, const char * mode); 11 | 12 | // TODO remove this 13 | void _fs_path(const char * filename, char * buf, size_t size); 14 | 15 | // TODO add iOS specific things for file writing, like context, lifetime, etc 16 | 17 | // TODO proper game save interface 18 | FILE * fsopen_gamesave(const char * filename, const char * mode); 19 | 20 | // ----------------------------------------------------------------------------- 21 | // helpers for 3rdparty tools 22 | 23 | #include 24 | STBIDEF stbi_uc * stbi_fsload(char const * filename, int * x, int * y, int * comp, int req_comp); 25 | 26 | //#include 27 | //STBIWDEF int stbi_write_png_fs(char const * filename, int w, int h, int comp, const void * data, int stride_in_bytes); 28 | -------------------------------------------------------------------------------- /src/filesystem_android.c: -------------------------------------------------------------------------------- 1 | 2 | #if defined(__ANDROID__) 3 | 4 | #define ENTRYPOINT_CTX 5 | #include "entrypoint.h" 6 | 7 | #include "filesystem.h" 8 | #include "portable.h" 9 | 10 | #include 11 | 12 | static int asset_read(void * asset, char * buf, int size) {return asset ? AAsset_read((AAsset*)asset, buf, size) : 0;} 13 | static fpos_t asset_seek(void * asset, fpos_t pos, int dir) {return asset ? AAsset_seek((AAsset*)asset, pos, dir) : 0;} 14 | static int asset_close(void * asset) {if(asset) {AAsset_close((AAsset*)asset); return 0;} return -1;} 15 | 16 | FILE * fsopen(const char * filename, const char * mode) 17 | { 18 | // TODO remove this hack 19 | if(memcmp(filename, "res/", 4) == 0) 20 | filename = filename + 4; 21 | else 22 | return NULL; 23 | 24 | if(!ep_ctx()->app || !ep_ctx()->app->activity || !ep_ctx()->app->activity->assetManager) 25 | return NULL; 26 | 27 | AAsset * asset = AAssetManager_open(ep_ctx()->app->activity->assetManager, filename, AASSET_MODE_UNKNOWN); 28 | if(asset) 29 | return funopen(asset, asset_read, NULL, asset_seek, asset_close); 30 | else 31 | return NULL; 32 | } 33 | 34 | void _fs_path(const char * filename, char * buf, size_t size) 35 | { 36 | // the way to load fmod files on android 37 | // TODO remove this hack 38 | if(memcmp(filename, "res/", 4) == 0) 39 | filename = filename + 4; 40 | snprintf(buf, size, "file:///android_asset/%s", filename); 41 | } 42 | 43 | FILE * fsopen_gamesave(const char * filename, const char * mode) 44 | { 45 | return NULL; 46 | } 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /src/filesystem_ios.m: -------------------------------------------------------------------------------- 1 | #define ENTRYPOINT_CTX 2 | #include "entrypoint.h" 3 | #include "filesystem.h" 4 | 5 | #if defined(__APPLE__) && TARGET_OS_IOS 6 | 7 | #include 8 | 9 | FILE * fsopen(const char * filename, const char * mode) 10 | { 11 | char buf[1024 * 2] = {0}; 12 | _fs_path(filename, buf, sizeof(buf)); 13 | return fopen(buf, mode); 14 | } 15 | 16 | void _fs_path(const char * filename, char * buf, size_t size) 17 | { 18 | NSString * fn = [NSString stringWithUTF8String:filename]; 19 | NSString * fn_path = [fn stringByDeletingLastPathComponent]; 20 | NSString * fn_name = [fn lastPathComponent]; 21 | NSString * fn_root = [[NSBundle mainBundle] pathForResource:fn_name ofType:nil inDirectory:fn_path]; 22 | strlcpy(buf, [fn_root UTF8String], size); 23 | } 24 | 25 | FILE * fsopen_gamesave(const char * filename, const char * mode) 26 | { 27 | NSArray * lib_paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); 28 | if(!lib_paths || [lib_paths count] == 0) 29 | return NULL; 30 | 31 | char buf[1024 * 2] = {0}; 32 | snprintf(buf, sizeof(buf), "%s/%s", [[lib_paths objectAtIndex:0] UTF8String], filename); 33 | return fopen(buf, mode); 34 | } 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /src/helpers/dict.h: -------------------------------------------------------------------------------- 1 | // small helper to represent yaml in more fashionable manner 2 | 3 | #pragma once 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | typedef struct dict_t dict_t; 10 | typedef khint_t diter_t; 11 | 12 | KHASH_MAP_INIT_STR(dict_map, dict_t*) 13 | 14 | // TODO well internal memory consumption is shit here 15 | // TODO probably we can just do one huge blob and point to it 16 | // TODO but guess it's fine like this for now 17 | struct dict_t 18 | { 19 | char * value; 20 | dict_t ** array; 21 | kh_dict_map_t * dict; 22 | size_t count; 23 | }; 24 | 25 | // parse, free, debug 26 | dict_t * dparsey(const char * yaml_filename); 27 | //dict_t * dparsejs(const char * json_string); 28 | void dfree(dict_t * dict); 29 | void dtraverse(dict_t * dict, int level); 30 | 31 | // get value by key or index 32 | dict_t * dget(dict_t * dict, const char * key); 33 | dict_t * dgeti(dict_t * dict, size_t index); 34 | 35 | // iterator 36 | diter_t dibegin(dict_t * dict); 37 | diter_t diend(dict_t * dict); 38 | const char * dikey(dict_t * dict, diter_t index); // might return NULL if bucket is empty 39 | dict_t * divalue(dict_t * dict, diter_t index); 40 | 41 | // get value 42 | const char * dstr(dict_t * dict, const char * default_value); 43 | int dint(dict_t * dict, int default_value); 44 | uint64_t duint64(dict_t * dict, uint64_t default_value); 45 | uint32_t duint32(dict_t * dict, uint32_t default_value); 46 | float dfloat(dict_t * dict, float default_value); 47 | 48 | // get value by key 49 | const char * dgstr(dict_t * dict, const char * key, const char * default_value); 50 | int dgint(dict_t * dict, const char * key, int default_value); 51 | uint32_t dguint32(dict_t * dict, const char * key, uint32_t default_value); 52 | uint64_t dguint64(dict_t * dict, const char * key, uint64_t default_value); 53 | float dgfloat(dict_t * dict, const char * key, float default_value); 54 | bool dgstr2(char * buffer, size_t buffer_length, dict_t * dict, const char * key, const char * default_value); 55 | -------------------------------------------------------------------------------- /src/helpers/khash_uuid.h: -------------------------------------------------------------------------------- 1 | 2 | #pragma once 3 | 4 | #include 5 | #include 6 | #include "murmur3hash.h" 7 | 8 | #define kh_uuid_hash_func(key) murmur16((uint32_t*)(key).bytes) 9 | #define kh_uuid_hash_equal(a, b) uuuid2_eq((a), (b)) 10 | #define KHASH_MAP_INIT_UUID(name, khval_t) KHASH_INIT(name, uuuid2_t, khval_t, 1, kh_uuid_hash_func, kh_uuid_hash_equal) 11 | -------------------------------------------------------------------------------- /src/helpers/pool.h: -------------------------------------------------------------------------------- 1 | #if 0 2 | 3 | #pragma once 4 | 5 | // can't be bothered, simplest pool wrapper out there 6 | 7 | #include 8 | #include 9 | #include 10 | 11 | typedef struct 12 | { 13 | void * mem; 14 | tlsf_t tlsf; 15 | size_t size; 16 | } pmem_t; 17 | 18 | void pinit(pmem_t * pool, size_t object_size, size_t object_count); 19 | void pdestory(pmem_t * pool); 20 | void * palloc(pmem_t * pool); 21 | void pfree(pmem_t * pool, void * ptr); 22 | 23 | #ifdef POOL_IMPLEMENTATION 24 | 25 | void pinit(pmem_t * pool, size_t object_size, size_t object_count) 26 | { 27 | size_t size = tlsf_size() + tlsf_align_size() + tlsf_block_size_min(); 28 | size += (object_size + tlsf_pool_overhead() + tlsf_alloc_overhead()) * object_count; // TODO check this 29 | pool->mem = malloc(size); 30 | pool->tlsf = tlsf_create_with_pool(pool->mem, size); 31 | pool->size = object_size; 32 | } 33 | 34 | void pdestory(pmem_t * pool) 35 | { 36 | free(pool->mem); 37 | memset(pool, 0, sizeof(pmem_t)); 38 | } 39 | 40 | void * palloc(pmem_t * pool) 41 | { 42 | return tlsf_malloc(pool->tlsf, pool->size); 43 | } 44 | 45 | void pfree(pmem_t * pool, void * ptr) 46 | { 47 | tlsf_free(pool->tlsf, ptr); 48 | } 49 | 50 | #endif POOL_IMPLEMENTATION 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /src/helpers/portable.c: -------------------------------------------------------------------------------- 1 | 2 | #include "portable.h" 3 | 4 | #if !defined(__FreeBSD__) && !defined(EMSCRIPTEN) && !defined(__APPLE__) 5 | 6 | size_t strlcpy(char * dst, const char * src, size_t size) 7 | { 8 | size_t srclen = strlen(src); 9 | 10 | if(!size) 11 | return srclen + 1; 12 | 13 | size_t copysize = srclen < size - 1 ? srclen : size - 1; 14 | memcpy(dst, src, copysize); 15 | dst[copysize] = 0; 16 | return srclen + 1; 17 | } 18 | 19 | #endif 20 | 21 | bool startswith(const char * string_starts, const char * with_prefix) 22 | { 23 | size_t ls = strlen(string_starts); 24 | size_t lp = strlen(with_prefix); 25 | return (ls >= lp) && (memcmp(string_starts, with_prefix, lp) == 0); 26 | } 27 | 28 | bool endswith(const char * string_ends, const char * with_prefix) 29 | { 30 | size_t ls = strlen(string_ends); 31 | size_t lp = strlen(with_prefix); 32 | return (ls >= lp) && (memcmp(string_ends + ls - lp, with_prefix, lp) == 0); 33 | } 34 | 35 | #ifdef _WIN32 36 | errno_t memset_s(void *v, rsize_t smax, int c, rsize_t n) 37 | { 38 | if(v == NULL) 39 | return EINVAL; 40 | if(n > smax) 41 | return EINVAL; 42 | 43 | volatile uint8_t * p = v; 44 | while(smax-- && n--) 45 | *p++ = c; 46 | 47 | return 0; 48 | } 49 | #endif 50 | 51 | 52 | #if defined(BIG_ENDIAN) // TODO fix this when we ever compile to big endian platform 53 | 54 | uint16_t read_bigendian_16(const uint8_t * i) 55 | { 56 | return *(const uint16_t*)i; 57 | } 58 | 59 | void write_bigendian_16(uint16_t i, uint8_t * o) 60 | { 61 | *(uint16_t*)o = i;; 62 | } 63 | 64 | #else 65 | 66 | uint16_t read_bigendian_16(const uint8_t * i) 67 | { 68 | uint16_t t; 69 | ((uint8_t*)&t)[0] = i[1]; 70 | ((uint8_t*)&t)[1] = i[0]; 71 | return t; 72 | } 73 | 74 | void write_bigendian_16(uint16_t i, uint8_t * o) 75 | { 76 | o[0] = ((uint8_t*)&i)[1]; 77 | o[1] = ((uint8_t*)&i)[0]; 78 | } 79 | 80 | #endif 81 | 82 | #if defined(__ANDROID__) || defined(EMSCRIPTEN) 83 | int memset_s(void *v, size_t smax, int c, size_t n) 84 | { 85 | if(v == NULL) 86 | return -1; 87 | if(smax > SIZE_MAX) 88 | return -1; 89 | if(n > smax) 90 | return -1; 91 | 92 | volatile unsigned char * p = v; 93 | while (smax-- && n--) 94 | { 95 | *p++ = c; 96 | } 97 | 98 | return 0; 99 | } 100 | #endif 101 | -------------------------------------------------------------------------------- /src/helpers/portable.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #if !defined(__FreeBSD__) && !defined(EMSCRIPTEN) && !defined(__APPLE__) 10 | 11 | size_t strlcpy(char * dst, const char * src, size_t size); 12 | 13 | #endif 14 | 15 | #include 16 | #include 17 | 18 | #ifdef _WIN32 19 | #ifndef stat 20 | #define stat _stat 21 | #endif 22 | #ifndef fstat 23 | #define fstat _fstat 24 | #endif 25 | #ifndef open 26 | #define open _open 27 | #endif 28 | #ifndef close 29 | #define close _close 30 | #endif 31 | #ifndef O_RDONLY 32 | #define O_RDONLY _O_RDONLY 33 | #endif 34 | #ifndef O_RDONLY 35 | #define O_RDONLY _O_RDONLY 36 | #endif 37 | #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) 38 | #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) 39 | #endif 40 | 41 | // C doesn't have strcmp in prefix form, wtf 42 | bool startswith(const char * string_starts, const char * with_prefix); 43 | bool endswith(const char * string_ends, const char * with_prefix); 44 | 45 | #define P_STATIC_ASSERT(__cond, __msg) typedef char static_assertion_##__msg[(__cond) ? 1 : -1] 46 | 47 | #ifdef _WIN32 48 | errno_t memset_s(void * v, rsize_t smax, int c, rsize_t n); 49 | #endif 50 | 51 | uint16_t read_bigendian_16(const uint8_t * i); 52 | void write_bigendian_16(uint16_t i, uint8_t * o); 53 | 54 | #if defined(__ANDROID__) || defined(EMSCRIPTEN) 55 | int memset_s(void *v, size_t smax, int c, size_t n); 56 | #endif 57 | 58 | #ifdef _MSC_VER 59 | #ifndef alloca 60 | #define alloca _alloca 61 | #endif 62 | #endif 63 | -------------------------------------------------------------------------------- /src/helpers/pstrstream.c: -------------------------------------------------------------------------------- 1 | #include "pstrstream.h" 2 | #include 3 | 4 | void ssinit(strstream_t * stream, char * buffer, size_t buffer_size) 5 | { 6 | stream->buffer = buffer; 7 | stream->size = buffer_size; 8 | stream->pos = 0; 9 | } 10 | 11 | bool ssvalid(strstream_t * stream) 12 | { 13 | return stream->pos <= stream->size; 14 | } 15 | 16 | bool ssprintf(strstream_t * stream, const char * format, ...) 17 | { 18 | if(!ssvalid(stream)) 19 | return false; 20 | 21 | va_list args; 22 | va_start(args, format); 23 | int result = vsnprintf(stream->buffer + stream->pos, stream->size - stream->pos, format, args); 24 | va_end(args); 25 | 26 | if(result < 0) 27 | return false; 28 | 29 | stream->pos += result; 30 | 31 | return ssvalid(stream); 32 | } 33 | -------------------------------------------------------------------------------- /src/helpers/pstrstream.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // why the f*** fmemopen is not portable? :( 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | typedef struct 10 | { 11 | char * buffer; 12 | size_t size; 13 | size_t pos; 14 | } strstream_t; 15 | 16 | void ssinit(strstream_t * stream, char * buffer, size_t buffer_size); 17 | bool ssvalid(strstream_t * stream); 18 | 19 | // string stream printf 20 | // returns print on success 21 | bool ssprintf(strstream_t * stream, const char * format, ...); 22 | -------------------------------------------------------------------------------- /src/physics.c: -------------------------------------------------------------------------------- 1 | #if 0 2 | 3 | #include "physics.h" 4 | #include "physics_debug.h" 5 | #include 6 | #include 7 | #include 8 | 9 | static void _shape_free_wrap(cpSpace * space, cpShape * shape, void * unused) {cpSpaceRemoveShape(space, shape); cpShapeFree(shape);} 10 | static void _shape_free(cpShape * shape, cpSpace * space) {cpSpaceAddPostStepCallback(space, (cpPostStepFunc)_shape_free_wrap, shape, NULL);} 11 | static void _body_shape_free(cpBody * body, cpShape * shape, cpSpace * space) {cpSpaceAddPostStepCallback(space, (cpPostStepFunc)_shape_free_wrap, shape, NULL);} 12 | static void _constraint_free_wrap(cpSpace * space, cpConstraint * constraint, void * unused) {cpSpaceRemoveConstraint(space, constraint); cpConstraintFree(constraint);} 13 | static void _constraint_free(cpConstraint * constraint, cpSpace * space) {cpSpaceAddPostStepCallback(space, (cpPostStepFunc)_constraint_free_wrap, constraint, NULL);} 14 | static void _body_free_wrap(cpSpace * space, cpBody * body, void * unused) {cpSpaceRemoveBody(space, body); cpBodyFree(body);} 15 | static void _body_free(cpBody * body, cpSpace * space) {cpSpaceAddPostStepCallback(space, (cpPostStepFunc)_body_free_wrap, body, NULL);} 16 | 17 | static struct 18 | { 19 | cpSpace * space; 20 | float scale; 21 | } ctx; 22 | 23 | void _p_init() 24 | { 25 | ctx.space = cpSpaceNew(); 26 | p_set_scale(1.0f); 27 | //cpSpaceSetIterations(ctx.space, 30); 28 | } 29 | 30 | void _p_deinit() 31 | { 32 | cpSpaceEachShape(ctx.space, (cpSpaceShapeIteratorFunc)_shape_free, ctx.space); 33 | cpSpaceEachConstraint(ctx.space, (cpSpaceConstraintIteratorFunc)_constraint_free, ctx.space); 34 | cpSpaceEachBody(ctx.space, (cpSpaceBodyIteratorFunc)_body_free, ctx.space); 35 | cpSpaceFree(ctx.space); 36 | } 37 | 38 | void _p_update(double dt) 39 | { 40 | uint8_t k = 4; 41 | for(size_t i = 0; i < k; ++i) 42 | cpSpaceStep(ctx.space, dt / (float)k); 43 | } 44 | 45 | void _p_debug_render() 46 | { 47 | cpSpaceDebugDraw(ctx.space, p_debug_opt()); 48 | p_debug_flush(ctx.scale); 49 | } 50 | 51 | cpSpace * p_space() {return ctx.space;} 52 | 53 | void p_set_scale(float scale) 54 | { 55 | ctx.scale = scale; 56 | cpSpaceSetGravity(ctx.space, cpv(0, -250.0f / ctx.scale)); 57 | cpSpaceSetSleepTimeThreshold(ctx.space, 1.0f); 58 | cpSpaceSetCollisionSlop(ctx.space, 0.05f / ctx.scale); 59 | } 60 | 61 | float p_scale() {return ctx.scale;} 62 | 63 | void p_remove_body(cpBody * body) 64 | { 65 | cpBodyEachShape(body, (cpBodyShapeIteratorFunc)_body_shape_free, ctx.space); 66 | _body_free(body, ctx.space); 67 | } 68 | 69 | #endif 70 | -------------------------------------------------------------------------------- /src/physics.h: -------------------------------------------------------------------------------- 1 | #if 0 2 | 3 | #pragma once 4 | 5 | #include 6 | 7 | // default physics configuration: 8 | // - 1 chipmunk2d unit = 1 cm 9 | // - scale is 1 cm = 1 px = 1 chipmunk2d unit 10 | // - gravity is 9.8 m/s^2 11 | 12 | void _p_init(); 13 | void _p_deinit(); 14 | void _p_update(double dt); 15 | void _p_debug_render(); 16 | 17 | cpSpace * p_space(); 18 | 19 | void p_set_scale(float scale); // default 1 cm = 1 px 20 | float p_scale(); 21 | 22 | void p_remove_body(cpBody * body); 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /src/physics_debug.c: -------------------------------------------------------------------------------- 1 | #if 0 2 | 3 | #include "physics_debug.h" 4 | #define _USE_MATH_DEFINES 5 | #include 6 | #include 7 | 8 | #define MAX_LINES 16 * 1024 9 | 10 | typedef struct 11 | { 12 | float x1, y1, x2, y2; 13 | r_color_t color; 14 | } line_t; 15 | 16 | static struct 17 | { 18 | line_t lines[MAX_LINES]; 19 | size_t lines_count; 20 | } ctx; 21 | 22 | static void _line(cpVect a, cpVect b, cpSpaceDebugColor c) 23 | { 24 | if(ctx.lines_count >= MAX_LINES) 25 | return; 26 | line_t * l = &ctx.lines[ctx.lines_count]; 27 | l->x1 = (float)a.x; l->y1 = (float)a.y; l->x2 = (float)b.x; l->y2 = (float)b.y; 28 | l->color = r_color(c.r, c.g, c.b, c.a); 29 | ctx.lines_count++; 30 | if(ctx.lines_count >= MAX_LINES) 31 | printf("reached max lines in physics debug renderer!\n"); 32 | } 33 | 34 | static void _r_circle(cpVect pos, cpFloat angle, cpFloat radius, cpSpaceDebugColor outline_color, cpSpaceDebugColor fill_color, cpDataPointer data) 35 | { 36 | float lx = (float)radius + (float)pos.x, ly = (float)pos.y; 37 | float steps = 10.0f; 38 | float k = 2.0f * (float)M_PI / steps; 39 | for(float a = 0.0f; a <= 2.0f * M_PI; a += k) 40 | { 41 | float x = cosf(a + k) * (float)radius + (float)pos.x, y = sinf(a + k) * (float)radius + (float)pos.y; 42 | _line(cpv(x, y), cpv(lx, ly), fill_color); 43 | lx = x; ly = y; 44 | } 45 | } 46 | 47 | static void _r_segment(cpVect a, cpVect b, cpSpaceDebugColor color, cpDataPointer data) 48 | { 49 | //_line(a, b, color); 50 | } 51 | 52 | static void _r_fat_segment(cpVect a, cpVect b, cpFloat radius, cpSpaceDebugColor outline_color, cpSpaceDebugColor fill_color, cpDataPointer data) 53 | { 54 | _line(a, b, fill_color); 55 | } 56 | 57 | static void _r_polygon(int count, const cpVect *verts, cpFloat radius, cpSpaceDebugColor outline_color, cpSpaceDebugColor fill_color, cpDataPointer data) 58 | { 59 | for(int i = 0; i < count; ++i) 60 | _line(verts[i ? i - 1 : count - 1], verts[i], fill_color); 61 | } 62 | 63 | static void _r_dot(cpFloat size, cpVect pos, cpSpaceDebugColor color, cpDataPointer data) 64 | { 65 | _line(pos, pos, color); 66 | } 67 | 68 | static cpSpaceDebugColor _r_shape_color(cpShape * shape, cpDataPointer data) 69 | { 70 | cpSpaceDebugColor wut = {1.0f, 1.0f, 1.0f, 1.0f}; 71 | return wut; 72 | } 73 | 74 | static cpSpaceDebugDrawOptions opt = 75 | { 76 | _r_circle, 77 | _r_segment, 78 | _r_fat_segment, 79 | _r_polygon, 80 | _r_dot, 81 | CP_SPACE_DEBUG_DRAW_SHAPES | CP_SPACE_DEBUG_DRAW_CONSTRAINTS | CP_SPACE_DEBUG_DRAW_COLLISION_POINTS, 82 | {1.0f, 1.0f, 1.0f, 1.0f}, // shape outline color 83 | _r_shape_color, 84 | {0.0f, 1.0f, 0.0f, 1.0f}, // constraint color 85 | {1.0f, 0.0f, 0.0f, 1.0f}, // collision point color 86 | NULL // data pointer 87 | }; 88 | 89 | cpSpaceDebugDrawOptions * p_debug_opt() 90 | { 91 | return &opt; 92 | } 93 | 94 | void p_debug_flush(float scale) 95 | { 96 | bgfx_transient_vertex_buffer_t vt; 97 | bgfx_alloc_transient_vertex_buffer(&vt, (uint32_t)ctx.lines_count * 2, r_decl()); 98 | vrtx_t * vert = (vrtx_t*)vt.data; 99 | 100 | for(size_t i = 0; i < ctx.lines_count; ++i) 101 | { 102 | line_t * l = &ctx.lines[i]; 103 | vert[i * 2 + 0].x = l->x1 * scale; 104 | vert[i * 2 + 0].y = l->y1 * scale; 105 | vert[i * 2 + 0].z = 0.0f; 106 | vert[i * 2 + 0].u = 0.0f; 107 | vert[i * 2 + 0].v = 0.0f; 108 | vert[i * 2 + 0].color = l->color; 109 | vert[i * 2 + 1].x = l->x2 * scale; 110 | vert[i * 2 + 1].y = l->y2 * scale; 111 | vert[i * 2 + 1].z = 0.0f; 112 | vert[i * 2 + 1].u = 0.0f; 113 | vert[i * 2 + 1].v = 0.0f; 114 | vert[i * 2 + 1].color = l->color; 115 | } 116 | 117 | bgfx_transient_index_buffer_t it; 118 | bgfx_alloc_transient_index_buffer(&it, (uint32_t)ctx.lines_count * 2); 119 | uint16_t * id = (uint16_t*)it.data; 120 | 121 | for(size_t i = 0; i < ctx.lines_count; ++i) 122 | { 123 | id[i * 2 + 0] = (uint16_t)(i * 2 + 0); 124 | id[i * 2 + 1] = (uint16_t)(i * 2 + 1); 125 | } 126 | 127 | tr_set_world(tr_identity()); 128 | r_submit_transient(&vt, &it, r_white_tex().tex, 1.0f, 1.0f, 1.0f, 1.0f, BGFX_STATE_DEFAULT_2D | BGFX_STATE_PT_LINES); 129 | 130 | ctx.lines_count = 0; 131 | } 132 | 133 | #endif 134 | -------------------------------------------------------------------------------- /src/physics_debug.h: -------------------------------------------------------------------------------- 1 | #if 0 2 | 3 | #pragma once 4 | 5 | #include 6 | #include "render.h" 7 | 8 | cpSpaceDebugDrawOptions * p_debug_opt(); 9 | void p_debug_flush(float scale); 10 | 11 | // needed for chipmunk collision debug 12 | #if 0 13 | void ChipmunkDebugDrawCircle(cpVect pos, cpFloat angle, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor); 14 | void ChipmunkDebugDrawSegment(cpVect a, cpVect b, cpSpaceDebugColor color); 15 | void ChipmunkDebugDrawFatSegment(cpVect a, cpVect b, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor); 16 | void ChipmunkDebugDrawPolygon(int count, const cpVect * verts, cpFloat radius, cpSpaceDebugColor outlineColor, cpSpaceDebugColor fillColor); 17 | void ChipmunkDebugDrawDot(cpFloat size, cpVect pos, cpSpaceDebugColor fillColor); 18 | static inline cpSpaceDebugColor RGBAColor(float r, float g, float b, float a) {cpSpaceDebugColor color = {r, g, b, a}; return color;} 19 | static inline cpSpaceDebugColor LAColor(float l, float a) {cpSpaceDebugColor color = {l, l, l, a}; return color;} 20 | #endif 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /src/render.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include "transforms.h" 6 | 7 | // color stuff 8 | typedef uint32_t r_color_t; // r_colot_t is ABGR 9 | typedef struct {float r,g,b,a;} r_colorf_t; 10 | r_color_t r_color(float r, float g, float b, float a); 11 | r_colorf_t r_colorf(float r, float g, float b, float a); 12 | r_color_t r_coloru(uint8_t r, uint8_t g, uint8_t b, uint8_t a); 13 | r_colorf_t r_colorfu(uint8_t r, uint8_t g, uint8_t b, uint8_t a); 14 | uint32_t r_color_to_rgba(r_color_t abgr_color); 15 | r_colorf_t r_color_to_colorf(r_color_t abgr_color); 16 | r_color_t r_colorf_to_color(r_colorf_t color); 17 | r_colorf_t r_colorf_mul(r_colorf_t a, r_colorf_t b); 18 | 19 | // default vertex 20 | #pragma pack(push, 1) 21 | typedef struct 22 | { 23 | float x, y, z; 24 | float u, v; 25 | r_color_t color; 26 | } vrtx_t; 27 | #pragma pack(pop) 28 | 29 | // texture structure 30 | typedef struct 31 | { 32 | bgfx_texture_handle_t tex; // texture handle 33 | uint16_t pixel_w, pixel_h; // size of texture in pixels, please don't override 34 | float w, h; // size of sprite, might be overrided externally 35 | float u1, v1, u2, v2; // texture coordinates, might be overrided externally 36 | } tex_t; 37 | 38 | // default 2d rendering state 39 | #define BGFX_STATE_DEFAULT_2D (0 \ 40 | | BGFX_STATE_RGB_WRITE \ 41 | | BGFX_STATE_ALPHA_WRITE \ 42 | | BGFX_STATE_CULL_CCW \ 43 | | BGFX_STATE_MSAA \ 44 | ) 45 | 46 | // texture loading flags 47 | #define TEX_FLAGS_NONE 0x0 48 | #define TEX_FLAGS_POINT 0x1 // disables filtering 49 | #define TEX_FLAGS_REPEAT 0x2 50 | 51 | void _r_init(); 52 | void _r_deinit(); 53 | 54 | tex_t r_load(const char * filename, uint32_t flags); 55 | void r_free(tex_t tex); 56 | 57 | void r_viewport(uint16_t x, uint16_t y, uint16_t w, uint16_t h, r_color_t color); 58 | void r_frame_end(); 59 | 60 | // modifies coordinates in place to map to screen grid 61 | void r_pixel_perfect_map(float * x, float * y, float w, float h); 62 | 63 | void r_render_hint_no_alpha(); // TODO rethink how to push many arguments to render_sprite 64 | void r_render_sprite(tex_t tex, float x, float y, float r_deg, float sx, float sy); 65 | void r_render_sprite_ex(tex_t tex, float x, float y, float r_deg, float rox, float roy, float sx, float sy, float sox, float soy, float ox, float oy, float r, float g, float b, float a, bool pixel_perfect); 66 | 67 | void r_render_transient( // submit transient buffers 68 | vrtx_t * vbuf, 69 | uint16_t vbuf_count, 70 | uint16_t * ibuf, 71 | uint32_t ibuf_count, 72 | bgfx_texture_handle_t tex, 73 | float diffuse_r, float diffuse_g, float diffuse_b, float diffuse_a, 74 | uint64_t state 75 | ); 76 | 77 | void r_scissors(uint16_t x, uint16_t y, uint16_t w, uint16_t h); 78 | void r_scissors_clear(); 79 | 80 | bgfx_vertex_decl_t * r_decl(); // vertex declaration 81 | uint8_t r_viewid(); // get current viewid 82 | bgfx_uniform_handle_t r_s_texture(); // default texture sampler 83 | bgfx_program_handle_t r_prog(); // default program 84 | tex_t r_white_tex(); // white texture 85 | -------------------------------------------------------------------------------- /src/render_9slice.c: -------------------------------------------------------------------------------- 1 | 2 | #include "render_9slice.h" 3 | 4 | static float _u(tex_t tex, float u) {return u * (tex.u2 - tex.u1) + tex.u1;} 5 | static float _v(tex_t tex, float v) {return v * (tex.v2 - tex.v1) + tex.v1;} 6 | 7 | void r_9slice( 8 | tex_t tex, tex_9slice_t slice, 9 | float w, float h, 10 | float x, float y, 11 | float r_deg, float rox, float roy, 12 | float ox, float oy, 13 | float r, float g, float b, float a, 14 | bool pixel_perfect) 15 | { 16 | // 0----1---------------2----3 17 | // | | | | 18 | // 4----5---------------6----7 19 | // | | | | 20 | // | | | | 21 | // | | | | 22 | // 8----9--------------10---11 23 | // | | | | 24 | // | | | | 25 | // 12--13--------------14---15 26 | 27 | vrtx_t vert[16]; 28 | 29 | float arr_u[4] = {0.0f, slice.p1u, slice.p2u, 1.0f}; 30 | float arr_v[4] = {0.0f, slice.p1v, slice.p2v, 1.0f}; 31 | 32 | float lw = (_u(tex, arr_u[1]) - _u(tex, arr_u[0])) * ((float)tex.pixel_w); 33 | float rw = (_u(tex, arr_u[3]) - _u(tex, arr_u[2])) * ((float)tex.pixel_w); 34 | float th = (_v(tex, arr_v[1]) - _v(tex, arr_v[0])) * ((float)tex.pixel_h); 35 | float bh = (_v(tex, arr_v[3]) - _v(tex, arr_v[2])) * ((float)tex.pixel_h); 36 | 37 | float kw = w / (lw + rw); 38 | float kh = h / (th + bh); 39 | float k = (kw < 1.0f || kh < 1.0f) ? (kw < kh ? kw : kh) : 1.0f; 40 | k *= slice.scale; 41 | 42 | float arr_x[4] = {-w / 2.0f, -w / 2.0f + lw * k, w / 2.0f - rw * k, w / 2.0f}; 43 | float arr_y[4] = { h / 2.0f, h / 2.0f - th * k, -h / 2.0f + bh * k, -h / 2.0f}; 44 | 45 | for(uint16_t i = 0; i < 16; ++i) 46 | { 47 | vert[i].x = arr_x[i % 4] / w; 48 | vert[i].y = arr_y[i / 4] / h; 49 | vert[i].z = 0.0f; 50 | vert[i].u = _u(tex, arr_u[i % 4]); 51 | vert[i].v = _v(tex, arr_v[i / 4]); 52 | vert[i].color = 0xffffffff; 53 | } 54 | 55 | uint16_t id[6 * 9]; 56 | 57 | for(uint16_t i = 0; i < 9; ++i) // we only have 9 squares with 2 triangles in each 58 | { 59 | uint16_t base = (i / 3) + i; 60 | id[i * 6 + 0] = base + 0; 61 | id[i * 6 + 1] = base + 1; 62 | id[i * 6 + 2] = base + 5; 63 | id[i * 6 + 3] = base + 0; 64 | id[i * 6 + 4] = base + 5; 65 | id[i * 6 + 5] = base + 4; 66 | } 67 | 68 | if(pixel_perfect) 69 | r_pixel_perfect_map(&x, &y, w, h); 70 | tr_set_world(tr_model_spr(x, y, r_deg, rox, roy, 1.0f, 1.0f, 0.0f, 0.0f, w, h, ox, oy)); 71 | r_render_transient(vert, 16, id, 6 * 9, tex.tex, r, g, b, a, BGFX_STATE_DEFAULT_2D | BGFX_STATE_BLEND_ALPHA); 72 | } 73 | -------------------------------------------------------------------------------- /src/render_9slice.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "render.h" 4 | 5 | // |-------------------------| 6 | // | | | | 7 | // |---p1---------------|----| 8 | // | | | | 9 | // | | | | 10 | // | | | | 11 | // |----|--------------p2----| 12 | // | | | | 13 | // | | | | 14 | // |-------------------------| 15 | 16 | typedef struct 17 | { 18 | float p1u, p1v, p2u, p2v; 19 | float scale; 20 | } tex_9slice_t; 21 | 22 | void r_9slice(tex_t tex, tex_9slice_t slice, 23 | float w, float h, 24 | float x, float y, 25 | float r_deg, float rox, float roy, 26 | float ox, float oy, 27 | float r, float g, float b, float a, 28 | bool pixel_perfect); 29 | -------------------------------------------------------------------------------- /src/render_batch.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "render.h" 4 | 5 | void rb_init(); 6 | void rb_deinit(); 7 | 8 | void rb_start(); 9 | void rb_add(bgfx_texture_handle_t texture, const vrtx_t * vbuf, uint16_t vbuf_count, const uint16_t * ibuf, uint32_t ibuf_count, uint64_t state); 10 | void rb_flush(); 11 | -------------------------------------------------------------------------------- /src/render_text.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | typedef int32_t font_t; 8 | 9 | #define NATIVE_FONT ((font_t)-1) 10 | 11 | void _t_init(uint32_t w, uint32_t h); // size of text texture atlas in pixels 12 | void _t_deinit(); 13 | void _t_cleanup(); 14 | 15 | font_t t_add(const char * fontname, const char * filename); 16 | 17 | #define TEXT_ALIGN_LEFT (1 << 0) // horizontal align default 18 | #define TEXT_ALIGN_CENTER (1 << 1) 19 | #define TEXT_ALIGN_RIGHT (1 << 2) 20 | #define TEXT_ALIGN_TOP (1 << 3) 21 | #define TEXT_ALIGN_MIDDLE (1 << 4) 22 | #define TEXT_ALIGN_BOTTOM (1 << 5) 23 | #define TEXT_ALIGN_BASELINE (1 << 6) // vertical align default 24 | 25 | void r_text_ex2(font_t font, 26 | float x, float y, 27 | float deg, float rox, float roy, 28 | float sx, float sy, float sox, float soy, 29 | float r, float g, float b, float a, 30 | bool shadow, 31 | float shadow_x, float shadow_y, 32 | float shadow_r, float shadow_g, float shadow_b, float shadow_a, 33 | gbRect2 * out_bounds, uint8_t align, float size_in_pt, float spacing_in_pt, 34 | const char * text); 35 | 36 | void _r_text_debug_atlas(float k_size); 37 | -------------------------------------------------------------------------------- /src/scene.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | // this is "interface" to scenes 4 | // actual implementation is generated with psd slice tool (or from code) 5 | 6 | #include "render.h" 7 | #include "render_text.h" 8 | #include "render_9slice.h" 9 | 10 | typedef font_t (*scene_load_font_t)(const char * name); // TODO temporarely solution 11 | 12 | typedef struct scene_entity_t scene_entity_t; 13 | typedef struct scene_sprite_t scene_sprite_t; 14 | typedef struct scene_text_t scene_text_t; 15 | typedef struct scene_button_t scene_button_t; 16 | typedef struct scene_t scene_t; 17 | 18 | // ----------------------------------------------------------------------------- 19 | 20 | typedef void (*scene_callback_t)(scene_entity_t * entity, scene_t * scene); 21 | 22 | struct scene_entity_t 23 | { 24 | float x, y, r, rox, roy, sx, sy, sox, soy, ox, oy; // position stuff 25 | 26 | float start_x, start_y; // original position of an object 27 | float start_w, start_h; // original size 28 | 29 | bool visible; // TODO rename to enabled 30 | 31 | const char * name; // object name, same as in psd 32 | 33 | scene_callback_t callback; 34 | uintptr_t userdata; 35 | 36 | // components, 37 | scene_sprite_t * sprite; 38 | scene_text_t * text; 39 | }; 40 | 41 | // ----------------------------------------------------------------------------- 42 | 43 | struct scene_sprite_t 44 | { 45 | scene_entity_t * entity; 46 | 47 | r_colorf_t diffuse; 48 | 49 | tex_t tex; 50 | 51 | // if present, render current sprite as 9slice 52 | tex_9slice_t * tex_9slice; 53 | 54 | bool pixel_perfect; 55 | }; 56 | 57 | struct scene_text_t 58 | { 59 | scene_entity_t * entity; 60 | 61 | const char * text; 62 | const char * original_text; 63 | 64 | float size_in_pt; 65 | font_t font; 66 | r_colorf_t diffuse; 67 | bool use_native_font; 68 | 69 | bool shadow; 70 | float shadow_x, shadow_y; 71 | r_colorf_t shadow_diffuse; 72 | 73 | bool new_style; 74 | float size_in_px; 75 | uint8_t align; 76 | gbRect2 bounds; // bounds feedback after rendering 77 | }; 78 | 79 | struct scene_button_t 80 | { 81 | char name[256]; 82 | scene_entity_t * enabled; 83 | scene_entity_t * disabled; 84 | scene_entity_t * touched; 85 | scene_entity_t * activated; 86 | bool mouse_in; 87 | bool is_pressed; 88 | size_t btn_index; 89 | }; 90 | 91 | // ----------------------------------------------------------------------------- 92 | 93 | #define SCENE_PASS_DRAW 1 94 | #define SCENE_PASS_FREE 2 95 | typedef void (*scene_pass_callback_t)(scene_t * scene, uint8_t at_pass); 96 | 97 | struct scene_t 98 | { 99 | scene_entity_t ** entities; // sorted in rendering order 100 | size_t entities_count; 101 | 102 | tex_t ** textures; 103 | size_t textures_count; 104 | 105 | tex_9slice_t ** tex_9slices; 106 | size_t tex_9slices_count; 107 | 108 | scene_sprite_t ** sprites; 109 | size_t sprites_count; 110 | 111 | scene_text_t ** texts; 112 | size_t texts_count; 113 | 114 | scene_pass_callback_t pass_callback; 115 | uintptr_t userdata; 116 | }; 117 | 118 | void scene_free(scene_t * scene); 119 | void scene_draw(scene_t * scene); 120 | void scene_draw_entity(scene_entity_t * entity); 121 | 122 | // ----------------------------------------------------------------------------- 123 | 124 | #define SCENE_MAX_ENT_SEARCH_COUNT 128 125 | typedef struct 126 | { 127 | scene_entity_t * entities[SCENE_MAX_ENT_SEARCH_COUNT]; 128 | size_t count; 129 | } scene_entities_list_t; 130 | scene_entities_list_t scene_get_entities_for_prefix(scene_t * scene, const char * prefix); 131 | void scene_set_entities_visibility(scene_entities_list_t * entities, bool visible); 132 | void scene_set_entities_visibility_for_prefix(scene_t * scene, const char * prefix, bool visible); 133 | 134 | // AABB in parent space 135 | gbRect2 sprite_AABB(scene_sprite_t * sprite, bool original); 136 | gbRect2 sprites_AABB(scene_entities_list_t * entities, bool original); 137 | -------------------------------------------------------------------------------- /src/scrollview.h: -------------------------------------------------------------------------------- 1 | 2 | // 1D kinetic scrolling 3 | // similar by feel to iOS UIScrollView 4 | 5 | #pragma once 6 | 7 | #include 8 | #include 9 | 10 | #define SCROLLVIEW_DRAG_POS_FRAMES_MAX 20 11 | 12 | typedef struct 13 | { 14 | // ----------------------------- params, set outside 15 | float view_rect_x; 16 | float view_rect_y; 17 | float view_rect_w; 18 | float view_rect_h; 19 | 20 | float view_pos_min; 21 | float view_pos_max; 22 | 23 | bool scroll_direction; // true - vertical 24 | 25 | float snap_with_interval; // if > 0, will snap to specific positions 26 | 27 | // ----------------------------- current position 28 | float view_current_pos; 29 | 30 | // ----------------------------- internal parameters 31 | 32 | // animation 33 | float view_velocity; 34 | float view_target_pos; 35 | bool view_anim_out_of_bounds; 36 | 37 | // dragging 38 | float drag_start_view_pos; 39 | float drag_start_touch_pos; 40 | struct 41 | { 42 | float pos; 43 | float dt; 44 | } drag_frames[SCROLLVIEW_DRAG_POS_FRAMES_MAX]; 45 | uint8_t drag_frames_count; 46 | bool was_dragging; 47 | bool drag_is_not_in_view; 48 | } scrollview_t; 49 | 50 | void scrollview_update(scrollview_t * sv, float dt, float touch_pos_x, float touch_pos_y, bool touch_press); 51 | -------------------------------------------------------------------------------- /src/shaders/tex_color.fs: -------------------------------------------------------------------------------- 1 | $input v_color0, v_texcoord0 2 | 3 | #include 4 | 5 | SAMPLER2D(s_texture, 0); 6 | 7 | void main() 8 | { 9 | gl_FragColor = vec4(texture2D(s_texture, v_texcoord0).rgba) * v_color0; 10 | } 11 | -------------------------------------------------------------------------------- /src/shaders/tex_color.vs: -------------------------------------------------------------------------------- 1 | $input a_position, a_color0, a_texcoord0 2 | $output v_color0, v_texcoord0 3 | 4 | #include 5 | 6 | void main() 7 | { 8 | mat4 projViewWorld = mul(mul(u_proj, u_view), u_model[0]); // TODO work it out after https://github.com/bkaradzic/bgfx/issues/983 9 | gl_Position = mul(projViewWorld, vec4(a_position, 1.0)); 10 | v_color0 = a_color0; 11 | v_texcoord0 = a_texcoord0; 12 | } 13 | -------------------------------------------------------------------------------- /src/shaders/varying.def.sc: -------------------------------------------------------------------------------- 1 | vec4 v_color0 : COLOR = vec4(1.0, 1.0, 1.0, 1.0); 2 | vec2 v_texcoord0 : TEXCOORD0 = vec2(0.0, 0.0); 3 | 4 | vec3 a_position : POSITION; 5 | vec4 a_color0 : COLOR0; 6 | vec2 a_texcoord0 : TEXCOORD0; 7 | -------------------------------------------------------------------------------- /src/sound.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | typedef struct 6 | { 7 | void * inst; 8 | } bank_t; 9 | 10 | typedef struct 11 | { 12 | void * inst; 13 | } sound_t; 14 | 15 | void _s_init(); 16 | void _s_deinit(); 17 | void _s_update(); 18 | 19 | typedef void (*s_on_destroyed_t)(void * inst); 20 | 21 | bank_t s_load_bank(const char * path); 22 | sound_t s_create(const char * event_path, s_on_destroyed_t callback); 23 | void s_free(sound_t sound); 24 | 25 | void s_start(sound_t sound); 26 | void s_stop(sound_t sound); 27 | void s_set(sound_t sound, const char * parameter, float value); 28 | bool s_is_playing(sound_t sound); 29 | -------------------------------------------------------------------------------- /src/spine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "render.h" 4 | 5 | typedef struct spAtlas spAtlas; 6 | typedef struct spSkeleton spSkeleton; 7 | typedef struct spAnimationState spAnimationState; 8 | 9 | typedef struct 10 | { 11 | spAtlas * atlas; 12 | spSkeleton * skeleton; 13 | spAnimationState * state; 14 | } spine_t; 15 | 16 | spine_t sp_load(const char * json_filename, const char * atlas_filename); 17 | void sp_free(spine_t sp); 18 | void sp_update(spine_t sp, float dt); 19 | void sp_render_ex(spine_t sp, float x, float y, float deg, float sx, float sy); 20 | void sp_render(spine_t sp, float x, float y, float deg); 21 | void sp_set(spine_t sp, const char * anim_name, bool loop); 22 | -------------------------------------------------------------------------------- /src/transforms.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | typedef gbMat4 trns_t; 7 | 8 | trns_t tr_mul(trns_t a, trns_t b); // generally look, position vector is from right here 9 | trns_t tr_ortho(float left, float right, float bottom, float top, float z_near, float z_far); 10 | trns_t tr_identity(); 11 | trns_t tr_model_spr(float x, float y, 12 | float r_deg, float rox, float roy, 13 | float sx, float sy, float sox, float soy, 14 | float w, float h, float ox, float oy); 15 | void tr_debug(trns_t tr); 16 | 17 | void tr_set_view_prj(uint8_t viewid, trns_t prj, trns_t view, gbVec2 viewport_pos, gbVec2 viewport_size); 18 | void tr_set_parent_world(trns_t parent_world); 19 | trns_t tr_get_parent_world(); 20 | void tr_set_world(trns_t model); 21 | trns_t tr_get_model(); 22 | trns_t tr_get_world(); 23 | 24 | gbVec2 tr_prj(gbVec2 pos); 25 | gbVec2 tr_inverted_prj(gbVec2 pos); 26 | 27 | gbRect2 gb_rect2_union(gbRect2 a, gbRect2 b); // TODO remove when will be added to gb_math 28 | -------------------------------------------------------------------------------- /src/window.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | // ----------------------------------------------------------------------------- 9 | // implement this in your codebase 10 | int32_t game_init(int32_t argc, char * argv[]); // 0 is ok 11 | int32_t game_deinit(); // 0 is ok, don't really rely on this to be called 12 | int32_t game_might_unload(); // 0 is ok 13 | int32_t game_update(uint16_t w, uint16_t h, float dt); // 0 is ok, != 0 means we want to exit if possible 14 | int32_t game_render(uint16_t w, uint16_t h, float dt); // 0 is ok, != 0 means we want to exit if possible 15 | 16 | // ----------------------------------------------------------------------------- 17 | 18 | uint16_t w_width(); 19 | uint16_t w_height(); 20 | 21 | #define DBG_NONE 0x0 22 | #define DBG_TEXT 0x1 23 | #define DBG_WIREFRAME 0x2 24 | #define DBG_STATS 0x4 25 | void w_dbg(uint32_t options); 26 | 27 | // mouse 28 | float w_mx(); 29 | float w_my(); 30 | bool w_mtouch(); 31 | bool w_ml(); 32 | bool w_mr(); 33 | 34 | // touch 35 | uint8_t w_tmax(); 36 | float w_tx(uint8_t i); 37 | float w_ty(uint8_t i); 38 | bool w_touch(uint8_t i); 39 | bool w_thit(uint8_t i); 40 | #define MAX_FINGERS ENTRYPOINT_MAX_MULTITOUCH 41 | typedef struct {gbVec2 pos[MAX_FINGERS]; bool touch[MAX_FINGERS]; bool hit[MAX_FINGERS];} fingers_t; 42 | -------------------------------------------------------------------------------- /tools/localization_csv_to_c.py: -------------------------------------------------------------------------------- 1 | 2 | import sys 3 | 4 | 5 | if sys.version_info < (3, 0): 6 | reload(sys) 7 | sys.setdefaultencoding('utf-8') 8 | 9 | import csv, pystache, argparse, codecs, os 10 | 11 | c_template = r"""// hey, it's autogenerated! :) 12 | #include "{{header_filename}}" 13 | #include 14 | 15 | static lang_t _lang = lang_invalid; 16 | void loc_set(lang_t lang) {_lang = lang;} 17 | 18 | const char * loc(const char * key) 19 | { 20 | {{#strings}} 21 | if(!strcmp(key, "%{{name}}%")) return loc_{{name}}(); 22 | {{/strings}} 23 | return NULL; 24 | } 25 | 26 | {{#strings}} 27 | const char * loc_{{name}}() 28 | { 29 | switch(_lang) 30 | { 31 | {{#data}} 32 | case lang_{{lang}}: return "{{text}}"; 33 | {{/data}} 34 | default: return "%{{name}}%"; 35 | } 36 | } 37 | 38 | {{/strings}} 39 | """ 40 | 41 | h_template = r"""// hey, it's autogenerated! :) 42 | #pragma once 43 | 44 | typedef enum 45 | { 46 | lang_invalid = 0, 47 | {{#languages}} 48 | lang_{{name}}, 49 | {{/languages}} 50 | lang_max 51 | } lang_t; 52 | 53 | void loc_set(lang_t lang); 54 | const char * loc(const char * key); 55 | 56 | {{#strings}} 57 | const char * loc_{{name}}(); 58 | {{/strings}} 59 | """ 60 | 61 | def form_dict(settings, data, header_filename): 62 | langs = [ 63 | { 64 | 'name': name 65 | } 66 | for name in settings[1] 67 | ] 68 | strings = [ 69 | { 70 | 'name': label[0], 71 | 'data': 72 | [ 73 | { 74 | 'lang': settings[1][i], 75 | 'text': text 76 | } 77 | for i, text in enumerate(label[1]) 78 | ] 79 | } 80 | for label in data if len(label[0]) 81 | ] 82 | return {'languages': langs, 'strings': strings, 'header_filename': header_filename} 83 | 84 | parser = argparse.ArgumentParser(description='localization csv to c+h files') 85 | parser.add_argument('-i', '--in', required=True, help='input csv file') 86 | parser.add_argument('-o', '--out', nargs='+', help='output c and h files') 87 | args = vars(parser.parse_args()) 88 | 89 | in_csv = args.get('in') 90 | out_c = None 91 | out_h = None 92 | for name in args.get('out'): 93 | if name.endswith('.c'): 94 | out_c = name 95 | elif name.endswith('.h'): 96 | out_h = name 97 | 98 | data = {} 99 | with codecs.open(in_csv, mode='r', encoding='utf8') as csvfile: 100 | rows = [(row[0], row[1:]) for row in csv.reader(csvfile, delimiter=',', quotechar='|')] 101 | data = form_dict(rows[1], rows[2:], os.path.split(out_h)[1]) 102 | 103 | with codecs.open(out_c, 'w', 'utf-8') as f: 104 | f.write(pystache.render(c_template, data)) 105 | 106 | with codecs.open(out_h, 'w', 'utf-8') as f: 107 | f.write(pystache.render(h_template, data)) 108 | -------------------------------------------------------------------------------- /tools/requirements.txt: -------------------------------------------------------------------------------- 1 | psd-tools 2 | Pillow 3 | pystache 4 | --------------------------------------------------------------------------------