mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-02-06 15:24:55 +08:00
Almost done with SkeletonBinary
This commit is contained in:
parent
b78b0171ec
commit
8f28ae1c2d
@ -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);
|
||||
|
||||
|
||||
@ -40,6 +40,8 @@ namespace Spine
|
||||
class BoneData
|
||||
{
|
||||
friend class SkeletonBinary;
|
||||
friend class SkeletonJson;
|
||||
|
||||
friend class AnimationState;
|
||||
|
||||
friend class RotateTimeline;
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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:
|
||||
|
||||
@ -41,6 +41,8 @@ namespace Spine
|
||||
|
||||
class IkConstraintData
|
||||
{
|
||||
friend class SkeletonBinary;
|
||||
friend class SkeletonJson;
|
||||
friend class IkConstraint;
|
||||
friend class Skeleton;
|
||||
friend class IkConstraintTimeline;
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -37,6 +37,9 @@ namespace Spine
|
||||
{
|
||||
class PathAttachment : public VertexAttachment
|
||||
{
|
||||
friend class SkeletonBinary;
|
||||
friend class SkeletonJson;
|
||||
|
||||
RTTI_DECL;
|
||||
|
||||
public:
|
||||
|
||||
@ -45,6 +45,9 @@ namespace Spine
|
||||
|
||||
class PathConstraintData
|
||||
{
|
||||
friend class SkeletonBinary;
|
||||
friend class SkeletonJson;
|
||||
|
||||
friend class PathConstraint;
|
||||
friend class Skeleton;
|
||||
friend class PathConstraintMixTimeline;
|
||||
|
||||
@ -46,6 +46,9 @@ namespace Spine
|
||||
///
|
||||
class PointAttachment : public Attachment
|
||||
{
|
||||
friend class SkeletonBinary;
|
||||
friend class SkeletonJson;
|
||||
|
||||
RTTI_DECL;
|
||||
|
||||
public:
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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);
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -41,6 +41,9 @@ namespace Spine
|
||||
|
||||
class TransformConstraintData
|
||||
{
|
||||
friend class SkeletonBinary;
|
||||
friend class SkeletonJson;
|
||||
|
||||
friend class TransformConstraint;
|
||||
friend class Skeleton;
|
||||
friend class TransformConstraintTimeline;
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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
@ -45,6 +45,7 @@ namespace Spine
|
||||
_r2(0),
|
||||
_g2(0),
|
||||
_b2(0),
|
||||
_a2(1),
|
||||
_hasSecondColor(false),
|
||||
_attachmentName(),
|
||||
_blendMode(BlendMode_Normal)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user