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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -42,6 +42,10 @@ namespace Spine
class Atlas; class Atlas;
class AttachmentLoader; class AttachmentLoader;
class LinkedMesh; class LinkedMesh;
class Skin;
class Attachment;
class VertexAttachment;
class Animation;
class SkeletonBinary class SkeletonBinary
{ {
@ -101,15 +105,29 @@ namespace Spine
float readFloat(DataInput* input); 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 class SlotData
{ {
friend class SkeletonBinary;
friend class SkeletonJson;
friend class AttachmentTimeline; friend class AttachmentTimeline;
friend class ColorTimeline; friend class ColorTimeline;
friend class DeformTimeline; friend class DeformTimeline;
@ -95,7 +98,7 @@ namespace Spine
const std::string _name; const std::string _name;
BoneData& _boneData; BoneData& _boneData;
float _r, _g, _b, _a; float _r, _g, _b, _a;
float _r2, _g2, _b2; float _r2, _g2, _b2, _a2;
bool _hasSecondColor; bool _hasSecondColor;
std::string _attachmentName; std::string _attachmentName;
BlendMode _blendMode; BlendMode _blendMode;

View File

@ -41,6 +41,9 @@ namespace Spine
class TransformConstraintData class TransformConstraintData
{ {
friend class SkeletonBinary;
friend class SkeletonJson;
friend class TransformConstraint; friend class TransformConstraint;
friend class Skeleton; friend class Skeleton;
friend class TransformConstraintTimeline; 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. /// 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 class VertexAttachment : public Attachment
{ {
RTTI_DECL;
friend class DeformTimeline; friend class DeformTimeline;
RTTI_DECL;
public: public:
VertexAttachment(std::string name); VertexAttachment(std::string name);

View File

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

File diff suppressed because it is too large Load Diff

View File

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