mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2025-12-20 01:06:00 +08:00
commit
0833be847e
@ -15,6 +15,7 @@ public:
|
||||
float duration;
|
||||
|
||||
Animation (const std::vector<Timeline*> &timelines, float duration);
|
||||
~Animation();
|
||||
|
||||
void apply (BaseSkeleton *skeleton, float time, bool loop);
|
||||
};
|
||||
|
||||
@ -71,6 +71,7 @@ public:
|
||||
int *splits;
|
||||
int *pads;
|
||||
|
||||
BaseAtlasRegion() : splits(0), pads(0) {}
|
||||
virtual ~BaseAtlasRegion ();
|
||||
};
|
||||
|
||||
|
||||
@ -31,6 +31,7 @@ public:
|
||||
std::string name;
|
||||
|
||||
Skin (const std::string &name);
|
||||
~Skin();
|
||||
|
||||
void addAttachment (int slotIndex, const std::string &name, Attachment *attachment);
|
||||
|
||||
|
||||
@ -18,6 +18,14 @@ Animation::Animation (const vector<Timeline*> &timelines, float duration) :
|
||||
duration(duration) {
|
||||
}
|
||||
|
||||
Animation::~Animation()
|
||||
{
|
||||
for (std::vector<Timeline*>::iterator iter = timelines.begin(); iter != timelines.end(); ++iter)
|
||||
{
|
||||
delete *iter;
|
||||
}
|
||||
}
|
||||
|
||||
void Animation::apply (BaseSkeleton *skeleton, float time, bool loop) {
|
||||
if (!skeleton) throw std::invalid_argument("skeleton cannot be null.");
|
||||
|
||||
|
||||
@ -35,6 +35,8 @@ BaseSkeletonJson::BaseSkeletonJson (BaseAttachmentLoader *attachmentLoader) :
|
||||
}
|
||||
|
||||
BaseSkeletonJson::~BaseSkeletonJson () {
|
||||
if (attachmentLoader)
|
||||
delete attachmentLoader;
|
||||
}
|
||||
|
||||
SkeletonData* BaseSkeletonJson::readSkeletonData (std::ifstream &file) const {
|
||||
|
||||
@ -8,6 +8,13 @@ Skin::Skin (const std::string &name) :
|
||||
name(name) {
|
||||
}
|
||||
|
||||
Skin::~Skin()
|
||||
{
|
||||
for (std::map<Key, Attachment*>::iterator iter = attachments.begin(); iter != attachments.end(); ++iter) {
|
||||
delete iter->second;
|
||||
}
|
||||
}
|
||||
|
||||
void Skin::addAttachment (int slotIndex, const std::string &name, Attachment *attachment) {
|
||||
Key key = {slotIndex, name};
|
||||
attachments[key] = attachment;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user