Changing RTTI to SPINE_RTTI and RTTI.h/cpp to SpineRTTI.h/cpp

This commit is contained in:
Stephen Gowen 2017-11-19 19:01:30 -05:00
parent 44194018ad
commit 5bba269f13
69 changed files with 103 additions and 103 deletions

View File

@ -45,7 +45,7 @@ namespace Spine
///
class AtlasAttachmentLoader : public AttachmentLoader
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
AtlasAttachmentLoader (Vector<Atlas*>& inAtlasArray) : _atlasArray(inAtlasArray)

View File

@ -31,7 +31,7 @@
#ifndef Spine_Attachment_h
#define Spine_Attachment_h
#include <spine/RTTI.h>
#include <spine/SpineRTTI.h>
#include <string>
@ -39,7 +39,7 @@ namespace Spine
{
class Attachment
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
Attachment(std::string name);

View File

@ -31,7 +31,7 @@
#ifndef Spine_AttachmentLoader_h
#define Spine_AttachmentLoader_h
#include <spine/RTTI.h>
#include <spine/SpineRTTI.h>
#include <string>
@ -47,7 +47,7 @@ namespace Spine
class AttachmentLoader
{
RTTI_DECL;
SPINE_RTTI_DECL;
/// @return May be NULL to not load any attachment.
virtual RegionAttachment* newRegionAttachment(Skin& skin, std::string name, std::string path) = 0;

View File

@ -46,7 +46,7 @@ namespace Spine
class AttachmentTimeline : public Timeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
AttachmentTimeline(int frameCount)

View File

@ -47,7 +47,7 @@ namespace Spine
/// constraint or application code modifies the world transform after it was computed from the local transform.
class Bone : public Updatable
{
RTTI_DECL;
SPINE_RTTI_DECL;
friend class RotateTimeline;
friend class IkConstraint;

View File

@ -38,7 +38,7 @@ namespace Spine
/// Attachment that has a polygon for bounds checking.
class BoundingBoxAttachment : public VertexAttachment
{
RTTI_DECL;
SPINE_RTTI_DECL;
BoundingBoxAttachment(std::string name);
};

View File

@ -39,7 +39,7 @@ namespace Spine
class ClippingAttachment : public VertexAttachment
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
ClippingAttachment(std::string name);

View File

@ -37,7 +37,7 @@ namespace Spine
{
class ColorTimeline : public CurveTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// public const int ENTRIES = 5;
// protected const int PREV_TIME = -5, PREV_R = -4, PREV_G = -3, PREV_B = -2, PREV_A = -1;

View File

@ -38,7 +38,7 @@ namespace Spine
/// The interface for all constraints.
class Constraint : public Updatable
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
Constraint();

View File

@ -41,7 +41,7 @@ namespace Spine
/// Base class for frames that use an interpolation bezier curve.
class CurveTimeline : public Timeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
CurveTimeline(int frameCount);

View File

@ -37,7 +37,7 @@ namespace Spine
{
class DeformTimeline : CurveTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// internal int slotIndex;
// internal float[] frames;

View File

@ -37,7 +37,7 @@ namespace Spine
{
class DrawOrderTimeline : public Timeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// internal float[] frames;
// private int[][] drawOrders;

View File

@ -37,7 +37,7 @@ namespace Spine
{
class EventTimeline : public Timeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// internal float[] frames;
// private Event[] events;

View File

@ -45,7 +45,7 @@ namespace Spine
{
friend class Skeleton;
RTTI_DECL;
SPINE_RTTI_DECL;
public:
/// Adjusts the bone rotation so the tip is as close to the target position as possible. The target is specified

View File

@ -37,7 +37,7 @@ namespace Spine
{
class IkConstraintTimeline : public CurveTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// public const int ENTRIES = 3;
// private const int PREV_TIME = -3, PREV_MIX = -2, PREV_BEND_DIRECTION = -1;

View File

@ -42,7 +42,7 @@ namespace Spine
/// Attachment that displays a texture region using a mesh.
class MeshAttachment : public VertexAttachment
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
MeshAttachment(std::string name);

View File

@ -37,7 +37,7 @@ namespace Spine
{
class PathAttachment : public VertexAttachment
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
PathAttachment(std::string name);

View File

@ -47,7 +47,7 @@ namespace Spine
{
friend class Skeleton;
RTTI_DECL;
SPINE_RTTI_DECL;
public:
PathConstraint(PathConstraintData& data, Skeleton& skeleton);

View File

@ -37,7 +37,7 @@ namespace Spine
{
class PathConstraintMixTimeline : public CurveTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// public const int ENTRIES = 3;
// private const int PREV_TIME = -3, PREV_ROTATE = -2, PREV_TRANSLATE = -1;

View File

@ -37,7 +37,7 @@ namespace Spine
{
class PathConstraintPositionTimeline : public CurveTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// public const int ENTRIES = 2;
// protected const int PREV_TIME = -2, PREV_VALUE = -1;

View File

@ -37,7 +37,7 @@ namespace Spine
{
class PathConstraintSpacingTimeline : public PathConstraintPositionTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// override public int PropertyId {
// get { return ((int)TimelineType.PathConstraintSpacing << 24) + pathConstraintIndex; }

View File

@ -46,7 +46,7 @@ namespace Spine
///
class PointAttachment : public Attachment
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
PointAttachment(std::string name);

View File

@ -46,7 +46,7 @@ namespace Spine
/// Attachment that displays a texture region.
class RegionAttachment : public Attachment
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
RegionAttachment(std::string name);

View File

@ -37,7 +37,7 @@ namespace Spine
{
class RotateTimeline : public CurveTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
static const int ENTRIES = 2;

View File

@ -37,7 +37,7 @@ namespace Spine
{
class ScaleTimeline : public TranslateTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// override public int PropertyId {
// get { return ((int)TimelineType.Scale << 24) + boneIndex; }

View File

@ -37,7 +37,7 @@ namespace Spine
{
class ShearTimeline : public TranslateTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// override public int PropertyId {
// get { return ((int)TimelineType.Shear << 24) + boneIndex; }

View File

@ -28,48 +28,48 @@
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#ifndef Spine_RTTI_h
#define Spine_RTTI_h
#ifndef Spine_SPINE_RTTI_h
#define Spine_SPINE_RTTI_h
#include <string>
namespace Spine
{
class RTTI
class SPINE_RTTI
{
public:
RTTI(const std::string& className);
SPINE_RTTI(const std::string& className);
RTTI(const std::string& className, const RTTI& baseRTTI);
SPINE_RTTI(const std::string& className, const SPINE_RTTI& baseSPINE_RTTI);
const std::string& getClassName() const;
bool isExactly(const RTTI& rtti) const;
bool isExactly(const SPINE_RTTI& rtti) const;
bool derivesFrom(const RTTI& rtti) const;
bool derivesFrom(const SPINE_RTTI& rtti) const;
private:
// Prevent copying
RTTI(const RTTI& obj);
RTTI& operator=(const RTTI& obj);
SPINE_RTTI(const SPINE_RTTI& obj);
SPINE_RTTI& operator=(const SPINE_RTTI& obj);
const std::string m_className;
const RTTI *m_pBaseRTTI;
const SPINE_RTTI *m_pBaseSPINE_RTTI;
};
}
#define RTTI_DECL \
#define SPINE_RTTI_DECL \
public: \
static const Spine::RTTI rtti; \
virtual const Spine::RTTI& getRTTI();
static const Spine::SPINE_RTTI rtti; \
virtual const Spine::SPINE_RTTI& getSPINE_RTTI();
#define RTTI_IMPL_NOPARENT(name) \
const Spine::RTTI name::rtti(#name); \
const Spine::RTTI& name::getRTTI() { return rtti; }
#define SPINE_RTTI_IMPL_NOPARENT(name) \
const Spine::SPINE_RTTI name::rtti(#name); \
const Spine::SPINE_RTTI& name::getSPINE_RTTI() { return rtti; }
#define RTTI_IMPL(name,parent) \
const Spine::RTTI name::rtti(#name, parent::rtti); \
const Spine::RTTI& name::getRTTI() { return rtti; }
#define SPINE_RTTI_IMPL(name,parent) \
const Spine::SPINE_RTTI name::rtti(#name, parent::rtti); \
const Spine::SPINE_RTTI& name::getSPINE_RTTI() { return rtti; }
#endif /* Spine_RTTI_h */
#endif /* Spine_SPINE_RTTI_h */

View File

@ -31,7 +31,7 @@
#ifndef Spine_Timeline_h
#define Spine_Timeline_h
#include <spine/RTTI.h>
#include <spine/SpineRTTI.h>
#include <spine/Vector.h>
#include <spine/MixPose.h>
#include <spine/MixDirection.h>
@ -43,7 +43,7 @@ namespace Spine
class Timeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
Timeline();

View File

@ -45,7 +45,7 @@ namespace Spine
{
friend class Skeleton;
RTTI_DECL;
SPINE_RTTI_DECL;
public:
TransformConstraint(TransformConstraintData& data, Skeleton& skeleton);

View File

@ -37,7 +37,7 @@ namespace Spine
{
class TransformConstraintTimeline : public CurveTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// public const int ENTRIES = 5;
// private const int PREV_TIME = -5, PREV_ROTATE = -4, PREV_TRANSLATE = -3, PREV_SCALE = -2, PREV_SHEAR = -1;

View File

@ -40,7 +40,7 @@ namespace Spine
{
class TranslateTimeline : public CurveTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// public const int ENTRIES = 3;
// protected const int PREV_TIME = -3, PREV_X = -2, PREV_Y = -1;

View File

@ -37,7 +37,7 @@ namespace Spine
{
class TwoColorTimeline : public CurveTimeline
{
RTTI_DECL;
SPINE_RTTI_DECL;
// public const int ENTRIES = 8;
// protected const int PREV_TIME = -8, PREV_R = -7, PREV_G = -6, PREV_B = -5, PREV_A = -4;

View File

@ -31,13 +31,13 @@
#ifndef Spine_Updatable_h
#define Spine_Updatable_h
#include <spine/RTTI.h>
#include <spine/SpineRTTI.h>
namespace Spine
{
class Updatable
{
RTTI_DECL;
SPINE_RTTI_DECL;
public:
Updatable();

View File

@ -42,7 +42,7 @@ 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;
SPINE_RTTI_DECL;
public:
VertexAttachment(std::string name);

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(AtlasAttachmentLoader, AttachmentLoader);
SPINE_RTTI_IMPL(AtlasAttachmentLoader, AttachmentLoader);
}

View File

@ -34,7 +34,7 @@
namespace Spine
{
RTTI_IMPL_NOPARENT(Attachment);
SPINE_RTTI_IMPL_NOPARENT(Attachment);
Attachment::Attachment(std::string name) : _name(name)
{

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL_NOPARENT(AttachmentLoader);
SPINE_RTTI_IMPL_NOPARENT(AttachmentLoader);
}

View File

@ -38,5 +38,5 @@
namespace Spine
{
RTTI_IMPL(AttachmentTimeline, Timeline);
SPINE_RTTI_IMPL(AttachmentTimeline, Timeline);
}

View File

@ -38,7 +38,7 @@
namespace Spine
{
RTTI_IMPL(Bone, Updatable);
SPINE_RTTI_IMPL(Bone, Updatable);
bool Bone::yDown = false;

View File

@ -32,7 +32,7 @@
namespace Spine
{
RTTI_IMPL(BoundingBoxAttachment, VertexAttachment);
SPINE_RTTI_IMPL(BoundingBoxAttachment, VertexAttachment);
BoundingBoxAttachment::BoundingBoxAttachment(std::string name) : VertexAttachment(name)
{

View File

@ -34,7 +34,7 @@
namespace Spine
{
RTTI_IMPL(ClippingAttachment, VertexAttachment);
SPINE_RTTI_IMPL(ClippingAttachment, VertexAttachment);
ClippingAttachment::ClippingAttachment(std::string name) : VertexAttachment(name)
{

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(ColorTimeline, CurveTimeline);
SPINE_RTTI_IMPL(ColorTimeline, CurveTimeline);
}

View File

@ -32,7 +32,7 @@
namespace Spine
{
RTTI_IMPL(Constraint, Updatable);
SPINE_RTTI_IMPL(Constraint, Updatable);
Constraint::Constraint()
{

View File

@ -34,7 +34,7 @@
namespace Spine
{
RTTI_IMPL(CurveTimeline, Timeline);
SPINE_RTTI_IMPL(CurveTimeline, Timeline);
const float CurveTimeline::LINEAR = 0;
const float CurveTimeline::STEPPED = 1;

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(DeformTimeline, CurveTimeline);
SPINE_RTTI_IMPL(DeformTimeline, CurveTimeline);
}

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(DrawOrderTimeline, Timeline);
SPINE_RTTI_IMPL(DrawOrderTimeline, Timeline);
}

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(EventTimeline, Timeline);
SPINE_RTTI_IMPL(EventTimeline, Timeline);
}

View File

@ -39,7 +39,7 @@
namespace Spine
{
RTTI_IMPL(IkConstraint, Constraint);
SPINE_RTTI_IMPL(IkConstraint, Constraint);
void IkConstraint::apply(Bone& bone, float targetX, float targetY, float alpha)
{

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(IkConstraintTimeline, CurveTimeline);
SPINE_RTTI_IMPL(IkConstraintTimeline, CurveTimeline);
}

View File

@ -32,7 +32,7 @@
namespace Spine
{
RTTI_IMPL(MeshAttachment, VertexAttachment);
SPINE_RTTI_IMPL(MeshAttachment, VertexAttachment);
MeshAttachment::MeshAttachment(std::string name) : VertexAttachment(name),
_regionOffsetX(0),

View File

@ -32,7 +32,7 @@
namespace Spine
{
RTTI_IMPL(PathAttachment, VertexAttachment);
SPINE_RTTI_IMPL(PathAttachment, VertexAttachment);
PathAttachment::PathAttachment(std::string name) : VertexAttachment(name)
{

View File

@ -45,7 +45,7 @@
namespace Spine
{
RTTI_IMPL(PathConstraint, Constraint);
SPINE_RTTI_IMPL(PathConstraint, Constraint);
const float PathConstraint::EPSILON = 0.00001f;
const int PathConstraint::NONE = -1;
@ -79,7 +79,7 @@ namespace Spine
void PathConstraint::update()
{
Attachment* baseAttachment = _target->getAttachment();
if (baseAttachment == NULL || !baseAttachment->getRTTI().derivesFrom(PathAttachment::rtti))
if (baseAttachment == NULL || !baseAttachment->getSPINE_RTTI().derivesFrom(PathAttachment::rtti))
{
return;
}

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(PathConstraintMixTimeline, CurveTimeline);
SPINE_RTTI_IMPL(PathConstraintMixTimeline, CurveTimeline);
}

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(PathConstraintPositionTimeline, CurveTimeline);
SPINE_RTTI_IMPL(PathConstraintPositionTimeline, CurveTimeline);
}

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(PathConstraintSpacingTimeline, PathConstraintPositionTimeline);
SPINE_RTTI_IMPL(PathConstraintSpacingTimeline, PathConstraintPositionTimeline);
}

View File

@ -36,7 +36,7 @@
namespace Spine
{
RTTI_IMPL(PointAttachment, Attachment);
SPINE_RTTI_IMPL(PointAttachment, Attachment);
PointAttachment::PointAttachment(std::string name) : Attachment(name)
{

View File

@ -38,7 +38,7 @@
namespace Spine
{
RTTI_IMPL(RegionAttachment, Attachment);
SPINE_RTTI_IMPL(RegionAttachment, Attachment);
const int RegionAttachment::BLX = 0;
const int RegionAttachment::BLY = 1;

View File

@ -40,7 +40,7 @@
namespace Spine
{
RTTI_IMPL(RotateTimeline, CurveTimeline);
SPINE_RTTI_IMPL(RotateTimeline, CurveTimeline);
RotateTimeline::RotateTimeline(int frameCount) : CurveTimeline(frameCount), _boneIndex(0)
{

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(ScaleTimeline, TranslateTimeline);
SPINE_RTTI_IMPL(ScaleTimeline, TranslateTimeline);
}

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(ShearTimeline, TranslateTimeline);
SPINE_RTTI_IMPL(ShearTimeline, TranslateTimeline);
}

View File

@ -471,7 +471,7 @@ namespace Spine
int verticesLength = 0;
Attachment* attachment = slot->getAttachment();
if (attachment != NULL && attachment->getRTTI().derivesFrom(RegionAttachment::rtti))
if (attachment != NULL && attachment->getSPINE_RTTI().derivesFrom(RegionAttachment::rtti))
{
RegionAttachment* regionAttachment = static_cast<RegionAttachment*>(attachment);
@ -482,7 +482,7 @@ namespace Spine
}
regionAttachment->computeWorldVertices(slot->getBone(), outVertexBuffer, 0);
}
else if (attachment != NULL && attachment->getRTTI().derivesFrom(MeshAttachment::rtti))
else if (attachment != NULL && attachment->getSPINE_RTTI().derivesFrom(MeshAttachment::rtti))
{
MeshAttachment* mesh = static_cast<MeshAttachment*>(attachment);
@ -699,7 +699,7 @@ namespace Spine
}
Attachment* attachment = slot->_attachment;
if (attachment != NULL && attachment->getRTTI().derivesFrom(PathAttachment::rtti))
if (attachment != NULL && attachment->getSPINE_RTTI().derivesFrom(PathAttachment::rtti))
{
sortPathConstraintAttachment(attachment, slotBone);
}
@ -780,7 +780,7 @@ namespace Spine
void Skeleton::sortPathConstraintAttachment(Attachment* attachment, Bone& slotBone)
{
if (attachment == NULL || attachment->getRTTI().derivesFrom(PathAttachment::rtti))
if (attachment == NULL || attachment->getSPINE_RTTI().derivesFrom(PathAttachment::rtti))
{
return;
}

View File

@ -28,33 +28,33 @@
* POSSIBILITY OF SUCH DAMAGE.
*****************************************************************************/
#include <spine/RTTI.h>
#include <spine/SpineRTTI.h>
namespace Spine
{
RTTI::RTTI(const std::string& className) : m_className(className), m_pBaseRTTI(NULL)
SPINE_RTTI::SPINE_RTTI(const std::string& className) : m_className(className), m_pBaseSPINE_RTTI(NULL)
{
// Empty
}
RTTI::RTTI(const std::string& className, const RTTI& baseRTTI) : m_className(className), m_pBaseRTTI(&baseRTTI)
SPINE_RTTI::SPINE_RTTI(const std::string& className, const SPINE_RTTI& baseSPINE_RTTI) : m_className(className), m_pBaseSPINE_RTTI(&baseSPINE_RTTI)
{
// Empty
}
const std::string& RTTI::getClassName() const
const std::string& SPINE_RTTI::getClassName() const
{
return m_className;
}
bool RTTI::isExactly(const RTTI& rtti) const
bool SPINE_RTTI::isExactly(const SPINE_RTTI& rtti) const
{
return (this == &rtti);
}
bool RTTI::derivesFrom(const RTTI& rtti) const
bool SPINE_RTTI::derivesFrom(const SPINE_RTTI& rtti) const
{
const RTTI * pCompare = this;
const SPINE_RTTI * pCompare = this;
while (pCompare)
{
@ -63,7 +63,7 @@ namespace Spine
return true;
}
pCompare = pCompare->m_pBaseRTTI;
pCompare = pCompare->m_pBaseSPINE_RTTI;
}
return false;

View File

@ -35,7 +35,7 @@
namespace Spine
{
RTTI_IMPL_NOPARENT(Timeline);
SPINE_RTTI_IMPL_NOPARENT(Timeline);
Timeline::Timeline()
{

View File

@ -39,7 +39,7 @@
namespace Spine
{
RTTI_IMPL(TransformConstraint, Constraint);
SPINE_RTTI_IMPL(TransformConstraint, Constraint);
TransformConstraint::TransformConstraint(TransformConstraintData& data, Skeleton& skeleton) : Constraint(),
_data(data),

View File

@ -32,6 +32,6 @@
namespace Spine
{
RTTI_IMPL(TransformConstraintTimeline, CurveTimeline);
SPINE_RTTI_IMPL(TransformConstraintTimeline, CurveTimeline);
}

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(TranslateTimeline, CurveTimeline);
SPINE_RTTI_IMPL(TranslateTimeline, CurveTimeline);
}

View File

@ -32,5 +32,5 @@
namespace Spine
{
RTTI_IMPL(TwoColorTimeline, CurveTimeline);
SPINE_RTTI_IMPL(TwoColorTimeline, CurveTimeline);
}

View File

@ -32,7 +32,7 @@
namespace Spine
{
RTTI_IMPL_NOPARENT(Updatable);
SPINE_RTTI_IMPL_NOPARENT(Updatable);
Updatable::Updatable()
{

View File

@ -37,7 +37,7 @@
namespace Spine
{
RTTI_IMPL(VertexAttachment, Attachment);
SPINE_RTTI_IMPL(VertexAttachment, Attachment);
VertexAttachment::VertexAttachment(std::string name) : Attachment(name), _worldVerticesLength(0), _id(getNextID())
{