[cpp] 4.3 porting WIP

This commit is contained in:
Mario Zechner 2025-06-10 15:32:44 +02:00
parent 5fe90b456f
commit 6dce28c68e
2 changed files with 20 additions and 55 deletions

View File

@ -30,40 +30,32 @@
#ifndef Spine_Constraint_h
#define Spine_Constraint_h
#include <spine/Updatable.h>
#include <spine/PosedData.h>
#include <spine/SpineString.h>
#include <spine/RTTI.h>
namespace spine {
/// The interface for all constraints.
class SP_API ConstraintData : public SpineObject {
friend class SkeletonBinary;
RTTI_DECL
class Constraint;
class Skeleton;
/// Base class for all constraint data.
template<class T, class P>
class SP_API ConstraintData : public PosedData<P> {
public:
ConstraintData(const String &name);
ConstraintData(const String &name, P* setup);
virtual ~ConstraintData();
/// The IK constraint's name, which is unique within the skeleton.
const String &getName();
/// The ordinal for the order a skeleton's constraints will be applied.
size_t getOrder();
void setOrder(size_t inValue);
/// Whether the constraint is only active for a specific skin.
bool isSkinRequired();
void setSkinRequired(bool inValue);
private:
const String _name;
size_t _order;
bool _skinRequired;
/// Creates a constraint instance.
virtual T* create(Skeleton& skeleton) = 0;
};
template<class T, class P>
ConstraintData<T, P>::ConstraintData(const String &name, P* setup) : PosedData<P>(name, setup) {
}
template<class T, class P>
ConstraintData<T, P>::~ConstraintData() {
}
}
#endif /* Spine_Constraint_h */

View File

@ -29,32 +29,5 @@
#include <spine/ConstraintData.h>
using namespace spine;
RTTI_IMPL_NOPARENT(ConstraintData)
ConstraintData::ConstraintData(const String &name) : _name(name), _order(0), _skinRequired(false) {
}
ConstraintData::~ConstraintData() {
}
const String &ConstraintData::getName() {
return _name;
}
size_t ConstraintData::getOrder() {
return _order;
}
void ConstraintData::setOrder(size_t inValue) {
_order = inValue;
}
bool ConstraintData::isSkinRequired() {
return _skinRequired;
}
void ConstraintData::setSkinRequired(bool inValue) {
_skinRequired = inValue;
}
// Template class - implementation is in the header file
using namespace spine;