Blame view

ios/cocos2d/cocos/editor-support/spine/SkeletonAnimation.h 6.36 KB
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
1
  /******************************************************************************
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
2
3
   * Spine Runtimes License Agreement
   * Last updated May 1, 2019. Replaces all prior versions.
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
4
   *
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
5
   * Copyright (c) 2013-2019, Esoteric Software LLC
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
6
   *
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
7
8
9
10
   * Integration of the Spine Runtimes into software or otherwise creating
   * derivative works of the Spine Runtimes is permitted under the terms and
   * conditions of Section 2 of the Spine Editor License Agreement:
   * http://esotericsoftware.com/spine-editor-license
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
11
   *
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
   * Otherwise, it is permitted to integrate the Spine Runtimes into software
   * or otherwise create derivative works of the Spine Runtimes (collectively,
   * "Products"), provided that each user of the Products must obtain their own
   * Spine Editor license and redistribution of the Products in any form must
   * include this license and copyright notice.
   *
   * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE LLC "AS IS" AND ANY EXPRESS
   * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
   * NO EVENT SHALL ESOTERIC SOFTWARE LLC BE LIABLE FOR ANY DIRECT, INDIRECT,
   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
   * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS
   * INTERRUPTION, OR LOSS OF USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY
   * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
   * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
28
29
30
31
32
33
   *****************************************************************************/
  
  #ifndef SPINE_SKELETONANIMATION_H_
  #define SPINE_SKELETONANIMATION_H_
  
  #include <spine/spine.h>
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
34
  #include <spine/spine-cocos2dx.h>
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
35
36
37
38
  #include "cocos2d.h"
  
  namespace spine {
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
39
40
41
42
43
44
45
46
47
  class SkeletonAnimation;
  
  typedef std::function<void(TrackEntry* entry)> StartListener;
  typedef std::function<void(TrackEntry* entry)> InterruptListener;
  typedef std::function<void(TrackEntry* entry)> EndListener;
  typedef std::function<void(TrackEntry* entry)> DisposeListener;
  typedef std::function<void(TrackEntry* entry)> CompleteListener;
  typedef std::function<void(TrackEntry* entry, Event* event)> EventListener;
  typedef std::function<void(SkeletonAnimation* node)> UpdateWorldTransformsListener;
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
48
49
50
51
52
53
  
  /** Draws an animated skeleton, providing an AnimationState for applying one or more animations and queuing animations to be
    * played later. */
  class SkeletonAnimation: public SkeletonRenderer {
  public:
  	CREATE_FUNC(SkeletonAnimation);
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
54
55
  	static SkeletonAnimation* createWithData (SkeletonData* skeletonData, bool ownsSkeletonData = false);
  	static SkeletonAnimation* createWithJsonFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
56
  	static SkeletonAnimation* createWithJsonFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1);
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
57
  	static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, Atlas* atlas, float scale = 1);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
58
59
60
  	static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, const std::string& atlasFile, float scale = 1);
  
  	// Use createWithJsonFile instead
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
61
  	CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1)
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
62
63
64
65
66
67
68
69
70
71
  	{
  		return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlas, scale);
  	}
  	// Use createWithJsonFile instead
  	CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1)
  	{
  		return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlasFile, scale);
  	}
  
  	virtual void update (float deltaTime) override;
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
72
  	virtual void draw (cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t transformFlags) override;
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
73
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
74
  	void setAnimationStateData (AnimationStateData* stateData);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
75
76
  	void setMix (const std::string& fromAnimation, const std::string& toAnimation, float duration);
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
77
78
79
  	TrackEntry* setAnimation (int trackIndex, const std::string& name, bool loop);
  	TrackEntry* addAnimation (int trackIndex, const std::string& name, bool loop, float delay = 0);
  	TrackEntry* setEmptyAnimation (int trackIndex, float mixDuration);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
80
  	void setEmptyAnimations (float mixDuration);
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
81
82
83
  	TrackEntry* addEmptyAnimation (int trackIndex, float mixDuration, float delay = 0);
  	Animation* findAnimation(const std::string& name) const;
  	TrackEntry* getCurrent (int trackIndex = 0);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
84
85
86
87
  	void clearTracks ();
  	void clearTrack (int trackIndex = 0);
  
  	void setStartListener (const StartListener& listener);
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
88
  	void setInterruptListener (const InterruptListener& listener);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
89
  	void setEndListener (const EndListener& listener);
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
90
  	void setDisposeListener (const DisposeListener& listener);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
91
92
  	void setCompleteListener (const CompleteListener& listener);
  	void setEventListener (const EventListener& listener);
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
93
94
  	void setPreUpdateWorldTransformsListener(const UpdateWorldTransformsListener& listener);
  	void setPostUpdateWorldTransformsListener(const UpdateWorldTransformsListener& listener);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
95
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
96
97
98
99
100
101
  	void setTrackStartListener (TrackEntry* entry, const StartListener& listener);
  	void setTrackInterruptListener (TrackEntry* entry, const InterruptListener& listener);
  	void setTrackEndListener (TrackEntry* entry, const EndListener& listener);
  	void setTrackDisposeListener (TrackEntry* entry, const DisposeListener& listener);
  	void setTrackCompleteListener (TrackEntry* entry, const CompleteListener& listener);
  	void setTrackEventListener (TrackEntry* entry, const EventListener& listener);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
102
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
103
104
  	virtual void onAnimationStateEvent (TrackEntry* entry, EventType type, Event* event);
  	virtual void onTrackEntryEvent (TrackEntry* entry, EventType type, Event* event);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
105
  
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
106
107
  	AnimationState* getState() const;
  	void setUpdateOnlyIfVisible(bool status);
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
108
109
110
111
112
113
114
  
  CC_CONSTRUCTOR_ACCESS:
  	SkeletonAnimation ();
  	virtual ~SkeletonAnimation ();
  	virtual void initialize () override;
  
  protected:
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
115
  	AnimationState* _state;
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
116
117
  
  	bool _ownsAnimationStateData;
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
118
119
  	bool _updateOnlyIfVisible;
  	bool _firstDraw;
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
120
121
  
  	StartListener _startListener;
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
122
  	InterruptListener _interruptListener;
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
123
  	EndListener _endListener;
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
124
  	DisposeListener _disposeListener;
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
125
126
  	CompleteListener _completeListener;
  	EventListener _eventListener;
5daad4bc   xiaoyu   游戏源码添加编译(现存问题:游戏内...
127
128
  	UpdateWorldTransformsListener _preUpdateListener;
  	UpdateWorldTransformsListener _postUpdateListener;
520389e3   xiaoyu   接入cocos源码,编译未通过,继续修改
129
130
131
132
133
134
135
136
  
  private:
  	typedef SkeletonRenderer super;
  };
  
  }
  
  #endif /* SPINE_SKELETONANIMATION_H_ */