├── .gitignore ├── DesktopSprite.sln ├── DesktopSprite ├── DesktopSprite.vcxproj ├── DesktopSprite.vcxproj.filters ├── include │ ├── ds │ │ ├── aboutdlg.h │ │ ├── basewindow.h │ │ ├── config.h │ │ ├── configdlg.h │ │ ├── framework.h │ │ ├── mainwnd.h │ │ ├── notifyicon.h │ │ ├── perfmonitor.h │ │ ├── spinechar.h │ │ ├── spritewnd.h │ │ ├── utils.h │ │ ├── version.h │ │ └── winapp.h │ ├── json │ │ ├── allocator.h │ │ ├── assertions.h │ │ ├── config.h │ │ ├── forwards.h │ │ ├── json.h │ │ ├── json_features.h │ │ ├── reader.h │ │ ├── value.h │ │ ├── version.h │ │ └── writer.h │ └── spine │ │ ├── Animation.h │ │ ├── AnimationState.h │ │ ├── AnimationStateData.h │ │ ├── Array.h │ │ ├── Atlas.h │ │ ├── AtlasAttachmentLoader.h │ │ ├── Attachment.h │ │ ├── AttachmentLoader.h │ │ ├── Bone.h │ │ ├── BoneData.h │ │ ├── BoundingBoxAttachment.h │ │ ├── ClippingAttachment.h │ │ ├── Color.h │ │ ├── Event.h │ │ ├── EventData.h │ │ ├── IkConstraint.h │ │ ├── IkConstraintData.h │ │ ├── MeshAttachment.h │ │ ├── PathAttachment.h │ │ ├── PathConstraint.h │ │ ├── PathConstraintData.h │ │ ├── PointAttachment.h │ │ ├── RegionAttachment.h │ │ ├── Skeleton.h │ │ ├── SkeletonBinary.h │ │ ├── SkeletonBounds.h │ │ ├── SkeletonClipping.h │ │ ├── SkeletonData.h │ │ ├── SkeletonJson.h │ │ ├── Skin.h │ │ ├── Slot.h │ │ ├── SlotData.h │ │ ├── TransformConstraint.h │ │ ├── TransformConstraintData.h │ │ ├── Triangulator.h │ │ ├── VertexAttachment.h │ │ ├── VertexEffect.h │ │ ├── dll.h │ │ ├── extension.h │ │ └── spine.h ├── res │ ├── DesktopSprite.rc │ ├── font │ │ ├── AGENCYB.TTF │ │ └── AGENCYR.TTF │ ├── image │ │ ├── appicon_dark.ico │ │ ├── appicon_dark.png │ │ ├── appicon_light.ico │ │ ├── appicon_light.png │ │ ├── timealarm.ico │ │ └── timealarm.png │ ├── resource.h │ ├── resource1.h │ ├── spine │ │ ├── guanghui_2.atlas │ │ ├── guanghui_2.png │ │ └── guanghui_2.skel │ └── version.rc └── src │ ├── ds │ ├── aboutdlg.cpp │ ├── basewindow.cpp │ ├── config.cpp │ ├── configdlg.cpp │ ├── mainwnd.cpp │ ├── notifyicon.cpp │ ├── perfmonitor.cpp │ ├── spinechar.cpp │ ├── spritewnd.cpp │ ├── utils.cpp │ └── winapp.cpp │ ├── json │ ├── json_reader.cpp │ ├── json_tool.h │ ├── json_value.cpp │ ├── json_valueiterator.inl │ └── json_writer.cpp │ └── spine │ ├── Animation.cpp │ ├── AnimationState.cpp │ ├── AnimationStateData.cpp │ ├── Array.cpp │ ├── Atlas.cpp │ ├── AtlasAttachmentLoader.cpp │ ├── Attachment.cpp │ ├── AttachmentLoader.cpp │ ├── Bone.cpp │ ├── BoneData.cpp │ ├── BoundingBoxAttachment.cpp │ ├── ClippingAttachment.cpp │ ├── Color.cpp │ ├── Event.cpp │ ├── EventData.cpp │ ├── IkConstraint.cpp │ ├── IkConstraintData.cpp │ ├── Json.cpp │ ├── Json.h │ ├── MeshAttachment.cpp │ ├── PathAttachment.cpp │ ├── PathConstraint.cpp │ ├── PathConstraintData.cpp │ ├── PointAttachment.cpp │ ├── RegionAttachment.cpp │ ├── Skeleton.cpp │ ├── SkeletonBinary.cpp │ ├── SkeletonBounds.cpp │ ├── SkeletonClipping.cpp │ ├── SkeletonData.cpp │ ├── SkeletonJson.cpp │ ├── Skin.cpp │ ├── Slot.cpp │ ├── SlotData.cpp │ ├── TransformConstraint.cpp │ ├── TransformConstraintData.cpp │ ├── Triangulator.cpp │ ├── VertexAttachment.cpp │ ├── VertexEffect.cpp │ ├── extension.cpp │ └── kvec.h ├── LICENSE ├── README.dev.md ├── README.md ├── README.user.md ├── Setup └── Setup.vdproj └── img ├── atlasconfig.png ├── biaoqiang_h.gif ├── config.png ├── guanghui_2.gif ├── lafei_h.gif ├── perfmonitor.gif └── z23_h.gif /DesktopSprite.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.2.32616.157 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "DesktopSprite", "DesktopSprite\DesktopSprite.vcxproj", "{41226B32-84C7-489C-80EA-49BD0E4EF6B6}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C20011A3-5B20-40B4-8FDB-7D6225AE442E}" 9 | ProjectSection(SolutionItems) = preProject 10 | .gitignore = .gitignore 11 | LICENSE = LICENSE 12 | README.dev.md = README.dev.md 13 | README.md = README.md 14 | README.user.md = README.user.md 15 | EndProjectSection 16 | EndProject 17 | Project("{54435603-DBB4-11D2-8724-00A0C9A8B90C}") = "Setup", "Setup\Setup.vdproj", "{885B3AD9-2218-488E-AF5B-FDB656DC7ECD}" 18 | EndProject 19 | Global 20 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 21 | Debug|x64 = Debug|x64 22 | Debug|x86 = Debug|x86 23 | Release|x64 = Release|x64 24 | Release|x86 = Release|x86 25 | EndGlobalSection 26 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 27 | {41226B32-84C7-489C-80EA-49BD0E4EF6B6}.Debug|x64.ActiveCfg = Debug|x64 28 | {41226B32-84C7-489C-80EA-49BD0E4EF6B6}.Debug|x64.Build.0 = Debug|x64 29 | {41226B32-84C7-489C-80EA-49BD0E4EF6B6}.Debug|x86.ActiveCfg = Debug|Win32 30 | {41226B32-84C7-489C-80EA-49BD0E4EF6B6}.Debug|x86.Build.0 = Debug|Win32 31 | {41226B32-84C7-489C-80EA-49BD0E4EF6B6}.Release|x64.ActiveCfg = Release|x64 32 | {41226B32-84C7-489C-80EA-49BD0E4EF6B6}.Release|x64.Build.0 = Release|x64 33 | {41226B32-84C7-489C-80EA-49BD0E4EF6B6}.Release|x86.ActiveCfg = Release|Win32 34 | {41226B32-84C7-489C-80EA-49BD0E4EF6B6}.Release|x86.Build.0 = Release|Win32 35 | {885B3AD9-2218-488E-AF5B-FDB656DC7ECD}.Debug|x64.ActiveCfg = Debug 36 | {885B3AD9-2218-488E-AF5B-FDB656DC7ECD}.Debug|x86.ActiveCfg = Debug 37 | {885B3AD9-2218-488E-AF5B-FDB656DC7ECD}.Release|x64.ActiveCfg = Release 38 | {885B3AD9-2218-488E-AF5B-FDB656DC7ECD}.Release|x86.ActiveCfg = Release 39 | EndGlobalSection 40 | GlobalSection(SolutionProperties) = preSolution 41 | HideSolutionNode = FALSE 42 | EndGlobalSection 43 | GlobalSection(ExtensibilityGlobals) = postSolution 44 | SolutionGuid = {75E6CED0-51F6-48FF-BA9B-252043CFC980} 45 | EndGlobalSection 46 | EndGlobal 47 | -------------------------------------------------------------------------------- /DesktopSprite/include/ds/aboutdlg.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef DS_ABOUTDLG_H 3 | #define DS_ABOUTDLG_H 4 | 5 | #include 6 | #include 7 | 8 | class AboutDlg : public BaseDialog 9 | { 10 | public: 11 | PCWSTR GetTemplateName() const; 12 | 13 | private: 14 | INT_PTR HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam); 15 | INT_PTR OnInitDialog(WPARAM wParam, LPARAM lParam); 16 | INT_PTR OnNotify(WPARAM wParam, LPARAM lParam); 17 | INT_PTR OnCommand(WPARAM wParam, LPARAM lParam); 18 | }; 19 | 20 | #endif // !DS_ABOUTDLG_H 21 | 22 | -------------------------------------------------------------------------------- /DesktopSprite/include/ds/basewindow.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/include/ds/basewindow.h -------------------------------------------------------------------------------- /DesktopSprite/include/ds/config.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/include/ds/config.h -------------------------------------------------------------------------------- /DesktopSprite/include/ds/configdlg.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/include/ds/configdlg.h -------------------------------------------------------------------------------- /DesktopSprite/include/ds/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef DS_FRAMEWORK_H 3 | #define DS_FRAMEWORK_H 4 | 5 | //#pragma comment(linker,"\"/manifestdependency:type='win32' \ 6 | //name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \ 7 | //processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"") 8 | 9 | // Windows headers 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | //#include 23 | 24 | // C headers 25 | #include 26 | 27 | // C++ headers 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | 34 | #endif // !DS_FRAMEWORK_H 35 | -------------------------------------------------------------------------------- /DesktopSprite/include/ds/mainwnd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/include/ds/mainwnd.h -------------------------------------------------------------------------------- /DesktopSprite/include/ds/notifyicon.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/include/ds/notifyicon.h -------------------------------------------------------------------------------- /DesktopSprite/include/ds/perfmonitor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/include/ds/perfmonitor.h -------------------------------------------------------------------------------- /DesktopSprite/include/ds/spinechar.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/include/ds/spinechar.h -------------------------------------------------------------------------------- /DesktopSprite/include/ds/spritewnd.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/include/ds/spritewnd.h -------------------------------------------------------------------------------- /DesktopSprite/include/ds/utils.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/include/ds/utils.h -------------------------------------------------------------------------------- /DesktopSprite/include/ds/version.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef DS_VERSION_H 3 | #define DS_VERSION_H 4 | 5 | // project link to github repo 6 | #define PROJECT_LINK L"https://github.com/ww-rm/DesktopSprite" 7 | 8 | #define __STR(v) #v 9 | #define _STR(v) __STR(v) 10 | 11 | #define __VERSTR(MAJOR, MINOR, PATCH, INNER) _STR(MAJOR##.##MINOR##.##PATCH##.##INNER) 12 | #define _VERSTR(MAJOR, MINOR, PATCH, INNER) __VERSTR(MAJOR, MINOR, PATCH, INNER) 13 | 14 | #define __SEMANTIC_VERSTR(MAJOR, MINOR, PATCH) _STR(v##MAJOR##.##MINOR##.##PATCH) 15 | #define _SEMANTIC_VERSTR(MAJOR, MINOR, PATCH) __SEMANTIC_VERSTR(MAJOR, MINOR, PATCH) 16 | 17 | // version num 18 | #define MAJOR_VER 1 19 | #define MINOR_VER 4 20 | #define PATCH_VER 2 21 | #define BUILD_VER 0 22 | 23 | // version string vX.Y.Z 24 | #define VERSION_STR _SEMANTIC_VERSTR(MAJOR_VER, MINOR_VER, PATCH_VER) 25 | 26 | // debug version string vX.Y.Z-debug 27 | #ifdef _DEBUG 28 | #undef VERSION_STR 29 | #define VERSION_STR _SEMANTIC_VERSTR(MAJOR_VER, MINOR_VER, PATCH_VER)##"-debug" 30 | #endif // _DEBUG 31 | 32 | // file version 33 | #define FILE_MAJOR_VER MAJOR_VER 34 | #define FILE_MINOR_VER MINOR_VER 35 | #define FILE_PATCH_VER PATCH_VER 36 | #define FILE_BUILD_VER BUILD_VER 37 | #define FILE_VERSION_VAL FILE_MAJOR_VER, FILE_MINOR_VER, FILE_PATCH_VER, FILE_BUILD_VER 38 | #define FILE_VERSION_STR _VERSTR(FILE_MAJOR_VER, FILE_MINOR_VER, FILE_PATCH_VER, FILE_BUILD_VER) 39 | 40 | // product version 41 | #define PRODUCT_MAJOR_VER MAJOR_VER 42 | #define PRODUCT_MINOR_VER MINOR_VER 43 | #define PRODUCT_PATCH_VER PATCH_VER 44 | #define PRODUCT_BUILD_VER BUILD_VER 45 | #define PRODUCT_VERSION_VAL PRODUCT_MAJOR_VER, PRODUCT_MINOR_VER, PRODUCT_PATCH_VER, PRODUCT_BUILD_VER 46 | #define PRODUCT_VERSION_STR _VERSTR(PRODUCT_MAJOR_VER, PRODUCT_MINOR_VER, PRODUCT_PATCH_VER, PRODUCT_BUILD_VER) 47 | 48 | #endif // !DS_VERSION_H 49 | -------------------------------------------------------------------------------- /DesktopSprite/include/ds/winapp.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #ifndef DS_WINAPP_H 3 | #define DS_WINAPP_H 4 | 5 | #include 6 | 7 | namespace WinApp { 8 | 9 | class WinApp 10 | { 11 | private: 12 | HANDLE hAppMutex = NULL; 13 | ULONG_PTR gdiplusToken = 0; 14 | WCHAR szExeFullDir[MAX_PATH] = { 0 }; 15 | WCHAR szExeFullPath[MAX_PATH] = { 0 }; 16 | WCHAR szAppDataDir[MAX_PATH] = { 0 }; // %APPDATA%/WinApp::GetName() 17 | WCHAR szConfigFullPath[MAX_PATH] = { 0 }; 18 | 19 | public: 20 | WinApp(); 21 | 22 | BOOL Initialize(); 23 | BOOL Uninitialize(); 24 | 25 | INT Mainloop(); 26 | 27 | PCWSTR GetName() const; 28 | PCWSTR GetPath() const; 29 | PCWSTR GetDir() const; 30 | PCWSTR GetAppDataDir() const; 31 | PCWSTR GetConfigPath() const; 32 | }; 33 | 34 | // global functions 35 | 36 | BOOL Init(); 37 | BOOL Uninit(); 38 | 39 | PCWSTR GetName(); 40 | PCWSTR GetPath(); 41 | PCWSTR GetDir(); 42 | PCWSTR GetAppDataDir(); 43 | PCWSTR GetConfigPath(); 44 | } 45 | 46 | #endif // !DS_WINAPP_H 47 | -------------------------------------------------------------------------------- /DesktopSprite/include/json/allocator.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_ALLOCATOR_H_INCLUDED 7 | #define JSON_ALLOCATOR_H_INCLUDED 8 | 9 | #include 10 | #include 11 | 12 | #pragma pack(push, 8) 13 | 14 | namespace Json { 15 | template class SecureAllocator { 16 | public: 17 | // Type definitions 18 | using value_type = T; 19 | using pointer = T*; 20 | using const_pointer = const T*; 21 | using reference = T&; 22 | using const_reference = const T&; 23 | using size_type = std::size_t; 24 | using difference_type = std::ptrdiff_t; 25 | 26 | /** 27 | * Allocate memory for N items using the standard allocator. 28 | */ 29 | pointer allocate(size_type n) { 30 | // allocate using "global operator new" 31 | return static_cast(::operator new(n * sizeof(T))); 32 | } 33 | 34 | /** 35 | * Release memory which was allocated for N items at pointer P. 36 | * 37 | * The memory block is filled with zeroes before being released. 38 | */ 39 | void deallocate(pointer p, size_type n) { 40 | // memset_s is used because memset may be optimized away by the compiler 41 | memset_s(p, n * sizeof(T), 0, n * sizeof(T)); 42 | // free using "global operator delete" 43 | ::operator delete(p); 44 | } 45 | 46 | /** 47 | * Construct an item in-place at pointer P. 48 | */ 49 | template void construct(pointer p, Args&&... args) { 50 | // construct using "placement new" and "perfect forwarding" 51 | ::new (static_cast(p)) T(std::forward(args)...); 52 | } 53 | 54 | size_type max_size() const { return size_t(-1) / sizeof(T); } 55 | 56 | pointer address(reference x) const { return std::addressof(x); } 57 | 58 | const_pointer address(const_reference x) const { return std::addressof(x); } 59 | 60 | /** 61 | * Destroy an item in-place at pointer P. 62 | */ 63 | void destroy(pointer p) { 64 | // destroy using "explicit destructor" 65 | p->~T(); 66 | } 67 | 68 | // Boilerplate 69 | SecureAllocator() {} 70 | template SecureAllocator(const SecureAllocator&) {} 71 | template struct rebind { using other = SecureAllocator; }; 72 | }; 73 | 74 | template 75 | bool operator==(const SecureAllocator&, const SecureAllocator&) { 76 | return true; 77 | } 78 | 79 | template 80 | bool operator!=(const SecureAllocator&, const SecureAllocator&) { 81 | return false; 82 | } 83 | 84 | } // namespace Json 85 | 86 | #pragma pack(pop) 87 | 88 | #endif // JSON_ALLOCATOR_H_INCLUDED 89 | -------------------------------------------------------------------------------- /DesktopSprite/include/json/assertions.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_ASSERTIONS_H_INCLUDED 7 | #define JSON_ASSERTIONS_H_INCLUDED 8 | 9 | #include 10 | #include 11 | 12 | #if !defined(JSON_IS_AMALGAMATION) 13 | #include "config.h" 14 | #endif // if !defined(JSON_IS_AMALGAMATION) 15 | 16 | /** It should not be possible for a maliciously designed file to 17 | * cause an abort() or seg-fault, so these macros are used only 18 | * for pre-condition violations and internal logic errors. 19 | */ 20 | #if JSON_USE_EXCEPTION 21 | 22 | // @todo <= add detail about condition in exception 23 | #define JSON_ASSERT(condition) \ 24 | do { \ 25 | if (!(condition)) { \ 26 | Json::throwLogicError("assert json failed"); \ 27 | } \ 28 | } while (0) 29 | 30 | #define JSON_FAIL_MESSAGE(message) \ 31 | do { \ 32 | OStringStream oss; \ 33 | oss << message; \ 34 | Json::throwLogicError(oss.str()); \ 35 | abort(); \ 36 | } while (0) 37 | 38 | #else // JSON_USE_EXCEPTION 39 | 40 | #define JSON_ASSERT(condition) assert(condition) 41 | 42 | // The call to assert() will show the failure message in debug builds. In 43 | // release builds we abort, for a core-dump or debugger. 44 | #define JSON_FAIL_MESSAGE(message) \ 45 | { \ 46 | OStringStream oss; \ 47 | oss << message; \ 48 | assert(false && oss.str().c_str()); \ 49 | abort(); \ 50 | } 51 | 52 | #endif 53 | 54 | #define JSON_ASSERT_MESSAGE(condition, message) \ 55 | do { \ 56 | if (!(condition)) { \ 57 | JSON_FAIL_MESSAGE(message); \ 58 | } \ 59 | } while (0) 60 | 61 | #endif // JSON_ASSERTIONS_H_INCLUDED 62 | -------------------------------------------------------------------------------- /DesktopSprite/include/json/forwards.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_FORWARDS_H_INCLUDED 7 | #define JSON_FORWARDS_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "config.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | namespace Json { 14 | 15 | // writer.h 16 | class StreamWriter; 17 | class StreamWriterBuilder; 18 | class Writer; 19 | class FastWriter; 20 | class StyledWriter; 21 | class StyledStreamWriter; 22 | 23 | // reader.h 24 | class Reader; 25 | class CharReader; 26 | class CharReaderBuilder; 27 | 28 | // json_features.h 29 | class Features; 30 | 31 | // value.h 32 | using ArrayIndex = unsigned int; 33 | class StaticString; 34 | class Path; 35 | class PathArgument; 36 | class Value; 37 | class ValueIteratorBase; 38 | class ValueIterator; 39 | class ValueConstIterator; 40 | 41 | } // namespace Json 42 | 43 | #endif // JSON_FORWARDS_H_INCLUDED 44 | -------------------------------------------------------------------------------- /DesktopSprite/include/json/json.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_JSON_H_INCLUDED 7 | #define JSON_JSON_H_INCLUDED 8 | 9 | #include "config.h" 10 | #include "json_features.h" 11 | #include "reader.h" 12 | #include "value.h" 13 | #include "writer.h" 14 | 15 | #endif // JSON_JSON_H_INCLUDED 16 | -------------------------------------------------------------------------------- /DesktopSprite/include/json/json_features.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_FEATURES_H_INCLUDED 7 | #define JSON_FEATURES_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "forwards.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | #pragma pack(push, 8) 14 | 15 | namespace Json { 16 | 17 | /** \brief Configuration passed to reader and writer. 18 | * This configuration object can be used to force the Reader or Writer 19 | * to behave in a standard conforming way. 20 | */ 21 | class JSON_API Features { 22 | public: 23 | /** \brief A configuration that allows all features and assumes all strings 24 | * are UTF-8. 25 | * - C & C++ comments are allowed 26 | * - Root object can be any JSON value 27 | * - Assumes Value strings are encoded in UTF-8 28 | */ 29 | static Features all(); 30 | 31 | /** \brief A configuration that is strictly compatible with the JSON 32 | * specification. 33 | * - Comments are forbidden. 34 | * - Root object must be either an array or an object value. 35 | * - Assumes Value strings are encoded in UTF-8 36 | */ 37 | static Features strictMode(); 38 | 39 | /** \brief Initialize the configuration like JsonConfig::allFeatures; 40 | */ 41 | Features(); 42 | 43 | /// \c true if comments are allowed. Default: \c true. 44 | bool allowComments_{true}; 45 | 46 | /// \c true if root must be either an array or an object value. Default: \c 47 | /// false. 48 | bool strictRoot_{false}; 49 | 50 | /// \c true if dropped null placeholders are allowed. Default: \c false. 51 | bool allowDroppedNullPlaceholders_{false}; 52 | 53 | /// \c true if numeric object key are allowed. Default: \c false. 54 | bool allowNumericKeys_{false}; 55 | }; 56 | 57 | } // namespace Json 58 | 59 | #pragma pack(pop) 60 | 61 | #endif // JSON_FEATURES_H_INCLUDED 62 | -------------------------------------------------------------------------------- /DesktopSprite/include/json/version.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_VERSION_H_INCLUDED 2 | #define JSON_VERSION_H_INCLUDED 3 | 4 | // Note: version must be updated in three places when doing a release. This 5 | // annoying process ensures that amalgamate, CMake, and meson all report the 6 | // correct version. 7 | // 1. /meson.build 8 | // 2. /include/json/version.h 9 | // 3. /CMakeLists.txt 10 | // IMPORTANT: also update the SOVERSION!! 11 | 12 | #define JSONCPP_VERSION_STRING "1.9.5" 13 | #define JSONCPP_VERSION_MAJOR 1 14 | #define JSONCPP_VERSION_MINOR 9 15 | #define JSONCPP_VERSION_PATCH 5 16 | #define JSONCPP_VERSION_QUALIFIER 17 | #define JSONCPP_VERSION_HEXA \ 18 | ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \ 19 | (JSONCPP_VERSION_PATCH << 8)) 20 | 21 | #ifdef JSONCPP_USING_SECURE_MEMORY 22 | #undef JSONCPP_USING_SECURE_MEMORY 23 | #endif 24 | #define JSONCPP_USING_SECURE_MEMORY 0 25 | // If non-zero, the library zeroes any memory that it has allocated before 26 | // it frees its memory. 27 | 28 | #endif // JSON_VERSION_H_INCLUDED 29 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/AnimationStateData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_ANIMATIONSTATEDATA_H_ 32 | #define SPINE_ANIMATIONSTATEDATA_H_ 33 | 34 | #include 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 | SP_API spAnimationStateData* spAnimationStateData_create (spSkeletonData* skeletonData); 57 | SP_API void spAnimationStateData_dispose (spAnimationStateData* self); 58 | 59 | SP_API void spAnimationStateData_setMixByName (spAnimationStateData* self, const char* fromName, const char* toName, float duration); 60 | SP_API void spAnimationStateData_setMix (spAnimationStateData* self, spAnimation* from, spAnimation* to, float duration); 61 | /* Returns 0 if there is no mixing between the animations. */ 62 | SP_API 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 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/AtlasAttachmentLoader.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_ATLASATTACHMENTLOADER_H_ 32 | #define SPINE_ATLASATTACHMENTLOADER_H_ 33 | 34 | #include 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 | SP_API 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 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/Attachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_ATTACHMENT_H_ 32 | #define SPINE_ATTACHMENT_H_ 33 | 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | struct spAttachmentLoader; 41 | 42 | typedef enum { 43 | SP_ATTACHMENT_REGION, 44 | SP_ATTACHMENT_BOUNDING_BOX, 45 | SP_ATTACHMENT_MESH, 46 | SP_ATTACHMENT_LINKED_MESH, 47 | SP_ATTACHMENT_PATH, 48 | SP_ATTACHMENT_POINT, 49 | SP_ATTACHMENT_CLIPPING 50 | } spAttachmentType; 51 | 52 | typedef struct spAttachment { 53 | const char* const name; 54 | const spAttachmentType type; 55 | const void* const vtable; 56 | struct spAttachmentLoader* attachmentLoader; 57 | 58 | #ifdef __cplusplus 59 | spAttachment() : 60 | name(0), 61 | type(SP_ATTACHMENT_REGION), 62 | vtable(0) { 63 | } 64 | #endif 65 | } spAttachment; 66 | 67 | void spAttachment_dispose (spAttachment* self); 68 | 69 | #ifdef SPINE_SHORT_NAMES 70 | typedef spAttachmentType AttachmentType; 71 | #define ATTACHMENT_REGION SP_ATTACHMENT_REGION 72 | #define ATTACHMENT_BOUNDING_BOX SP_ATTACHMENT_BOUNDING_BOX 73 | #define ATTACHMENT_MESH SP_ATTACHMENT_MESH 74 | #define ATTACHMENT_LINKED_MESH SP_ATTACHMENT_LINKED_MESH 75 | typedef spAttachment Attachment; 76 | #define Attachment_dispose(...) spAttachment_dispose(__VA_ARGS__) 77 | #endif 78 | 79 | #ifdef __cplusplus 80 | } 81 | #endif 82 | 83 | #endif /* SPINE_ATTACHMENT_H_ */ 84 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/AttachmentLoader.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_ATTACHMENTLOADER_H_ 32 | #define SPINE_ATTACHMENTLOADER_H_ 33 | 34 | #include 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 | SP_API 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 | SP_API 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 | SP_API void spAttachmentLoader_configureAttachment (spAttachmentLoader* self, spAttachment* attachment); 64 | /* Called just before the attachment is disposed. This can release allocations made in spAttachmentLoader_configureAttachment. */ 65 | SP_API 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 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/BoneData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_BONEDATA_H_ 32 | #define SPINE_BONEDATA_H_ 33 | 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | typedef enum { 41 | SP_TRANSFORMMODE_NORMAL, 42 | SP_TRANSFORMMODE_ONLYTRANSLATION, 43 | SP_TRANSFORMMODE_NOROTATIONORREFLECTION, 44 | SP_TRANSFORMMODE_NOSCALE, 45 | SP_TRANSFORMMODE_NOSCALEORREFLECTION 46 | } spTransformMode; 47 | 48 | typedef struct spBoneData spBoneData; 49 | struct spBoneData { 50 | const int index; 51 | const char* const name; 52 | spBoneData* const parent; 53 | float length; 54 | float x, y, rotation, scaleX, scaleY, shearX, shearY; 55 | spTransformMode transformMode; 56 | 57 | #ifdef __cplusplus 58 | spBoneData() : 59 | index(0), 60 | name(0), 61 | parent(0), 62 | length(0), 63 | x(0), y(0), 64 | rotation(0), 65 | scaleX(0), scaleY(0), 66 | shearX(0), shearY(0), 67 | transformMode(SP_TRANSFORMMODE_NORMAL) { 68 | } 69 | #endif 70 | }; 71 | 72 | SP_API spBoneData* spBoneData_create (int index, const char* name, spBoneData* parent); 73 | SP_API void spBoneData_dispose (spBoneData* self); 74 | 75 | #ifdef SPINE_SHORT_NAMES 76 | typedef spBoneData BoneData; 77 | #define BoneData_create(...) spBoneData_create(__VA_ARGS__) 78 | #define BoneData_dispose(...) spBoneData_dispose(__VA_ARGS__) 79 | #endif 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* SPINE_BONEDATA_H_ */ 86 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/BoundingBoxAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_BOUNDINGBOXATTACHMENT_H_ 32 | #define SPINE_BOUNDINGBOXATTACHMENT_H_ 33 | 34 | #include 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 | SP_API spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name); 49 | 50 | #ifdef SPINE_SHORT_NAMES 51 | typedef spBoundingBoxAttachment BoundingBoxAttachment; 52 | #define BoundingBoxAttachment_create(...) spBoundingBoxAttachment_create(__VA_ARGS__) 53 | #endif 54 | 55 | #ifdef __cplusplus 56 | } 57 | #endif 58 | 59 | #endif /* SPINE_BOUNDINGBOXATTACHMENT_H_ */ 60 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/ClippingAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_CLIPPINGATTACHMENT_H_ 32 | #define SPINE_CLIPPINGATTACHMENT_H_ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef struct spClippingAttachment { 45 | spVertexAttachment super; 46 | spSlotData* endSlot; 47 | } spClippingAttachment; 48 | 49 | SP_API void _spClippingAttachment_dispose(spAttachment* self); 50 | SP_API spClippingAttachment* spClippingAttachment_create (const char* name); 51 | 52 | #ifdef SPINE_SHORT_NAMES 53 | typedef spClippingAttachment ClippingAttachment; 54 | #define ClippingAttachment_create(...) spClippingAttachment_create(__VA_ARGS__) 55 | #endif 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif /* SPINE_CLIPPINGATTACHMENT_H_ */ 62 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/Color.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_COLOR_H_ 32 | #define SPINE_COLOR_H_ 33 | 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | typedef struct spColor { 41 | float r, g, b, a; 42 | 43 | #ifdef __cplusplus 44 | spColor() : 45 | r(0), g(0), b(0), a(0) { 46 | } 47 | 48 | bool operator==(const spColor& rhs) { 49 | return r == rhs.r && g == rhs.g && b == rhs.b && a == rhs.a; 50 | } 51 | #endif 52 | } spColor; 53 | 54 | /* @param attachmentName May be 0 for no setup pose attachment. */ 55 | SP_API spColor* spColor_create(); 56 | SP_API void spColor_dispose(spColor* self); 57 | SP_API void spColor_setFromFloats(spColor* color, float r, float g, float b, float a); 58 | SP_API void spColor_setFromColor(spColor* color, spColor* otherColor); 59 | SP_API void spColor_addFloats(spColor* color, float r, float g, float b, float a); 60 | SP_API void spColor_addColor(spColor* color, spColor* otherColor); 61 | SP_API void spColor_clamp(spColor* color); 62 | 63 | #ifdef SPINE_SHORT_NAMES 64 | typedef spColor color; 65 | #define Color_create() spColor_create() 66 | #define Color_dispose(...) spColor_dispose(__VA_ARGS__) 67 | #define Color_setFromFloats(...) spColor_setFromFloats(__VA_ARGS__) 68 | #define Color_setFromColor(...) spColor_setFromColor(__VA_ARGS__) 69 | #define Color_addColor(...) spColor_addColor(__VA_ARGS__) 70 | #define Color_addFloats(...) spColor_addFloats(__VA_ARGS__) 71 | #define Color_clamp(...) spColor_clamp(__VA_ARGS__) 72 | #endif 73 | 74 | #ifdef __cplusplus 75 | } 76 | #endif 77 | 78 | #endif /* SPINE_COLOR_H_ */ 79 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/Event.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_EVENT_H_ 32 | #define SPINE_EVENT_H_ 33 | 34 | #include 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 | SP_API spEvent* spEvent_create (float time, spEventData* data); 60 | SP_API 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 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/EventData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_EVENTDATA_H_ 32 | #define SPINE_EVENTDATA_H_ 33 | 34 | #include 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | typedef struct spEventData { 41 | const char* const name; 42 | int intValue; 43 | float floatValue; 44 | const char* stringValue; 45 | 46 | #ifdef __cplusplus 47 | spEventData() : 48 | name(0), 49 | intValue(0), 50 | floatValue(0), 51 | stringValue(0) { 52 | } 53 | #endif 54 | } spEventData; 55 | 56 | SP_API spEventData* spEventData_create (const char* name); 57 | SP_API void spEventData_dispose (spEventData* self); 58 | 59 | #ifdef SPINE_SHORT_NAMES 60 | typedef spEventData EventData; 61 | #define EventData_create(...) spEventData_create(__VA_ARGS__) 62 | #define EventData_dispose(...) spEventData_dispose(__VA_ARGS__) 63 | #endif 64 | 65 | #ifdef __cplusplus 66 | } 67 | #endif 68 | 69 | #endif /* SPINE_EVENTDATA_H_ */ 70 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/IkConstraint.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_IKCONSTRAINT_H_ 32 | #define SPINE_IKCONSTRAINT_H_ 33 | 34 | #include 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 | #ifdef __cplusplus 55 | spIkConstraint() : 56 | data(0), 57 | bonesCount(0), 58 | bones(0), 59 | target(0), 60 | bendDirection(0), 61 | mix(0) { 62 | } 63 | #endif 64 | } spIkConstraint; 65 | 66 | SP_API spIkConstraint* spIkConstraint_create (spIkConstraintData* data, const struct spSkeleton* skeleton); 67 | SP_API void spIkConstraint_dispose (spIkConstraint* self); 68 | 69 | SP_API void spIkConstraint_apply (spIkConstraint* self); 70 | 71 | SP_API void spIkConstraint_apply1 (spBone* bone, float targetX, float targetY, float alpha); 72 | SP_API void spIkConstraint_apply2 (spBone* parent, spBone* child, float targetX, float targetY, int bendDirection, float alpha); 73 | 74 | #ifdef SPINE_SHORT_NAMES 75 | typedef spIkConstraint IkConstraint; 76 | #define IkConstraint_create(...) spIkConstraint_create(__VA_ARGS__) 77 | #define IkConstraint_dispose(...) spIkConstraint_dispose(__VA_ARGS__) 78 | #define IkConstraint_apply(...) spIkConstraint_apply(__VA_ARGS__) 79 | #define IkConstraint_apply1(...) spIkConstraint_apply1(__VA_ARGS__) 80 | #define IkConstraint_apply2(...) spIkConstraint_apply2(__VA_ARGS__) 81 | #endif 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | #endif /* SPINE_IKCONSTRAINT_H_ */ 88 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/IkConstraintData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_IKCONSTRAINTDATA_H_ 32 | #define SPINE_IKCONSTRAINTDATA_H_ 33 | 34 | #include 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef struct spIkConstraintData { 42 | const char* const name; 43 | int order; 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 | SP_API spIkConstraintData* spIkConstraintData_create (const char* name); 64 | SP_API 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 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/MeshAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_MESHATTACHMENT_H_ 32 | #define SPINE_MESHATTACHMENT_H_ 33 | 34 | #include 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 | spColor color; 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 | SP_API spMeshAttachment* spMeshAttachment_create (const char* name); 77 | SP_API void spMeshAttachment_updateUVs (spMeshAttachment* self); 78 | SP_API void spMeshAttachment_setParentMesh (spMeshAttachment* self, spMeshAttachment* parentMesh); 79 | 80 | #ifdef SPINE_SHORT_NAMES 81 | typedef spMeshAttachment MeshAttachment; 82 | #define MeshAttachment_create(...) spMeshAttachment_create(__VA_ARGS__) 83 | #define MeshAttachment_updateUVs(...) spMeshAttachment_updateUVs(__VA_ARGS__) 84 | #define MeshAttachment_setParentMesh(...) spMeshAttachment_setParentMesh(__VA_ARGS__) 85 | #endif 86 | 87 | #ifdef __cplusplus 88 | } 89 | #endif 90 | 91 | #endif /* SPINE_MESHATTACHMENT_H_ */ 92 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/PathAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_PATHATTACHMENT_H_ 32 | #define SPINE_PATHATTACHMENT_H_ 33 | 34 | #include 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 | SP_API spPathAttachment* spPathAttachment_create (const char* name); 52 | 53 | #ifdef SPINE_SHORT_NAMES 54 | typedef spPathAttachment PathAttachment; 55 | #define PathAttachment_create(...) spPathAttachment_create(__VA_ARGS__) 56 | #define PathAttachment_computeWorldVertices(...) spPathAttachment_computeWorldVertices(__VA_ARGS__) 57 | #endif 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* SPINE_PATHATTACHMENT_H_ */ 64 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/PathConstraint.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_PATHCONSTRAINT_H_ 32 | #define SPINE_PATHCONSTRAINT_H_ 33 | 34 | #include 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 | SP_API spPathConstraint* spPathConstraint_create (spPathConstraintData* data, const struct spSkeleton* skeleton); 97 | SP_API void spPathConstraint_dispose (spPathConstraint* self); 98 | 99 | SP_API void spPathConstraint_apply (spPathConstraint* self); 100 | SP_API 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 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/PathConstraintData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_PATHCONSTRAINTDATA_H_ 32 | #define SPINE_PATHCONSTRAINTDATA_H_ 33 | 34 | #include 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 order; 57 | int bonesCount; 58 | spBoneData** const bones; 59 | spSlotData* target; 60 | spPositionMode positionMode; 61 | spSpacingMode spacingMode; 62 | spRotateMode rotateMode; 63 | float offsetRotation; 64 | float position, spacing, rotateMix, translateMix; 65 | 66 | #ifdef __cplusplus 67 | spPathConstraintData() : 68 | name(0), 69 | bonesCount(0), 70 | bones(0), 71 | target(0), 72 | positionMode(SP_POSITION_MODE_FIXED), 73 | spacingMode(SP_SPACING_MODE_LENGTH), 74 | rotateMode(SP_ROTATE_MODE_TANGENT), 75 | offsetRotation(0), 76 | position(0), 77 | spacing(0), 78 | rotateMix(0), 79 | translateMix(0) { 80 | } 81 | #endif 82 | } spPathConstraintData; 83 | 84 | SP_API spPathConstraintData* spPathConstraintData_create (const char* name); 85 | SP_API void spPathConstraintData_dispose (spPathConstraintData* self); 86 | 87 | #ifdef SPINE_SHORT_NAMES 88 | typedef spPathConstraintData PathConstraintData; 89 | #define PathConstraintData_create(...) spPathConstraintData_create(__VA_ARGS__) 90 | #define PathConstraintData_dispose(...) spPathConstraintData_dispose(__VA_ARGS__) 91 | #endif 92 | 93 | #ifdef __cplusplus 94 | } 95 | #endif 96 | 97 | #endif /* SPINE_PATHCONSTRAINTDATA_H_ */ 98 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/PointAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_POINTATTACHMENT_H_ 32 | #define SPINE_POINTATTACHMENT_H_ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef struct spPointAttachment { 45 | spVertexAttachment super; 46 | float x, y, rotation; 47 | spColor color; 48 | } spPointAttachment; 49 | 50 | SP_API spPointAttachment* spPointAttachment_create (const char* name); 51 | SP_API void spPointAttachment_computeWorldPosition (spPointAttachment* self, spBone* bone, float* x, float* y); 52 | SP_API float spPointAttachment_computeWorldRotation (spPointAttachment* self, spBone* bone); 53 | 54 | #ifdef SPINE_SHORT_NAMES 55 | typedef spPointAttachment PointAttachment; 56 | #define PointAttachment_create(...) spPointAttachment_create(__VA_ARGS__) 57 | #define PointAttachment_computeWorldPosition(...) spPointAttachment_computeWorldPosition(__VA_ARGS__) 58 | #define PointAttachment_computeWorldRotation(...) spPointAttachment_computeWorldRotation(__VA_ARGS__) 59 | #endif 60 | 61 | #ifdef __cplusplus 62 | } 63 | #endif 64 | 65 | #endif /* SPINE_POINTATTACHMENT_H_ */ 66 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/RegionAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_REGIONATTACHMENT_H_ 32 | #define SPINE_REGIONATTACHMENT_H_ 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | typedef struct spRegionAttachment { 44 | spAttachment super; 45 | const char* path; 46 | float x, y, scaleX, scaleY, rotation, width, height; 47 | spColor color; 48 | 49 | void* rendererObject; 50 | int regionOffsetX, regionOffsetY; /* Pixels stripped from the bottom left, unrotated. */ 51 | int regionWidth, regionHeight; /* Unrotated, stripped pixel size. */ 52 | int regionOriginalWidth, regionOriginalHeight; /* Unrotated, unstripped pixel size. */ 53 | 54 | float offset[8]; 55 | float uvs[8]; 56 | } spRegionAttachment; 57 | 58 | SP_API spRegionAttachment* spRegionAttachment_create (const char* name); 59 | SP_API void spRegionAttachment_setUVs (spRegionAttachment* self, float u, float v, float u2, float v2, int/*bool*/rotate); 60 | SP_API void spRegionAttachment_updateOffset (spRegionAttachment* self); 61 | SP_API void spRegionAttachment_computeWorldVertices (spRegionAttachment* self, spBone* bone, float* vertices, int offset, int stride); 62 | 63 | #ifdef SPINE_SHORT_NAMES 64 | typedef spRegionAttachment RegionAttachment; 65 | #define RegionAttachment_create(...) spRegionAttachment_create(__VA_ARGS__) 66 | #define RegionAttachment_setUVs(...) spRegionAttachment_setUVs(__VA_ARGS__) 67 | #define RegionAttachment_updateOffset(...) spRegionAttachment_updateOffset(__VA_ARGS__) 68 | #define RegionAttachment_computeWorldVertices(...) spRegionAttachment_computeWorldVertices(__VA_ARGS__) 69 | #endif 70 | 71 | #ifdef __cplusplus 72 | } 73 | #endif 74 | 75 | #endif /* SPINE_REGIONATTACHMENT_H_ */ 76 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/SkeletonBinary.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_SKELETONBINARY_H_ 32 | #define SPINE_SKELETONBINARY_H_ 33 | 34 | #include 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 | SP_API spSkeletonBinary* spSkeletonBinary_createWithLoader (spAttachmentLoader* attachmentLoader); 53 | SP_API spSkeletonBinary* spSkeletonBinary_create (spAtlas* atlas); 54 | SP_API void spSkeletonBinary_dispose (spSkeletonBinary* self); 55 | 56 | SP_API spSkeletonData* spSkeletonBinary_readSkeletonData (spSkeletonBinary* self, const unsigned char* binary, const int length); 57 | SP_API 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 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/SkeletonClipping.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_SKELETONCLIPPING_H 32 | #define SPINE_SKELETONCLIPPING_H 33 | 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | typedef struct spSkeletonClipping { 45 | spTriangulator* triangulator; 46 | spFloatArray* clippingPolygon; 47 | spFloatArray* clipOutput; 48 | spFloatArray* clippedVertices; 49 | spFloatArray* clippedUVs; 50 | spUnsignedShortArray* clippedTriangles; 51 | spFloatArray* scratch; 52 | spClippingAttachment* clipAttachment; 53 | spArrayFloatArray* clippingPolygons; 54 | } spSkeletonClipping; 55 | 56 | SP_API spSkeletonClipping* spSkeletonClipping_create(); 57 | SP_API int spSkeletonClipping_clipStart(spSkeletonClipping* self, spSlot* slot, spClippingAttachment* clip); 58 | SP_API void spSkeletonClipping_clipEnd(spSkeletonClipping* self, spSlot* slot); 59 | SP_API void spSkeletonClipping_clipEnd2(spSkeletonClipping* self); 60 | SP_API int /*boolean*/ spSkeletonClipping_isClipping(spSkeletonClipping* self); 61 | SP_API void spSkeletonClipping_clipTriangles(spSkeletonClipping* self, float* vertices, int verticesLength, unsigned short* triangles, int trianglesLength, float* uvs, int stride); 62 | SP_API void spSkeletonClipping_dispose(spSkeletonClipping* self); 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* SPINE_SKELETONCLIPPING_H */ 69 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/SkeletonJson.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_SKELETONJSON_H_ 32 | #define SPINE_SKELETONJSON_H_ 33 | 34 | #include 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 | SP_API spSkeletonJson* spSkeletonJson_createWithLoader (spAttachmentLoader* attachmentLoader); 54 | SP_API spSkeletonJson* spSkeletonJson_create (spAtlas* atlas); 55 | SP_API void spSkeletonJson_dispose (spSkeletonJson* self); 56 | 57 | SP_API spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const char* json); 58 | SP_API 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 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/Skin.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_SKIN_H_ 32 | #define SPINE_SKIN_H_ 33 | 34 | #include 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | /* Size of hashtable used in skin structure for fast attachment lookup. */ 42 | #define SKIN_ENTRIES_HASH_TABLE_SIZE 100 43 | 44 | struct spSkeleton; 45 | 46 | typedef struct spSkin { 47 | const char* const name; 48 | 49 | #ifdef __cplusplus 50 | spSkin() : 51 | name(0) { 52 | } 53 | #endif 54 | } spSkin; 55 | 56 | /* Private structs, needed by Skeleton */ 57 | typedef struct _Entry _Entry; 58 | struct _Entry { 59 | int slotIndex; 60 | const char* name; 61 | spAttachment* attachment; 62 | _Entry* next; 63 | }; 64 | 65 | typedef struct _SkinHashTableEntry _SkinHashTableEntry; 66 | struct _SkinHashTableEntry { 67 | _Entry* entry; 68 | _SkinHashTableEntry* next; /* list for elements with same hashes */ 69 | }; 70 | 71 | typedef struct { 72 | spSkin super; 73 | _Entry* entries; /* entries list stored for getting attachment name by attachment index */ 74 | _SkinHashTableEntry* entriesHashTable[SKIN_ENTRIES_HASH_TABLE_SIZE]; /* hashtable for fast attachment lookup */ 75 | } _spSkin; 76 | 77 | SP_API spSkin* spSkin_create (const char* name); 78 | SP_API void spSkin_dispose (spSkin* self); 79 | 80 | /* The Skin owns the attachment. */ 81 | SP_API void spSkin_addAttachment (spSkin* self, int slotIndex, const char* name, spAttachment* attachment); 82 | /* Returns 0 if the attachment was not found. */ 83 | SP_API spAttachment* spSkin_getAttachment (const spSkin* self, int slotIndex, const char* name); 84 | 85 | /* Returns 0 if the slot or attachment was not found. */ 86 | SP_API const char* spSkin_getAttachmentName (const spSkin* self, int slotIndex, int attachmentIndex); 87 | 88 | /** Attach each attachment in this skin if the corresponding attachment in oldSkin is currently attached. */ 89 | SP_API void spSkin_attachAll (const spSkin* self, struct spSkeleton* skeleton, const spSkin* oldspSkin); 90 | 91 | #ifdef SPINE_SHORT_NAMES 92 | typedef spSkin Skin; 93 | #define Skin_create(...) spSkin_create(__VA_ARGS__) 94 | #define Skin_dispose(...) spSkin_dispose(__VA_ARGS__) 95 | #define Skin_addAttachment(...) spSkin_addAttachment(__VA_ARGS__) 96 | #define Skin_getAttachment(...) spSkin_getAttachment(__VA_ARGS__) 97 | #define Skin_getAttachmentName(...) spSkin_getAttachmentName(__VA_ARGS__) 98 | #define Skin_attachAll(...) spSkin_attachAll(__VA_ARGS__) 99 | #endif 100 | 101 | #ifdef __cplusplus 102 | } 103 | #endif 104 | 105 | #endif /* SPINE_SKIN_H_ */ 106 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/Slot.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_SLOT_H_ 32 | #define SPINE_SLOT_H_ 33 | 34 | #include 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 | spColor color; 47 | spColor* darkColor; 48 | spAttachment* const attachment; 49 | 50 | int attachmentVerticesCapacity; 51 | int attachmentVerticesCount; 52 | float* attachmentVertices; 53 | 54 | #ifdef __cplusplus 55 | spSlot() : 56 | data(0), 57 | bone(0), 58 | color(), 59 | darkColor(0), 60 | attachment(0), 61 | attachmentVerticesCapacity(0), 62 | attachmentVerticesCount(0), 63 | attachmentVertices(0) { 64 | } 65 | #endif 66 | } spSlot; 67 | 68 | SP_API spSlot* spSlot_create (spSlotData* data, spBone* bone); 69 | SP_API void spSlot_dispose (spSlot* self); 70 | 71 | /* @param attachment May be 0 to clear the attachment for the slot. */ 72 | SP_API void spSlot_setAttachment (spSlot* self, spAttachment* attachment); 73 | 74 | SP_API void spSlot_setAttachmentTime (spSlot* self, float time); 75 | SP_API float spSlot_getAttachmentTime (const spSlot* self); 76 | 77 | SP_API void spSlot_setToSetupPose (spSlot* self); 78 | 79 | #ifdef SPINE_SHORT_NAMES 80 | typedef spSlot Slot; 81 | #define Slot_create(...) spSlot_create(__VA_ARGS__) 82 | #define Slot_dispose(...) spSlot_dispose(__VA_ARGS__) 83 | #define Slot_setAttachment(...) spSlot_setAttachment(__VA_ARGS__) 84 | #define Slot_setAttachmentTime(...) spSlot_setAttachmentTime(__VA_ARGS__) 85 | #define Slot_getAttachmentTime(...) spSlot_getAttachmentTime(__VA_ARGS__) 86 | #define Slot_setToSetupPose(...) spSlot_setToSetupPose(__VA_ARGS__) 87 | #endif 88 | 89 | #ifdef __cplusplus 90 | } 91 | #endif 92 | 93 | #endif /* SPINE_SLOT_H_ */ 94 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/SlotData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_SLOTDATA_H_ 32 | #define SPINE_SLOTDATA_H_ 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | typedef enum { 43 | SP_BLEND_MODE_NORMAL, SP_BLEND_MODE_ADDITIVE, SP_BLEND_MODE_MULTIPLY, SP_BLEND_MODE_SCREEN 44 | } spBlendMode; 45 | 46 | typedef struct spSlotData { 47 | const int index; 48 | const char* const name; 49 | const spBoneData* const boneData; 50 | const char* attachmentName; 51 | spColor color; 52 | spColor* darkColor; 53 | spBlendMode blendMode; 54 | 55 | #ifdef __cplusplus 56 | spSlotData() : 57 | index(0), 58 | name(0), 59 | boneData(0), 60 | attachmentName(0), 61 | color(), 62 | darkColor(0), 63 | blendMode(SP_BLEND_MODE_NORMAL) { 64 | } 65 | #endif 66 | } spSlotData; 67 | 68 | SP_API spSlotData* spSlotData_create (const int index, const char* name, spBoneData* boneData); 69 | SP_API void spSlotData_dispose (spSlotData* self); 70 | 71 | /* @param attachmentName May be 0 for no setup pose attachment. */ 72 | SP_API void spSlotData_setAttachmentName (spSlotData* self, const char* attachmentName); 73 | 74 | #ifdef SPINE_SHORT_NAMES 75 | typedef spBlendMode BlendMode; 76 | #define BLEND_MODE_NORMAL SP_BLEND_MODE_NORMAL 77 | #define BLEND_MODE_ADDITIVE SP_BLEND_MODE_ADDITIVE 78 | #define BLEND_MODE_MULTIPLY SP_BLEND_MODE_MULTIPLY 79 | #define BLEND_MODE_SCREEN SP_BLEND_MODE_SCREEN 80 | typedef spSlotData SlotData; 81 | #define SlotData_create(...) spSlotData_create(__VA_ARGS__) 82 | #define SlotData_dispose(...) spSlotData_dispose(__VA_ARGS__) 83 | #define SlotData_setAttachmentName(...) spSlotData_setAttachmentName(__VA_ARGS__) 84 | #endif 85 | 86 | #ifdef __cplusplus 87 | } 88 | #endif 89 | 90 | #endif /* SPINE_SLOTDATA_H_ */ 91 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/TransformConstraint.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_TRANSFORMCONSTRAINT_H_ 32 | #define SPINE_TRANSFORMCONSTRAINT_H_ 33 | 34 | #include 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 | SP_API spTransformConstraint* spTransformConstraint_create (spTransformConstraintData* data, const struct spSkeleton* skeleton); 66 | SP_API void spTransformConstraint_dispose (spTransformConstraint* self); 67 | 68 | SP_API 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 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/TransformConstraintData.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_TRANSFORMCONSTRAINTDATA_H_ 32 | #define SPINE_TRANSFORMCONSTRAINTDATA_H_ 33 | 34 | #include 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef struct spTransformConstraintData { 42 | const char* const name; 43 | int order; 44 | int bonesCount; 45 | spBoneData** const bones; 46 | spBoneData* target; 47 | float rotateMix, translateMix, scaleMix, shearMix; 48 | float offsetRotation, offsetX, offsetY, offsetScaleX, offsetScaleY, offsetShearY; 49 | int /*boolean*/ relative; 50 | int /*boolean*/ local; 51 | 52 | #ifdef __cplusplus 53 | spTransformConstraintData() : 54 | name(0), 55 | bonesCount(0), 56 | bones(0), 57 | target(0), 58 | rotateMix(0), 59 | translateMix(0), 60 | scaleMix(0), 61 | shearMix(0), 62 | offsetRotation(0), 63 | offsetX(0), 64 | offsetY(0), 65 | offsetScaleX(0), 66 | offsetScaleY(0), 67 | offsetShearY(0), 68 | relative(0), 69 | local(0) { 70 | } 71 | #endif 72 | } spTransformConstraintData; 73 | 74 | SP_API spTransformConstraintData* spTransformConstraintData_create (const char* name); 75 | SP_API void spTransformConstraintData_dispose (spTransformConstraintData* self); 76 | 77 | #ifdef SPINE_SHORT_NAMES 78 | typedef spTransformConstraintData TransformConstraintData; 79 | #define TransformConstraintData_create(...) spTransformConstraintData_create(__VA_ARGS__) 80 | #define TransformConstraintData_dispose(...) spTransformConstraintData_dispose(__VA_ARGS__) 81 | #endif 82 | 83 | #ifdef __cplusplus 84 | } 85 | #endif 86 | 87 | #endif /* SPINE_TRANSFORMCONSTRAINTDATA_H_ */ 88 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/Triangulator.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_TRIANGULATOR_H 32 | #define SPINE_TRIANGULATOR_H 33 | 34 | #include 35 | #include 36 | 37 | #ifdef __cplusplus 38 | extern "C" { 39 | #endif 40 | 41 | typedef struct spTriangulator { 42 | spArrayFloatArray* convexPolygons; 43 | spArrayShortArray* convexPolygonsIndices; 44 | 45 | spShortArray* indicesArray; 46 | spIntArray* isConcaveArray; 47 | spShortArray* triangles; 48 | 49 | spArrayFloatArray* polygonPool; 50 | spArrayShortArray* polygonIndicesPool; 51 | } spTriangulator; 52 | 53 | SP_API spTriangulator* spTriangulator_create(); 54 | SP_API spShortArray* spTriangulator_triangulate(spTriangulator* self, spFloatArray* verticesArray); 55 | SP_API spArrayFloatArray* spTriangulator_decompose(spTriangulator* self, spFloatArray* verticesArray, spShortArray* triangles); 56 | SP_API void spTriangulator_dispose(spTriangulator* self); 57 | 58 | 59 | #ifdef __cplusplus 60 | } 61 | #endif 62 | 63 | #endif /* SPINE_TRIANGULATOR_H_ */ 64 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/VertexAttachment.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_VERTEXATTACHMENT_H_ 32 | #define SPINE_VERTEXATTACHMENT_H_ 33 | 34 | #include 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 | int id; 55 | }; 56 | 57 | SP_API void spVertexAttachment_computeWorldVertices (spVertexAttachment* self, spSlot* slot, int start, int count, float* worldVertices, int offset, int stride); 58 | 59 | #ifdef SPINE_SHORT_NAMES 60 | typedef spVertexAttachment VertexAttachment; 61 | #define VertexAttachment_computeWorldVertices(...) spVertexAttachment_computeWorldVertices(__VA_ARGS__) 62 | #endif 63 | 64 | #ifdef __cplusplus 65 | } 66 | #endif 67 | 68 | #endif /* SPINE_VERTEXATTACHMENT_H_ */ 69 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/VertexEffect.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_VERTEXEFFECT_H_ 32 | #define SPINE_VERTEXEFFECT_H_ 33 | 34 | #include 35 | #include 36 | #include 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | struct spVertexEffect; 43 | 44 | typedef void (*spVertexEffectBegin)(struct spVertexEffect *self, spSkeleton *skeleton); 45 | 46 | typedef void (*spVertexEffectTransform)(struct spVertexEffect *self, float *x, float *y, float *u, float *v, 47 | spColor *light, spColor *dark); 48 | 49 | typedef void (*spVertexEffectEnd)(struct spVertexEffect *self); 50 | 51 | typedef struct spVertexEffect { 52 | spVertexEffectBegin begin; 53 | spVertexEffectTransform transform; 54 | spVertexEffectEnd end; 55 | } spVertexEffect; 56 | 57 | typedef struct spJitterVertexEffect { 58 | spVertexEffect super; 59 | float jitterX; 60 | float jitterY; 61 | } spJitterVertexEffect; 62 | 63 | typedef struct spSwirlVertexEffect { 64 | spVertexEffect super; 65 | float centerX; 66 | float centerY; 67 | float radius; 68 | float angle; 69 | float worldX; 70 | float worldY; 71 | } spSwirlVertexEffect; 72 | 73 | SP_API spJitterVertexEffect *spJitterVertexEffect_create(float jitterX, float jitterY); 74 | 75 | SP_API void spJitterVertexEffect_dispose(spJitterVertexEffect *effect); 76 | 77 | SP_API spSwirlVertexEffect *spSwirlVertexEffect_create(float radius); 78 | 79 | SP_API void spSwirlVertexEffect_dispose(spSwirlVertexEffect *effect); 80 | 81 | #ifdef __cplusplus 82 | } 83 | #endif 84 | 85 | #endif /* SPINE_VERTEX_EFFECT_H_ */ 86 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/dll.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_SHAREDLIB_H 32 | #define SPINE_SHAREDLIB_H 33 | 34 | #ifdef _WIN32 35 | #define DLLIMPORT __declspec(dllimport) 36 | #define DLLEXPORT __declspec(dllexport) 37 | #else 38 | #ifndef DLLIMPORT 39 | #define DLLIMPORT 40 | #endif 41 | #ifndef DLLEXPORT 42 | #define DLLEXPORT 43 | #endif 44 | #endif 45 | 46 | #ifdef SPINEPLUGIN_API 47 | #define SP_API SPINEPLUGIN_API 48 | #else 49 | #define SP_API 50 | #endif 51 | 52 | #endif /* SPINE_SHAREDLIB_H */ 53 | -------------------------------------------------------------------------------- /DesktopSprite/include/spine/spine.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #ifndef SPINE_SPINE_H_ 32 | #define SPINE_SPINE_H_ 33 | 34 | #include 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 | #include 59 | #include 60 | #include 61 | #include 62 | 63 | #endif /* SPINE_SPINE_H_ */ 64 | -------------------------------------------------------------------------------- /DesktopSprite/res/DesktopSprite.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/DesktopSprite.rc -------------------------------------------------------------------------------- /DesktopSprite/res/font/AGENCYB.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/font/AGENCYB.TTF -------------------------------------------------------------------------------- /DesktopSprite/res/font/AGENCYR.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/font/AGENCYR.TTF -------------------------------------------------------------------------------- /DesktopSprite/res/image/appicon_dark.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/image/appicon_dark.ico -------------------------------------------------------------------------------- /DesktopSprite/res/image/appicon_dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/image/appicon_dark.png -------------------------------------------------------------------------------- /DesktopSprite/res/image/appicon_light.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/image/appicon_light.ico -------------------------------------------------------------------------------- /DesktopSprite/res/image/appicon_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/image/appicon_light.png -------------------------------------------------------------------------------- /DesktopSprite/res/image/timealarm.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/image/timealarm.ico -------------------------------------------------------------------------------- /DesktopSprite/res/image/timealarm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/image/timealarm.png -------------------------------------------------------------------------------- /DesktopSprite/res/resource.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/resource.h -------------------------------------------------------------------------------- /DesktopSprite/res/resource1.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/resource1.h -------------------------------------------------------------------------------- /DesktopSprite/res/spine/guanghui_2.atlas: -------------------------------------------------------------------------------- 1 | 2 | guanghui_2.png 3 | size: 512,512 4 | format: RGBA8888 5 | filter: Linear,Linear 6 | repeat: none 7 | body 8 | rotate: false 9 | xy: 90, 119 10 | size: 81, 143 11 | orig: 81, 143 12 | offset: 0, 0 13 | index: -1 14 | body_w 15 | rotate: false 16 | xy: 395, 247 17 | size: 45, 48 18 | orig: 45, 48 19 | offset: 0, 0 20 | index: -1 21 | chabei 22 | rotate: true 23 | xy: 263, 2 24 | size: 22, 17 25 | orig: 22, 17 26 | offset: 0, 0 27 | index: -1 28 | daimao 29 | rotate: true 30 | xy: 448, 295 31 | size: 66, 33 32 | orig: 66, 33 33 | offset: 0, 0 34 | index: -1 35 | eye1_1 36 | rotate: true 37 | xy: 482, 251 38 | size: 42, 28 39 | orig: 42, 28 40 | offset: 0, 0 41 | index: -1 42 | eye1_2 43 | rotate: false 44 | xy: 162, 2 45 | size: 36, 29 46 | orig: 36, 29 47 | offset: 0, 0 48 | index: -1 49 | eye_2_1 50 | rotate: false 51 | xy: 112, 12 52 | size: 37, 17 53 | orig: 37, 17 54 | offset: 0, 0 55 | index: -1 56 | eye_2_2 57 | rotate: false 58 | xy: 315, 138 59 | size: 26, 17 60 | orig: 26, 17 61 | offset: 0, 0 62 | index: -1 63 | eye_3_1 64 | rotate: true 65 | xy: 200, 5 66 | size: 26, 38 67 | orig: 26, 38 68 | offset: 0, 0 69 | index: -1 70 | eye_3_2 71 | rotate: true 72 | xy: 442, 210 73 | size: 26, 38 74 | orig: 26, 38 75 | offset: 0, 0 76 | index: -1 77 | face 78 | rotate: false 79 | xy: 2, 264 80 | size: 131, 134 81 | orig: 131, 134 82 | offset: 0, 0 83 | index: -1 84 | fashi 85 | rotate: false 86 | xy: 135, 271 87 | size: 89, 127 88 | orig: 89, 127 89 | offset: 0, 0 90 | index: -1 91 | hair_B 92 | rotate: true 93 | xy: 173, 151 94 | size: 118, 107 95 | orig: 118, 107 96 | offset: 0, 0 97 | index: -1 98 | hair_F 99 | rotate: false 100 | xy: 282, 213 101 | size: 111, 95 102 | orig: 111, 95 103 | offset: 0, 0 104 | index: -1 105 | hair_L 106 | rotate: true 107 | xy: 239, 444 108 | size: 66, 194 109 | orig: 66, 194 110 | offset: 0, 0 111 | index: -1 112 | hair_R 113 | rotate: true 114 | xy: 282, 157 115 | size: 54, 104 116 | orig: 54, 104 117 | offset: 0, 0 118 | index: -1 119 | hair_R2 120 | rotate: true 121 | xy: 239, 385 122 | size: 57, 194 123 | orig: 57, 194 124 | offset: 0, 0 125 | index: -1 126 | hand_L 127 | rotate: false 128 | xy: 254, 275 129 | size: 26, 33 130 | orig: 26, 33 131 | offset: 0, 0 132 | index: -1 133 | hand_L2 134 | rotate: false 135 | xy: 226, 271 136 | size: 26, 37 137 | orig: 26, 37 138 | offset: 0, 0 139 | index: -1 140 | hand_R 141 | rotate: true 142 | xy: 244, 26 143 | size: 22, 33 144 | orig: 22, 33 145 | offset: 0, 0 146 | index: -1 147 | hand_R2 148 | rotate: false 149 | xy: 482, 217 150 | size: 24, 32 151 | orig: 24, 32 152 | offset: 0, 0 153 | index: -1 154 | hua 155 | rotate: false 156 | xy: 244, 50 157 | size: 33, 43 158 | orig: 33, 43 159 | offset: 0, 0 160 | index: -1 161 | jianzhaung 162 | rotate: false 163 | xy: 2, 400 164 | size: 235, 110 165 | orig: 235, 110 166 | offset: 0, 0 167 | index: -1 168 | leg_L 169 | rotate: false 170 | xy: 483, 315 171 | size: 25, 46 172 | orig: 25, 46 173 | offset: 0, 0 174 | index: -1 175 | leg_L2 176 | rotate: false 177 | xy: 267, 119 178 | size: 23, 30 179 | orig: 23, 30 180 | offset: 0, 0 181 | index: -1 182 | leg_R 183 | rotate: true 184 | xy: 395, 220 185 | size: 25, 45 186 | orig: 25, 45 187 | offset: 0, 0 188 | index: -1 189 | leg_R2 190 | rotate: false 191 | xy: 292, 125 192 | size: 21, 30 193 | orig: 21, 30 194 | offset: 0, 0 195 | index: -1 196 | mawei 197 | rotate: true 198 | xy: 226, 310 199 | size: 73, 178 200 | orig: 73, 178 201 | offset: 0, 0 202 | index: -1 203 | meimao 204 | rotate: false 205 | xy: 173, 95 206 | size: 92, 54 207 | orig: 92, 54 208 | offset: 0, 0 209 | index: -1 210 | meimao_3 211 | rotate: false 212 | xy: 162, 33 213 | size: 80, 60 214 | orig: 80, 60 215 | offset: 0, 0 216 | index: -1 217 | paopao1 218 | rotate: true 219 | xy: 2, 92 220 | size: 170, 86 221 | orig: 170, 86 222 | offset: 0, 0 223 | index: -1 224 | qun1 225 | rotate: false 226 | xy: 442, 238 227 | size: 38, 55 228 | orig: 38, 55 229 | offset: 0, 0 230 | index: -1 231 | qun2 232 | rotate: false 233 | xy: 448, 363 234 | size: 62, 49 235 | orig: 62, 49 236 | offset: 0, 0 237 | index: -1 238 | qun3 239 | rotate: true 240 | xy: 435, 414 241 | size: 96, 66 242 | orig: 96, 66 243 | offset: 0, 0 244 | index: -1 245 | sleep2 246 | rotate: false 247 | xy: 240, 2 248 | size: 21, 22 249 | orig: 21, 22 250 | offset: 0, 0 251 | index: -1 252 | sleep5 253 | rotate: true 254 | xy: 112, 31 255 | size: 86, 48 256 | orig: 86, 48 257 | offset: 0, 0 258 | index: -1 259 | sleep6 260 | rotate: true 261 | xy: 406, 297 262 | size: 86, 40 263 | orig: 86, 40 264 | offset: 0, 0 265 | index: -1 266 | toushi1 267 | rotate: false 268 | xy: 2, 13 269 | size: 108, 77 270 | orig: 108, 77 271 | offset: 0, 0 272 | index: -1 273 | -------------------------------------------------------------------------------- /DesktopSprite/res/spine/guanghui_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/spine/guanghui_2.png -------------------------------------------------------------------------------- /DesktopSprite/res/spine/guanghui_2.skel: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/spine/guanghui_2.skel -------------------------------------------------------------------------------- /DesktopSprite/res/version.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/res/version.rc -------------------------------------------------------------------------------- /DesktopSprite/src/ds/aboutdlg.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | PCWSTR AboutDlg::GetTemplateName() const 9 | { 10 | return MAKEINTRESOURCEW(IDD_ABOUT); 11 | } 12 | 13 | INT_PTR AboutDlg::HandleMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) 14 | { 15 | switch (uMsg) 16 | { 17 | case WM_INITDIALOG: 18 | return this->OnInitDialog(wParam, lParam); 19 | case WM_NOTIFY: 20 | return this->OnNotify(wParam, lParam); 21 | case WM_COMMAND: 22 | return this->OnCommand(wParam, lParam); 23 | default: 24 | return FALSE; 25 | } 26 | } 27 | 28 | INT_PTR AboutDlg::OnInitDialog(WPARAM wParam, LPARAM lParam) 29 | { 30 | SetDlgItemTextA(this->hDlg, IDC_LABELVER, VERSION_STR); 31 | 32 | WCHAR projectLink[256] = { 0 }; 33 | StringCchPrintfW(projectLink, 256, L"%s", PROJECT_LINK, PROJECT_LINK); 34 | SetDlgItemTextW(this->hDlg, IDC_PROJECTLINK, projectLink); 35 | return TRUE; 36 | } 37 | 38 | INT_PTR AboutDlg::OnNotify(WPARAM wParam, LPARAM lParam) 39 | { 40 | LPNMHDR nmhdr = (LPNMHDR)lParam; 41 | switch (nmhdr->code) 42 | { 43 | case NM_CLICK: 44 | case NM_RETURN: 45 | LITEM item = ((PNMLINK)lParam)->item; 46 | ShellExecuteW(NULL, L"open", item.szUrl, NULL, NULL, SW_SHOW); 47 | return TRUE; 48 | default: 49 | return FALSE; 50 | } 51 | } 52 | 53 | INT_PTR AboutDlg::OnCommand(WPARAM wParam, LPARAM lParam) 54 | { 55 | // HIWORD(wParam) notification code 56 | // LOWORD(wParam) control identifier 57 | // lParam is the HWND of control 58 | switch (LOWORD(wParam)) 59 | { 60 | case IDOK: 61 | case IDCANCEL: 62 | return EndDialog(this->hDlg, TRUE); 63 | default: 64 | return FALSE; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /DesktopSprite/src/ds/basewindow.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/src/ds/basewindow.cpp -------------------------------------------------------------------------------- /DesktopSprite/src/ds/config.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/src/ds/config.cpp -------------------------------------------------------------------------------- /DesktopSprite/src/ds/configdlg.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/src/ds/configdlg.cpp -------------------------------------------------------------------------------- /DesktopSprite/src/ds/mainwnd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/src/ds/mainwnd.cpp -------------------------------------------------------------------------------- /DesktopSprite/src/ds/notifyicon.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | NotifyIcon::NotifyIcon(HWND hWnd, UINT uID) : hWnd(hWnd), uID(uID) {} 5 | 6 | BOOL NotifyIcon::Add(UINT uCallbackMessage, HICON hIcon, PCWSTR szTip) 7 | { 8 | NOTIFYICONDATAW nid = { 0 }; 9 | nid.cbSize = sizeof(nid); 10 | nid.hWnd = this->hWnd; 11 | nid.uID = this->uID; 12 | nid.uVersion = NOTIFYICON_VERSION_4; 13 | nid.uFlags = 0; 14 | if (uCallbackMessage) 15 | { 16 | nid.uFlags = nid.uFlags | NIF_MESSAGE; 17 | nid.uCallbackMessage = uCallbackMessage; 18 | } 19 | if (hIcon) 20 | { 21 | nid.uFlags = nid.uFlags | NIF_ICON; 22 | nid.hIcon = hIcon; 23 | } 24 | if (szTip) 25 | { 26 | nid.uFlags = nid.uFlags | NIF_TIP; 27 | StringCchCopyW(nid.szTip, MAX_NIDTIP, szTip); 28 | } 29 | return (BOOL)(Shell_NotifyIconW(NIM_ADD, &nid) && Shell_NotifyIconW(NIM_SETVERSION, &nid)); 30 | } 31 | 32 | BOOL NotifyIcon::Delete() 33 | { 34 | NOTIFYICONDATAW nid = { 0 }; 35 | nid.cbSize = sizeof(nid); 36 | nid.hWnd = this->hWnd; 37 | nid.uID = this->uID; 38 | return Shell_NotifyIconW(NIM_DELETE, &nid); 39 | } 40 | 41 | BOOL NotifyIcon::ModifyCallbackMessage(UINT uCallbackMessage) 42 | { 43 | NOTIFYICONDATAW nid = { 0 }; 44 | nid.cbSize = sizeof(nid); 45 | nid.hWnd = this->hWnd; 46 | nid.uID = this->uID; 47 | nid.uFlags = NIF_MESSAGE; 48 | nid.uCallbackMessage = uCallbackMessage; 49 | return Shell_NotifyIconW(NIM_MODIFY, &nid); 50 | } 51 | 52 | BOOL NotifyIcon::ModifyIcon(HICON hIcon) 53 | { 54 | NOTIFYICONDATAW nid = { 0 }; 55 | nid.cbSize = sizeof(nid); 56 | nid.hWnd = this->hWnd; 57 | nid.uID = this->uID; 58 | nid.uFlags = NIF_ICON; 59 | nid.hIcon = hIcon; 60 | return Shell_NotifyIconW(NIM_MODIFY, &nid); 61 | } 62 | 63 | BOOL NotifyIcon::ModifyTip(PCWSTR szTip) 64 | { 65 | NOTIFYICONDATAW nid = { 0 }; 66 | nid.cbSize = sizeof(nid); 67 | nid.hWnd = this->hWnd; 68 | nid.uID = this->uID; 69 | nid.uFlags = NIF_TIP; 70 | StringCchCopyW(nid.szTip, MAX_NIDTIP, szTip); 71 | return Shell_NotifyIconW(NIM_MODIFY, &nid); 72 | } 73 | 74 | BOOL NotifyIcon::PopupIconInfo(PCWSTR szInfoTitle, PCWSTR szInfo, HICON hBalloonIcon, BOOL bSound) 75 | { 76 | NOTIFYICONDATAW nid = { 0 }; 77 | nid.cbSize = sizeof(nid); 78 | nid.hWnd = this->hWnd; 79 | nid.uID = this->uID; 80 | nid.uFlags = NIF_INFO | NIF_REALTIME; 81 | nid.dwInfoFlags = NIIF_USER | NIIF_LARGE_ICON | (bSound ? 0 : NIIF_NOSOUND); 82 | StringCchCopyW(nid.szInfoTitle, MAX_NIDINFOTITLE, szInfoTitle); 83 | StringCchCopyW(nid.szInfo, MAX_NIDINFO, szInfo); 84 | nid.hBalloonIcon = hBalloonIcon; 85 | return Shell_NotifyIconW(NIM_MODIFY, &nid); 86 | } 87 | 88 | BOOL NotifyIcon::SetFocus() 89 | { 90 | NOTIFYICONDATAW nid = { 0 }; 91 | nid.cbSize = sizeof(nid); 92 | nid.hWnd = this->hWnd; 93 | nid.uID = this->uID; 94 | return Shell_NotifyIconW(NIM_SETFOCUS, &nid); 95 | } 96 | 97 | BOOL NotifyIcon::GetRect(PRECT pRect) 98 | { 99 | NOTIFYICONIDENTIFIER niid = { 0 }; 100 | niid.cbSize = sizeof(niid); 101 | niid.hWnd = this->hWnd; 102 | niid.uID = this->uID; 103 | return SUCCEEDED(Shell_NotifyIconGetRect(&niid, pRect)); 104 | } 105 | -------------------------------------------------------------------------------- /DesktopSprite/src/ds/perfmonitor.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/src/ds/perfmonitor.cpp -------------------------------------------------------------------------------- /DesktopSprite/src/ds/spinechar.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/src/ds/spinechar.cpp -------------------------------------------------------------------------------- /DesktopSprite/src/ds/spritewnd.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/src/ds/spritewnd.cpp -------------------------------------------------------------------------------- /DesktopSprite/src/ds/utils.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/src/ds/utils.cpp -------------------------------------------------------------------------------- /DesktopSprite/src/ds/winapp.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/DesktopSprite/src/ds/winapp.cpp -------------------------------------------------------------------------------- /DesktopSprite/src/json/json_tool.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef LIB_JSONCPP_JSON_TOOL_H_INCLUDED 7 | #define LIB_JSONCPP_JSON_TOOL_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include 11 | #endif 12 | 13 | // Also support old flag NO_LOCALE_SUPPORT 14 | #ifdef NO_LOCALE_SUPPORT 15 | #define JSONCPP_NO_LOCALE_SUPPORT 16 | #endif 17 | 18 | #ifndef JSONCPP_NO_LOCALE_SUPPORT 19 | #include 20 | #endif 21 | 22 | /* This header provides common string manipulation support, such as UTF-8, 23 | * portable conversion from/to string... 24 | * 25 | * It is an internal header that must not be exposed. 26 | */ 27 | 28 | namespace Json { 29 | static inline char getDecimalPoint() { 30 | #ifdef JSONCPP_NO_LOCALE_SUPPORT 31 | return '\0'; 32 | #else 33 | struct lconv* lc = localeconv(); 34 | return lc ? *(lc->decimal_point) : '\0'; 35 | #endif 36 | } 37 | 38 | /// Converts a unicode code-point to UTF-8. 39 | static inline String codePointToUTF8(unsigned int cp) { 40 | String result; 41 | 42 | // based on description from http://en.wikipedia.org/wiki/UTF-8 43 | 44 | if (cp <= 0x7f) { 45 | result.resize(1); 46 | result[0] = static_cast(cp); 47 | } else if (cp <= 0x7FF) { 48 | result.resize(2); 49 | result[1] = static_cast(0x80 | (0x3f & cp)); 50 | result[0] = static_cast(0xC0 | (0x1f & (cp >> 6))); 51 | } else if (cp <= 0xFFFF) { 52 | result.resize(3); 53 | result[2] = static_cast(0x80 | (0x3f & cp)); 54 | result[1] = static_cast(0x80 | (0x3f & (cp >> 6))); 55 | result[0] = static_cast(0xE0 | (0xf & (cp >> 12))); 56 | } else if (cp <= 0x10FFFF) { 57 | result.resize(4); 58 | result[3] = static_cast(0x80 | (0x3f & cp)); 59 | result[2] = static_cast(0x80 | (0x3f & (cp >> 6))); 60 | result[1] = static_cast(0x80 | (0x3f & (cp >> 12))); 61 | result[0] = static_cast(0xF0 | (0x7 & (cp >> 18))); 62 | } 63 | 64 | return result; 65 | } 66 | 67 | enum { 68 | /// Constant that specify the size of the buffer that must be passed to 69 | /// uintToString. 70 | uintToStringBufferSize = 3 * sizeof(LargestUInt) + 1 71 | }; 72 | 73 | // Defines a char buffer for use with uintToString(). 74 | using UIntToStringBuffer = char[uintToStringBufferSize]; 75 | 76 | /** Converts an unsigned integer to string. 77 | * @param value Unsigned integer to convert to string 78 | * @param current Input/Output string buffer. 79 | * Must have at least uintToStringBufferSize chars free. 80 | */ 81 | static inline void uintToString(LargestUInt value, char*& current) { 82 | *--current = 0; 83 | do { 84 | *--current = static_cast(value % 10U + static_cast('0')); 85 | value /= 10; 86 | } while (value != 0); 87 | } 88 | 89 | /** Change ',' to '.' everywhere in buffer. 90 | * 91 | * We had a sophisticated way, but it did not work in WinCE. 92 | * @see https://github.com/open-source-parsers/jsoncpp/pull/9 93 | */ 94 | template Iter fixNumericLocale(Iter begin, Iter end) { 95 | for (; begin != end; ++begin) { 96 | if (*begin == ',') { 97 | *begin = '.'; 98 | } 99 | } 100 | return begin; 101 | } 102 | 103 | template void fixNumericLocaleInput(Iter begin, Iter end) { 104 | char decimalPoint = getDecimalPoint(); 105 | if (decimalPoint == '\0' || decimalPoint == '.') { 106 | return; 107 | } 108 | for (; begin != end; ++begin) { 109 | if (*begin == '.') { 110 | *begin = decimalPoint; 111 | } 112 | } 113 | } 114 | 115 | /** 116 | * Return iterator that would be the new end of the range [begin,end), if we 117 | * were to delete zeros in the end of string, but not the last zero before '.'. 118 | */ 119 | template 120 | Iter fixZerosInTheEnd(Iter begin, Iter end, unsigned int precision) { 121 | for (; begin != end; --end) { 122 | if (*(end - 1) != '0') { 123 | return end; 124 | } 125 | // Don't delete the last zero before the decimal point. 126 | if (begin != (end - 1) && begin != (end - 2) && *(end - 2) == '.') { 127 | if (precision) { 128 | return end; 129 | } 130 | return end - 2; 131 | } 132 | } 133 | return end; 134 | } 135 | 136 | } // namespace Json 137 | 138 | #endif // LIB_JSONCPP_JSON_TOOL_H_INCLUDED 139 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/Array.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | _SP_ARRAY_IMPLEMENT_TYPE(spFloatArray, float) 35 | _SP_ARRAY_IMPLEMENT_TYPE(spIntArray, int) 36 | _SP_ARRAY_IMPLEMENT_TYPE(spShortArray, short) 37 | _SP_ARRAY_IMPLEMENT_TYPE(spUnsignedShortArray, unsigned short) 38 | _SP_ARRAY_IMPLEMENT_TYPE(spArrayFloatArray, spFloatArray*) 39 | _SP_ARRAY_IMPLEMENT_TYPE(spArrayShortArray, spShortArray*) 40 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/AtlasAttachmentLoader.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | spAttachment* _spAtlasAttachmentLoader_createAttachment (spAttachmentLoader* loader, spSkin* skin, spAttachmentType type, 35 | const char* name, const char* path) { 36 | spAtlasAttachmentLoader* self = SUB_CAST(spAtlasAttachmentLoader, loader); 37 | switch (type) { 38 | case SP_ATTACHMENT_REGION: { 39 | spRegionAttachment* attachment; 40 | spAtlasRegion* region = spAtlas_findRegion(self->atlas, path); 41 | if (!region) { 42 | _spAttachmentLoader_setError(loader, "Region not found: ", path); 43 | return 0; 44 | } 45 | attachment = spRegionAttachment_create(name); 46 | attachment->rendererObject = region; 47 | spRegionAttachment_setUVs(attachment, region->u, region->v, region->u2, region->v2, region->rotate); 48 | attachment->regionOffsetX = region->offsetX; 49 | attachment->regionOffsetY = region->offsetY; 50 | attachment->regionWidth = region->width; 51 | attachment->regionHeight = region->height; 52 | attachment->regionOriginalWidth = region->originalWidth; 53 | attachment->regionOriginalHeight = region->originalHeight; 54 | return SUPER(attachment); 55 | } 56 | case SP_ATTACHMENT_MESH: 57 | case SP_ATTACHMENT_LINKED_MESH: { 58 | spMeshAttachment* attachment; 59 | spAtlasRegion* region = spAtlas_findRegion(self->atlas, path); 60 | if (!region) { 61 | _spAttachmentLoader_setError(loader, "Region not found: ", path); 62 | return 0; 63 | } 64 | attachment = spMeshAttachment_create(name); 65 | attachment->rendererObject = region; 66 | attachment->regionU = region->u; 67 | attachment->regionV = region->v; 68 | attachment->regionU2 = region->u2; 69 | attachment->regionV2 = region->v2; 70 | attachment->regionRotate = region->rotate; 71 | attachment->regionOffsetX = region->offsetX; 72 | attachment->regionOffsetY = region->offsetY; 73 | attachment->regionWidth = region->width; 74 | attachment->regionHeight = region->height; 75 | attachment->regionOriginalWidth = region->originalWidth; 76 | attachment->regionOriginalHeight = region->originalHeight; 77 | return SUPER(SUPER(attachment)); 78 | } 79 | case SP_ATTACHMENT_BOUNDING_BOX: 80 | return SUPER(SUPER(spBoundingBoxAttachment_create(name))); 81 | case SP_ATTACHMENT_PATH: 82 | return SUPER(SUPER(spPathAttachment_create(name))); 83 | case SP_ATTACHMENT_POINT: 84 | return SUPER(SUPER(spPointAttachment_create(name))); 85 | case SP_ATTACHMENT_CLIPPING: 86 | return SUPER(SUPER(spClippingAttachment_create(name))); 87 | default: 88 | _spAttachmentLoader_setUnknownTypeError(loader, type); 89 | return 0; 90 | } 91 | 92 | UNUSED(skin); 93 | } 94 | 95 | spAtlasAttachmentLoader* spAtlasAttachmentLoader_create (spAtlas* atlas) { 96 | spAtlasAttachmentLoader* self = NEW(spAtlasAttachmentLoader); 97 | _spAttachmentLoader_init(SUPER(self), _spAttachmentLoader_deinit, _spAtlasAttachmentLoader_createAttachment, 0, 0); 98 | self->atlas = atlas; 99 | return self; 100 | } 101 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/Attachment.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #define _CRT_SECURE_NO_WARNINGS 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | typedef struct _spAttachmentVtable { 38 | void (*dispose) (spAttachment* self); 39 | } _spAttachmentVtable; 40 | 41 | void _spAttachment_init (spAttachment* self, const char* name, spAttachmentType type, /**/ 42 | void (*dispose) (spAttachment* self)) { 43 | 44 | CONST_CAST(_spAttachmentVtable*, self->vtable) = NEW(_spAttachmentVtable); 45 | VTABLE(spAttachment, self) ->dispose = dispose; 46 | 47 | MALLOC_STR(self->name, name); 48 | CONST_CAST(spAttachmentType, self->type) = type; 49 | } 50 | 51 | void _spAttachment_deinit (spAttachment* self) { 52 | if (self->attachmentLoader) spAttachmentLoader_disposeAttachment(self->attachmentLoader, self); 53 | FREE(self->vtable); 54 | FREE(self->name); 55 | } 56 | 57 | void spAttachment_dispose (spAttachment* self) { 58 | VTABLE(spAttachment, self) ->dispose(self); 59 | } 60 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/AttachmentLoader.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #define _CRT_SECURE_NO_WARNINGS 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | typedef struct _spAttachmentLoaderVtable { 38 | spAttachment* (*createAttachment) (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name, 39 | const char* path); 40 | void (*configureAttachment) (spAttachmentLoader* self, spAttachment*); 41 | void (*disposeAttachment) (spAttachmentLoader* self, spAttachment*); 42 | void (*dispose) (spAttachmentLoader* self); 43 | } _spAttachmentLoaderVtable; 44 | 45 | void _spAttachmentLoader_init (spAttachmentLoader* self, 46 | void (*dispose) (spAttachmentLoader* self), 47 | spAttachment* (*createAttachment) (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name, 48 | const char* path), 49 | void (*configureAttachment) (spAttachmentLoader* self, spAttachment*), 50 | void (*disposeAttachment) (spAttachmentLoader* self, spAttachment*) 51 | ) { 52 | CONST_CAST(_spAttachmentLoaderVtable*, self->vtable) = NEW(_spAttachmentLoaderVtable); 53 | VTABLE(spAttachmentLoader, self)->dispose = dispose; 54 | VTABLE(spAttachmentLoader, self)->createAttachment = createAttachment; 55 | VTABLE(spAttachmentLoader, self)->configureAttachment = configureAttachment; 56 | VTABLE(spAttachmentLoader, self)->disposeAttachment = disposeAttachment; 57 | } 58 | 59 | void _spAttachmentLoader_deinit (spAttachmentLoader* self) { 60 | FREE(self->vtable); 61 | FREE(self->error1); 62 | FREE(self->error2); 63 | } 64 | 65 | void spAttachmentLoader_dispose (spAttachmentLoader* self) { 66 | VTABLE(spAttachmentLoader, self)->dispose(self); 67 | FREE(self); 68 | } 69 | 70 | spAttachment* spAttachmentLoader_createAttachment (spAttachmentLoader* self, spSkin* skin, spAttachmentType type, const char* name, 71 | const char* path) { 72 | FREE(self->error1); 73 | FREE(self->error2); 74 | self->error1 = 0; 75 | self->error2 = 0; 76 | return VTABLE(spAttachmentLoader, self)->createAttachment(self, skin, type, name, path); 77 | } 78 | 79 | void spAttachmentLoader_configureAttachment (spAttachmentLoader* self, spAttachment* attachment) { 80 | if (!VTABLE(spAttachmentLoader, self)->configureAttachment) return; 81 | VTABLE(spAttachmentLoader, self)->configureAttachment(self, attachment); 82 | } 83 | 84 | void spAttachmentLoader_disposeAttachment (spAttachmentLoader* self, spAttachment* attachment) { 85 | if (!VTABLE(spAttachmentLoader, self)->disposeAttachment) return; 86 | VTABLE(spAttachmentLoader, self)->disposeAttachment(self, attachment); 87 | } 88 | 89 | void _spAttachmentLoader_setError (spAttachmentLoader* self, const char* error1, const char* error2) { 90 | FREE(self->error1); 91 | FREE(self->error2); 92 | MALLOC_STR(self->error1, error1); 93 | MALLOC_STR(self->error2, error2); 94 | } 95 | 96 | void _spAttachmentLoader_setUnknownTypeError (spAttachmentLoader* self, spAttachmentType type) { 97 | char buffer[16]; 98 | sprintf(buffer, "%d", type); 99 | _spAttachmentLoader_setError(self, "Unknown attachment type: ", buffer); 100 | } 101 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/BoneData.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #define _CRT_SECURE_NO_WARNINGS 32 | 33 | #include 34 | #include 35 | 36 | spBoneData* spBoneData_create (int index, const char* name, spBoneData* parent) { 37 | spBoneData* self = NEW(spBoneData); 38 | CONST_CAST(int, self->index) = index; 39 | MALLOC_STR(self->name, name); 40 | CONST_CAST(spBoneData*, self->parent) = parent; 41 | self->scaleX = 1; 42 | self->scaleY = 1; 43 | self->transformMode = SP_TRANSFORMMODE_NORMAL; 44 | return self; 45 | } 46 | 47 | void spBoneData_dispose (spBoneData* self) { 48 | FREE(self->name); 49 | FREE(self); 50 | } 51 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/BoundingBoxAttachment.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | void _spBoundingBoxAttachment_dispose (spAttachment* attachment) { 35 | spBoundingBoxAttachment* self = SUB_CAST(spBoundingBoxAttachment, attachment); 36 | 37 | _spVertexAttachment_deinit(SUPER(self)); 38 | 39 | FREE(self); 40 | } 41 | 42 | spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name) { 43 | spBoundingBoxAttachment* self = NEW(spBoundingBoxAttachment); 44 | _spVertexAttachment_init(SUPER(self)); 45 | _spAttachment_init(SUPER(SUPER(self)), name, SP_ATTACHMENT_BOUNDING_BOX, _spBoundingBoxAttachment_dispose); 46 | return self; 47 | } 48 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/ClippingAttachment.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | void _spClippingAttachment_dispose (spAttachment* attachment) { 35 | spClippingAttachment* self = SUB_CAST(spClippingAttachment, attachment); 36 | 37 | _spVertexAttachment_deinit(SUPER(self)); 38 | 39 | FREE(self); 40 | } 41 | 42 | spClippingAttachment* spClippingAttachment_create (const char* name) { 43 | spClippingAttachment* self = NEW(spClippingAttachment); 44 | _spVertexAttachment_init(SUPER(self)); 45 | _spAttachment_init(SUPER(SUPER(self)), name, SP_ATTACHMENT_CLIPPING, _spClippingAttachment_dispose); 46 | self->endSlot = 0; 47 | return self; 48 | } 49 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/Color.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | spColor* spColor_create() { 35 | return MALLOC(spColor, 1); 36 | } 37 | 38 | void spColor_dispose(spColor* self) { 39 | if (self) FREE(self); 40 | } 41 | 42 | void spColor_setFromFloats(spColor* self, float r, float g, float b, float a) { 43 | self->r = r; 44 | self->g = g; 45 | self->b = b; 46 | self->a = a; 47 | spColor_clamp(self); 48 | } 49 | 50 | void spColor_setFromColor(spColor* self, spColor* otherColor) { 51 | self->r = otherColor->r; 52 | self->g = otherColor->g; 53 | self->b = otherColor->b; 54 | self->a = otherColor->a; 55 | } 56 | 57 | void spColor_addColor(spColor* self, spColor* otherColor) { 58 | self->r += otherColor->r; 59 | self->g += otherColor->g; 60 | self->b += otherColor->b; 61 | self->a += otherColor->a; 62 | spColor_clamp(self); 63 | } 64 | 65 | void spColor_addFloats(spColor* self, float r, float g, float b, float a) { 66 | self->r += r; 67 | self->g += g; 68 | self->b += b; 69 | self->a += a; 70 | spColor_clamp(self); 71 | } 72 | 73 | void spColor_clamp(spColor* self) { 74 | if (self->r < 0) self->r = 0; 75 | else if (self->r > 1) self->r = 1; 76 | 77 | if (self->g < 0) self->g = 0; 78 | else if (self->g > 1) self->g = 1; 79 | 80 | if (self->b < 0) self->b = 0; 81 | else if (self->b > 1) self->b = 1; 82 | 83 | if (self->a < 0) self->a = 0; 84 | else if (self->a > 1) self->a = 1; 85 | } 86 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/Event.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | spEvent* spEvent_create (float time, spEventData* data) { 35 | spEvent* self = NEW(spEvent); 36 | CONST_CAST(spEventData*, self->data) = data; 37 | CONST_CAST(float, self->time) = time; 38 | return self; 39 | } 40 | 41 | void spEvent_dispose (spEvent* self) { 42 | FREE(self->stringValue); 43 | FREE(self); 44 | } 45 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/EventData.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #define _CRT_SECURE_NO_WARNINGS 32 | 33 | #include 34 | #include 35 | 36 | spEventData* spEventData_create (const char* name) { 37 | spEventData* self = NEW(spEventData); 38 | MALLOC_STR(self->name, name); 39 | return self; 40 | } 41 | 42 | void spEventData_dispose (spEventData* self) { 43 | FREE(self->stringValue); 44 | FREE(self->name); 45 | FREE(self); 46 | } 47 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/IkConstraintData.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #define _CRT_SECURE_NO_WARNINGS 32 | 33 | #include 34 | #include 35 | 36 | spIkConstraintData* spIkConstraintData_create (const char* name) { 37 | spIkConstraintData* self = NEW(spIkConstraintData); 38 | MALLOC_STR(self->name, name); 39 | self->bendDirection = 1; 40 | self->mix = 1; 41 | return self; 42 | } 43 | 44 | void spIkConstraintData_dispose (spIkConstraintData* self) { 45 | FREE(self->name); 46 | FREE(self->bones); 47 | FREE(self); 48 | } 49 | -------------------------------------------------------------------------------- /DesktopSprite/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 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/MeshAttachment.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | void _spMeshAttachment_dispose (spAttachment* attachment) { 35 | spMeshAttachment* self = SUB_CAST(spMeshAttachment, attachment); 36 | FREE(self->path); 37 | FREE(self->uvs); 38 | if (!self->parentMesh) { 39 | _spVertexAttachment_deinit(SUPER(self)); 40 | FREE(self->regionUVs); 41 | FREE(self->triangles); 42 | FREE(self->edges); 43 | } else 44 | _spAttachment_deinit(attachment); 45 | FREE(self); 46 | } 47 | 48 | spMeshAttachment* spMeshAttachment_create (const char* name) { 49 | spMeshAttachment* self = NEW(spMeshAttachment); 50 | _spVertexAttachment_init(SUPER(self)); 51 | spColor_setFromFloats(&self->color, 1, 1, 1, 1); 52 | _spAttachment_init(SUPER(SUPER(self)), name, SP_ATTACHMENT_MESH, _spMeshAttachment_dispose); 53 | return self; 54 | } 55 | 56 | void spMeshAttachment_updateUVs (spMeshAttachment* self) { 57 | int i; 58 | float width = self->regionU2 - self->regionU, height = self->regionV2 - self->regionV; 59 | int verticesLength = SUPER(self)->worldVerticesLength; 60 | FREE(self->uvs); 61 | self->uvs = MALLOC(float, verticesLength); 62 | if (self->regionRotate) { 63 | for (i = 0; i < verticesLength; i += 2) { 64 | self->uvs[i] = self->regionU + self->regionUVs[i + 1] * width; 65 | self->uvs[i + 1] = self->regionV + height - self->regionUVs[i] * height; 66 | } 67 | } else { 68 | for (i = 0; i < verticesLength; i += 2) { 69 | self->uvs[i] = self->regionU + self->regionUVs[i] * width; 70 | self->uvs[i + 1] = self->regionV + self->regionUVs[i + 1] * height; 71 | } 72 | } 73 | } 74 | 75 | void spMeshAttachment_setParentMesh (spMeshAttachment* self, spMeshAttachment* parentMesh) { 76 | CONST_CAST(spMeshAttachment*, self->parentMesh) = parentMesh; 77 | if (parentMesh) { 78 | 79 | self->super.bones = parentMesh->super.bones; 80 | self->super.bonesCount = parentMesh->super.bonesCount; 81 | 82 | self->super.vertices = parentMesh->super.vertices; 83 | self->super.verticesCount = parentMesh->super.verticesCount; 84 | 85 | self->regionUVs = parentMesh->regionUVs; 86 | 87 | self->triangles = parentMesh->triangles; 88 | self->trianglesCount = parentMesh->trianglesCount; 89 | 90 | self->hullLength = parentMesh->hullLength; 91 | 92 | self->super.worldVerticesLength = parentMesh->super.worldVerticesLength; 93 | 94 | self->edges = parentMesh->edges; 95 | self->edgesCount = parentMesh->edgesCount; 96 | 97 | self->width = parentMesh->width; 98 | self->height = parentMesh->height; 99 | } 100 | } 101 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/PathAttachment.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | void _spPathAttachment_dispose (spAttachment* attachment) { 35 | spPathAttachment* self = SUB_CAST(spPathAttachment, attachment); 36 | 37 | _spVertexAttachment_deinit(SUPER(self)); 38 | 39 | FREE(self->lengths); 40 | FREE(self); 41 | } 42 | 43 | spPathAttachment* spPathAttachment_create (const char* name) { 44 | spPathAttachment* self = NEW(spPathAttachment); 45 | _spVertexAttachment_init(SUPER(self)); 46 | _spAttachment_init(SUPER(SUPER(self)), name, SP_ATTACHMENT_PATH, _spPathAttachment_dispose); 47 | return self; 48 | } 49 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/PathConstraintData.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #define _CRT_SECURE_NO_WARNINGS 32 | 33 | #include 34 | #include 35 | 36 | spPathConstraintData* spPathConstraintData_create (const char* name) { 37 | spPathConstraintData* self = NEW(spPathConstraintData); 38 | MALLOC_STR(self->name, name); 39 | return self; 40 | } 41 | 42 | void spPathConstraintData_dispose (spPathConstraintData* self) { 43 | FREE(self->name); 44 | FREE(self->bones); 45 | FREE(self); 46 | } 47 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/PointAttachment.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | void _spPointAttachment_dispose (spAttachment* attachment) { 35 | spPathAttachment* self = SUB_CAST(spPathAttachment, attachment); 36 | 37 | _spVertexAttachment_deinit(SUPER(self)); 38 | 39 | FREE(self); 40 | } 41 | 42 | spPointAttachment* spPointAttachment_create (const char* name) { 43 | spPointAttachment* self = NEW(spPointAttachment); 44 | _spVertexAttachment_init(SUPER(self)); 45 | _spAttachment_init(SUPER(SUPER(self)), name, SP_ATTACHMENT_POINT, _spPointAttachment_dispose); 46 | return self; 47 | } 48 | 49 | void spPointAttachment_computeWorldPosition (spPointAttachment* self, spBone* bone, float* x, float* y) { 50 | *x = self->x * bone->a + self->y * bone->b + bone->worldX; 51 | *y = self->x * bone->c + self->y * bone->d + bone->worldY; 52 | } 53 | 54 | float spPointAttachment_computeWorldRotation (spPointAttachment* self, spBone* bone) { 55 | float cosine, sine, x, y; 56 | cosine = COS_DEG(self->rotation); 57 | sine = SIN_DEG(self->rotation); 58 | x = cosine * bone->a + sine * bone->b; 59 | y = cosine * bone->c + sine * bone->d; 60 | return ATAN2(y, x) * RAD_DEG; 61 | } 62 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/Slot.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | typedef struct { 35 | spSlot super; 36 | float attachmentTime; 37 | } _spSlot; 38 | 39 | spSlot* spSlot_create (spSlotData* data, spBone* bone) { 40 | spSlot* self = SUPER(NEW(_spSlot)); 41 | CONST_CAST(spSlotData*, self->data) = data; 42 | CONST_CAST(spBone*, self->bone) = bone; 43 | spColor_setFromFloats(&self->color, 1, 1, 1, 1); 44 | self->darkColor = data->darkColor == 0 ? 0 : spColor_create(); 45 | spSlot_setToSetupPose(self); 46 | return self; 47 | } 48 | 49 | void spSlot_dispose (spSlot* self) { 50 | FREE(self->attachmentVertices); 51 | FREE(self->darkColor); 52 | FREE(self); 53 | } 54 | 55 | void spSlot_setAttachment (spSlot* self, spAttachment* attachment) { 56 | if (attachment == self->attachment) return; 57 | CONST_CAST(spAttachment*, self->attachment) = attachment; 58 | SUB_CAST(_spSlot, self)->attachmentTime = self->bone->skeleton->time; 59 | self->attachmentVerticesCount = 0; 60 | } 61 | 62 | void spSlot_setAttachmentTime (spSlot* self, float time) { 63 | SUB_CAST(_spSlot, self)->attachmentTime = self->bone->skeleton->time - time; 64 | } 65 | 66 | float spSlot_getAttachmentTime (const spSlot* self) { 67 | return self->bone->skeleton->time - SUB_CAST(_spSlot, self) ->attachmentTime; 68 | } 69 | 70 | void spSlot_setToSetupPose (spSlot* self) { 71 | spColor_setFromColor(&self->color, &self->data->color); 72 | if (self->darkColor) spColor_setFromColor(self->darkColor, self->data->darkColor); 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 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/SlotData.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #define _CRT_SECURE_NO_WARNINGS 32 | 33 | #include 34 | #include 35 | 36 | spSlotData* spSlotData_create (const int index, const char* name, spBoneData* boneData) { 37 | spSlotData* self = NEW(spSlotData); 38 | CONST_CAST(int, self->index) = index; 39 | MALLOC_STR(self->name, name); 40 | CONST_CAST(spBoneData*, self->boneData) = boneData; 41 | spColor_setFromFloats(&self->color, 1, 1, 1, 1); 42 | return self; 43 | } 44 | 45 | void spSlotData_dispose (spSlotData* self) { 46 | FREE(self->name); 47 | FREE(self->attachmentName); 48 | FREE(self->darkColor); 49 | FREE(self); 50 | } 51 | 52 | void spSlotData_setAttachmentName (spSlotData* self, const char* attachmentName) { 53 | FREE(self->attachmentName); 54 | if (attachmentName) 55 | MALLOC_STR(self->attachmentName, attachmentName); 56 | else 57 | CONST_CAST(char*, self->attachmentName) = 0; 58 | } 59 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/TransformConstraintData.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #define _CRT_SECURE_NO_WARNINGS 32 | 33 | #include 34 | #include 35 | 36 | spTransformConstraintData* spTransformConstraintData_create (const char* name) { 37 | spTransformConstraintData* self = NEW(spTransformConstraintData); 38 | MALLOC_STR(self->name, name); 39 | return self; 40 | } 41 | 42 | void spTransformConstraintData_dispose (spTransformConstraintData* self) { 43 | FREE(self->name); 44 | FREE(self->bones); 45 | FREE(self); 46 | } 47 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/VertexAttachment.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | /* FIXME this is not thread-safe */ 35 | static int nextID = 0; 36 | 37 | void _spVertexAttachment_init (spVertexAttachment* attachment) { 38 | attachment->id = (nextID++ & 65535) << 11; 39 | } 40 | 41 | void _spVertexAttachment_deinit (spVertexAttachment* attachment) { 42 | _spAttachment_deinit(SUPER(attachment)); 43 | FREE(attachment->bones); 44 | FREE(attachment->vertices); 45 | } 46 | 47 | void spVertexAttachment_computeWorldVertices (spVertexAttachment* self, spSlot* slot, int start, int count, float* worldVertices, int offset, int stride) { 48 | spSkeleton* skeleton; 49 | int deformLength; 50 | float* deform; 51 | float* vertices; 52 | int* bones; 53 | 54 | count = offset + (count >> 1) * stride; 55 | skeleton = slot->bone->skeleton; 56 | deformLength = slot->attachmentVerticesCount; 57 | deform = slot->attachmentVertices; 58 | vertices = self->vertices; 59 | bones = self->bones; 60 | if (!bones) { 61 | spBone* bone; 62 | int v, w; 63 | float x, y; 64 | if (deformLength > 0) vertices = deform; 65 | bone = slot->bone; 66 | x = bone->worldX; 67 | y = bone->worldY; 68 | for (v = start, w = offset; w < count; v += 2, w += stride) { 69 | float vx = vertices[v], vy = vertices[v + 1]; 70 | worldVertices[w] = vx * bone->a + vy * bone->b + x; 71 | worldVertices[w + 1] = vx * bone->c + vy * bone->d + y; 72 | } 73 | } else { 74 | int v = 0, skip = 0, i; 75 | spBone** skeletonBones; 76 | for (i = 0; i < start; i += 2) { 77 | int n = bones[v]; 78 | v += n + 1; 79 | skip += n; 80 | } 81 | skeletonBones = skeleton->bones; 82 | if (deformLength == 0) { 83 | int w, b; 84 | for (w = offset, b = skip * 3; w < count; w += stride) { 85 | float wx = 0, wy = 0; 86 | int n = bones[v++]; 87 | n += v; 88 | for (; v < n; v++, b += 3) { 89 | spBone* bone = skeletonBones[bones[v]]; 90 | float vx = vertices[b], vy = vertices[b + 1], weight = vertices[b + 2]; 91 | wx += (vx * bone->a + vy * bone->b + bone->worldX) * weight; 92 | wy += (vx * bone->c + vy * bone->d + bone->worldY) * weight; 93 | } 94 | worldVertices[w] = wx; 95 | worldVertices[w + 1] = wy; 96 | } 97 | } else { 98 | int w, b, f; 99 | for (w = offset, b = skip * 3, f = skip << 1; w < count; w += stride) { 100 | float wx = 0, wy = 0; 101 | int n = bones[v++]; 102 | n += v; 103 | for (; v < n; v++, b += 3, f += 2) { 104 | spBone* bone = skeletonBones[bones[v]]; 105 | float vx = vertices[b] + deform[f], vy = vertices[b + 1] + deform[f + 1], weight = vertices[b + 2]; 106 | wx += (vx * bone->a + vy * bone->b + bone->worldX) * weight; 107 | wy += (vx * bone->c + vy * bone->d + bone->worldY) * weight; 108 | } 109 | worldVertices[w] = wx; 110 | worldVertices[w + 1] = wy; 111 | } 112 | } 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /DesktopSprite/src/spine/VertexEffect.cpp: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | * Spine Runtimes Software License v2.5 3 | * 4 | * Copyright (c) 2013-2016, 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 and derivative works solely for personal or internal 10 | * use. Without the written permission of Esoteric Software (see Section 2 of 11 | * the Spine Software License Agreement), you may not (a) modify, translate, 12 | * adapt, or develop new applications using the Spine Runtimes or otherwise 13 | * create derivative works or improvements of the Spine Runtimes 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, BUSINESS INTERRUPTION, OR LOSS OF 25 | * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 26 | * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 | * POSSIBILITY OF SUCH DAMAGE. 29 | *****************************************************************************/ 30 | 31 | #include 32 | #include 33 | 34 | void _spJitterVertexEffect_begin(spVertexEffect* self, spSkeleton* skeleton) { 35 | } 36 | 37 | void _spJitterVertexEffect_transform(spVertexEffect* self, float* x, float* y, float* u, float* v, spColor* light, spColor* dark) { 38 | spJitterVertexEffect* internal = (spJitterVertexEffect*)self; 39 | float jitterX = internal->jitterX; 40 | float jitterY = internal->jitterY; 41 | (*x) += _spMath_randomTriangular(-jitterX, jitterY); 42 | (*y) += _spMath_randomTriangular(-jitterX, jitterY); 43 | } 44 | 45 | void _spJitterVertexEffect_end(spVertexEffect* self) { 46 | } 47 | 48 | spJitterVertexEffect* spJitterVertexEffect_create(float jitterX, float jitterY) { 49 | spJitterVertexEffect* effect = CALLOC(spJitterVertexEffect, 1); 50 | effect->super.begin = _spJitterVertexEffect_begin; 51 | effect->super.transform = _spJitterVertexEffect_transform; 52 | effect->super.end = _spJitterVertexEffect_end; 53 | effect->jitterX = jitterX; 54 | effect->jitterY = jitterY; 55 | return effect; 56 | } 57 | 58 | void spJitterVertexEffect_dispose(spJitterVertexEffect* effect) { 59 | FREE(effect); 60 | } 61 | 62 | void _spSwirlVertexEffect_begin(spVertexEffect* self, spSkeleton* skeleton) { 63 | spSwirlVertexEffect* internal = (spSwirlVertexEffect*)self; 64 | internal->worldX = skeleton->x + internal->centerX; 65 | internal->worldY = skeleton->y + internal->centerY; 66 | } 67 | 68 | void _spSwirlVertexEffect_transform(spVertexEffect* self, float* positionX, float* positionY, float* u, float* v, spColor* light, spColor* dark) { 69 | spSwirlVertexEffect* internal = (spSwirlVertexEffect*)self; 70 | float radAngle = internal->angle * DEG_RAD; 71 | float x = *positionX - internal->worldX; 72 | float y = *positionY - internal->worldY; 73 | float dist = SQRT(x * x + y * y); 74 | if (dist < internal->radius) { 75 | float theta = _spMath_interpolate(_spMath_pow2_apply, 0, radAngle, (internal->radius - dist) / internal->radius); 76 | float cosine = COS(theta); 77 | float sine = SIN(theta); 78 | (*positionX) = cosine * x - sine * y + internal->worldX; 79 | (*positionY) = sine * x + cosine * y + internal->worldY; 80 | } 81 | } 82 | 83 | void _spSwirlVertexEffect_end(spVertexEffect* self) { 84 | } 85 | 86 | spSwirlVertexEffect* spSwirlVertexEffect_create(float radius) { 87 | spSwirlVertexEffect* effect = CALLOC(spSwirlVertexEffect, 1); 88 | effect->super.begin = _spSwirlVertexEffect_begin; 89 | effect->super.transform = _spSwirlVertexEffect_transform; 90 | effect->super.end = _spSwirlVertexEffect_end; 91 | effect->radius = radius; 92 | return effect; 93 | } 94 | 95 | void spSwirlVertexEffect_dispose(spSwirlVertexEffect* effect) { 96 | FREE(effect); 97 | } 98 | 99 | -------------------------------------------------------------------------------- /DesktopSprite/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 | 2017-19-18 (0.1.1): 47 | 48 | Spine Special Edition 49 | * Made helper macros for alloc, free and memcpy, which can be overridden. 50 | * Made these helpers point to the Spine C Runtime alloc and free functions by default 51 | * Reimplemented kv_resize to use alloc and free instead of realloc 52 | * Changed kv_push to use kv_resize instead of realloc 53 | * Removed kv_pushp and kv_a macros because the weren't used 54 | * Removed stdlib include 55 | */ 56 | 57 | #ifndef AC_KVEC_H 58 | #define AC_KVEC_H 59 | 60 | #ifndef _kv_free 61 | #define _kv_free(type, p) (FREE(p)) 62 | #endif 63 | 64 | #ifndef _kv_alloc 65 | #define _kv_alloc(type, s) ((type*)(MALLOC(type, (s)))) 66 | #endif 67 | 68 | #ifndef _kv_copy 69 | #define _kv_copy(type, d, s, n) memcpy((d), (s), sizeof(type) * (n)) 70 | #endif 71 | 72 | #define kv_roundup32(x) (--(x), (x)|=(x)>>1, (x)|=(x)>>2, (x)|=(x)>>4, (x)|=(x)>>8, (x)|=(x)>>16, ++(x)) 73 | 74 | #define kvec_t(type) struct { size_t n, m; type *a; } 75 | #define kv_init(v) ((v).n = (v).m = 0, (v).a = 0) 76 | #define kv_destroy(v) _kv_free(type, (v).a) 77 | #define kv_A(v, i) ((v).a[(i)]) 78 | #define kv_array(v) ((v).a) 79 | #define kv_pop(v) ((v).a[--(v).n]) 80 | #define kv_size(v) ((v).n) 81 | #define kv_max(v) ((v).m) 82 | 83 | #define kv_resize(type, v, s) do { \ 84 | type* b = _kv_alloc(type, (s)); \ 85 | if (((s) > 0) && ((v).m > 0)) \ 86 | _kv_copy(type, b, (v).a, ((s) < (v).m)? (s) : (v).m); \ 87 | _kv_free(type, (v).a); \ 88 | (v).a = b; (v).m = (s); \ 89 | } while (0) 90 | 91 | #define kv_trim(type, v) kv_resize(type, (v), kv_size(v)) 92 | 93 | #define kv_copy(type, v1, v0) do { \ 94 | if ((v1).m < (v0).n) kv_resize(type, v1, (v0).n); \ 95 | (v1).n = (v0).n; \ 96 | _kv_copy(type, (v1).a, (v0).a, (v0).n); \ 97 | } while (0) \ 98 | 99 | #define kv_push(type, v, x) do { \ 100 | if ((v).n == (v).m) \ 101 | kv_resize(type, (v), ((v).m? (v).m<<1 : 2)); \ 102 | (v).a[(v).n++] = (x); \ 103 | } while (0) 104 | 105 | #endif 106 | -------------------------------------------------------------------------------- /README.dev.md: -------------------------------------------------------------------------------- 1 | # DesktopSprite | Developer 2 | 3 | [←README](README.md) 4 | 5 | 这是关于项目代码结构和一些功能实现说明, 普通用户酌情阅读. 6 | 7 | ## 环境 8 | 9 | - `Win10+` 10 | - `Visual Studio 2022` 11 | - `C++14` 12 | - [`spine-runtime`](https://github.com/EsotericSoftware/spine-runtimes/tree/3.6) 13 | - [`jsoncpp`](https://github.com/open-source-parsers/jsoncpp) 14 | 15 | 其中 `spine-runtime` 和 `jsoncpp` 均是以源码方式引入并编译的, 内部有一些相应的适配性修改. 16 | 17 | `spine-runtime` 版本固定了是 `v3.6.53`, 所以几乎只支持碧蓝航线导出的小人资源. 18 | 19 | ## 代码结构 20 | 21 | ```mermaid 22 | flowchart 23 | 24 | WA(WinApp) 25 | PM(PerfMonitor) 26 | AC(AppConfig) 27 | 28 | 29 | MW(MainWnd) 30 | CD(ConfigDlg) 31 | SW(SpriteWnd) 32 | SC(SpineChar) 33 | SR(SpineRenderer) 34 | 35 | WA --> MW 36 | PM -.- MW 37 | PM -.- SW 38 | 39 | MW --> CD 40 | CD --> AC 41 | MW --> SW 42 | 43 | SW --> SC 44 | SW --> SR 45 | SR --> SW 46 | SC --> SR 47 | ``` 48 | 49 | (仅展示了一部分核心关系) 50 | 51 | ## 注意事项 52 | 53 | ### 性能监视器部分 54 | 55 | 性能数据使用 [PDH](https://docs.microsoft.com/en-us/windows/win32/perfctrs/performance-counters-portal) 进行收集, 数据与任务管理器看到的会有一些不同, 但是和性能监视器 [perfmon.msc](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/perfmon) 的数据是一样的. 56 | 57 | 有关数据收集的内容见 [`perfmonitor.cpp`](DesktopSprite/src/ds/perfmonitor.cpp). 58 | 59 | ### 桌宠部分 60 | 61 | 桌宠使用 2D 图形库绘制, 具体实现原理参考 [spine-c 运行时文档](http://zh.esotericsoftware.com/spine-c), 标准实现需要使用纹理映射等计算机图形学操作~但是我不会~, 所以纹理映射是通过 2D 库的纹理笔刷来实现的. 62 | 63 | 创建纹理笔刷之后, 在绘制顶点三角形时, 需要自己手动计算纹理到模型的仿射矩阵, 然后设置笔刷的变换矩阵, 就能完成纹理映射. 关键函数是这个 `GetAffineMatrix`: 64 | 65 | ```cpp 66 | void GetAffineMatrix( 67 | float x1, float y1, float x2, float y2, float x3, float y3, 68 | float u1, float v1, float u2, float v2, float u3, float v3, 69 | Matrix* m 70 | ); 71 | ``` 72 | 73 | 能够计算两个平面三角形 `UV` 到 `XY` 的仿射矩阵. 与渲染有关的详细实现见 [`spinechar.cpp`](DesktopSprite/src/ds/spinechar.cpp). 74 | 75 | ### 多线程 76 | 77 | 由于开发过程原因, 程序的主窗口其实是性能浮窗, 因此为了避免阻塞窗口消息循环, 渲染的过程是放在子线程里完成的. 因此在跨线程调用的时候, 要视情况考虑调用互斥锁操作 `SpineRenderer::Lock` 和 `SpineRenderer::Unlock` 来避免数据同步错误. 78 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # DesktopSprite 2 | 3 | :tada::tada::tada: 使用C#编写的新版本程序 [DeskSpine](https://github.com/ww-rm/DeskSpine) 现已开源并发布,欢迎前往下载使用,拥有更酷炫的性能监控窗与更丰富的动画功能支持! 4 | 5 | --- 6 | 7 | [用户手册](README.user.md) | [开发手册](README.dev.md) 8 | 9 | 这是一个适用于 `Windows` 系统下的桌面精灵, 目前已在 `Win10`, `Win11` 下基本测试通过. 10 | 11 | - 轻量的性能监视器: 可以显示电脑占用和网速监视浮窗 12 | 13 | ![性能浮窗动图](img/perfmonitor.gif) 14 | 15 | - 可自定义桌宠: 支持基于 `spine v3.6.53` 导出的碧蓝航线全角色小人动画 16 | 17 | ![guanghui_2 动图](img/guanghui_2.gif) 18 | ![biaoqiang_h 动图](img/biaoqiang_h.gif) 19 | ![lafei_h 动图](img/lafei_h.gif) 20 | ![z23_h 动图](img/z23_h.gif) 21 | 22 | ## 安装与使用 23 | 24 | ### 安装 25 | 26 | 前往 [Release](https://github.com/ww-rm/DesktopSprite/releases) 下载 `Latest` 版本的 `zip` 压缩包, 解压后双击运行里面的 `DesktopSprite.msi` 安装文件进行安装, 可以自定义安装位置. 27 | 28 | 安装完成后, 开始菜单和桌面都会出现程序启动图标. 双击运行, 通知栏会有程序图标, 首次运行桌面默认会显示自带的碧蓝小人角色, 且有一个性能浮窗. 29 | 30 | ### 更换角色 31 | 32 | 右键通知区域程序图标, 可以进入设置界面, 设置对应的 `atlas` 和 `skel/json` 文件, 然后应用/确定设置即可完成更换. 33 | 34 | 需要注意 `*.atlas`, `*.png`, `*.skel/*.json` 三份文件需要互相匹配, 且 `*.atlas` 和 `*.png` 文件名必须相同 (选择 `atlas` 的时候会自动填入 `png` 文件). 35 | 36 | ![atlasconfig](img/atlasconfig.png) 37 | 38 | ### 更多功能 39 | 40 | 程序内还有一些附带的小功能和更多细致的调节参数, 详细说明见[用户手册](README.user.md). 41 | 42 | 此处附一下自己导出的角色小人资源, 不一定包含最新角色, [AzurLaneSD](https://github.com/ww-rm/AzurLaneSD). 43 | 44 | 如果无法下载则可以试一下下面的链接: 45 | 46 | - [单角色下载](https://pan.baidu.com/s/1tSaBzZTWCyvcrgbGh_mgrg?pwd=blhx), 提取码: `blhx`. 47 | - [全角色下载](https://pan.baidu.com/s/1qpZnJRB4PaC9Eb3tkZdACw?pwd=blhx), 提取码: `blhx`. 48 | 49 | ## 关于 50 | 51 | - 一些资源的出处 52 | - [图标文件](https://github.com/ww-rm/DesktopSprite/blob/main/DesktopSprite/res/image/appicon_dark.png): 来自: [凪白みと](https://www.pixiv.net/artworks/56065927) 53 | - [默认气泡图标](https://github.com/ww-rm/DesktopSprite/blob/main/DesktopSprite/res/image/timealarm.png) 来自: [むーらん@お仕事募集中](https://www.pixiv.net/artworks/67763478) 54 | 55 | --- 56 | 57 | *如果你觉得这个项目不错请给个 Star⭐, 并分享给更多人知道. :)* 58 | 59 | *If you think this project is helpful to you, plz star it and let more people see it. :)* 60 | -------------------------------------------------------------------------------- /README.user.md: -------------------------------------------------------------------------------- 1 | # DesktopSprite | User 2 | 3 | [←README](README.md) 4 | 5 | 这是关于程序的详细功能和使用方法. 6 | 7 | ## 设置面板 8 | 9 | ![config.png](img/config.png) 10 | 11 | ### 系统设置 12 | 13 | - 开机启动: 程序是否开机启动 14 | - 整点报时: 一个小功能, 可以在整点时间弹出通知提醒 15 | - 提示声音: 整点报时是否有声音 16 | - 气泡图标路径: 整点报时气泡通知使用的图标 17 | 18 | ### 显示设置 19 | 20 | 这部分的设置是针对性能浮窗的. 21 | 22 | - 显示浮窗: 是在桌面显示浮窗还是隐藏到通知区域图标使用鼠标悬停显示 23 | - 显示占用: 是否在浮窗上显示处理器和内存占用百分比 24 | - 显示网速: 是否在浮窗上显示上传和下载速度 25 | - 深色主题: 设置浮窗主题颜色 26 | - 透明度: 设置浮窗透明度百分比, 0 为完全透明, 100 为完全不透明 27 | 28 | ### 精灵设置 29 | 30 | 这部分的设置是针对桌宠的 31 | 32 | - atlas, png, skel 路径: 选择要使用的 SD 小人模型, 三个文件要互相匹配 33 | - 显示精灵: 是否在桌面上显示桌宠, 不显示的情况下不会有桌宠的资源占用 34 | - 鼠标穿透: 是否让桌宠鼠标穿透, 穿透情况下桌宠无视鼠标和键盘输入 35 | - 最大帧率: 设置桌宠的渲染帧率, 对电脑性能有较高影响 36 | - 透明度: 设置桌宠透明度, 配合鼠标穿透可以设置挂件效果 37 | - 缩放: 设置桌宠的大小 38 | 39 | ### Spine 设置 40 | 41 | 该部分设置桌宠动画小人不同事件和动画的映射关系, 可选内容由加载的 spine 模型决定. 42 | 43 | - 待机: 无操作的普通情况 44 | - 拖动: 鼠标拖动桌宠时触发 45 | - 任务中: 没想好 46 | - 睡觉: 电脑无输入闲置一段时间后触发 47 | - 闲置: 电脑低负载时随机触发 48 | - 触摸: 单击桌宠触发 49 | - 摸头: 鼠标中键下滚 50 | - 任务完成: 任务结束后, 和任务中是连着的 51 | - 跳舞: 鼠标中键上滚 52 | - 过载: 电脑高负载时随机触发 53 | 54 | ### 按钮 55 | 56 | - 打开数据文件夹: 打开程序数据文件所在的文件夹 57 | 58 | ## 快捷操作 59 | 60 | - 右键菜单: 有两个, 一个是浮窗/通知区域图标的, 另一个是桌宠的, 大部分选项都是设置面板里有的, 是快捷操作 61 | - 精灵复位: 用来预防一些未知的特殊情况, 如一些不可知的显示器分辨率问题导致的精灵错位消失, 点击之后精灵会回到原点, 屏幕的正下方 62 | - 双击桌宠: 让角色转向 63 | 64 | ## 通知区域图标 65 | 66 | - 右键单击: 显示右键菜单 67 | - 左键双击: 显示桌宠 68 | 69 | ## 配置文件 70 | 71 | ⚠️不建议直接操作配置文件! ⚠️ 72 | 73 | ⚠️不建议直接操作配置文件! ⚠️ 74 | 75 | ⚠️不建议直接操作配置文件! ⚠️ 76 | 77 | 点击 "打开数据文件夹" 后, 可以看到数据文件夹里有一份 `config.json`, 里面以 `json` 格式存储了所有的设置面板可见的配置信息. 78 | 79 | ## 注意事项 80 | 81 | - 不建议帧率调太高, 会使电脑耗电显著增加, 或者风扇抽风 82 | - 如果不慎出了一些和配置有关的问题, 比如设置了错误的内容导致程序崩了/打不开, 直接打开数据文件夹, 关闭程序并删除 `config.json` 后重启程序, 即可让程序使用默认配置运行 83 | 84 | ## 资源拆包 85 | 86 | 这里不提供资源拆包方法, 请自行百度 `碧蓝航线`, `SD小人`, `拆包`, `AssetStudio` 等有关内容. 87 | -------------------------------------------------------------------------------- /img/atlasconfig.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/img/atlasconfig.png -------------------------------------------------------------------------------- /img/biaoqiang_h.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/img/biaoqiang_h.gif -------------------------------------------------------------------------------- /img/config.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/img/config.png -------------------------------------------------------------------------------- /img/guanghui_2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/img/guanghui_2.gif -------------------------------------------------------------------------------- /img/lafei_h.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/img/lafei_h.gif -------------------------------------------------------------------------------- /img/perfmonitor.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/img/perfmonitor.gif -------------------------------------------------------------------------------- /img/z23_h.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ww-rm/DesktopSprite/7984f4d64ee7d416e0c52d6a162ff9f0673430cf/img/z23_h.gif --------------------------------------------------------------------------------