mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-06 02:36:56 +08:00
wip
This commit is contained in:
parent
3e94e53a4c
commit
1361203f1c
File diff suppressed because it is too large
Load Diff
@ -124,7 +124,7 @@ namespace Spine
|
|||||||
static const int BRX;
|
static const int BRX;
|
||||||
static const int BRY;
|
static const int BRY;
|
||||||
|
|
||||||
float _x, _y, _rotation, _scaleX = 1, _scaleY = 1, _width, _height;
|
float _x, _y, _rotation, _scaleX, _scaleY, _width, _height;
|
||||||
float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
|
float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight;
|
||||||
Vector<float> _offset;
|
Vector<float> _offset;
|
||||||
Vector<float> _uvs;
|
Vector<float> _uvs;
|
||||||
|
|||||||
@ -28,7 +28,99 @@
|
|||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
|
#include <spine/AnimationState.h>
|
||||||
|
|
||||||
|
#include <spine/Animation.h>
|
||||||
|
|
||||||
|
#include <spine/MathUtil.h>
|
||||||
|
|
||||||
namespace Spine
|
namespace Spine
|
||||||
{
|
{
|
||||||
// TODO
|
TrackEntry::TrackEntry()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int TrackEntry::getTrackIndex() { return _trackIndex; }
|
||||||
|
|
||||||
|
Animation* TrackEntry::getAnimation() { return _animation; }
|
||||||
|
|
||||||
|
bool TrackEntry::getLoop() { return _loop; }
|
||||||
|
void TrackEntry::setLoop(bool inValue) { _loop = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getDelay() { return _delay; }
|
||||||
|
void TrackEntry::setDelay(float inValue) { _delay = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getTrackTime() { return _trackTime; }
|
||||||
|
void TrackEntry::setTrackTime(float inValue) { _trackTime = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getTrackEnd() { return _trackEnd; }
|
||||||
|
void TrackEntry::setTrackEnd(float inValue) { _trackEnd = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getAnimationStart() { return _animationStart; }
|
||||||
|
void TrackEntry::setAnimationStart(float inValue) { _animationStart = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getAnimationEnd() { return _animationEnd; }
|
||||||
|
void TrackEntry::setAnimationEnd(float inValue) { _animationEnd = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getAnimationLast() { return _animationLast; }
|
||||||
|
void TrackEntry::setAnimationLast(float inValue)
|
||||||
|
{
|
||||||
|
_animationLast = inValue;
|
||||||
|
_nextAnimationLast = inValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
float TrackEntry::getAnimationTime()
|
||||||
|
{
|
||||||
|
if (_loop)
|
||||||
|
{
|
||||||
|
float duration = _animationEnd - _animationStart;
|
||||||
|
if (duration == 0)
|
||||||
|
{
|
||||||
|
return _animationStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
return fmodf(_trackTime, duration) + _animationStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
return MIN(_trackTime + _animationStart, _animationEnd);
|
||||||
|
}
|
||||||
|
|
||||||
|
float TrackEntry::getTimeScale() { return _timeScale; }
|
||||||
|
void TrackEntry::setTimeScale(float inValue) { _timeScale = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getAlpha() { return _alpha; }
|
||||||
|
void TrackEntry::setAlpha(float inValue) { _alpha = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getEventThreshold() { return _eventThreshold; }
|
||||||
|
void TrackEntry::setEventThreshold(float inValue) { _eventThreshold = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getAttachmentThreshold() { return _attachmentThreshold; }
|
||||||
|
void TrackEntry::setAttachmentThreshold(float inValue) { _attachmentThreshold = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getDrawOrderThreshold() { return _drawOrderThreshold; }
|
||||||
|
void TrackEntry::setDrawOrderThreshold(float inValue) { _drawOrderThreshold = inValue; }
|
||||||
|
|
||||||
|
TrackEntry* TrackEntry::getNext() { return _next; }
|
||||||
|
|
||||||
|
bool TrackEntry::isComplete()
|
||||||
|
{
|
||||||
|
return _trackTime >= _animationEnd - _animationStart;
|
||||||
|
}
|
||||||
|
|
||||||
|
float TrackEntry::getMixTime() { return _mixTime; }
|
||||||
|
void TrackEntry::setMixTime(float inValue) { _mixTime = inValue; }
|
||||||
|
|
||||||
|
float TrackEntry::getMixDuration() { return _mixDuration; }
|
||||||
|
void TrackEntry::setMixDuration(float inValue) { _mixDuration = inValue; }
|
||||||
|
|
||||||
|
TrackEntry* TrackEntry::getMixingFrom() { return _mixingFrom; }
|
||||||
|
|
||||||
|
// event AnimationState.TrackEntryDelegate Start, Interrupt, End, Dispose, Complete;
|
||||||
|
// event AnimationState.TrackEntryEventDelegate Event;
|
||||||
|
|
||||||
|
void TrackEntry::resetRotationDirections()
|
||||||
|
{
|
||||||
|
_timelinesRotation.clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
namespace Spine
|
namespace Spine
|
||||||
{
|
{
|
||||||
AnimationStateData::AnimationStateData(SkeletonData& skeletonData) : _skeletonData(skeletonData)
|
AnimationStateData::AnimationStateData(SkeletonData& skeletonData) : _skeletonData(skeletonData), _defaultMix(0)
|
||||||
{
|
{
|
||||||
// Empty
|
// Empty
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ namespace Spine
|
|||||||
{
|
{
|
||||||
RTTI_IMPL(ClippingAttachment, VertexAttachment);
|
RTTI_IMPL(ClippingAttachment, VertexAttachment);
|
||||||
|
|
||||||
ClippingAttachment::ClippingAttachment(std::string name) : VertexAttachment(name)
|
ClippingAttachment::ClippingAttachment(std::string name) : VertexAttachment(name), _endSlot(NULL)
|
||||||
{
|
{
|
||||||
// Empty
|
// Empty
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,7 @@ namespace Spine
|
|||||||
{
|
{
|
||||||
RTTI_IMPL(PathAttachment, VertexAttachment);
|
RTTI_IMPL(PathAttachment, VertexAttachment);
|
||||||
|
|
||||||
PathAttachment::PathAttachment(std::string name) : VertexAttachment(name)
|
PathAttachment::PathAttachment(std::string name) : VertexAttachment(name), _closed(false), _constantSpeed(false)
|
||||||
{
|
{
|
||||||
// Empty
|
// Empty
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ namespace Spine
|
|||||||
{
|
{
|
||||||
RTTI_IMPL(PointAttachment, Attachment);
|
RTTI_IMPL(PointAttachment, Attachment);
|
||||||
|
|
||||||
PointAttachment::PointAttachment(std::string name) : Attachment(name)
|
PointAttachment::PointAttachment(std::string name) : Attachment(name), _x(0), _y(0), _rotation(0)
|
||||||
{
|
{
|
||||||
// Empty
|
// Empty
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,7 +49,30 @@ namespace Spine
|
|||||||
const int RegionAttachment::BRX = 6;
|
const int RegionAttachment::BRX = 6;
|
||||||
const int RegionAttachment::BRY = 7;
|
const int RegionAttachment::BRY = 7;
|
||||||
|
|
||||||
RegionAttachment::RegionAttachment(std::string name) : Attachment(name)
|
RegionAttachment::RegionAttachment(std::string name) : Attachment(name),
|
||||||
|
_x(0),
|
||||||
|
_y(0),
|
||||||
|
_rotation(0),
|
||||||
|
_scaleX(1),
|
||||||
|
_scaleY(1),
|
||||||
|
_width(0),
|
||||||
|
_height(0),
|
||||||
|
_regionOffsetX(0),
|
||||||
|
_regionOffsetY(0),
|
||||||
|
_regionWidth(0),
|
||||||
|
_regionHeight(0),
|
||||||
|
_regionOriginalWidth(0),
|
||||||
|
_regionOriginalHeight(0),
|
||||||
|
_rendererObject(NULL),
|
||||||
|
_path(),
|
||||||
|
_regionU(0),
|
||||||
|
_regionV(0),
|
||||||
|
_regionU2(0),
|
||||||
|
_regionV2(0),
|
||||||
|
_r(0),
|
||||||
|
_g(0),
|
||||||
|
_b(0),
|
||||||
|
_a(0)
|
||||||
{
|
{
|
||||||
_offset.reserve(NUM_UVS);
|
_offset.reserve(NUM_UVS);
|
||||||
_uvs.reserve(NUM_UVS);
|
_uvs.reserve(NUM_UVS);
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
|
|
||||||
namespace Spine
|
namespace Spine
|
||||||
{
|
{
|
||||||
SkeletonClipping::SkeletonClipping()
|
SkeletonClipping::SkeletonClipping() : _clipAttachment(NULL)
|
||||||
{
|
{
|
||||||
_clipOutput.reserve(128);
|
_clipOutput.reserve(128);
|
||||||
_clippedVertices.reserve(128);
|
_clippedVertices.reserve(128);
|
||||||
|
|||||||
@ -59,7 +59,7 @@ namespace Spine
|
|||||||
const int TwoColorTimeline::G2 = 6;
|
const int TwoColorTimeline::G2 = 6;
|
||||||
const int TwoColorTimeline::B2 = 7;
|
const int TwoColorTimeline::B2 = 7;
|
||||||
|
|
||||||
TwoColorTimeline::TwoColorTimeline(int frameCount) : CurveTimeline(frameCount)
|
TwoColorTimeline::TwoColorTimeline(int frameCount) : CurveTimeline(frameCount), _slotIndex(0)
|
||||||
{
|
{
|
||||||
_frames.reserve(frameCount * ENTRIES);
|
_frames.reserve(frameCount * ENTRIES);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user