AnimationStateData.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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_ANIMATIONSTATEDATA_H_
  29. #define SPINE_ANIMATIONSTATEDATA_H_
  30. #include <spine/Animation.h>
  31. #include <spine/SkeletonData.h>
  32. #ifdef __cplusplus
  33. extern "C" {
  34. #endif
  35. typedef struct {
  36. spSkeletonData* const skeletonData;
  37. float defaultMix;
  38. const void* const entries;
  39. } spAnimationStateData;
  40. spAnimationStateData* spAnimationStateData_create (spSkeletonData* skeletonData);
  41. void spAnimationStateData_dispose (spAnimationStateData* self);
  42. void spAnimationStateData_setMixByName (spAnimationStateData* self, const char* fromName, const char* toName, float duration);
  43. void spAnimationStateData_setMix (spAnimationStateData* self, spAnimation* from, spAnimation* to, float duration);
  44. /* Returns 0 if there is no mixing between the animations. */
  45. float spAnimationStateData_getMix (spAnimationStateData* self, spAnimation* from, spAnimation* to);
  46. #ifdef SPINE_SHORT_NAMES
  47. typedef spAnimationStateData AnimationStateData;
  48. #define AnimationStateData_create(...) spAnimationStateData_create(__VA_ARGS__)
  49. #define AnimationStateData_dispose(...) spAnimationStateData_dispose(__VA_ARGS__)
  50. #define AnimationStateData_setMixByName(...) spAnimationStateData_setMixByName(__VA_ARGS__)
  51. #define AnimationStateData_setMix(...) spAnimationStateData_setMix(__VA_ARGS__)
  52. #define AnimationStateData_getMix(...) spAnimationStateData_getMix(__VA_ARGS__)
  53. #endif
  54. #ifdef __cplusplus
  55. }
  56. #endif
  57. #endif /* SPINE_ANIMATIONSTATEDATA_H_ */