SkeletonJson.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /******************************************************************************
  2. * Spine Runtimes Software License
  3. * Version 2
  4. *
  5. * Copyright (c) 2013, Esoteric Software
  6. * All rights reserved.
  7. *
  8. * You are granted a perpetual, non-exclusive, non-sublicensable and
  9. * non-transferable license to install, execute and perform the Spine Runtimes
  10. * Software (the "Software") solely for internal use. Without the written
  11. * permission of Esoteric Software, you may not (a) modify, translate, adapt or
  12. * otherwise create derivative works, improvements of the Software or develop
  13. * new applications using the Software or (b) remove, delete, alter or obscure
  14. * any trademarks or any copyright, trademark, patent or other intellectual
  15. * property or proprietary rights notices on or in the Software, including
  16. * any copy thereof. Redistributions in binary or source form must include
  17. * this license and terms. THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE
  18. * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  19. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ESOTERIC SOFTARE BE LIABLE FOR ANY
  21. * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  23. * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  24. * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  25. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  26. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  27. *****************************************************************************/
  28. #ifndef SPINE_SKELETONJSON_H_
  29. #define SPINE_SKELETONJSON_H_
  30. #include <spine/Attachment.h>
  31. #include <spine/AttachmentLoader.h>
  32. #include <spine/SkeletonData.h>
  33. #include <spine/Atlas.h>
  34. #include <spine/Animation.h>
  35. #ifdef __cplusplus
  36. extern "C" {
  37. #endif
  38. typedef struct {
  39. float scale;
  40. spAttachmentLoader* attachmentLoader;
  41. const char* const error;
  42. } spSkeletonJson;
  43. spSkeletonJson* spSkeletonJson_createWithLoader (spAttachmentLoader* attachmentLoader);
  44. spSkeletonJson* spSkeletonJson_create (spAtlas* atlas);
  45. void spSkeletonJson_dispose (spSkeletonJson* self);
  46. spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const char* json);
  47. spSkeletonData* spSkeletonJson_readSkeletonDataFile (spSkeletonJson* self, const char* path);
  48. #ifdef SPINE_SHORT_NAMES
  49. typedef spSkeletonJson SkeletonJson;
  50. #define SkeletonJson_createWithLoader(...) spSkeletonJson_createWithLoader(__VA_ARGS__)
  51. #define SkeletonJson_create(...) spSkeletonJson_create(__VA_ARGS__)
  52. #define SkeletonJson_dispose(...) spSkeletonJson_dispose(__VA_ARGS__)
  53. #define SkeletonJson_readSkeletonData(...) spSkeletonJson_readSkeletonData(__VA_ARGS__)
  54. #define SkeletonJson_readSkeletonDataFile(...) spSkeletonJson_readSkeletonDataFile(__VA_ARGS__)
  55. #endif
  56. #ifdef __cplusplus
  57. }
  58. #endif
  59. #endif /* SPINE_SKELETONJSON_H_ */