Almost done with SkeletonBinary

This commit is contained in:
Stephen Gowen 2017-12-03 13:15:57 -05:00
parent b78b0171ec
commit 8f28ae1c2d
18 changed files with 1024 additions and 216 deletions

View File

@ -47,8 +47,6 @@ namespace Spine
/// constraint or application code modifies the world transform after it was computed from the local transform.
class Bone : public Updatable
{
RTTI_DECL;
friend class AnimationState;
friend class RotateTimeline;
@ -63,6 +61,8 @@ namespace Spine
friend class ShearTimeline;
friend class TranslateTimeline;
RTTI_DECL;
public:
static void setYDown(bool inValue);

View File

@ -40,6 +40,8 @@ namespace Spine
class BoneData
{
friend class SkeletonBinary;
friend class SkeletonJson;
friend class AnimationState;
friend class RotateTimeline;

View File

@ -39,10 +39,13 @@ namespace Spine
class ClippingAttachment : public VertexAttachment
{
RTTI_DECL;
friend class SkeletonBinary;
friend class SkeletonJson;
friend class SkeletonClipping;
RTTI_DECL;
public:
ClippingAttachment(std::string name);

View File

@ -38,6 +38,8 @@ namespace Spine
/// Stores the setup pose values for an Event.
class EventData
{
friend class SkeletonBinary;
friend class SkeletonJson;
friend class Event;
public:

View File

@ -41,6 +41,8 @@ namespace Spine
class IkConstraintData
{
friend class SkeletonBinary;
friend class SkeletonJson;
friend class IkConstraint;
friend class Skeleton;
friend class IkConstraintTimeline;

View File

@ -39,6 +39,9 @@ namespace Spine
class LinkedMesh
{
friend class SkeletonBinary;
friend class SkeletonJson;
public:
LinkedMesh(MeshAttachment* mesh, std::string skin, int slotIndex, std::string parent);

View File

@ -42,10 +42,12 @@ namespace Spine
/// Attachment that displays a texture region using a mesh.
class MeshAttachment : public VertexAttachment
{
RTTI_DECL;
friend class SkeletonBinary;
friend class SkeletonJson;
friend class AtlasAttachmentLoader;
RTTI_DECL;
public:
MeshAttachment(std::string name);
@ -63,8 +65,8 @@ namespace Spine
Vector<float>& getUVs();
void setUVs(Vector<float>& inValue);
Vector<int>& getTriangles();
void setTriangles(Vector<int>& inValue);
Vector<short>& getTriangles();
void setTriangles(Vector<short>& inValue);
float getR();
void setR(float inValue);
@ -123,8 +125,8 @@ namespace Spine
void setParentMesh(MeshAttachment* inValue);
// Nonessential.
Vector<int>& getEdges();
void setEdges(Vector<int>& inValue);
Vector<short>& getEdges();
void setEdges(Vector<short>& inValue);
float getWidth();
void setWidth(float inValue);
float getHeight();
@ -135,8 +137,8 @@ namespace Spine
MeshAttachment* _parentMesh;
Vector<float> _uvs;
Vector<float> _regionUVs;
Vector<int> _triangles;
Vector<int> _edges;
Vector<short> _triangles;
Vector<short> _edges;
void* _rendererObject;
std::string _path;
float _regionU;

View File

@ -37,6 +37,9 @@ namespace Spine
{
class PathAttachment : public VertexAttachment
{
friend class SkeletonBinary;
friend class SkeletonJson;
RTTI_DECL;
public:

View File

@ -45,6 +45,9 @@ namespace Spine
class PathConstraintData
{
friend class SkeletonBinary;
friend class SkeletonJson;
friend class PathConstraint;
friend class Skeleton;
friend class PathConstraintMixTimeline;

View File

@ -46,6 +46,9 @@ namespace Spine
///
class PointAttachment : public Attachment
{
friend class SkeletonBinary;
friend class SkeletonJson;
RTTI_DECL;
public:

View File

@ -46,10 +46,12 @@ namespace Spine
/// Attachment that displays a texture region.
class RegionAttachment : public Attachment
{
RTTI_DECL;
friend class SkeletonBinary;
friend class SkeletonJson;
friend class AtlasAttachmentLoader;
RTTI_DECL;
public:
RegionAttachment(std::string name);

View File

@ -42,6 +42,10 @@ namespace Spine
class Atlas;
class AttachmentLoader;
class LinkedMesh;
class Skin;
class Attachment;
class VertexAttachment;
class Animation;
class SkeletonBinary
{
@ -101,15 +105,29 @@ namespace Spine
float readFloat(DataInput* input);
static unsigned char readByte(DataInput* input);
unsigned char readByte(DataInput* input);
static signed char readSByte(DataInput* input);
signed char readSByte(DataInput* input);
static int readBoolean(DataInput* input);
int readBoolean(DataInput* input);
static int readInt(DataInput* input);
int readInt(DataInput* input);
static int readVarint(DataInput* input, bool optimizePositive);
void readColor(DataInput* input, float *r, float *g, float *b, float *a);
int readVarint(DataInput* input, bool optimizePositive);
Skin* readSkin(DataInput* input, const char* skinName, SkeletonData* skeletonData, bool nonessential);
Attachment* readAttachment(DataInput* input, Skin* skin, int slotIndex, const char* attachmentName, SkeletonData* skeletonData, bool nonessential);
void readVertices(DataInput* input, VertexAttachment* attachment, int vertexCount);
Vector<float> readFloatArray(DataInput *input, int n, float scale);
Vector<short> readShortArray(DataInput *input);
Animation* readAnimation(const char* name, DataInput* input, SkeletonData *skeletonData);
};
}

View File

@ -41,6 +41,9 @@ namespace Spine
class SlotData
{
friend class SkeletonBinary;
friend class SkeletonJson;
friend class AttachmentTimeline;
friend class ColorTimeline;
friend class DeformTimeline;
@ -95,7 +98,7 @@ namespace Spine
const std::string _name;
BoneData& _boneData;
float _r, _g, _b, _a;
float _r2, _g2, _b2;
float _r2, _g2, _b2, _a2;
bool _hasSecondColor;
std::string _attachmentName;
BlendMode _blendMode;

View File

@ -41,6 +41,9 @@ namespace Spine
class TransformConstraintData
{
friend class SkeletonBinary;
friend class SkeletonJson;
friend class TransformConstraint;
friend class Skeleton;
friend class TransformConstraintTimeline;

View File

@ -42,10 +42,10 @@ namespace Spine
/// An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices.
class VertexAttachment : public Attachment
{
RTTI_DECL;
friend class DeformTimeline;
RTTI_DECL;
public:
VertexAttachment(std::string name);

View File

@ -123,12 +123,12 @@ namespace Spine
_uvs = inValue;
}
Vector<int>& MeshAttachment::getTriangles()
Vector<short>& MeshAttachment::getTriangles()
{
return _triangles;
}
void MeshAttachment::setTriangles(Vector<int>& inValue)
void MeshAttachment::setTriangles(Vector<short>& inValue)
{
_triangles = inValue;
}
@ -335,12 +335,12 @@ namespace Spine
}
}
Vector<int>& MeshAttachment::getEdges()
Vector<short>& MeshAttachment::getEdges()
{
return _edges;
}
void MeshAttachment::setEdges(Vector<int>& inValue)
void MeshAttachment::setEdges(Vector<short>& inValue)
{
_edges = inValue;
}

File diff suppressed because it is too large Load Diff

View File

@ -45,6 +45,7 @@ namespace Spine
_r2(0),
_g2(0),
_b2(0),
_a2(1),
_hasSecondColor(false),
_attachmentName(),
_blendMode(BlendMode_Normal)