diff --git a/spine-cocos2dx/example/Classes/AppDelegate.cpp b/spine-cocos2dx/example/Classes/AppDelegate.cpp index 3cad127b2..c5df8af33 100644 --- a/spine-cocos2dx/example/Classes/AppDelegate.cpp +++ b/spine-cocos2dx/example/Classes/AppDelegate.cpp @@ -36,16 +36,20 @@ #include "RaptorExample.h" #include "BatchingExample.h" #include "CoinExample.h" -#include "SkeletonRendererSeparatorExample.h" +#include "SkeletonRendererSeparatorExample.h" +#include #include "AppMacros.h" USING_NS_CC; -using namespace std; +using namespace std; + +DebugExtension debugExtension(SpineExtension::getInstance()); AppDelegate::AppDelegate () { } -AppDelegate::~AppDelegate () { +AppDelegate::~AppDelegate () { + debugExtension.reportLeaks(); } bool AppDelegate::applicationDidFinishLaunching () { @@ -97,7 +101,10 @@ bool AppDelegate::applicationDidFinishLaunching () { // set FPS. the default value is 1.0/60 if you don't call this director->setAnimationInterval(1.0f / 60); - + + // Set the Debug wrapper extension so we know about memory leaks. + SpineExtension::setInstance(&debugExtension); + // create a scene. it's an autorelease object //auto scene = RaptorExample::scene(); auto scene = SkeletonRendererSeparatorExample::scene(); diff --git a/spine-cocos2dx/example/Classes/BatchingExample.cpp b/spine-cocos2dx/example/Classes/BatchingExample.cpp index 4ba7ac497..1221d1d26 100644 --- a/spine-cocos2dx/example/Classes/BatchingExample.cpp +++ b/spine-cocos2dx/example/Classes/BatchingExample.cpp @@ -45,25 +45,26 @@ Scene* BatchingExample::scene () { bool BatchingExample::init () { if (!LayerColor::initWithColor(Color4B(128, 128, 128, 255))) return false; - // Load the texture atlas. - _atlas = spAtlas_createFromFile("spineboy.atlas", 0); + // Load the texture atlas. + Cocos2dTextureLoader textureLoader; + _atlas = new (__FILE__, __LINE__) Atlas("spineboy.atlas", &textureLoader); CCASSERT(_atlas, "Error reading atlas file."); // This attachment loader configures attachments with data needed for cocos2d-x rendering. // Do not dispose the attachment loader until the skeleton data is disposed! - _attachmentLoader = (spAttachmentLoader*)Cocos2dAttachmentLoader_create(_atlas); + _attachmentLoader = new (__FILE__, __LINE__) AtlasAttachmentLoader(_atlas); // Load the skeleton data. - spSkeletonJson* json = spSkeletonJson_createWithLoader(_attachmentLoader); - json->scale = 0.6f; // Resizes skeleton data to 60% of the size it was in Spine. - _skeletonData = spSkeletonJson_readSkeletonDataFile(json, "spineboy-ess.json"); - CCASSERT(_skeletonData, json->error ? json->error : "Error reading skeleton data file."); - spSkeletonJson_dispose(json); + SkeletonJson* json = new (__FILE__, __LINE__) SkeletonJson(_attachmentLoader); + json->setScale(0.6f); // Resizes skeleton data to 60% of the size it was in Spine. + _skeletonData = json->readSkeletonDataFile("spineboy-ess.json"); + CCASSERT(_skeletonData, json->getError().isEmpty() ? json->getError().buffer() : "Error reading skeleton data file."); + delete json; // Setup mix times. - _stateData = spAnimationStateData_create(_skeletonData); - spAnimationStateData_setMixByName(_stateData, "walk", "jump", 0.2f); - spAnimationStateData_setMixByName(_stateData, "jump", "run", 0.2f); + _stateData = new (__FILE__, __LINE__) AnimationStateData(_skeletonData); + _stateData->setMix("walk", "jump", 0.2f); + _stateData->setMix("jump", "run", 0.2f); int xMin = _contentSize.width * 0.10f, xMax = _contentSize.width * 0.90f; int yMin = 0, yMax = _contentSize.height * 0.7f; @@ -93,7 +94,7 @@ bool BatchingExample::init () { scheduleUpdate(); EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = [this] (Touch* touch, Event* event) -> bool { + listener->onTouchBegan = [this] (Touch* touch, cocos2d::Event* event) -> bool { Director::getInstance()->replaceScene(SpineboyExample::scene()); return true; }; @@ -104,9 +105,10 @@ bool BatchingExample::init () { BatchingExample::~BatchingExample () { // SkeletonAnimation instances are cocos2d-x nodes and are disposed of automatically as normal, but the data created - // manually to be shared across multiple SkeletonAnimations needs to be disposed of manually. - spSkeletonData_dispose(_skeletonData); - spAnimationStateData_dispose(_stateData); - spAttachmentLoader_dispose(_attachmentLoader); - spAtlas_dispose(_atlas); + // manually to be shared across multiple SkeletonAnimations needs to be disposed of manually. + + delete _skeletonData; + delete _stateData; + delete _attachmentLoader; + delete _atlas; } diff --git a/spine-cocos2dx/example/Classes/BatchingExample.h b/spine-cocos2dx/example/Classes/BatchingExample.h index 1ca3d2c05..7fddfb09a 100644 --- a/spine-cocos2dx/example/Classes/BatchingExample.h +++ b/spine-cocos2dx/example/Classes/BatchingExample.h @@ -32,7 +32,9 @@ #define _BATCHINGEXAMPLE_H_ #include "cocos2d.h" -#include +#include + +using namespace spine; class BatchingExample : public cocos2d::LayerColor { public: @@ -44,10 +46,10 @@ public: virtual bool init (); protected: - spAtlas* _atlas; - spAttachmentLoader* _attachmentLoader; - spSkeletonData* _skeletonData; - spAnimationStateData* _stateData; + Atlas* _atlas; + AttachmentLoader* _attachmentLoader; + SkeletonData* _skeletonData; + AnimationStateData* _stateData; }; #endif // _BATCHINGEXAMPLE_H_ diff --git a/spine-cocos2dx/example/Classes/CoinExample.cpp b/spine-cocos2dx/example/Classes/CoinExample.cpp index 0ec89b805..bc798d02a 100644 --- a/spine-cocos2dx/example/Classes/CoinExample.cpp +++ b/spine-cocos2dx/example/Classes/CoinExample.cpp @@ -52,7 +52,7 @@ bool CoinExample::init () { scheduleUpdate(); EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = [this] (Touch* touch, Event* event) -> bool { + listener->onTouchBegan = [this] (Touch* touch, cocos2d::Event* event) -> bool { if (!skeletonNode->getDebugBonesEnabled()) skeletonNode->setDebugBonesEnabled(true); else if (skeletonNode->getTimeScale() == 1) diff --git a/spine-cocos2dx/example/Classes/GoblinsExample.cpp b/spine-cocos2dx/example/Classes/GoblinsExample.cpp index 47648c007..351979903 100644 --- a/spine-cocos2dx/example/Classes/GoblinsExample.cpp +++ b/spine-cocos2dx/example/Classes/GoblinsExample.cpp @@ -53,7 +53,7 @@ bool GoblinsExample::init () { scheduleUpdate(); EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = [this] (Touch* touch, Event* event) -> bool { + listener->onTouchBegan = [this] (Touch* touch, cocos2d::Event* event) -> bool { if (!skeletonNode->getDebugBonesEnabled()) skeletonNode->setDebugBonesEnabled(true); else if (skeletonNode->getTimeScale() == 1) diff --git a/spine-cocos2dx/example/Classes/RaptorExample.cpp b/spine-cocos2dx/example/Classes/RaptorExample.cpp index cfd610a88..fa2b7bc77 100644 --- a/spine-cocos2dx/example/Classes/RaptorExample.cpp +++ b/spine-cocos2dx/example/Classes/RaptorExample.cpp @@ -30,12 +30,14 @@ #include "RaptorExample.h" #include "TankExample.h" -#include +#include USING_NS_CC; using namespace spine; - -spSwirlVertexEffect* effect = spSwirlVertexEffect_create(400); + +PowInterpolation pow2(2); +PowOutInterpolation powOut2(2); +SwirlVertexEffect effect(400, powOut2); Scene* RaptorExample::scene () { Scene *scene = Scene::create(); @@ -48,14 +50,13 @@ bool RaptorExample::init () { skeletonNode = SkeletonAnimation::createWithJsonFile("raptor-pro.json", "raptor.atlas", 0.5f); skeletonNode->setAnimation(0, "walk", true); - skeletonNode->setAnimation(1, "empty", false); - skeletonNode->addAnimation(1, "gungrab", false, 2); + skeletonNode->addAnimation(1, "gun-grab", false, 2); skeletonNode->setTwoColorTint(true); - effect->centerY = 200; + effect.setCenterY(200); swirlTime = 0; - skeletonNode->setVertexEffect(&effect->super); + skeletonNode->setVertexEffect(&effect); skeletonNode->setPosition(Vec2(_contentSize.width / 2, 20)); addChild(skeletonNode); @@ -63,7 +64,7 @@ bool RaptorExample::init () { scheduleUpdate(); EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = [this] (Touch* touch, Event* event) -> bool { + listener->onTouchBegan = [this] (Touch* touch, cocos2d::Event* event) -> bool { if (!skeletonNode->getDebugBonesEnabled()) { skeletonNode->setDebugBonesEnabled(true); skeletonNode->setDebugMeshesEnabled(true); @@ -79,8 +80,8 @@ bool RaptorExample::init () { } void RaptorExample::update(float fDelta) { - swirlTime += fDelta; - float percent = fmod(swirlTime, 2); - if (percent > 1) percent = 1 - (percent - 1); - effect->angle = _spMath_interpolate(_spMath_pow2_apply, -60, 60, percent); + swirlTime += fDelta; + float percent = spine::MathUtil::fmod(swirlTime, 2); + if (percent > 1) percent = 1 - (percent - 1); + effect.setAngle(pow2.interpolate(-60.0f, 60.0f, percent)); } diff --git a/spine-cocos2dx/example/Classes/SkeletonRendererSeparatorExample.cpp b/spine-cocos2dx/example/Classes/SkeletonRendererSeparatorExample.cpp index 5ebdfc4eb..cb48f2a9a 100644 --- a/spine-cocos2dx/example/Classes/SkeletonRendererSeparatorExample.cpp +++ b/spine-cocos2dx/example/Classes/SkeletonRendererSeparatorExample.cpp @@ -48,7 +48,7 @@ bool SkeletonRendererSeparatorExample::init () { backNode = SkeletonAnimation::createWithJsonFile("spineboy-ess.json", "spineboy.atlas", 0.6f); backNode->setMix("walk", "jump", 0.4); backNode->setAnimation(0, "walk", true); - backNode->setSlotsRange(backNode->findSlot("rear-upper-arm")->data->index, backNode->findSlot("rear-shin")->data->index); + backNode->setSlotsRange(backNode->findSlot("rear-upper-arm")->getData().getIndex(), backNode->findSlot("rear-shin")->getData().getIndex()); backNode->setPosition(Vec2(_contentSize.width / 2, 20)); // A simple rectangle to go between the front and back slots of Spineboy @@ -65,7 +65,7 @@ bool SkeletonRendererSeparatorExample::init () { // renders the back slots of Spineboy. The skeleton, animatio state and GPU resources // are shared with the front node! frontNode = SkeletonRenderer::createWithSkeleton(backNode->getSkeleton()); - frontNode->setSlotsRange(frontNode->findSlot("neck")->data->index, -1); + frontNode->setSlotsRange(frontNode->findSlot("neck")->getData().getIndex(), -1); frontNode->setPosition(Vec2(_contentSize.width / 2, 20)); // Add the front, between and back node in the correct order to this scene @@ -76,7 +76,7 @@ bool SkeletonRendererSeparatorExample::init () { scheduleUpdate(); EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = [this] (Touch* touch, Event* event) -> bool { + listener->onTouchBegan = [this] (Touch* touch, cocos2d::Event* event) -> bool { if (!backNode->getDebugBonesEnabled()) backNode->setDebugBonesEnabled(true); else if (backNode->getTimeScale() == 1) diff --git a/spine-cocos2dx/example/Classes/SpineboyExample.cpp b/spine-cocos2dx/example/Classes/SpineboyExample.cpp index 3c8966f6a..b3554516c 100644 --- a/spine-cocos2dx/example/Classes/SpineboyExample.cpp +++ b/spine-cocos2dx/example/Classes/SpineboyExample.cpp @@ -45,32 +45,32 @@ bool SpineboyExample::init () { skeletonNode = SkeletonAnimation::createWithJsonFile("spineboy-ess.json", "spineboy.atlas", 0.6f); - skeletonNode->setStartListener( [] (spTrackEntry* entry) { - log("%d start: %s", entry->trackIndex, entry->animation->name); + skeletonNode->setStartListener( [] (TrackEntry* entry) { + log("%d start: %s", entry->getTrackIndex(), entry->getAnimation()->getName().buffer()); }); - skeletonNode->setInterruptListener( [] (spTrackEntry* entry) { - log("%d interrupt", entry->trackIndex); + skeletonNode->setInterruptListener( [] (TrackEntry* entry) { + log("%d interrupt", entry->getTrackIndex()); }); - skeletonNode->setEndListener( [] (spTrackEntry* entry) { - log("%d end", entry->trackIndex); + skeletonNode->setEndListener( [] (TrackEntry* entry) { + log("%d end", entry->getTrackIndex()); }); - skeletonNode->setCompleteListener( [] (spTrackEntry* entry) { - log("%d complete", entry->trackIndex); + skeletonNode->setCompleteListener( [] (TrackEntry* entry) { + log("%d complete", entry->getTrackIndex()); }); - skeletonNode->setDisposeListener( [] (spTrackEntry* entry) { - log("%d dispose", entry->trackIndex); + skeletonNode->setDisposeListener( [] (TrackEntry* entry) { + log("%d dispose", entry->getTrackIndex()); }); - skeletonNode->setEventListener( [] (spTrackEntry* entry, spEvent* event) { - log("%d event: %s, %d, %f, %s", entry->trackIndex, event->data->name, event->intValue, event->floatValue, event->stringValue); + skeletonNode->setEventListener( [] (TrackEntry* entry, spine::Event* event) { + log("%d event: %s, %d, %f, %s", entry->getTrackIndex(), event->getData().getName().buffer(), event->getIntValue(), event->getFloatValue(), event->getStringValue().buffer()); }); skeletonNode->setMix("walk", "jump", 0.4); skeletonNode->setMix("jump", "run", 0.4); skeletonNode->setAnimation(0, "walk", true); - spTrackEntry* jumpEntry = skeletonNode->addAnimation(0, "jump", false, 1); + TrackEntry* jumpEntry = skeletonNode->addAnimation(0, "jump", false, 1); skeletonNode->addAnimation(0, "run", true); - skeletonNode->setTrackStartListener(jumpEntry, [] (spTrackEntry* entry) { + skeletonNode->setTrackStartListener(jumpEntry, [] (TrackEntry* entry) { log("jumped!"); }); @@ -83,7 +83,7 @@ bool SpineboyExample::init () { scheduleUpdate(); EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = [this] (Touch* touch, Event* event) -> bool { + listener->onTouchBegan = [this] (Touch* touch, cocos2d::Event* event) -> bool { if (!skeletonNode->getDebugBonesEnabled()) skeletonNode->setDebugBonesEnabled(true); else if (skeletonNode->getTimeScale() == 1) diff --git a/spine-cocos2dx/example/Classes/TankExample.cpp b/spine-cocos2dx/example/Classes/TankExample.cpp index b6fa26130..19839526b 100644 --- a/spine-cocos2dx/example/Classes/TankExample.cpp +++ b/spine-cocos2dx/example/Classes/TankExample.cpp @@ -52,7 +52,7 @@ bool TankExample::init () { scheduleUpdate(); EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create(); - listener->onTouchBegan = [this] (Touch* touch, Event* event) -> bool { + listener->onTouchBegan = [this] (Touch* touch, cocos2d::Event* event) -> bool { if (!skeletonNode->getDebugBonesEnabled()) skeletonNode->setDebugBonesEnabled(true); else if (skeletonNode->getTimeScale() == 1) diff --git a/spine-cocos2dx/example/proj.ios_mac/spine-cocos2d-x.xcodeproj/project.pbxproj b/spine-cocos2dx/example/proj.ios_mac/spine-cocos2d-x.xcodeproj/project.pbxproj index e4bb73140..f11db218d 100644 --- a/spine-cocos2dx/example/proj.ios_mac/spine-cocos2d-x.xcodeproj/project.pbxproj +++ b/spine-cocos2dx/example/proj.ios_mac/spine-cocos2d-x.xcodeproj/project.pbxproj @@ -46,6 +46,128 @@ 521A8E6519F0C34300D177D7 /* Default-736h@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = 521A8E6319F0C34300D177D7 /* Default-736h@3x.png */; }; 52B47A471A53D09C004E4C60 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 52B47A461A53D09B004E4C60 /* Security.framework */; }; 7602C5551D7DAA1300C7C674 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7602C5541D7DAA1300C7C674 /* CoreText.framework */; }; + 763104C320BC1B5E00927A1E /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048620BC1B5400927A1E /* Event.cpp */; }; + 763104C420BC1B5E00927A1E /* PathConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048720BC1B5400927A1E /* PathConstraint.cpp */; }; + 763104C520BC1B5E00927A1E /* ScaleTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048820BC1B5400927A1E /* ScaleTimeline.cpp */; }; + 763104C620BC1B5E00927A1E /* CurveTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048920BC1B5400927A1E /* CurveTimeline.cpp */; }; + 763104C720BC1B5E00927A1E /* DrawOrderTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048A20BC1B5400927A1E /* DrawOrderTimeline.cpp */; }; + 763104C820BC1B5E00927A1E /* PathConstraintMixTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048B20BC1B5400927A1E /* PathConstraintMixTimeline.cpp */; }; + 763104C920BC1B5E00927A1E /* EventTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048C20BC1B5400927A1E /* EventTimeline.cpp */; }; + 763104CA20BC1B5E00927A1E /* PathConstraintSpacingTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048D20BC1B5500927A1E /* PathConstraintSpacingTimeline.cpp */; }; + 763104CB20BC1B5E00927A1E /* SkeletonBinary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048E20BC1B5500927A1E /* SkeletonBinary.cpp */; }; + 763104CC20BC1B5E00927A1E /* RTTI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048F20BC1B5500927A1E /* RTTI.cpp */; }; + 763104CD20BC1B5E00927A1E /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049020BC1B5500927A1E /* Slot.cpp */; }; + 763104CE20BC1B5E00927A1E /* PointAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049120BC1B5500927A1E /* PointAttachment.cpp */; }; + 763104CF20BC1B5E00927A1E /* VertexAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049220BC1B5500927A1E /* VertexAttachment.cpp */; }; + 763104D020BC1B5E00927A1E /* PathConstraintPositionTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049320BC1B5500927A1E /* PathConstraintPositionTimeline.cpp */; }; + 763104D120BC1B5E00927A1E /* MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049420BC1B5500927A1E /* MathUtil.cpp */; }; + 763104D220BC1B5E00927A1E /* RotateTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049520BC1B5500927A1E /* RotateTimeline.cpp */; }; + 763104D320BC1B5E00927A1E /* ColorTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049620BC1B5500927A1E /* ColorTimeline.cpp */; }; + 763104D420BC1B5E00927A1E /* IkConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049720BC1B5500927A1E /* IkConstraint.cpp */; }; + 763104D520BC1B5E00927A1E /* SkeletonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049820BC1B5500927A1E /* SkeletonData.cpp */; }; + 763104D620BC1B5E00927A1E /* Extension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049920BC1B5500927A1E /* Extension.cpp */; }; + 763104D720BC1B5E00927A1E /* SpineObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049A20BC1B5500927A1E /* SpineObject.cpp */; }; + 763104D820BC1B5E00927A1E /* AnimationState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049B20BC1B5600927A1E /* AnimationState.cpp */; }; + 763104D920BC1B5E00927A1E /* TransformConstraintTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049C20BC1B5600927A1E /* TransformConstraintTimeline.cpp */; }; + 763104DA20BC1B5E00927A1E /* TextureLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049D20BC1B5600927A1E /* TextureLoader.cpp */; }; + 763104DB20BC1B5E00927A1E /* BoneData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049E20BC1B5600927A1E /* BoneData.cpp */; }; + 763104DC20BC1B5E00927A1E /* Atlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049F20BC1B5600927A1E /* Atlas.cpp */; }; + 763104DD20BC1B5E00927A1E /* Triangulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A020BC1B5600927A1E /* Triangulator.cpp */; }; + 763104DE20BC1B5E00927A1E /* Skeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A120BC1B5600927A1E /* Skeleton.cpp */; }; + 763104DF20BC1B5E00927A1E /* AttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A220BC1B5600927A1E /* AttachmentLoader.cpp */; }; + 763104E020BC1B5E00927A1E /* Constraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A320BC1B5600927A1E /* Constraint.cpp */; }; + 763104E120BC1B5E00927A1E /* AttachmentTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A420BC1B5600927A1E /* AttachmentTimeline.cpp */; }; + 763104E220BC1B5E00927A1E /* Updatable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A520BC1B5600927A1E /* Updatable.cpp */; }; + 763104E320BC1B5E00927A1E /* RegionAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A620BC1B5700927A1E /* RegionAttachment.cpp */; }; + 763104E420BC1B5E00927A1E /* ClippingAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A720BC1B5700927A1E /* ClippingAttachment.cpp */; }; + 763104E520BC1B5E00927A1E /* TwoColorTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A820BC1B5700927A1E /* TwoColorTimeline.cpp */; }; + 763104E620BC1B5E00927A1E /* TransformConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A920BC1B5700927A1E /* TransformConstraintData.cpp */; }; + 763104E720BC1B5E00927A1E /* PathAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AA20BC1B5700927A1E /* PathAttachment.cpp */; }; + 763104E820BC1B5E00927A1E /* BoundingBoxAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AB20BC1B5700927A1E /* BoundingBoxAttachment.cpp */; }; + 763104E920BC1B5E00927A1E /* Skin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AC20BC1B5700927A1E /* Skin.cpp */; }; + 763104EA20BC1B5E00927A1E /* IkConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AD20BC1B5700927A1E /* IkConstraintData.cpp */; }; + 763104EB20BC1B5E00927A1E /* VertexEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AE20BC1B5800927A1E /* VertexEffect.cpp */; }; + 763104EC20BC1B5E00927A1E /* AnimationStateData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AF20BC1B5800927A1E /* AnimationStateData.cpp */; }; + 763104ED20BC1B5E00927A1E /* EventData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B020BC1B5800927A1E /* EventData.cpp */; }; + 763104EE20BC1B5E00927A1E /* SkeletonClipping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B120BC1B5800927A1E /* SkeletonClipping.cpp */; }; + 763104EF20BC1B5E00927A1E /* IkConstraintTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B220BC1B5800927A1E /* IkConstraintTimeline.cpp */; }; + 763104F020BC1B5E00927A1E /* Timeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B320BC1B5C00927A1E /* Timeline.cpp */; }; + 763104F120BC1B5E00927A1E /* AtlasAttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B420BC1B5C00927A1E /* AtlasAttachmentLoader.cpp */; }; + 763104F220BC1B5E00927A1E /* LinkedMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B520BC1B5C00927A1E /* LinkedMesh.cpp */; }; + 763104F320BC1B5E00927A1E /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B620BC1B5C00927A1E /* Animation.cpp */; }; + 763104F420BC1B5E00927A1E /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B720BC1B5C00927A1E /* Attachment.cpp */; }; + 763104F520BC1B5E00927A1E /* MeshAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B820BC1B5C00927A1E /* MeshAttachment.cpp */; }; + 763104F620BC1B5E00927A1E /* SlotData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B920BC1B5C00927A1E /* SlotData.cpp */; }; + 763104F720BC1B5E00927A1E /* Bone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BA20BC1B5D00927A1E /* Bone.cpp */; }; + 763104F820BC1B5E00927A1E /* Json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BB20BC1B5D00927A1E /* Json.cpp */; }; + 763104F920BC1B5E00927A1E /* SkeletonJson.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BC20BC1B5D00927A1E /* SkeletonJson.cpp */; }; + 763104FA20BC1B5E00927A1E /* TransformConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BD20BC1B5D00927A1E /* TransformConstraint.cpp */; }; + 763104FB20BC1B5E00927A1E /* DeformTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BE20BC1B5D00927A1E /* DeformTimeline.cpp */; }; + 763104FC20BC1B5E00927A1E /* PathConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BF20BC1B5E00927A1E /* PathConstraintData.cpp */; }; + 763104FD20BC1B5E00927A1E /* SkeletonBounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104C020BC1B5E00927A1E /* SkeletonBounds.cpp */; }; + 763104FE20BC1B5E00927A1E /* ShearTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104C120BC1B5E00927A1E /* ShearTimeline.cpp */; }; + 763104FF20BC1B5E00927A1E /* TranslateTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104C220BC1B5E00927A1E /* TranslateTimeline.cpp */; }; + 7631059E20BC1B9700927A1E /* Animation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B620BC1B5C00927A1E /* Animation.cpp */; }; + 7631059F20BC1B9700927A1E /* AnimationState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049B20BC1B5600927A1E /* AnimationState.cpp */; }; + 763105A020BC1B9700927A1E /* AnimationStateData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AF20BC1B5800927A1E /* AnimationStateData.cpp */; }; + 763105A120BC1B9700927A1E /* Atlas.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049F20BC1B5600927A1E /* Atlas.cpp */; }; + 763105A220BC1B9700927A1E /* AtlasAttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B420BC1B5C00927A1E /* AtlasAttachmentLoader.cpp */; }; + 763105A320BC1B9700927A1E /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B720BC1B5C00927A1E /* Attachment.cpp */; }; + 763105A420BC1B9700927A1E /* AttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A220BC1B5600927A1E /* AttachmentLoader.cpp */; }; + 763105A520BC1B9700927A1E /* AttachmentTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A420BC1B5600927A1E /* AttachmentTimeline.cpp */; }; + 763105A620BC1B9700927A1E /* Bone.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BA20BC1B5D00927A1E /* Bone.cpp */; }; + 763105A720BC1B9700927A1E /* BoneData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049E20BC1B5600927A1E /* BoneData.cpp */; }; + 763105A820BC1B9700927A1E /* BoundingBoxAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AB20BC1B5700927A1E /* BoundingBoxAttachment.cpp */; }; + 763105A920BC1B9700927A1E /* ClippingAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A720BC1B5700927A1E /* ClippingAttachment.cpp */; }; + 763105AA20BC1B9700927A1E /* ColorTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049620BC1B5500927A1E /* ColorTimeline.cpp */; }; + 763105AB20BC1B9700927A1E /* Constraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A320BC1B5600927A1E /* Constraint.cpp */; }; + 763105AC20BC1B9700927A1E /* CurveTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048920BC1B5400927A1E /* CurveTimeline.cpp */; }; + 763105AD20BC1B9700927A1E /* DeformTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BE20BC1B5D00927A1E /* DeformTimeline.cpp */; }; + 763105AE20BC1B9700927A1E /* DrawOrderTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048A20BC1B5400927A1E /* DrawOrderTimeline.cpp */; }; + 763105AF20BC1B9700927A1E /* Event.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048620BC1B5400927A1E /* Event.cpp */; }; + 763105B020BC1B9700927A1E /* EventData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B020BC1B5800927A1E /* EventData.cpp */; }; + 763105B120BC1B9700927A1E /* EventTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048C20BC1B5400927A1E /* EventTimeline.cpp */; }; + 763105B220BC1B9700927A1E /* Extension.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049920BC1B5500927A1E /* Extension.cpp */; }; + 763105B320BC1B9700927A1E /* IkConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049720BC1B5500927A1E /* IkConstraint.cpp */; }; + 763105B420BC1B9700927A1E /* IkConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AD20BC1B5700927A1E /* IkConstraintData.cpp */; }; + 763105B520BC1B9700927A1E /* IkConstraintTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B220BC1B5800927A1E /* IkConstraintTimeline.cpp */; }; + 763105B620BC1B9700927A1E /* Json.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BB20BC1B5D00927A1E /* Json.cpp */; }; + 763105B720BC1B9700927A1E /* LinkedMesh.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B520BC1B5C00927A1E /* LinkedMesh.cpp */; }; + 763105B820BC1B9700927A1E /* MathUtil.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049420BC1B5500927A1E /* MathUtil.cpp */; }; + 763105B920BC1B9700927A1E /* MeshAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B820BC1B5C00927A1E /* MeshAttachment.cpp */; }; + 763105BA20BC1B9700927A1E /* PathAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AA20BC1B5700927A1E /* PathAttachment.cpp */; }; + 763105BB20BC1B9700927A1E /* PathConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048720BC1B5400927A1E /* PathConstraint.cpp */; }; + 763105BC20BC1B9700927A1E /* PathConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BF20BC1B5E00927A1E /* PathConstraintData.cpp */; }; + 763105BD20BC1B9700927A1E /* PathConstraintMixTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048B20BC1B5400927A1E /* PathConstraintMixTimeline.cpp */; }; + 763105BE20BC1B9700927A1E /* PathConstraintPositionTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049320BC1B5500927A1E /* PathConstraintPositionTimeline.cpp */; }; + 763105BF20BC1B9700927A1E /* PathConstraintSpacingTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048D20BC1B5500927A1E /* PathConstraintSpacingTimeline.cpp */; }; + 763105C020BC1B9700927A1E /* PointAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049120BC1B5500927A1E /* PointAttachment.cpp */; }; + 763105C120BC1B9700927A1E /* RegionAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A620BC1B5700927A1E /* RegionAttachment.cpp */; }; + 763105C220BC1B9700927A1E /* RotateTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049520BC1B5500927A1E /* RotateTimeline.cpp */; }; + 763105C320BC1B9700927A1E /* RTTI.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048F20BC1B5500927A1E /* RTTI.cpp */; }; + 763105C420BC1B9700927A1E /* ScaleTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048820BC1B5400927A1E /* ScaleTimeline.cpp */; }; + 763105C520BC1B9700927A1E /* ShearTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104C120BC1B5E00927A1E /* ShearTimeline.cpp */; }; + 763105C620BC1B9700927A1E /* Skeleton.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A120BC1B5600927A1E /* Skeleton.cpp */; }; + 763105C720BC1B9700927A1E /* SkeletonBinary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631048E20BC1B5500927A1E /* SkeletonBinary.cpp */; }; + 763105C820BC1B9700927A1E /* SkeletonBounds.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104C020BC1B5E00927A1E /* SkeletonBounds.cpp */; }; + 763105C920BC1B9700927A1E /* SkeletonClipping.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B120BC1B5800927A1E /* SkeletonClipping.cpp */; }; + 763105CA20BC1B9700927A1E /* SkeletonData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049820BC1B5500927A1E /* SkeletonData.cpp */; }; + 763105CB20BC1B9700927A1E /* SkeletonJson.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BC20BC1B5D00927A1E /* SkeletonJson.cpp */; }; + 763105CC20BC1B9700927A1E /* Skin.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AC20BC1B5700927A1E /* Skin.cpp */; }; + 763105CD20BC1B9700927A1E /* Slot.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049020BC1B5500927A1E /* Slot.cpp */; }; + 763105CE20BC1B9700927A1E /* SlotData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B920BC1B5C00927A1E /* SlotData.cpp */; }; + 763105CF20BC1B9700927A1E /* SpineObject.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049A20BC1B5500927A1E /* SpineObject.cpp */; }; + 763105D020BC1B9700927A1E /* TextureLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049D20BC1B5600927A1E /* TextureLoader.cpp */; }; + 763105D120BC1B9700927A1E /* Timeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104B320BC1B5C00927A1E /* Timeline.cpp */; }; + 763105D220BC1B9700927A1E /* TransformConstraint.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104BD20BC1B5D00927A1E /* TransformConstraint.cpp */; }; + 763105D320BC1B9700927A1E /* TransformConstraintData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A920BC1B5700927A1E /* TransformConstraintData.cpp */; }; + 763105D420BC1B9700927A1E /* TransformConstraintTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049C20BC1B5600927A1E /* TransformConstraintTimeline.cpp */; }; + 763105D520BC1B9700927A1E /* TranslateTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104C220BC1B5E00927A1E /* TranslateTimeline.cpp */; }; + 763105D620BC1B9700927A1E /* Triangulator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A020BC1B5600927A1E /* Triangulator.cpp */; }; + 763105D720BC1B9700927A1E /* TwoColorTimeline.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A820BC1B5700927A1E /* TwoColorTimeline.cpp */; }; + 763105D820BC1B9700927A1E /* Updatable.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104A520BC1B5600927A1E /* Updatable.cpp */; }; + 763105D920BC1B9700927A1E /* VertexAttachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7631049220BC1B5500927A1E /* VertexAttachment.cpp */; }; + 763105DA20BC1B9700927A1E /* VertexEffect.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 763104AE20BC1B5800927A1E /* VertexEffect.cpp */; }; 76A45BDE1E64396800745AA1 /* SkeletonTwoColorBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76A45BDC1E64396800745AA1 /* SkeletonTwoColorBatch.cpp */; }; 76A45BDF1E64396800745AA1 /* SkeletonTwoColorBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76A45BDC1E64396800745AA1 /* SkeletonTwoColorBatch.cpp */; }; 76AAA3C01D180F7C00C54FCB /* AppDelegate.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */; }; @@ -54,15 +176,12 @@ 76AAA3C31D180F7C00C54FCB /* RaptorExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3BA1D180F7C00C54FCB /* RaptorExample.cpp */; }; 76AAA3C51D180F7C00C54FCB /* SpineboyExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA3BE1D180F7C00C54FCB /* SpineboyExample.cpp */; }; 76AAA40C1D18106000C54FCB /* AttachmentVertices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4001D18106000C54FCB /* AttachmentVertices.cpp */; }; - 76AAA40D1D18106000C54FCB /* Cocos2dAttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4021D18106000C54FCB /* Cocos2dAttachmentLoader.cpp */; }; 76AAA40E1D18106000C54FCB /* SkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */; }; 76AAA40F1D18106000C54FCB /* SkeletonBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4061D18106000C54FCB /* SkeletonBatch.cpp */; }; 76AAA4101D18106000C54FCB /* SkeletonRenderer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4081D18106000C54FCB /* SkeletonRenderer.cpp */; }; 76AAA4111D18106000C54FCB /* spine-cocos2dx.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA40A1D18106000C54FCB /* spine-cocos2dx.cpp */; }; 76AAA4121D18119F00C54FCB /* AttachmentVertices.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4001D18106000C54FCB /* AttachmentVertices.cpp */; }; 76AAA4131D18119F00C54FCB /* AttachmentVertices.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4011D18106000C54FCB /* AttachmentVertices.h */; }; - 76AAA4141D18119F00C54FCB /* Cocos2dAttachmentLoader.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4021D18106000C54FCB /* Cocos2dAttachmentLoader.cpp */; }; - 76AAA4151D18119F00C54FCB /* Cocos2dAttachmentLoader.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4031D18106000C54FCB /* Cocos2dAttachmentLoader.h */; }; 76AAA4161D18119F00C54FCB /* SkeletonAnimation.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */; }; 76AAA4171D18119F00C54FCB /* SkeletonAnimation.h in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4051D18106000C54FCB /* SkeletonAnimation.h */; }; 76AAA4181D18119F00C54FCB /* SkeletonBatch.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76AAA4061D18106000C54FCB /* SkeletonBatch.cpp */; }; @@ -86,91 +205,11 @@ 76AAA4581D18132D00C54FCB /* common in Resources */ = {isa = PBXBuildFile; fileRef = 76AAA4521D18132D00C54FCB /* common */; }; 76D1BFE02029E35200A0272D /* SkeletonRendererSeparatorExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D1BFDF2029E35200A0272D /* SkeletonRendererSeparatorExample.cpp */; }; 76D1BFE12029E37700A0272D /* SkeletonRendererSeparatorExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D1BFDF2029E35200A0272D /* SkeletonRendererSeparatorExample.cpp */; }; - 76D520DA1EB3611300572471 /* ClippingAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76D520D71EB3611300572471 /* ClippingAttachment.c */; }; - 76D520DB1EB3611300572471 /* SkeletonClipping.c in Sources */ = {isa = PBXBuildFile; fileRef = 76D520D81EB3611300572471 /* SkeletonClipping.c */; }; - 76D520DC1EB3611300572471 /* Triangulator.c in Sources */ = {isa = PBXBuildFile; fileRef = 76D520D91EB3611300572471 /* Triangulator.c */; }; - 76D520DE1EB3619800572471 /* ClippingAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76D520D71EB3611300572471 /* ClippingAttachment.c */; }; - 76D520DF1EB3619800572471 /* SkeletonClipping.c in Sources */ = {isa = PBXBuildFile; fileRef = 76D520D81EB3611300572471 /* SkeletonClipping.c */; }; - 76D520E01EB3619800572471 /* Triangulator.c in Sources */ = {isa = PBXBuildFile; fileRef = 76D520D91EB3611300572471 /* Triangulator.c */; }; - 76D520E21EB3625700572471 /* Array.c in Sources */ = {isa = PBXBuildFile; fileRef = 76D520E11EB3625700572471 /* Array.c */; }; - 76D520E31EB3625B00572471 /* Array.c in Sources */ = {isa = PBXBuildFile; fileRef = 76D520E11EB3625700572471 /* Array.c */; }; 76D520E61EB362DD00572471 /* CoinExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D520E41EB362DD00572471 /* CoinExample.cpp */; }; 76D520E71EB3634600572471 /* CoinExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76D520E41EB362DD00572471 /* CoinExample.cpp */; }; - 76F28CB11DEC7EBB00CDE54D /* Animation.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C8F1DEC7EBA00CDE54D /* Animation.c */; }; - 76F28CB21DEC7EBB00CDE54D /* AnimationState.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C901DEC7EBA00CDE54D /* AnimationState.c */; }; - 76F28CB31DEC7EBB00CDE54D /* AnimationStateData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C911DEC7EBA00CDE54D /* AnimationStateData.c */; }; - 76F28CB41DEC7EBB00CDE54D /* Atlas.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C921DEC7EBA00CDE54D /* Atlas.c */; }; - 76F28CB51DEC7EBB00CDE54D /* AtlasAttachmentLoader.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C931DEC7EBA00CDE54D /* AtlasAttachmentLoader.c */; }; - 76F28CB61DEC7EBB00CDE54D /* Attachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C941DEC7EBA00CDE54D /* Attachment.c */; }; - 76F28CB71DEC7EBB00CDE54D /* AttachmentLoader.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C951DEC7EBA00CDE54D /* AttachmentLoader.c */; }; - 76F28CB81DEC7EBB00CDE54D /* Bone.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C961DEC7EBA00CDE54D /* Bone.c */; }; - 76F28CB91DEC7EBB00CDE54D /* BoneData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C971DEC7EBA00CDE54D /* BoneData.c */; }; - 76F28CBA1DEC7EBB00CDE54D /* BoundingBoxAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C981DEC7EBA00CDE54D /* BoundingBoxAttachment.c */; }; - 76F28CBB1DEC7EBB00CDE54D /* Event.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C991DEC7EBA00CDE54D /* Event.c */; }; - 76F28CBC1DEC7EBB00CDE54D /* EventData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9A1DEC7EBA00CDE54D /* EventData.c */; }; - 76F28CBD1DEC7EBB00CDE54D /* extension.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9B1DEC7EBA00CDE54D /* extension.c */; }; - 76F28CBE1DEC7EBB00CDE54D /* IkConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9C1DEC7EBA00CDE54D /* IkConstraint.c */; }; - 76F28CBF1DEC7EBB00CDE54D /* IkConstraintData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9D1DEC7EBA00CDE54D /* IkConstraintData.c */; }; - 76F28CC01DEC7EBB00CDE54D /* Json.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9E1DEC7EBA00CDE54D /* Json.c */; }; - 76F28CC11DEC7EBB00CDE54D /* MeshAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA11DEC7EBB00CDE54D /* MeshAttachment.c */; }; - 76F28CC21DEC7EBB00CDE54D /* PathAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA21DEC7EBB00CDE54D /* PathAttachment.c */; }; - 76F28CC31DEC7EBB00CDE54D /* PathConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA31DEC7EBB00CDE54D /* PathConstraint.c */; }; - 76F28CC41DEC7EBB00CDE54D /* PathConstraintData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA41DEC7EBB00CDE54D /* PathConstraintData.c */; }; - 76F28CC51DEC7EBB00CDE54D /* RegionAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA51DEC7EBB00CDE54D /* RegionAttachment.c */; }; - 76F28CC61DEC7EBB00CDE54D /* Skeleton.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA61DEC7EBB00CDE54D /* Skeleton.c */; }; - 76F28CC71DEC7EBB00CDE54D /* SkeletonBinary.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA71DEC7EBB00CDE54D /* SkeletonBinary.c */; }; - 76F28CC81DEC7EBB00CDE54D /* SkeletonBounds.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA81DEC7EBB00CDE54D /* SkeletonBounds.c */; }; - 76F28CC91DEC7EBB00CDE54D /* SkeletonData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA91DEC7EBB00CDE54D /* SkeletonData.c */; }; - 76F28CCA1DEC7EBB00CDE54D /* SkeletonJson.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAA1DEC7EBB00CDE54D /* SkeletonJson.c */; }; - 76F28CCB1DEC7EBB00CDE54D /* Skin.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAB1DEC7EBB00CDE54D /* Skin.c */; }; - 76F28CCC1DEC7EBB00CDE54D /* Slot.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAC1DEC7EBB00CDE54D /* Slot.c */; }; - 76F28CCD1DEC7EBB00CDE54D /* SlotData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAD1DEC7EBB00CDE54D /* SlotData.c */; }; - 76F28CCE1DEC7EBB00CDE54D /* TransformConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAE1DEC7EBB00CDE54D /* TransformConstraint.c */; }; - 76F28CCF1DEC7EBB00CDE54D /* TransformConstraintData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAF1DEC7EBB00CDE54D /* TransformConstraintData.c */; }; - 76F28CD01DEC7EBB00CDE54D /* VertexAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CB01DEC7EBB00CDE54D /* VertexAttachment.c */; }; - 76F28CD11DEC7FFA00CDE54D /* Animation.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C8F1DEC7EBA00CDE54D /* Animation.c */; }; - 76F28CD21DEC7FFA00CDE54D /* AnimationState.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C901DEC7EBA00CDE54D /* AnimationState.c */; }; - 76F28CD31DEC7FFA00CDE54D /* AnimationStateData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C911DEC7EBA00CDE54D /* AnimationStateData.c */; }; - 76F28CD41DEC7FFA00CDE54D /* Atlas.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C921DEC7EBA00CDE54D /* Atlas.c */; }; - 76F28CD51DEC7FFA00CDE54D /* AtlasAttachmentLoader.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C931DEC7EBA00CDE54D /* AtlasAttachmentLoader.c */; }; - 76F28CD61DEC7FFA00CDE54D /* Attachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C941DEC7EBA00CDE54D /* Attachment.c */; }; - 76F28CD71DEC7FFA00CDE54D /* AttachmentLoader.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C951DEC7EBA00CDE54D /* AttachmentLoader.c */; }; - 76F28CD81DEC7FFA00CDE54D /* Bone.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C961DEC7EBA00CDE54D /* Bone.c */; }; - 76F28CD91DEC7FFA00CDE54D /* BoneData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C971DEC7EBA00CDE54D /* BoneData.c */; }; - 76F28CDA1DEC7FFA00CDE54D /* BoundingBoxAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C981DEC7EBA00CDE54D /* BoundingBoxAttachment.c */; }; - 76F28CDB1DEC7FFA00CDE54D /* Event.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C991DEC7EBA00CDE54D /* Event.c */; }; - 76F28CDC1DEC7FFA00CDE54D /* EventData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9A1DEC7EBA00CDE54D /* EventData.c */; }; - 76F28CDD1DEC7FFA00CDE54D /* extension.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9B1DEC7EBA00CDE54D /* extension.c */; }; - 76F28CDE1DEC7FFA00CDE54D /* IkConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9C1DEC7EBA00CDE54D /* IkConstraint.c */; }; - 76F28CDF1DEC7FFA00CDE54D /* IkConstraintData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9D1DEC7EBA00CDE54D /* IkConstraintData.c */; }; - 76F28CE01DEC7FFA00CDE54D /* Json.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9E1DEC7EBA00CDE54D /* Json.c */; }; - 76F28CE11DEC7FFA00CDE54D /* Json.h in Sources */ = {isa = PBXBuildFile; fileRef = 76F28C9F1DEC7EBA00CDE54D /* Json.h */; }; - 76F28CE21DEC7FFA00CDE54D /* kvec.h in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA01DEC7EBB00CDE54D /* kvec.h */; }; - 76F28CE31DEC7FFA00CDE54D /* MeshAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA11DEC7EBB00CDE54D /* MeshAttachment.c */; }; - 76F28CE41DEC7FFA00CDE54D /* PathAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA21DEC7EBB00CDE54D /* PathAttachment.c */; }; - 76F28CE51DEC7FFA00CDE54D /* PathConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA31DEC7EBB00CDE54D /* PathConstraint.c */; }; - 76F28CE61DEC7FFA00CDE54D /* PathConstraintData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA41DEC7EBB00CDE54D /* PathConstraintData.c */; }; - 76F28CE71DEC7FFA00CDE54D /* RegionAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA51DEC7EBB00CDE54D /* RegionAttachment.c */; }; - 76F28CE81DEC7FFA00CDE54D /* Skeleton.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA61DEC7EBB00CDE54D /* Skeleton.c */; }; - 76F28CE91DEC7FFA00CDE54D /* SkeletonBinary.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA71DEC7EBB00CDE54D /* SkeletonBinary.c */; }; - 76F28CEA1DEC7FFA00CDE54D /* SkeletonBounds.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA81DEC7EBB00CDE54D /* SkeletonBounds.c */; }; - 76F28CEB1DEC7FFA00CDE54D /* SkeletonData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CA91DEC7EBB00CDE54D /* SkeletonData.c */; }; - 76F28CEC1DEC7FFA00CDE54D /* SkeletonJson.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAA1DEC7EBB00CDE54D /* SkeletonJson.c */; }; - 76F28CED1DEC7FFA00CDE54D /* Skin.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAB1DEC7EBB00CDE54D /* Skin.c */; }; - 76F28CEE1DEC7FFA00CDE54D /* Slot.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAC1DEC7EBB00CDE54D /* Slot.c */; }; - 76F28CEF1DEC7FFA00CDE54D /* SlotData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAD1DEC7EBB00CDE54D /* SlotData.c */; }; - 76F28CF01DEC7FFA00CDE54D /* TransformConstraint.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAE1DEC7EBB00CDE54D /* TransformConstraint.c */; }; - 76F28CF11DEC7FFA00CDE54D /* TransformConstraintData.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CAF1DEC7EBB00CDE54D /* TransformConstraintData.c */; }; - 76F28CF21DEC7FFA00CDE54D /* VertexAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76F28CB01DEC7EBB00CDE54D /* VertexAttachment.c */; }; 76F5BD551D2BD7D3005917E5 /* TankExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76F5BD531D2BD7D3005917E5 /* TankExample.cpp */; }; 76F5BD561D2BD7EF005917E5 /* TankExample.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 76F5BD531D2BD7D3005917E5 /* TankExample.cpp */; }; 76F5BD571D2BD7EF005917E5 /* TankExample.h in Sources */ = {isa = PBXBuildFile; fileRef = 76F5BD541D2BD7D3005917E5 /* TankExample.h */; }; - 76FAC18C1E3F97D2001CCC8C /* Color.c in Sources */ = {isa = PBXBuildFile; fileRef = 76FAC18A1E3F97D2001CCC8C /* Color.c */; }; - 76FAC18D1E3F97D2001CCC8C /* PointAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76FAC18B1E3F97D2001CCC8C /* PointAttachment.c */; }; - 76FAC18F1E3F98A0001CCC8C /* Color.c in Sources */ = {isa = PBXBuildFile; fileRef = 76FAC18A1E3F97D2001CCC8C /* Color.c */; }; - 76FAC1901E3F98A0001CCC8C /* PointAttachment.c in Sources */ = {isa = PBXBuildFile; fileRef = 76FAC18B1E3F97D2001CCC8C /* PointAttachment.c */; }; - 76FB150F1F01377200C5377F /* VertexEffect.c in Sources */ = {isa = PBXBuildFile; fileRef = 76FB150E1F01377200C5377F /* VertexEffect.c */; }; - 76FB15111F0139B400C5377F /* VertexEffect.c in Sources */ = {isa = PBXBuildFile; fileRef = 76FB150E1F01377200C5377F /* VertexEffect.c */; }; 8262943E1AAF051F00CB7CF7 /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 8262943D1AAF051F00CB7CF7 /* Security.framework */; }; BF171245129291EC00B8313A /* OpenGLES.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB012928DE900B8313A /* OpenGLES.framework */; }; BF1712471292920000B8313A /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = BF170DB412928DE900B8313A /* libz.dylib */; }; @@ -264,6 +303,67 @@ 521A8E6319F0C34300D177D7 /* Default-736h@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-736h@3x.png"; sourceTree = ""; }; 52B47A461A53D09B004E4C60 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.1.sdk/System/Library/Frameworks/Security.framework; sourceTree = DEVELOPER_DIR; }; 7602C5541D7DAA1300C7C674 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.3.sdk/System/Library/Frameworks/CoreText.framework; sourceTree = DEVELOPER_DIR; }; + 7631048620BC1B5400927A1E /* Event.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Event.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Event.cpp"; sourceTree = ""; }; + 7631048720BC1B5400927A1E /* PathConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathConstraint.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/PathConstraint.cpp"; sourceTree = ""; }; + 7631048820BC1B5400927A1E /* ScaleTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ScaleTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/ScaleTimeline.cpp"; sourceTree = ""; }; + 7631048920BC1B5400927A1E /* CurveTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CurveTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp"; sourceTree = ""; }; + 7631048A20BC1B5400927A1E /* DrawOrderTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DrawOrderTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp"; sourceTree = ""; }; + 7631048B20BC1B5400927A1E /* PathConstraintMixTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathConstraintMixTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp"; sourceTree = ""; }; + 7631048C20BC1B5400927A1E /* EventTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EventTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/EventTimeline.cpp"; sourceTree = ""; }; + 7631048D20BC1B5500927A1E /* PathConstraintSpacingTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathConstraintSpacingTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp"; sourceTree = ""; }; + 7631048E20BC1B5500927A1E /* SkeletonBinary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonBinary.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp"; sourceTree = ""; }; + 7631048F20BC1B5500927A1E /* RTTI.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RTTI.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/RTTI.cpp"; sourceTree = ""; }; + 7631049020BC1B5500927A1E /* Slot.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Slot.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Slot.cpp"; sourceTree = ""; }; + 7631049120BC1B5500927A1E /* PointAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PointAttachment.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/PointAttachment.cpp"; sourceTree = ""; }; + 7631049220BC1B5500927A1E /* VertexAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VertexAttachment.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp"; sourceTree = ""; }; + 7631049320BC1B5500927A1E /* PathConstraintPositionTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathConstraintPositionTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp"; sourceTree = ""; }; + 7631049420BC1B5500927A1E /* MathUtil.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MathUtil.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/MathUtil.cpp"; sourceTree = ""; }; + 7631049520BC1B5500927A1E /* RotateTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RotateTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/RotateTimeline.cpp"; sourceTree = ""; }; + 7631049620BC1B5500927A1E /* ColorTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ColorTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp"; sourceTree = ""; }; + 7631049720BC1B5500927A1E /* IkConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IkConstraint.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/IkConstraint.cpp"; sourceTree = ""; }; + 7631049820BC1B5500927A1E /* SkeletonData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonData.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/SkeletonData.cpp"; sourceTree = ""; }; + 7631049920BC1B5500927A1E /* Extension.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Extension.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Extension.cpp"; sourceTree = ""; }; + 7631049A20BC1B5500927A1E /* SpineObject.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SpineObject.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/SpineObject.cpp"; sourceTree = ""; }; + 7631049B20BC1B5600927A1E /* AnimationState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnimationState.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/AnimationState.cpp"; sourceTree = ""; }; + 7631049C20BC1B5600927A1E /* TransformConstraintTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TransformConstraintTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp"; sourceTree = ""; }; + 7631049D20BC1B5600927A1E /* TextureLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TextureLoader.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/TextureLoader.cpp"; sourceTree = ""; }; + 7631049E20BC1B5600927A1E /* BoneData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BoneData.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/BoneData.cpp"; sourceTree = ""; }; + 7631049F20BC1B5600927A1E /* Atlas.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Atlas.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Atlas.cpp"; sourceTree = ""; }; + 763104A020BC1B5600927A1E /* Triangulator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Triangulator.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Triangulator.cpp"; sourceTree = ""; }; + 763104A120BC1B5600927A1E /* Skeleton.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Skeleton.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Skeleton.cpp"; sourceTree = ""; }; + 763104A220BC1B5600927A1E /* AttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AttachmentLoader.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/AttachmentLoader.cpp"; sourceTree = ""; }; + 763104A320BC1B5600927A1E /* Constraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Constraint.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Constraint.cpp"; sourceTree = ""; }; + 763104A420BC1B5600927A1E /* AttachmentTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AttachmentTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp"; sourceTree = ""; }; + 763104A520BC1B5600927A1E /* Updatable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Updatable.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Updatable.cpp"; sourceTree = ""; }; + 763104A620BC1B5700927A1E /* RegionAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = RegionAttachment.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp"; sourceTree = ""; }; + 763104A720BC1B5700927A1E /* ClippingAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ClippingAttachment.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/ClippingAttachment.cpp"; sourceTree = ""; }; + 763104A820BC1B5700927A1E /* TwoColorTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TwoColorTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/TwoColorTimeline.cpp"; sourceTree = ""; }; + 763104A920BC1B5700927A1E /* TransformConstraintData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TransformConstraintData.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp"; sourceTree = ""; }; + 763104AA20BC1B5700927A1E /* PathAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathAttachment.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/PathAttachment.cpp"; sourceTree = ""; }; + 763104AB20BC1B5700927A1E /* BoundingBoxAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = BoundingBoxAttachment.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/BoundingBoxAttachment.cpp"; sourceTree = ""; }; + 763104AC20BC1B5700927A1E /* Skin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Skin.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Skin.cpp"; sourceTree = ""; }; + 763104AD20BC1B5700927A1E /* IkConstraintData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IkConstraintData.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp"; sourceTree = ""; }; + 763104AE20BC1B5800927A1E /* VertexEffect.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = VertexEffect.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/VertexEffect.cpp"; sourceTree = ""; }; + 763104AF20BC1B5800927A1E /* AnimationStateData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AnimationStateData.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/AnimationStateData.cpp"; sourceTree = ""; }; + 763104B020BC1B5800927A1E /* EventData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = EventData.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/EventData.cpp"; sourceTree = ""; }; + 763104B120BC1B5800927A1E /* SkeletonClipping.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonClipping.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp"; sourceTree = ""; }; + 763104B220BC1B5800927A1E /* IkConstraintTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = IkConstraintTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp"; sourceTree = ""; }; + 763104B320BC1B5C00927A1E /* Timeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Timeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Timeline.cpp"; sourceTree = ""; }; + 763104B420BC1B5C00927A1E /* AtlasAttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AtlasAttachmentLoader.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp"; sourceTree = ""; }; + 763104B520BC1B5C00927A1E /* LinkedMesh.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = LinkedMesh.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/LinkedMesh.cpp"; sourceTree = ""; }; + 763104B620BC1B5C00927A1E /* Animation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Animation.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Animation.cpp"; sourceTree = ""; }; + 763104B720BC1B5C00927A1E /* Attachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Attachment.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Attachment.cpp"; sourceTree = ""; }; + 763104B820BC1B5C00927A1E /* MeshAttachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = MeshAttachment.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp"; sourceTree = ""; }; + 763104B920BC1B5C00927A1E /* SlotData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SlotData.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/SlotData.cpp"; sourceTree = ""; }; + 763104BA20BC1B5D00927A1E /* Bone.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Bone.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Bone.cpp"; sourceTree = ""; }; + 763104BB20BC1B5D00927A1E /* Json.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Json.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/Json.cpp"; sourceTree = ""; }; + 763104BC20BC1B5D00927A1E /* SkeletonJson.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonJson.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp"; sourceTree = ""; }; + 763104BD20BC1B5D00927A1E /* TransformConstraint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TransformConstraint.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp"; sourceTree = ""; }; + 763104BE20BC1B5D00927A1E /* DeformTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DeformTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp"; sourceTree = ""; }; + 763104BF20BC1B5E00927A1E /* PathConstraintData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = PathConstraintData.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp"; sourceTree = ""; }; + 763104C020BC1B5E00927A1E /* SkeletonBounds.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonBounds.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp"; sourceTree = ""; }; + 763104C120BC1B5E00927A1E /* ShearTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = ShearTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/ShearTimeline.cpp"; sourceTree = ""; }; + 763104C220BC1B5E00927A1E /* TranslateTimeline.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = TranslateTimeline.cpp; path = "../../../spine-cpp/spine-cpp/src/spine/TranslateTimeline.cpp"; sourceTree = ""; }; 76A45BDC1E64396800745AA1 /* SkeletonTwoColorBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonTwoColorBatch.cpp; path = ../../src/spine/SkeletonTwoColorBatch.cpp; sourceTree = ""; }; 76A45BDD1E64396800745AA1 /* SkeletonTwoColorBatch.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonTwoColorBatch.h; path = ../../src/spine/SkeletonTwoColorBatch.h; sourceTree = ""; }; 76AAA3B31D180F7C00C54FCB /* AppDelegate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AppDelegate.cpp; sourceTree = ""; }; @@ -279,8 +379,6 @@ 76AAA3BF1D180F7C00C54FCB /* SpineboyExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SpineboyExample.h; sourceTree = ""; }; 76AAA4001D18106000C54FCB /* AttachmentVertices.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = AttachmentVertices.cpp; path = ../../src/spine/AttachmentVertices.cpp; sourceTree = ""; }; 76AAA4011D18106000C54FCB /* AttachmentVertices.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AttachmentVertices.h; path = ../../src/spine/AttachmentVertices.h; sourceTree = ""; }; - 76AAA4021D18106000C54FCB /* Cocos2dAttachmentLoader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = Cocos2dAttachmentLoader.cpp; path = ../../src/spine/Cocos2dAttachmentLoader.cpp; sourceTree = ""; }; - 76AAA4031D18106000C54FCB /* Cocos2dAttachmentLoader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Cocos2dAttachmentLoader.h; path = ../../src/spine/Cocos2dAttachmentLoader.h; sourceTree = ""; }; 76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonAnimation.cpp; path = ../../src/spine/SkeletonAnimation.cpp; sourceTree = ""; }; 76AAA4051D18106000C54FCB /* SkeletonAnimation.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SkeletonAnimation.h; path = ../../src/spine/SkeletonAnimation.h; sourceTree = ""; }; 76AAA4061D18106000C54FCB /* SkeletonBatch.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = SkeletonBatch.cpp; path = ../../src/spine/SkeletonBatch.cpp; sourceTree = ""; }; @@ -292,51 +390,10 @@ 76AAA4521D18132D00C54FCB /* common */ = {isa = PBXFileReference; lastKnownFileType = folder; path = common; sourceTree = ""; }; 76D1BFDE2029E35100A0272D /* SkeletonRendererSeparatorExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkeletonRendererSeparatorExample.h; sourceTree = ""; }; 76D1BFDF2029E35200A0272D /* SkeletonRendererSeparatorExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkeletonRendererSeparatorExample.cpp; sourceTree = ""; }; - 76D520D71EB3611300572471 /* ClippingAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ClippingAttachment.c; path = "../../../spine-c/spine-c/src/spine/ClippingAttachment.c"; sourceTree = ""; }; - 76D520D81EB3611300572471 /* SkeletonClipping.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkeletonClipping.c; path = "../../../spine-c/spine-c/src/spine/SkeletonClipping.c"; sourceTree = ""; }; - 76D520D91EB3611300572471 /* Triangulator.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Triangulator.c; path = "../../../spine-c/spine-c/src/spine/Triangulator.c"; sourceTree = ""; }; - 76D520E11EB3625700572471 /* Array.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Array.c; path = "../../../spine-c/spine-c/src/spine/Array.c"; sourceTree = ""; }; 76D520E41EB362DD00572471 /* CoinExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CoinExample.cpp; sourceTree = ""; }; 76D520E51EB362DD00572471 /* CoinExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoinExample.h; sourceTree = ""; }; - 76F28C8F1DEC7EBA00CDE54D /* Animation.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Animation.c; path = "../../../spine-c/spine-c/src/spine/Animation.c"; sourceTree = ""; }; - 76F28C901DEC7EBA00CDE54D /* AnimationState.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AnimationState.c; path = "../../../spine-c/spine-c/src/spine/AnimationState.c"; sourceTree = ""; }; - 76F28C911DEC7EBA00CDE54D /* AnimationStateData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AnimationStateData.c; path = "../../../spine-c/spine-c/src/spine/AnimationStateData.c"; sourceTree = ""; }; - 76F28C921DEC7EBA00CDE54D /* Atlas.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Atlas.c; path = "../../../spine-c/spine-c/src/spine/Atlas.c"; sourceTree = ""; }; - 76F28C931DEC7EBA00CDE54D /* AtlasAttachmentLoader.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AtlasAttachmentLoader.c; path = "../../../spine-c/spine-c/src/spine/AtlasAttachmentLoader.c"; sourceTree = ""; }; - 76F28C941DEC7EBA00CDE54D /* Attachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Attachment.c; path = "../../../spine-c/spine-c/src/spine/Attachment.c"; sourceTree = ""; }; - 76F28C951DEC7EBA00CDE54D /* AttachmentLoader.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = AttachmentLoader.c; path = "../../../spine-c/spine-c/src/spine/AttachmentLoader.c"; sourceTree = ""; }; - 76F28C961DEC7EBA00CDE54D /* Bone.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Bone.c; path = "../../../spine-c/spine-c/src/spine/Bone.c"; sourceTree = ""; }; - 76F28C971DEC7EBA00CDE54D /* BoneData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = BoneData.c; path = "../../../spine-c/spine-c/src/spine/BoneData.c"; sourceTree = ""; }; - 76F28C981DEC7EBA00CDE54D /* BoundingBoxAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = BoundingBoxAttachment.c; path = "../../../spine-c/spine-c/src/spine/BoundingBoxAttachment.c"; sourceTree = ""; }; - 76F28C991DEC7EBA00CDE54D /* Event.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Event.c; path = "../../../spine-c/spine-c/src/spine/Event.c"; sourceTree = ""; }; - 76F28C9A1DEC7EBA00CDE54D /* EventData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = EventData.c; path = "../../../spine-c/spine-c/src/spine/EventData.c"; sourceTree = ""; }; - 76F28C9B1DEC7EBA00CDE54D /* extension.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = extension.c; path = "../../../spine-c/spine-c/src/spine/extension.c"; sourceTree = ""; }; - 76F28C9C1DEC7EBA00CDE54D /* IkConstraint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = IkConstraint.c; path = "../../../spine-c/spine-c/src/spine/IkConstraint.c"; sourceTree = ""; }; - 76F28C9D1DEC7EBA00CDE54D /* IkConstraintData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = IkConstraintData.c; path = "../../../spine-c/spine-c/src/spine/IkConstraintData.c"; sourceTree = ""; }; - 76F28C9E1DEC7EBA00CDE54D /* Json.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Json.c; path = "../../../spine-c/spine-c/src/spine/Json.c"; sourceTree = ""; }; - 76F28C9F1DEC7EBA00CDE54D /* Json.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Json.h; path = "../../../spine-c/spine-c/src/spine/Json.h"; sourceTree = ""; }; - 76F28CA01DEC7EBB00CDE54D /* kvec.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = kvec.h; path = "../../../spine-c/spine-c/src/spine/kvec.h"; sourceTree = ""; }; - 76F28CA11DEC7EBB00CDE54D /* MeshAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = MeshAttachment.c; path = "../../../spine-c/spine-c/src/spine/MeshAttachment.c"; sourceTree = ""; }; - 76F28CA21DEC7EBB00CDE54D /* PathAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = PathAttachment.c; path = "../../../spine-c/spine-c/src/spine/PathAttachment.c"; sourceTree = ""; }; - 76F28CA31DEC7EBB00CDE54D /* PathConstraint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = PathConstraint.c; path = "../../../spine-c/spine-c/src/spine/PathConstraint.c"; sourceTree = ""; }; - 76F28CA41DEC7EBB00CDE54D /* PathConstraintData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = PathConstraintData.c; path = "../../../spine-c/spine-c/src/spine/PathConstraintData.c"; sourceTree = ""; }; - 76F28CA51DEC7EBB00CDE54D /* RegionAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = RegionAttachment.c; path = "../../../spine-c/spine-c/src/spine/RegionAttachment.c"; sourceTree = ""; }; - 76F28CA61DEC7EBB00CDE54D /* Skeleton.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Skeleton.c; path = "../../../spine-c/spine-c/src/spine/Skeleton.c"; sourceTree = ""; }; - 76F28CA71DEC7EBB00CDE54D /* SkeletonBinary.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkeletonBinary.c; path = "../../../spine-c/spine-c/src/spine/SkeletonBinary.c"; sourceTree = ""; }; - 76F28CA81DEC7EBB00CDE54D /* SkeletonBounds.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkeletonBounds.c; path = "../../../spine-c/spine-c/src/spine/SkeletonBounds.c"; sourceTree = ""; }; - 76F28CA91DEC7EBB00CDE54D /* SkeletonData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkeletonData.c; path = "../../../spine-c/spine-c/src/spine/SkeletonData.c"; sourceTree = ""; }; - 76F28CAA1DEC7EBB00CDE54D /* SkeletonJson.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SkeletonJson.c; path = "../../../spine-c/spine-c/src/spine/SkeletonJson.c"; sourceTree = ""; }; - 76F28CAB1DEC7EBB00CDE54D /* Skin.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Skin.c; path = "../../../spine-c/spine-c/src/spine/Skin.c"; sourceTree = ""; }; - 76F28CAC1DEC7EBB00CDE54D /* Slot.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Slot.c; path = "../../../spine-c/spine-c/src/spine/Slot.c"; sourceTree = ""; }; - 76F28CAD1DEC7EBB00CDE54D /* SlotData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = SlotData.c; path = "../../../spine-c/spine-c/src/spine/SlotData.c"; sourceTree = ""; }; - 76F28CAE1DEC7EBB00CDE54D /* TransformConstraint.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = TransformConstraint.c; path = "../../../spine-c/spine-c/src/spine/TransformConstraint.c"; sourceTree = ""; }; - 76F28CAF1DEC7EBB00CDE54D /* TransformConstraintData.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = TransformConstraintData.c; path = "../../../spine-c/spine-c/src/spine/TransformConstraintData.c"; sourceTree = ""; }; - 76F28CB01DEC7EBB00CDE54D /* VertexAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = VertexAttachment.c; path = "../../../spine-c/spine-c/src/spine/VertexAttachment.c"; sourceTree = ""; }; 76F5BD531D2BD7D3005917E5 /* TankExample.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TankExample.cpp; sourceTree = ""; }; 76F5BD541D2BD7D3005917E5 /* TankExample.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TankExample.h; sourceTree = ""; }; - 76FAC18A1E3F97D2001CCC8C /* Color.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = Color.c; path = "../../../spine-c/spine-c/src/spine/Color.c"; sourceTree = ""; }; - 76FAC18B1E3F97D2001CCC8C /* PointAttachment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = PointAttachment.c; path = "../../../spine-c/spine-c/src/spine/PointAttachment.c"; sourceTree = ""; }; - 76FB150E1F01377200C5377F /* VertexEffect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = VertexEffect.c; sourceTree = ""; }; 8262943D1AAF051F00CB7CF7 /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; BF170DB012928DE900B8313A /* OpenGLES.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGLES.framework; path = System/Library/Frameworks/OpenGLES.framework; sourceTree = SDKROOT; }; BF170DB412928DE900B8313A /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; @@ -554,47 +611,67 @@ 76AAA3B21D180F7300C54FCB /* spine */ = { isa = PBXGroup; children = ( - 76FB150E1F01377200C5377F /* VertexEffect.c */, - 76D520E11EB3625700572471 /* Array.c */, - 76D520D71EB3611300572471 /* ClippingAttachment.c */, - 76D520D81EB3611300572471 /* SkeletonClipping.c */, - 76D520D91EB3611300572471 /* Triangulator.c */, - 76FAC18A1E3F97D2001CCC8C /* Color.c */, - 76FAC18B1E3F97D2001CCC8C /* PointAttachment.c */, - 76F28C8F1DEC7EBA00CDE54D /* Animation.c */, - 76F28C901DEC7EBA00CDE54D /* AnimationState.c */, - 76F28C911DEC7EBA00CDE54D /* AnimationStateData.c */, - 76F28C921DEC7EBA00CDE54D /* Atlas.c */, - 76F28C931DEC7EBA00CDE54D /* AtlasAttachmentLoader.c */, - 76F28C941DEC7EBA00CDE54D /* Attachment.c */, - 76F28C951DEC7EBA00CDE54D /* AttachmentLoader.c */, - 76F28C961DEC7EBA00CDE54D /* Bone.c */, - 76F28C971DEC7EBA00CDE54D /* BoneData.c */, - 76F28C981DEC7EBA00CDE54D /* BoundingBoxAttachment.c */, - 76F28C991DEC7EBA00CDE54D /* Event.c */, - 76F28C9A1DEC7EBA00CDE54D /* EventData.c */, - 76F28C9B1DEC7EBA00CDE54D /* extension.c */, - 76F28C9C1DEC7EBA00CDE54D /* IkConstraint.c */, - 76F28C9D1DEC7EBA00CDE54D /* IkConstraintData.c */, - 76F28C9E1DEC7EBA00CDE54D /* Json.c */, - 76F28C9F1DEC7EBA00CDE54D /* Json.h */, - 76F28CA01DEC7EBB00CDE54D /* kvec.h */, - 76F28CA11DEC7EBB00CDE54D /* MeshAttachment.c */, - 76F28CA21DEC7EBB00CDE54D /* PathAttachment.c */, - 76F28CA31DEC7EBB00CDE54D /* PathConstraint.c */, - 76F28CA41DEC7EBB00CDE54D /* PathConstraintData.c */, - 76F28CA51DEC7EBB00CDE54D /* RegionAttachment.c */, - 76F28CA61DEC7EBB00CDE54D /* Skeleton.c */, - 76F28CA71DEC7EBB00CDE54D /* SkeletonBinary.c */, - 76F28CA81DEC7EBB00CDE54D /* SkeletonBounds.c */, - 76F28CA91DEC7EBB00CDE54D /* SkeletonData.c */, - 76F28CAA1DEC7EBB00CDE54D /* SkeletonJson.c */, - 76F28CAB1DEC7EBB00CDE54D /* Skin.c */, - 76F28CAC1DEC7EBB00CDE54D /* Slot.c */, - 76F28CAD1DEC7EBB00CDE54D /* SlotData.c */, - 76F28CAE1DEC7EBB00CDE54D /* TransformConstraint.c */, - 76F28CAF1DEC7EBB00CDE54D /* TransformConstraintData.c */, - 76F28CB01DEC7EBB00CDE54D /* VertexAttachment.c */, + 763104B620BC1B5C00927A1E /* Animation.cpp */, + 7631049B20BC1B5600927A1E /* AnimationState.cpp */, + 763104AF20BC1B5800927A1E /* AnimationStateData.cpp */, + 7631049F20BC1B5600927A1E /* Atlas.cpp */, + 763104B420BC1B5C00927A1E /* AtlasAttachmentLoader.cpp */, + 763104B720BC1B5C00927A1E /* Attachment.cpp */, + 763104A220BC1B5600927A1E /* AttachmentLoader.cpp */, + 763104A420BC1B5600927A1E /* AttachmentTimeline.cpp */, + 763104BA20BC1B5D00927A1E /* Bone.cpp */, + 7631049E20BC1B5600927A1E /* BoneData.cpp */, + 763104AB20BC1B5700927A1E /* BoundingBoxAttachment.cpp */, + 763104A720BC1B5700927A1E /* ClippingAttachment.cpp */, + 7631049620BC1B5500927A1E /* ColorTimeline.cpp */, + 763104A320BC1B5600927A1E /* Constraint.cpp */, + 7631048920BC1B5400927A1E /* CurveTimeline.cpp */, + 763104BE20BC1B5D00927A1E /* DeformTimeline.cpp */, + 7631048A20BC1B5400927A1E /* DrawOrderTimeline.cpp */, + 7631048620BC1B5400927A1E /* Event.cpp */, + 763104B020BC1B5800927A1E /* EventData.cpp */, + 7631048C20BC1B5400927A1E /* EventTimeline.cpp */, + 7631049920BC1B5500927A1E /* Extension.cpp */, + 7631049720BC1B5500927A1E /* IkConstraint.cpp */, + 763104AD20BC1B5700927A1E /* IkConstraintData.cpp */, + 763104B220BC1B5800927A1E /* IkConstraintTimeline.cpp */, + 763104BB20BC1B5D00927A1E /* Json.cpp */, + 763104B520BC1B5C00927A1E /* LinkedMesh.cpp */, + 7631049420BC1B5500927A1E /* MathUtil.cpp */, + 763104B820BC1B5C00927A1E /* MeshAttachment.cpp */, + 763104AA20BC1B5700927A1E /* PathAttachment.cpp */, + 7631048720BC1B5400927A1E /* PathConstraint.cpp */, + 763104BF20BC1B5E00927A1E /* PathConstraintData.cpp */, + 7631048B20BC1B5400927A1E /* PathConstraintMixTimeline.cpp */, + 7631049320BC1B5500927A1E /* PathConstraintPositionTimeline.cpp */, + 7631048D20BC1B5500927A1E /* PathConstraintSpacingTimeline.cpp */, + 7631049120BC1B5500927A1E /* PointAttachment.cpp */, + 763104A620BC1B5700927A1E /* RegionAttachment.cpp */, + 7631049520BC1B5500927A1E /* RotateTimeline.cpp */, + 7631048F20BC1B5500927A1E /* RTTI.cpp */, + 7631048820BC1B5400927A1E /* ScaleTimeline.cpp */, + 763104C120BC1B5E00927A1E /* ShearTimeline.cpp */, + 763104A120BC1B5600927A1E /* Skeleton.cpp */, + 7631048E20BC1B5500927A1E /* SkeletonBinary.cpp */, + 763104C020BC1B5E00927A1E /* SkeletonBounds.cpp */, + 763104B120BC1B5800927A1E /* SkeletonClipping.cpp */, + 7631049820BC1B5500927A1E /* SkeletonData.cpp */, + 763104BC20BC1B5D00927A1E /* SkeletonJson.cpp */, + 763104AC20BC1B5700927A1E /* Skin.cpp */, + 7631049020BC1B5500927A1E /* Slot.cpp */, + 763104B920BC1B5C00927A1E /* SlotData.cpp */, + 7631049A20BC1B5500927A1E /* SpineObject.cpp */, + 7631049D20BC1B5600927A1E /* TextureLoader.cpp */, + 763104B320BC1B5C00927A1E /* Timeline.cpp */, + 763104BD20BC1B5D00927A1E /* TransformConstraint.cpp */, + 763104A920BC1B5700927A1E /* TransformConstraintData.cpp */, + 7631049C20BC1B5600927A1E /* TransformConstraintTimeline.cpp */, + 763104C220BC1B5E00927A1E /* TranslateTimeline.cpp */, + 763104A020BC1B5600927A1E /* Triangulator.cpp */, + 763104A820BC1B5700927A1E /* TwoColorTimeline.cpp */, + 763104A520BC1B5600927A1E /* Updatable.cpp */, + 7631049220BC1B5500927A1E /* VertexAttachment.cpp */, + 763104AE20BC1B5800927A1E /* VertexEffect.cpp */, ); name = spine; sourceTree = ""; @@ -606,8 +683,6 @@ 76A45BDD1E64396800745AA1 /* SkeletonTwoColorBatch.h */, 76AAA4001D18106000C54FCB /* AttachmentVertices.cpp */, 76AAA4011D18106000C54FCB /* AttachmentVertices.h */, - 76AAA4021D18106000C54FCB /* Cocos2dAttachmentLoader.cpp */, - 76AAA4031D18106000C54FCB /* Cocos2dAttachmentLoader.h */, 76AAA4041D18106000C54FCB /* SkeletonAnimation.cpp */, 76AAA4051D18106000C54FCB /* SkeletonAnimation.h */, 76AAA4061D18106000C54FCB /* SkeletonBatch.cpp */, @@ -760,63 +835,84 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 76F28CCA1DEC7EBB00CDE54D /* SkeletonJson.c in Sources */, + 763104D320BC1B5E00927A1E /* ColorTimeline.cpp in Sources */, + 763104FA20BC1B5E00927A1E /* TransformConstraint.cpp in Sources */, + 763104CB20BC1B5E00927A1E /* SkeletonBinary.cpp in Sources */, 76AAA40C1D18106000C54FCB /* AttachmentVertices.cpp in Sources */, 76D1BFE02029E35200A0272D /* SkeletonRendererSeparatorExample.cpp in Sources */, - 76F28CC81DEC7EBB00CDE54D /* SkeletonBounds.c in Sources */, - 76F28CB71DEC7EBB00CDE54D /* AttachmentLoader.c in Sources */, + 763104EF20BC1B5E00927A1E /* IkConstraintTimeline.cpp in Sources */, + 763104E020BC1B5E00927A1E /* Constraint.cpp in Sources */, + 763104D820BC1B5E00927A1E /* AnimationState.cpp in Sources */, + 763104EE20BC1B5E00927A1E /* SkeletonClipping.cpp in Sources */, + 763104E420BC1B5E00927A1E /* ClippingAttachment.cpp in Sources */, + 763104C620BC1B5E00927A1E /* CurveTimeline.cpp in Sources */, + 763104E120BC1B5E00927A1E /* AttachmentTimeline.cpp in Sources */, + 763104ED20BC1B5E00927A1E /* EventData.cpp in Sources */, + 763104FD20BC1B5E00927A1E /* SkeletonBounds.cpp in Sources */, 76F5BD551D2BD7D3005917E5 /* TankExample.cpp in Sources */, - 76F28CCC1DEC7EBB00CDE54D /* Slot.c in Sources */, - 76F28CB31DEC7EBB00CDE54D /* AnimationStateData.c in Sources */, - 76D520E21EB3625700572471 /* Array.c in Sources */, - 76F28CBE1DEC7EBB00CDE54D /* IkConstraint.c in Sources */, + 763104CD20BC1B5E00927A1E /* Slot.cpp in Sources */, 76AAA3C51D180F7C00C54FCB /* SpineboyExample.cpp in Sources */, + 763104F220BC1B5E00927A1E /* LinkedMesh.cpp in Sources */, 76AAA3C11D180F7C00C54FCB /* BatchingExample.cpp in Sources */, - 76F28CD01DEC7EBB00CDE54D /* VertexAttachment.c in Sources */, - 76F28CBD1DEC7EBB00CDE54D /* extension.c in Sources */, - 76F28CB11DEC7EBB00CDE54D /* Animation.c in Sources */, - 76F28CC71DEC7EBB00CDE54D /* SkeletonBinary.c in Sources */, - 76AAA40D1D18106000C54FCB /* Cocos2dAttachmentLoader.cpp in Sources */, - 76F28CC51DEC7EBB00CDE54D /* RegionAttachment.c in Sources */, + 763104D520BC1B5E00927A1E /* SkeletonData.cpp in Sources */, + 763104D620BC1B5E00927A1E /* Extension.cpp in Sources */, 76AAA40F1D18106000C54FCB /* SkeletonBatch.cpp in Sources */, - 76F28CBB1DEC7EBB00CDE54D /* Event.c in Sources */, + 763104C920BC1B5E00927A1E /* EventTimeline.cpp in Sources */, + 763104EB20BC1B5E00927A1E /* VertexEffect.cpp in Sources */, 76AAA3C31D180F7C00C54FCB /* RaptorExample.cpp in Sources */, - 76F28CB51DEC7EBB00CDE54D /* AtlasAttachmentLoader.c in Sources */, + 763104D920BC1B5E00927A1E /* TransformConstraintTimeline.cpp in Sources */, + 763104CF20BC1B5E00927A1E /* VertexAttachment.cpp in Sources */, + 763104E720BC1B5E00927A1E /* PathAttachment.cpp in Sources */, + 763104F820BC1B5E00927A1E /* Json.cpp in Sources */, + 763104F620BC1B5E00927A1E /* SlotData.cpp in Sources */, + 763104DF20BC1B5E00927A1E /* AttachmentLoader.cpp in Sources */, 76AAA3C01D180F7C00C54FCB /* AppDelegate.cpp in Sources */, - 76FAC18D1E3F97D2001CCC8C /* PointAttachment.c in Sources */, - 76F28CC31DEC7EBB00CDE54D /* PathConstraint.c in Sources */, + 763104C420BC1B5E00927A1E /* PathConstraint.cpp in Sources */, + 763104F920BC1B5E00927A1E /* SkeletonJson.cpp in Sources */, 503AE10017EB989F00D1A890 /* AppController.mm in Sources */, - 76F28CC11DEC7EBB00CDE54D /* MeshAttachment.c in Sources */, - 76F28CC01DEC7EBB00CDE54D /* Json.c in Sources */, - 76F28CC21DEC7EBB00CDE54D /* PathAttachment.c in Sources */, - 76F28CBA1DEC7EBB00CDE54D /* BoundingBoxAttachment.c in Sources */, - 76F28CBC1DEC7EBB00CDE54D /* EventData.c in Sources */, - 76F28CCD1DEC7EBB00CDE54D /* SlotData.c in Sources */, + 763104E820BC1B5E00927A1E /* BoundingBoxAttachment.cpp in Sources */, + 763104C720BC1B5E00927A1E /* DrawOrderTimeline.cpp in Sources */, + 763104F520BC1B5E00927A1E /* MeshAttachment.cpp in Sources */, + 763104E520BC1B5E00927A1E /* TwoColorTimeline.cpp in Sources */, + 763104D420BC1B5E00927A1E /* IkConstraint.cpp in Sources */, + 763104E920BC1B5E00927A1E /* Skin.cpp in Sources */, + 763104C820BC1B5E00927A1E /* PathConstraintMixTimeline.cpp in Sources */, + 763104D120BC1B5E00927A1E /* MathUtil.cpp in Sources */, + 763104DD20BC1B5E00927A1E /* Triangulator.cpp in Sources */, + 763104F320BC1B5E00927A1E /* Animation.cpp in Sources */, 76AAA40E1D18106000C54FCB /* SkeletonAnimation.cpp in Sources */, - 76F28CB41DEC7EBB00CDE54D /* Atlas.c in Sources */, - 76F28CB21DEC7EBB00CDE54D /* AnimationState.c in Sources */, 76AAA4111D18106000C54FCB /* spine-cocos2dx.cpp in Sources */, - 76F28CCF1DEC7EBB00CDE54D /* TransformConstraintData.c in Sources */, - 76F28CCE1DEC7EBB00CDE54D /* TransformConstraint.c in Sources */, - 76F28CB91DEC7EBB00CDE54D /* BoneData.c in Sources */, + 763104FC20BC1B5E00927A1E /* PathConstraintData.cpp in Sources */, + 763104DC20BC1B5E00927A1E /* Atlas.cpp in Sources */, + 763104FF20BC1B5E00927A1E /* TranslateTimeline.cpp in Sources */, + 763104C320BC1B5E00927A1E /* Event.cpp in Sources */, + 763104DA20BC1B5E00927A1E /* TextureLoader.cpp in Sources */, + 763104F720BC1B5E00927A1E /* Bone.cpp in Sources */, + 763104DB20BC1B5E00927A1E /* BoneData.cpp in Sources */, + 763104D020BC1B5E00927A1E /* PathConstraintPositionTimeline.cpp in Sources */, + 763104C520BC1B5E00927A1E /* ScaleTimeline.cpp in Sources */, + 763104DE20BC1B5E00927A1E /* Skeleton.cpp in Sources */, 76AAA3C21D180F7C00C54FCB /* GoblinsExample.cpp in Sources */, - 76F28CC91DEC7EBB00CDE54D /* SkeletonData.c in Sources */, - 76D520DA1EB3611300572471 /* ClippingAttachment.c in Sources */, - 76F28CC41DEC7EBB00CDE54D /* PathConstraintData.c in Sources */, - 76F28CB81DEC7EBB00CDE54D /* Bone.c in Sources */, - 76F28CB61DEC7EBB00CDE54D /* Attachment.c in Sources */, + 763104FB20BC1B5E00927A1E /* DeformTimeline.cpp in Sources */, 503AE10217EB989F00D1A890 /* RootViewController.mm in Sources */, - 76FB150F1F01377200C5377F /* VertexEffect.c in Sources */, 503AE10117EB989F00D1A890 /* main.m in Sources */, - 76D520DB1EB3611300572471 /* SkeletonClipping.c in Sources */, - 76F28CCB1DEC7EBB00CDE54D /* Skin.c in Sources */, 76A45BDE1E64396800745AA1 /* SkeletonTwoColorBatch.cpp in Sources */, - 76F28CBF1DEC7EBB00CDE54D /* IkConstraintData.c in Sources */, - 76F28CC61DEC7EBB00CDE54D /* Skeleton.c in Sources */, + 763104CC20BC1B5E00927A1E /* RTTI.cpp in Sources */, + 763104F020BC1B5E00927A1E /* Timeline.cpp in Sources */, + 763104FE20BC1B5E00927A1E /* ShearTimeline.cpp in Sources */, 76AAA4101D18106000C54FCB /* SkeletonRenderer.cpp in Sources */, + 763104F120BC1B5E00927A1E /* AtlasAttachmentLoader.cpp in Sources */, + 763104EC20BC1B5E00927A1E /* AnimationStateData.cpp in Sources */, + 763104CE20BC1B5E00927A1E /* PointAttachment.cpp in Sources */, + 763104EA20BC1B5E00927A1E /* IkConstraintData.cpp in Sources */, + 763104F420BC1B5E00927A1E /* Attachment.cpp in Sources */, + 763104E620BC1B5E00927A1E /* TransformConstraintData.cpp in Sources */, + 763104D720BC1B5E00927A1E /* SpineObject.cpp in Sources */, + 763104CA20BC1B5E00927A1E /* PathConstraintSpacingTimeline.cpp in Sources */, 76D520E61EB362DD00572471 /* CoinExample.cpp in Sources */, - 76FAC18C1E3F97D2001CCC8C /* Color.c in Sources */, - 76D520DC1EB3611300572471 /* Triangulator.c in Sources */, + 763104E220BC1B5E00927A1E /* Updatable.cpp in Sources */, + 763104D220BC1B5E00927A1E /* RotateTimeline.cpp in Sources */, + 763104E320BC1B5E00927A1E /* RegionAttachment.cpp in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -824,49 +920,69 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 7631059E20BC1B9700927A1E /* Animation.cpp in Sources */, + 7631059F20BC1B9700927A1E /* AnimationState.cpp in Sources */, + 763105A020BC1B9700927A1E /* AnimationStateData.cpp in Sources */, + 763105A120BC1B9700927A1E /* Atlas.cpp in Sources */, + 763105A220BC1B9700927A1E /* AtlasAttachmentLoader.cpp in Sources */, + 763105A320BC1B9700927A1E /* Attachment.cpp in Sources */, + 763105A420BC1B9700927A1E /* AttachmentLoader.cpp in Sources */, + 763105A520BC1B9700927A1E /* AttachmentTimeline.cpp in Sources */, + 763105A620BC1B9700927A1E /* Bone.cpp in Sources */, + 763105A720BC1B9700927A1E /* BoneData.cpp in Sources */, + 763105A820BC1B9700927A1E /* BoundingBoxAttachment.cpp in Sources */, + 763105A920BC1B9700927A1E /* ClippingAttachment.cpp in Sources */, + 763105AA20BC1B9700927A1E /* ColorTimeline.cpp in Sources */, + 763105AB20BC1B9700927A1E /* Constraint.cpp in Sources */, + 763105AC20BC1B9700927A1E /* CurveTimeline.cpp in Sources */, + 763105AD20BC1B9700927A1E /* DeformTimeline.cpp in Sources */, + 763105AE20BC1B9700927A1E /* DrawOrderTimeline.cpp in Sources */, + 763105AF20BC1B9700927A1E /* Event.cpp in Sources */, + 763105B020BC1B9700927A1E /* EventData.cpp in Sources */, + 763105B120BC1B9700927A1E /* EventTimeline.cpp in Sources */, + 763105B220BC1B9700927A1E /* Extension.cpp in Sources */, + 763105B320BC1B9700927A1E /* IkConstraint.cpp in Sources */, + 763105B420BC1B9700927A1E /* IkConstraintData.cpp in Sources */, + 763105B520BC1B9700927A1E /* IkConstraintTimeline.cpp in Sources */, + 763105B620BC1B9700927A1E /* Json.cpp in Sources */, + 763105B720BC1B9700927A1E /* LinkedMesh.cpp in Sources */, + 763105B820BC1B9700927A1E /* MathUtil.cpp in Sources */, + 763105B920BC1B9700927A1E /* MeshAttachment.cpp in Sources */, + 763105BA20BC1B9700927A1E /* PathAttachment.cpp in Sources */, + 763105BB20BC1B9700927A1E /* PathConstraint.cpp in Sources */, + 763105BC20BC1B9700927A1E /* PathConstraintData.cpp in Sources */, + 763105BD20BC1B9700927A1E /* PathConstraintMixTimeline.cpp in Sources */, + 763105BE20BC1B9700927A1E /* PathConstraintPositionTimeline.cpp in Sources */, + 763105BF20BC1B9700927A1E /* PathConstraintSpacingTimeline.cpp in Sources */, + 763105C020BC1B9700927A1E /* PointAttachment.cpp in Sources */, + 763105C120BC1B9700927A1E /* RegionAttachment.cpp in Sources */, + 763105C220BC1B9700927A1E /* RotateTimeline.cpp in Sources */, + 763105C320BC1B9700927A1E /* RTTI.cpp in Sources */, + 763105C420BC1B9700927A1E /* ScaleTimeline.cpp in Sources */, + 763105C520BC1B9700927A1E /* ShearTimeline.cpp in Sources */, + 763105C620BC1B9700927A1E /* Skeleton.cpp in Sources */, + 763105C720BC1B9700927A1E /* SkeletonBinary.cpp in Sources */, + 763105C820BC1B9700927A1E /* SkeletonBounds.cpp in Sources */, + 763105C920BC1B9700927A1E /* SkeletonClipping.cpp in Sources */, + 763105CA20BC1B9700927A1E /* SkeletonData.cpp in Sources */, + 763105CB20BC1B9700927A1E /* SkeletonJson.cpp in Sources */, + 763105CC20BC1B9700927A1E /* Skin.cpp in Sources */, + 763105CD20BC1B9700927A1E /* Slot.cpp in Sources */, + 763105CE20BC1B9700927A1E /* SlotData.cpp in Sources */, + 763105CF20BC1B9700927A1E /* SpineObject.cpp in Sources */, + 763105D020BC1B9700927A1E /* TextureLoader.cpp in Sources */, + 763105D120BC1B9700927A1E /* Timeline.cpp in Sources */, + 763105D220BC1B9700927A1E /* TransformConstraint.cpp in Sources */, + 763105D320BC1B9700927A1E /* TransformConstraintData.cpp in Sources */, + 763105D420BC1B9700927A1E /* TransformConstraintTimeline.cpp in Sources */, + 763105D520BC1B9700927A1E /* TranslateTimeline.cpp in Sources */, + 763105D620BC1B9700927A1E /* Triangulator.cpp in Sources */, + 763105D720BC1B9700927A1E /* TwoColorTimeline.cpp in Sources */, + 763105D820BC1B9700927A1E /* Updatable.cpp in Sources */, + 763105D920BC1B9700927A1E /* VertexAttachment.cpp in Sources */, + 763105DA20BC1B9700927A1E /* VertexEffect.cpp in Sources */, 76D1BFE12029E37700A0272D /* SkeletonRendererSeparatorExample.cpp in Sources */, - 76FB15111F0139B400C5377F /* VertexEffect.c in Sources */, 76D520E71EB3634600572471 /* CoinExample.cpp in Sources */, - 76D520E31EB3625B00572471 /* Array.c in Sources */, - 76D520DE1EB3619800572471 /* ClippingAttachment.c in Sources */, - 76D520DF1EB3619800572471 /* SkeletonClipping.c in Sources */, - 76D520E01EB3619800572471 /* Triangulator.c in Sources */, - 76FAC18F1E3F98A0001CCC8C /* Color.c in Sources */, - 76FAC1901E3F98A0001CCC8C /* PointAttachment.c in Sources */, - 76F28CD11DEC7FFA00CDE54D /* Animation.c in Sources */, - 76F28CD21DEC7FFA00CDE54D /* AnimationState.c in Sources */, - 76F28CD31DEC7FFA00CDE54D /* AnimationStateData.c in Sources */, - 76F28CD41DEC7FFA00CDE54D /* Atlas.c in Sources */, - 76F28CD51DEC7FFA00CDE54D /* AtlasAttachmentLoader.c in Sources */, - 76F28CD61DEC7FFA00CDE54D /* Attachment.c in Sources */, - 76F28CD71DEC7FFA00CDE54D /* AttachmentLoader.c in Sources */, - 76F28CD81DEC7FFA00CDE54D /* Bone.c in Sources */, - 76F28CD91DEC7FFA00CDE54D /* BoneData.c in Sources */, - 76F28CDA1DEC7FFA00CDE54D /* BoundingBoxAttachment.c in Sources */, - 76F28CDB1DEC7FFA00CDE54D /* Event.c in Sources */, - 76F28CDC1DEC7FFA00CDE54D /* EventData.c in Sources */, - 76F28CDD1DEC7FFA00CDE54D /* extension.c in Sources */, - 76F28CDE1DEC7FFA00CDE54D /* IkConstraint.c in Sources */, - 76F28CDF1DEC7FFA00CDE54D /* IkConstraintData.c in Sources */, - 76F28CE01DEC7FFA00CDE54D /* Json.c in Sources */, - 76F28CE11DEC7FFA00CDE54D /* Json.h in Sources */, - 76F28CE21DEC7FFA00CDE54D /* kvec.h in Sources */, - 76F28CE31DEC7FFA00CDE54D /* MeshAttachment.c in Sources */, - 76F28CE41DEC7FFA00CDE54D /* PathAttachment.c in Sources */, - 76F28CE51DEC7FFA00CDE54D /* PathConstraint.c in Sources */, - 76F28CE61DEC7FFA00CDE54D /* PathConstraintData.c in Sources */, - 76F28CE71DEC7FFA00CDE54D /* RegionAttachment.c in Sources */, - 76F28CE81DEC7FFA00CDE54D /* Skeleton.c in Sources */, - 76F28CE91DEC7FFA00CDE54D /* SkeletonBinary.c in Sources */, - 76F28CEA1DEC7FFA00CDE54D /* SkeletonBounds.c in Sources */, - 76F28CEB1DEC7FFA00CDE54D /* SkeletonData.c in Sources */, - 76F28CEC1DEC7FFA00CDE54D /* SkeletonJson.c in Sources */, - 76F28CED1DEC7FFA00CDE54D /* Skin.c in Sources */, - 76F28CEE1DEC7FFA00CDE54D /* Slot.c in Sources */, - 76F28CEF1DEC7FFA00CDE54D /* SlotData.c in Sources */, - 76F28CF01DEC7FFA00CDE54D /* TransformConstraint.c in Sources */, - 76F28CF11DEC7FFA00CDE54D /* TransformConstraintData.c in Sources */, - 76F28CF21DEC7FFA00CDE54D /* VertexAttachment.c in Sources */, 76F5BD561D2BD7EF005917E5 /* TankExample.cpp in Sources */, 76F5BD571D2BD7EF005917E5 /* TankExample.h in Sources */, 76AAA43B1D1811B000C54FCB /* AppDelegate.cpp in Sources */, @@ -882,9 +998,7 @@ 76AAA4471D1811B000C54FCB /* SpineboyExample.h in Sources */, 76AAA4121D18119F00C54FCB /* AttachmentVertices.cpp in Sources */, 76AAA4131D18119F00C54FCB /* AttachmentVertices.h in Sources */, - 76AAA4141D18119F00C54FCB /* Cocos2dAttachmentLoader.cpp in Sources */, 76A45BDF1E64396800745AA1 /* SkeletonTwoColorBatch.cpp in Sources */, - 76AAA4151D18119F00C54FCB /* Cocos2dAttachmentLoader.h in Sources */, 76AAA4161D18119F00C54FCB /* SkeletonAnimation.cpp in Sources */, 76AAA4171D18119F00C54FCB /* SkeletonAnimation.h in Sources */, 76AAA4181D18119F00C54FCB /* SkeletonBatch.cpp in Sources */, @@ -1051,7 +1165,7 @@ "$(SRCROOT)/../cocos2d/extensions", "$(SRCROOT)/../cocos2d/external", "$(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../spine-c/spine-c/include", + "$(SRCROOT)/../../../spine-cpp/spine-cpp/include", "$(SRCROOT)/../../src", ); IPHONEOS_DEPLOYMENT_TARGET = 6.0; @@ -1076,7 +1190,7 @@ "$(SRCROOT)/../cocos2d/extensions", "$(SRCROOT)/../cocos2d/external", "$(SRCROOT)/../cocos2d/external/chipmunk/include/chipmunk", - "$(SRCROOT)/../../../spine-c/spine-c/include", + "$(SRCROOT)/../../../spine-cpp/spine-cpp/include", "$(SRCROOT)/../../src", ); IPHONEOS_DEPLOYMENT_TARGET = 6.0; diff --git a/spine-cocos2dx/src/spine/Cocos2dAttachmentLoader.cpp b/spine-cocos2dx/src/spine/Cocos2dAttachmentLoader.cpp deleted file mode 100644 index 48df257ee..000000000 --- a/spine-cocos2dx/src/spine/Cocos2dAttachmentLoader.cpp +++ /dev/null @@ -1,107 +0,0 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#include -#include -#include - -USING_NS_CC; -using namespace spine; - -static unsigned short quadTriangles[6] = {0, 1, 2, 2, 3, 0}; - -spAttachment* _Cocos2dAttachmentLoader_createAttachment (spAttachmentLoader* loader, spSkin* skin, spAttachmentType type, - const char* name, const char* path) { - Cocos2dAttachmentLoader* self = SUB_CAST(Cocos2dAttachmentLoader, loader); - return spAttachmentLoader_createAttachment(SUPER(self->atlasAttachmentLoader), skin, type, name, path); -} - -void _Cocos2dAttachmentLoader_configureAttachment (spAttachmentLoader* loader, spAttachment* attachment) { - attachment->attachmentLoader = loader; - - switch (attachment->type) { - case SP_ATTACHMENT_REGION: { - spRegionAttachment* regionAttachment = SUB_CAST(spRegionAttachment, attachment); - spAtlasRegion* region = (spAtlasRegion*)regionAttachment->rendererObject; - AttachmentVertices* attachmentVertices = new AttachmentVertices((Texture2D*)region->page->rendererObject, 4, quadTriangles, 6); - V3F_C4B_T2F* vertices = attachmentVertices->_triangles->verts; - for (int i = 0, ii = 0; i < 4; ++i, ii += 2) { - vertices[i].texCoords.u = regionAttachment->uvs[ii]; - vertices[i].texCoords.v = regionAttachment->uvs[ii + 1]; - } - regionAttachment->rendererObject = attachmentVertices; - break; - } - case SP_ATTACHMENT_MESH: { - spMeshAttachment* meshAttachment = SUB_CAST(spMeshAttachment, attachment); - spAtlasRegion* region = (spAtlasRegion*)meshAttachment->rendererObject; - AttachmentVertices* attachmentVertices = new AttachmentVertices((Texture2D*)region->page->rendererObject, - meshAttachment->super.worldVerticesLength >> 1, meshAttachment->triangles, meshAttachment->trianglesCount); - V3F_C4B_T2F* vertices = attachmentVertices->_triangles->verts; - for (int i = 0, ii = 0, nn = meshAttachment->super.worldVerticesLength; ii < nn; ++i, ii += 2) { - vertices[i].texCoords.u = meshAttachment->uvs[ii]; - vertices[i].texCoords.v = meshAttachment->uvs[ii + 1]; - } - meshAttachment->rendererObject = attachmentVertices; - break; - } - default: ; - } -} - -void _Cocos2dAttachmentLoader_disposeAttachment (spAttachmentLoader* loader, spAttachment* attachment) { - switch (attachment->type) { - case SP_ATTACHMENT_REGION: { - spRegionAttachment* regionAttachment = SUB_CAST(spRegionAttachment, attachment); - delete (AttachmentVertices*)regionAttachment->rendererObject; - break; - } - case SP_ATTACHMENT_MESH: { - spMeshAttachment* meshAttachment = SUB_CAST(spMeshAttachment, attachment); - delete (AttachmentVertices*)meshAttachment->rendererObject; - break; - } - default: ; - } -} - -void _Cocos2dAttachmentLoader_dispose (spAttachmentLoader* loader) { - Cocos2dAttachmentLoader* self = SUB_CAST(Cocos2dAttachmentLoader, loader); - spAttachmentLoader_dispose(SUPER_CAST(spAttachmentLoader, self->atlasAttachmentLoader)); - _spAttachmentLoader_deinit(loader); -} - -Cocos2dAttachmentLoader* Cocos2dAttachmentLoader_create (spAtlas* atlas) { - Cocos2dAttachmentLoader* self = NEW(Cocos2dAttachmentLoader); - _spAttachmentLoader_init(SUPER(self), _Cocos2dAttachmentLoader_dispose, _Cocos2dAttachmentLoader_createAttachment, - _Cocos2dAttachmentLoader_configureAttachment, _Cocos2dAttachmentLoader_disposeAttachment); - self->atlasAttachmentLoader = spAtlasAttachmentLoader_create(atlas); - return self; -} diff --git a/spine-cocos2dx/src/spine/SkeletonAnimation.cpp b/spine-cocos2dx/src/spine/SkeletonAnimation.cpp index c3947d72b..2d9fcc743 100644 --- a/spine-cocos2dx/src/spine/SkeletonAnimation.cpp +++ b/spine-cocos2dx/src/spine/SkeletonAnimation.cpp @@ -30,7 +30,7 @@ #include #include -#include +#include #include USING_NS_CC; @@ -38,7 +38,7 @@ using std::min; using std::max; using std::vector; -namespace spine { +namespace spine { typedef struct _TrackEntryListeners { StartListener startListener; @@ -49,34 +49,34 @@ typedef struct _TrackEntryListeners { EventListener eventListener; } _TrackEntryListeners; -void animationCallback (spAnimationState* state, spEventType type, spTrackEntry* entry, spEvent* event) { - ((SkeletonAnimation*)state->rendererObject)->onAnimationStateEvent(entry, type, event); +void animationCallback (AnimationState* state, EventType type, TrackEntry* entry, Event* event) { + ((SkeletonAnimation*)state->getRendererObject())->onAnimationStateEvent(entry, type, event); } -void trackEntryCallback (spAnimationState* state, spEventType type, spTrackEntry* entry, spEvent* event) { - ((SkeletonAnimation*)state->rendererObject)->onTrackEntryEvent(entry, type, event); - if (type == SP_ANIMATION_DISPOSE) - if (entry->rendererObject) delete (spine::_TrackEntryListeners*)entry->rendererObject; +void trackEntryCallback (AnimationState* state, EventType type, TrackEntry* entry, Event* event) { + ((SkeletonAnimation*)state->getRendererObject())->onTrackEntryEvent(entry, type, event); + if (type == EventType_Dispose) + if (entry->getRendererObject()) delete (spine::_TrackEntryListeners*)entry->getRendererObject(); } -static _TrackEntryListeners* getListeners (spTrackEntry* entry) { - if (!entry->rendererObject) { - entry->rendererObject = new spine::_TrackEntryListeners(); - entry->listener = trackEntryCallback; +static _TrackEntryListeners* getListeners (TrackEntry* entry) { + if (!entry->getRendererObject()) { + entry->setRendererObject(new spine::_TrackEntryListeners()); + entry->setListener(trackEntryCallback); } - return (_TrackEntryListeners*)entry->rendererObject; + return (_TrackEntryListeners*)entry->getRendererObject(); } // -SkeletonAnimation* SkeletonAnimation::createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData) { +SkeletonAnimation* SkeletonAnimation::createWithData (SkeletonData* skeletonData, bool ownsSkeletonData) { SkeletonAnimation* node = new SkeletonAnimation(); node->initWithData(skeletonData, ownsSkeletonData); node->autorelease(); return node; } -SkeletonAnimation* SkeletonAnimation::createWithJsonFile (const std::string& skeletonJsonFile, spAtlas* atlas, float scale) { +SkeletonAnimation* SkeletonAnimation::createWithJsonFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale) { SkeletonAnimation* node = new SkeletonAnimation(); node->initWithJsonFile(skeletonJsonFile, atlas, scale); node->autorelease(); @@ -85,13 +85,12 @@ SkeletonAnimation* SkeletonAnimation::createWithJsonFile (const std::string& ske SkeletonAnimation* SkeletonAnimation::createWithJsonFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale) { SkeletonAnimation* node = new SkeletonAnimation(); - spAtlas* atlas = spAtlas_createFromFile(atlasFile.c_str(), 0); - node->initWithJsonFile(skeletonJsonFile, atlas, scale); + node->initWithJsonFile(skeletonJsonFile, atlasFile, scale); node->autorelease(); return node; } -SkeletonAnimation* SkeletonAnimation::createWithBinaryFile (const std::string& skeletonBinaryFile, spAtlas* atlas, float scale) { +SkeletonAnimation* SkeletonAnimation::createWithBinaryFile (const std::string& skeletonBinaryFile, Atlas* atlas, float scale) { SkeletonAnimation* node = new SkeletonAnimation(); node->initWithBinaryFile(skeletonBinaryFile, atlas, scale); node->autorelease(); @@ -100,8 +99,7 @@ SkeletonAnimation* SkeletonAnimation::createWithBinaryFile (const std::string& s SkeletonAnimation* SkeletonAnimation::createWithBinaryFile (const std::string& skeletonBinaryFile, const std::string& atlasFile, float scale) { SkeletonAnimation* node = new SkeletonAnimation(); - spAtlas* atlas = spAtlas_createFromFile(atlasFile.c_str(), 0); - node->initWithBinaryFile(skeletonBinaryFile, atlas, scale); + node->initWithBinaryFile(skeletonBinaryFile, atlasFile, scale); node->autorelease(); return node; } @@ -111,11 +109,9 @@ void SkeletonAnimation::initialize () { super::initialize(); _ownsAnimationStateData = true; - _state = spAnimationState_create(spAnimationStateData_create(_skeleton->data)); - _state->rendererObject = this; - _state->listener = animationCallback; - - _spAnimationState* stateInternal = (_spAnimationState*)_state; + _state = new (__FILE__, __LINE__) AnimationState(new (__FILE__, __LINE__) AnimationStateData(_skeleton->getData())); + _state->setRendererObject(this); + _state->setListener(animationCallback); } SkeletonAnimation::SkeletonAnimation () @@ -123,124 +119,124 @@ SkeletonAnimation::SkeletonAnimation () } SkeletonAnimation::~SkeletonAnimation () { - if (_ownsAnimationStateData) spAnimationStateData_dispose(_state->data); - spAnimationState_dispose(_state); + if (_ownsAnimationStateData) delete _state->getData(); + delete _state; } void SkeletonAnimation::update (float deltaTime) { super::update(deltaTime); - deltaTime *= _timeScale; - spAnimationState_update(_state, deltaTime); - spAnimationState_apply(_state, _skeleton); - spSkeleton_updateWorldTransform(_skeleton); + deltaTime *= _timeScale; + _state->update(deltaTime); + _state->apply(*_skeleton); + _skeleton->updateWorldTransform(); } -void SkeletonAnimation::setAnimationStateData (spAnimationStateData* stateData) { +void SkeletonAnimation::setAnimationStateData (AnimationStateData* stateData) { CCASSERT(stateData, "stateData cannot be null."); - if (_ownsAnimationStateData) spAnimationStateData_dispose(_state->data); - spAnimationState_dispose(_state); + if (_ownsAnimationStateData) delete _state->getData(); + delete _state; _ownsAnimationStateData = false; - _state = spAnimationState_create(stateData); - _state->rendererObject = this; - _state->listener = animationCallback; + _state = new (__FILE__, __LINE__) AnimationState(stateData); + _state->setRendererObject(this); + _state->setListener(animationCallback); } void SkeletonAnimation::setMix (const std::string& fromAnimation, const std::string& toAnimation, float duration) { - spAnimationStateData_setMixByName(_state->data, fromAnimation.c_str(), toAnimation.c_str(), duration); + _state->getData()->setMix(fromAnimation.c_str(), toAnimation.c_str(), duration); } -spTrackEntry* SkeletonAnimation::setAnimation (int trackIndex, const std::string& name, bool loop) { - spAnimation* animation = spSkeletonData_findAnimation(_skeleton->data, name.c_str()); +TrackEntry* SkeletonAnimation::setAnimation (int trackIndex, const std::string& name, bool loop) { + Animation* animation = _skeleton->getData()->findAnimation(name.c_str()); if (!animation) { log("Spine: Animation not found: %s", name.c_str()); return 0; } - return spAnimationState_setAnimation(_state, trackIndex, animation, loop); + return _state->setAnimation(trackIndex, animation, loop); } -spTrackEntry* SkeletonAnimation::addAnimation (int trackIndex, const std::string& name, bool loop, float delay) { - spAnimation* animation = spSkeletonData_findAnimation(_skeleton->data, name.c_str()); +TrackEntry* SkeletonAnimation::addAnimation (int trackIndex, const std::string& name, bool loop, float delay) { + Animation* animation = _skeleton->getData()->findAnimation(name.c_str()); if (!animation) { log("Spine: Animation not found: %s", name.c_str()); return 0; } - return spAnimationState_addAnimation(_state, trackIndex, animation, loop, delay); + return _state->addAnimation(trackIndex, animation, loop, delay); } -spTrackEntry* SkeletonAnimation::setEmptyAnimation (int trackIndex, float mixDuration) { - return spAnimationState_setEmptyAnimation(_state, trackIndex, mixDuration); +TrackEntry* SkeletonAnimation::setEmptyAnimation (int trackIndex, float mixDuration) { + return _state->setEmptyAnimation(trackIndex, mixDuration); } void SkeletonAnimation::setEmptyAnimations (float mixDuration) { - spAnimationState_setEmptyAnimations(_state, mixDuration); + _state->setEmptyAnimations(mixDuration); } -spTrackEntry* SkeletonAnimation::addEmptyAnimation (int trackIndex, float mixDuration, float delay) { - return spAnimationState_addEmptyAnimation(_state, trackIndex, mixDuration, delay); +TrackEntry* SkeletonAnimation::addEmptyAnimation (int trackIndex, float mixDuration, float delay) { + return _state->addEmptyAnimation(trackIndex, mixDuration, delay); } -spAnimation* SkeletonAnimation::findAnimation(const std::string& name) const { - return spSkeletonData_findAnimation(_skeleton->data, name.c_str()); +Animation* SkeletonAnimation::findAnimation(const std::string& name) const { + return _skeleton->getData()->findAnimation(name.c_str()); } -spTrackEntry* SkeletonAnimation::getCurrent (int trackIndex) { - return spAnimationState_getCurrent(_state, trackIndex); +TrackEntry* SkeletonAnimation::getCurrent (int trackIndex) { + return _state->getCurrent(trackIndex); } void SkeletonAnimation::clearTracks () { - spAnimationState_clearTracks(_state); + _state->clearTracks(); } void SkeletonAnimation::clearTrack (int trackIndex) { - spAnimationState_clearTrack(_state, trackIndex); + _state->clearTrack(trackIndex); } -void SkeletonAnimation::onAnimationStateEvent (spTrackEntry* entry, spEventType type, spEvent* event) { +void SkeletonAnimation::onAnimationStateEvent (TrackEntry* entry, EventType type, Event* event) { switch (type) { - case SP_ANIMATION_START: + case EventType_Start: if (_startListener) _startListener(entry); break; - case SP_ANIMATION_INTERRUPT: + case EventType_Interrupt: if (_interruptListener) _interruptListener(entry); break; - case SP_ANIMATION_END: + case EventType_End: if (_endListener) _endListener(entry); break; - case SP_ANIMATION_DISPOSE: + case EventType_Dispose: if (_disposeListener) _disposeListener(entry); break; - case SP_ANIMATION_COMPLETE: + case EventType_Complete: if (_completeListener) _completeListener(entry); break; - case SP_ANIMATION_EVENT: + case EventType_Event: if (_eventListener) _eventListener(entry, event); break; } } -void SkeletonAnimation::onTrackEntryEvent (spTrackEntry* entry, spEventType type, spEvent* event) { - if (!entry->rendererObject) return; - _TrackEntryListeners* listeners = (_TrackEntryListeners*)entry->rendererObject; +void SkeletonAnimation::onTrackEntryEvent (TrackEntry* entry, EventType type, Event* event) { + if (!entry->getRendererObject()) return; + _TrackEntryListeners* listeners = (_TrackEntryListeners*)entry->getRendererObject(); switch (type) { - case SP_ANIMATION_START: + case EventType_Start: if (listeners->startListener) listeners->startListener(entry); break; - case SP_ANIMATION_INTERRUPT: + case EventType_Interrupt: if (listeners->interruptListener) listeners->interruptListener(entry); break; - case SP_ANIMATION_END: + case EventType_End: if (listeners->endListener) listeners->endListener(entry); break; - case SP_ANIMATION_DISPOSE: + case EventType_Dispose: if (listeners->disposeListener) listeners->disposeListener(entry); break; - case SP_ANIMATION_COMPLETE: + case EventType_Complete: if (listeners->completeListener) listeners->completeListener(entry); break; - case SP_ANIMATION_EVENT: + case EventType_Event: if (listeners->eventListener) listeners->eventListener(entry, event); break; } @@ -270,31 +266,31 @@ void SkeletonAnimation::setEventListener (const EventListener& listener) { _eventListener = listener; } -void SkeletonAnimation::setTrackStartListener (spTrackEntry* entry, const StartListener& listener) { +void SkeletonAnimation::setTrackStartListener (TrackEntry* entry, const StartListener& listener) { getListeners(entry)->startListener = listener; } -void SkeletonAnimation::setTrackInterruptListener (spTrackEntry* entry, const InterruptListener& listener) { +void SkeletonAnimation::setTrackInterruptListener (TrackEntry* entry, const InterruptListener& listener) { getListeners(entry)->interruptListener = listener; } -void SkeletonAnimation::setTrackEndListener (spTrackEntry* entry, const EndListener& listener) { +void SkeletonAnimation::setTrackEndListener (TrackEntry* entry, const EndListener& listener) { getListeners(entry)->endListener = listener; } -void SkeletonAnimation::setTrackDisposeListener (spTrackEntry* entry, const DisposeListener& listener) { +void SkeletonAnimation::setTrackDisposeListener (TrackEntry* entry, const DisposeListener& listener) { getListeners(entry)->disposeListener = listener; } -void SkeletonAnimation::setTrackCompleteListener (spTrackEntry* entry, const CompleteListener& listener) { +void SkeletonAnimation::setTrackCompleteListener (TrackEntry* entry, const CompleteListener& listener) { getListeners(entry)->completeListener = listener; } -void SkeletonAnimation::setTrackEventListener (spTrackEntry* entry, const EventListener& listener) { +void SkeletonAnimation::setTrackEventListener (TrackEntry* entry, const EventListener& listener) { getListeners(entry)->eventListener = listener; } -spAnimationState* SkeletonAnimation::getState() const { +AnimationState* SkeletonAnimation::getState() const { return _state; } diff --git a/spine-cocos2dx/src/spine/SkeletonAnimation.h b/spine-cocos2dx/src/spine/SkeletonAnimation.h index d6521d63d..17fb8e24f 100644 --- a/spine-cocos2dx/src/spine/SkeletonAnimation.h +++ b/spine-cocos2dx/src/spine/SkeletonAnimation.h @@ -37,26 +37,26 @@ namespace spine { -typedef std::function StartListener; -typedef std::function InterruptListener; -typedef std::function EndListener; -typedef std::function DisposeListener; -typedef std::function CompleteListener; -typedef std::function EventListener; +typedef std::function StartListener; +typedef std::function InterruptListener; +typedef std::function EndListener; +typedef std::function DisposeListener; +typedef std::function CompleteListener; +typedef std::function EventListener; /** Draws an animated skeleton, providing an AnimationState for applying one or more animations and queuing animations to be * played later. */ class SkeletonAnimation: public SkeletonRenderer { public: CREATE_FUNC(SkeletonAnimation); - static SkeletonAnimation* createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData = false); - static SkeletonAnimation* createWithJsonFile (const std::string& skeletonJsonFile, spAtlas* atlas, float scale = 1); + static SkeletonAnimation* createWithData (SkeletonData* skeletonData, bool ownsSkeletonData = false); + static SkeletonAnimation* createWithJsonFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1); static SkeletonAnimation* createWithJsonFile (const std::string& skeletonJsonFile, const std::string& atlasFile, float scale = 1); - static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, spAtlas* atlas, float scale = 1); + static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, Atlas* atlas, float scale = 1); static SkeletonAnimation* createWithBinaryFile (const std::string& skeletonBinaryFile, const std::string& atlasFile, float scale = 1); // Use createWithJsonFile instead - CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, spAtlas* atlas, float scale = 1) + CC_DEPRECATED_ATTRIBUTE static SkeletonAnimation* createWithFile (const std::string& skeletonJsonFile, Atlas* atlas, float scale = 1) { return SkeletonAnimation::createWithJsonFile(skeletonJsonFile, atlas, scale); } @@ -68,16 +68,16 @@ public: virtual void update (float deltaTime) override; - void setAnimationStateData (spAnimationStateData* stateData); + void setAnimationStateData (AnimationStateData* stateData); void setMix (const std::string& fromAnimation, const std::string& toAnimation, float duration); - spTrackEntry* setAnimation (int trackIndex, const std::string& name, bool loop); - spTrackEntry* addAnimation (int trackIndex, const std::string& name, bool loop, float delay = 0); - spTrackEntry* setEmptyAnimation (int trackIndex, float mixDuration); + TrackEntry* setAnimation (int trackIndex, const std::string& name, bool loop); + TrackEntry* addAnimation (int trackIndex, const std::string& name, bool loop, float delay = 0); + TrackEntry* setEmptyAnimation (int trackIndex, float mixDuration); void setEmptyAnimations (float mixDuration); - spTrackEntry* addEmptyAnimation (int trackIndex, float mixDuration, float delay = 0); - spAnimation* findAnimation(const std::string& name) const; - spTrackEntry* getCurrent (int trackIndex = 0); + TrackEntry* addEmptyAnimation (int trackIndex, float mixDuration, float delay = 0); + Animation* findAnimation(const std::string& name) const; + TrackEntry* getCurrent (int trackIndex = 0); void clearTracks (); void clearTrack (int trackIndex = 0); @@ -88,17 +88,17 @@ public: void setCompleteListener (const CompleteListener& listener); void setEventListener (const EventListener& listener); - void setTrackStartListener (spTrackEntry* entry, const StartListener& listener); - void setTrackInterruptListener (spTrackEntry* entry, const InterruptListener& listener); - void setTrackEndListener (spTrackEntry* entry, const EndListener& listener); - void setTrackDisposeListener (spTrackEntry* entry, const DisposeListener& listener); - void setTrackCompleteListener (spTrackEntry* entry, const CompleteListener& listener); - void setTrackEventListener (spTrackEntry* entry, const EventListener& listener); + void setTrackStartListener (TrackEntry* entry, const StartListener& listener); + void setTrackInterruptListener (TrackEntry* entry, const InterruptListener& listener); + void setTrackEndListener (TrackEntry* entry, const EndListener& listener); + void setTrackDisposeListener (TrackEntry* entry, const DisposeListener& listener); + void setTrackCompleteListener (TrackEntry* entry, const CompleteListener& listener); + void setTrackEventListener (TrackEntry* entry, const EventListener& listener); - virtual void onAnimationStateEvent (spTrackEntry* entry, spEventType type, spEvent* event); - virtual void onTrackEntryEvent (spTrackEntry* entry, spEventType type, spEvent* event); + virtual void onAnimationStateEvent (TrackEntry* entry, EventType type, Event* event); + virtual void onTrackEntryEvent (TrackEntry* entry, EventType type, Event* event); - spAnimationState* getState() const; + AnimationState* getState() const; CC_CONSTRUCTOR_ACCESS: SkeletonAnimation (); @@ -106,7 +106,7 @@ CC_CONSTRUCTOR_ACCESS: virtual void initialize () override; protected: - spAnimationState* _state; + AnimationState* _state; bool _ownsAnimationStateData; diff --git a/spine-cocos2dx/src/spine/SkeletonBatch.cpp b/spine-cocos2dx/src/spine/SkeletonBatch.cpp index 67abc7467..2a6b1231b 100644 --- a/spine-cocos2dx/src/spine/SkeletonBatch.cpp +++ b/spine-cocos2dx/src/spine/SkeletonBatch.cpp @@ -29,7 +29,7 @@ *****************************************************************************/ #include -#include +#include #include USING_NS_CC; @@ -58,8 +58,6 @@ SkeletonBatch::SkeletonBatch () { _commandsPool.push_back(new TrianglesCommand()); } - _indices = spUnsignedShortArray_create(8); - reset (); // callback after drawing is finished so we can clear out the batch state @@ -71,8 +69,6 @@ SkeletonBatch::SkeletonBatch () { SkeletonBatch::~SkeletonBatch () { Director::getInstance()->getEventDispatcher()->removeCustomEventListeners(EVENT_AFTER_DRAW_RESET_POSITION); - - spUnsignedShortArray_dispose(_indices); for (unsigned int i = 0; i < _commandsPool.size(); i++) { delete _commandsPool[i]; @@ -107,11 +103,11 @@ void SkeletonBatch::deallocateVertices(uint32_t numVertices) { unsigned short* SkeletonBatch::allocateIndices(uint32_t numIndices) { - if (_indices->capacity - _indices->size < numIndices) { - unsigned short* oldData = _indices->items; - int oldSize = _indices->size; - spUnsignedShortArray_ensureCapacity(_indices, _indices->size + numIndices); - unsigned short* newData = _indices->items; + if (_indices.getCapacity() - _indices.size() < numIndices) { + unsigned short* oldData = _indices.buffer(); + int oldSize = _indices.size(); + _indices.setSize(_indices.size() + numIndices, 0); + unsigned short* newData = _indices.buffer(); for (uint32_t i = 0; i < this->_nextFreeCommand; i++) { TrianglesCommand* command = _commandsPool[i]; cocos2d::TrianglesCommand::Triangles& triangles = (cocos2d::TrianglesCommand::Triangles&)command->getTriangles(); @@ -121,13 +117,12 @@ unsigned short* SkeletonBatch::allocateIndices(uint32_t numIndices) { } } - unsigned short* indices = _indices->items + _indices->size; - _indices->size += numIndices; + unsigned short* indices = _indices.buffer() + _indices.size() - numIndices; return indices; } void SkeletonBatch::deallocateIndices(uint32_t numIndices) { - _indices->size -= numIndices; + _indices.setSize(_indices.size() - numIndices, 0); } @@ -141,7 +136,7 @@ cocos2d::TrianglesCommand* SkeletonBatch::addCommand(cocos2d::Renderer* renderer void SkeletonBatch::reset() { _nextFreeCommand = 0; _numVertices = 0; - _indices->size = 0; + _indices.setSize(0, 0); } cocos2d::TrianglesCommand* SkeletonBatch::nextFreeCommand() { diff --git a/spine-cocos2dx/src/spine/SkeletonBatch.h b/spine-cocos2dx/src/spine/SkeletonBatch.h index a70623f6e..f5c5e8693 100644 --- a/spine-cocos2dx/src/spine/SkeletonBatch.h +++ b/spine-cocos2dx/src/spine/SkeletonBatch.h @@ -68,7 +68,7 @@ namespace spine { uint32_t _numVertices; // pool of indices - spUnsignedShortArray* _indices; + Vector _indices; }; } diff --git a/spine-cocos2dx/src/spine/SkeletonRenderer.cpp b/spine-cocos2dx/src/spine/SkeletonRenderer.cpp index 8fac0f5ed..158431027 100644 --- a/spine-cocos2dx/src/spine/SkeletonRenderer.cpp +++ b/spine-cocos2dx/src/spine/SkeletonRenderer.cpp @@ -28,12 +28,12 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ +#include #include -#include +#include #include #include #include -#include #include #define INITIAL_WORLD_VERTICES_LENGTH 1000 @@ -56,6 +56,8 @@ using std::min; using std::max; namespace spine { + +static Cocos2dTextureLoader textureLoader; void SkeletonRenderer::destroyScratchBuffers() { if (worldVertices) { @@ -65,19 +67,19 @@ void SkeletonRenderer::destroyScratchBuffers() { } } -SkeletonRenderer* SkeletonRenderer::createWithSkeleton(spSkeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData) { +SkeletonRenderer* SkeletonRenderer::createWithSkeleton(Skeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData) { SkeletonRenderer* node = new SkeletonRenderer(skeleton, ownsSkeleton, ownsSkeletonData); node->autorelease(); return node; } -SkeletonRenderer* SkeletonRenderer::createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData) { +SkeletonRenderer* SkeletonRenderer::createWithData (SkeletonData* skeletonData, bool ownsSkeletonData) { SkeletonRenderer* node = new SkeletonRenderer(skeletonData, ownsSkeletonData); node->autorelease(); return node; } -SkeletonRenderer* SkeletonRenderer::createWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) { +SkeletonRenderer* SkeletonRenderer::createWithFile (const std::string& skeletonDataFile, Atlas* atlas, float scale) { SkeletonRenderer* node = new SkeletonRenderer(skeletonDataFile, atlas, scale); node->autorelease(); return node; @@ -95,15 +97,15 @@ void SkeletonRenderer::initialize () { worldVerticesLength = INITIAL_WORLD_VERTICES_LENGTH; } - _clipper = spSkeletonClipping_create(); + _clipper = new (__FILE__, __LINE__) SkeletonClipping(); _blendFunc = BlendFunc::ALPHA_PREMULTIPLIED; setOpacityModifyRGB(true); setupGLProgramState(false); - spSkeleton_setToSetupPose(_skeleton); - spSkeleton_updateWorldTransform(_skeleton); + _skeleton->setToSetupPose(); + _skeleton->updateWorldTransform(); } void SkeletonRenderer::setupGLProgramState (bool twoColorTintEnabled) { @@ -113,22 +115,17 @@ void SkeletonRenderer::setupGLProgramState (bool twoColorTintEnabled) { } Texture2D *texture = nullptr; - for (int i = 0, n = _skeleton->slotsCount; i < n; i++) { - spSlot* slot = _skeleton->drawOrder[i]; - if (!slot->attachment) continue; - switch (slot->attachment->type) { - case SP_ATTACHMENT_REGION: { - spRegionAttachment* attachment = (spRegionAttachment*)slot->attachment; - texture = static_cast(attachment->rendererObject)->_texture; - break; - } - case SP_ATTACHMENT_MESH: { - spMeshAttachment* attachment = (spMeshAttachment*)slot->attachment; - texture = static_cast(attachment->rendererObject)->_texture; - break; - } - default: - continue; + for (int i = 0, n = _skeleton->getSlots().size(); i < n; i++) { + Slot* slot = _skeleton->getDrawOrder()[i]; + if (!slot->getAttachment()) continue; + if (slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) { + RegionAttachment* attachment = (RegionAttachment*)slot->getAttachment(); + texture = static_cast(attachment->getRendererObject())->_texture; + } else if (slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) { + MeshAttachment* attachment = (MeshAttachment*)slot->getAttachment(); + texture = static_cast(attachment->getRendererObject())->_texture; + } else { + continue; } if (texture != nullptr) { @@ -138,8 +135,8 @@ void SkeletonRenderer::setupGLProgramState (bool twoColorTintEnabled) { setGLProgramState(GLProgramState::getOrCreateWithGLProgramName(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP, texture)); } -void SkeletonRenderer::setSkeletonData (spSkeletonData *skeletonData, bool ownsSkeletonData) { - _skeleton = spSkeleton_create(skeletonData); +void SkeletonRenderer::setSkeletonData (SkeletonData *skeletonData, bool ownsSkeletonData) { + _skeleton = new (__FILE__, __LINE__) Skeleton(skeletonData); _ownsSkeletonData = ownsSkeletonData; } @@ -147,17 +144,17 @@ SkeletonRenderer::SkeletonRenderer () : _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _timeScale(1), _effect(nullptr), _startSlotIndex(-1), _endSlotIndex(-1) { } -SkeletonRenderer::SkeletonRenderer(spSkeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData) +SkeletonRenderer::SkeletonRenderer(Skeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData, bool ownsAtlas) : _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _timeScale(1), _effect(nullptr), _startSlotIndex(-1), _endSlotIndex(-1) { - initWithSkeleton(skeleton, ownsSkeleton, ownsSkeletonData); + initWithSkeleton(skeleton, ownsSkeleton, ownsSkeletonData, ownsAtlas); } -SkeletonRenderer::SkeletonRenderer (spSkeletonData *skeletonData, bool ownsSkeletonData) +SkeletonRenderer::SkeletonRenderer (SkeletonData *skeletonData, bool ownsSkeletonData) : _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _timeScale(1), _effect(nullptr), _startSlotIndex(-1), _endSlotIndex(-1) { initWithData(skeletonData, ownsSkeletonData); } -SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, spAtlas* atlas, float scale) +SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, Atlas* atlas, float scale) : _atlas(nullptr), _attachmentLoader(nullptr), _debugSlots(false), _debugBones(false), _debugMeshes(false), _timeScale(1), _effect(nullptr), _startSlotIndex(-1), _endSlotIndex(-1) { initWithJsonFile(skeletonDataFile, atlas, scale); } @@ -168,36 +165,37 @@ SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, const s } SkeletonRenderer::~SkeletonRenderer () { - if (_ownsSkeletonData) spSkeletonData_dispose(_skeleton->data); - if (_ownsSkeleton) spSkeleton_dispose(_skeleton); - if (_atlas) spAtlas_dispose(_atlas); - if (_attachmentLoader) spAttachmentLoader_dispose(_attachmentLoader); - spSkeletonClipping_dispose(_clipper); + if (_ownsSkeletonData) delete _skeleton->getData(); + if (_ownsSkeleton) delete _skeleton; + if (_ownsAtlas && _atlas) delete _atlas; + if (_attachmentLoader) delete _attachmentLoader; + delete _clipper; } -void SkeletonRenderer::initWithSkeleton(spSkeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData) { +void SkeletonRenderer::initWithSkeleton(Skeleton* skeleton, bool ownsSkeleton, bool ownsSkeletonData, bool ownsAtlas) { _skeleton = skeleton; _ownsSkeleton = ownsSkeleton; _ownsSkeletonData = ownsSkeletonData; + _ownsAtlas = ownsAtlas; initialize(); } -void SkeletonRenderer::initWithData (spSkeletonData* skeletonData, bool ownsSkeletonData) { +void SkeletonRenderer::initWithData (SkeletonData* skeletonData, bool ownsSkeletonData) { _ownsSkeleton = true; setSkeletonData(skeletonData, ownsSkeletonData); initialize(); } -void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) { +void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, Atlas* atlas, float scale) { _atlas = atlas; - _attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas)); + _attachmentLoader = new (__FILE__, __LINE__) AtlasAttachmentLoader(_atlas); - spSkeletonJson* json = spSkeletonJson_createWithLoader(_attachmentLoader); - json->scale = scale; - spSkeletonData* skeletonData = spSkeletonJson_readSkeletonDataFile(json, skeletonDataFile.c_str()); - CCASSERT(skeletonData, json->error ? json->error : "Error reading skeleton data."); - spSkeletonJson_dispose(json); + SkeletonJson* json = new (__FILE__, __LINE__) SkeletonJson(_attachmentLoader); + json->setScale(scale); + SkeletonData* skeletonData = json->readSkeletonDataFile(skeletonDataFile.c_str()); + CCASSERT(skeletonData, !json->getError().isEmpty() ? json->getError().buffer() : "Error reading skeleton data."); + delete json; _ownsSkeleton = true; setSkeletonData(skeletonData, true); @@ -206,32 +204,33 @@ void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, sp } void SkeletonRenderer::initWithJsonFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) { - _atlas = spAtlas_createFromFile(atlasFile.c_str(), 0); + _atlas = new (__FILE__, __LINE__) Atlas(atlasFile.c_str(), &textureLoader); CCASSERT(_atlas, "Error reading atlas file."); - _attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas)); + _attachmentLoader = new (__FILE__, __LINE__) AtlasAttachmentLoader(_atlas); - spSkeletonJson* json = spSkeletonJson_createWithLoader(_attachmentLoader); - json->scale = scale; - spSkeletonData* skeletonData = spSkeletonJson_readSkeletonDataFile(json, skeletonDataFile.c_str()); - CCASSERT(skeletonData, json->error ? json->error : "Error reading skeleton data file."); - spSkeletonJson_dispose(json); + SkeletonJson* json = new (__FILE__, __LINE__) SkeletonJson(_attachmentLoader); + json->setScale(scale); + SkeletonData* skeletonData = json->readSkeletonDataFile(skeletonDataFile.c_str()); + CCASSERT(skeletonData, !json->getError().isEmpty() ? json->getError().buffer() : "Error reading skeleton data."); + delete json; _ownsSkeleton = true; + _ownsAtlas = true; setSkeletonData(skeletonData, true); initialize(); } -void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) { +void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, Atlas* atlas, float scale) { _atlas = atlas; - _attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas)); + _attachmentLoader = new (__FILE__, __LINE__) AtlasAttachmentLoader(_atlas); - spSkeletonBinary* binary = spSkeletonBinary_createWithLoader(_attachmentLoader); - binary->scale = scale; - spSkeletonData* skeletonData = spSkeletonBinary_readSkeletonDataFile(binary, skeletonDataFile.c_str()); - CCASSERT(skeletonData, binary->error ? binary->error : "Error reading skeleton data file."); - spSkeletonBinary_dispose(binary); + SkeletonBinary* binary = new (__FILE__, __LINE__) SkeletonBinary(_attachmentLoader); + binary->setScale(scale); + SkeletonData* skeletonData = binary->readSkeletonDataFile(skeletonDataFile.c_str()); + CCASSERT(skeletonData, !binary->getError().isEmpty() ? binary->getError().buffer() : "Error reading skeleton data."); + delete binary; _ownsSkeleton = true; setSkeletonData(skeletonData, true); @@ -239,34 +238,65 @@ void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, } void SkeletonRenderer::initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) { - _atlas = spAtlas_createFromFile(atlasFile.c_str(), 0); + _atlas = new (__FILE__, __LINE__) Atlas(atlasFile.c_str(), &textureLoader); CCASSERT(_atlas, "Error reading atlas file."); - _attachmentLoader = SUPER(Cocos2dAttachmentLoader_create(_atlas)); - - spSkeletonBinary* binary = spSkeletonBinary_createWithLoader(_attachmentLoader); - binary->scale = scale; - spSkeletonData* skeletonData = spSkeletonBinary_readSkeletonDataFile(binary, skeletonDataFile.c_str()); - CCASSERT(skeletonData, binary->error ? binary->error : "Error reading skeleton data file."); - spSkeletonBinary_dispose(binary); - _ownsSkeleton = true; + _attachmentLoader = new (__FILE__, __LINE__) AtlasAttachmentLoader(_atlas); + + SkeletonBinary* binary = new (__FILE__, __LINE__) SkeletonBinary(_attachmentLoader); + binary->setScale(scale); + SkeletonData* skeletonData = binary->readSkeletonDataFile(skeletonDataFile.c_str()); + CCASSERT(skeletonData, !binary->getError().isEmpty() ? binary->getError().buffer() : "Error reading skeleton data."); + delete binary; + _ownsSkeleton = true; + _ownsAtlas = true; setSkeletonData(skeletonData, true); initialize(); } - void SkeletonRenderer::update (float deltaTime) { Node::update(deltaTime); - if (_ownsSkeleton) spSkeleton_update(_skeleton, deltaTime * _timeScale); + if (_ownsSkeleton) _skeleton->update(deltaTime * _timeScale); +} + +static void deleteAttachmentVertices (void* vertices) { + delete (AttachmentVertices *) vertices; +} + +static unsigned short quadTriangles[6] = {0, 1, 2, 2, 3, 0}; + +static void setAttachmentVertices(RegionAttachment* attachment) { + if (!attachment->getRendererObject()) { + AtlasRegion* region = (AtlasRegion*)attachment->getRendererObject(); + AttachmentVertices* attachmentVertices = new AttachmentVertices((Texture2D*)region->page->getRendererObject(), 4, quadTriangles, 6); + V3F_C4B_T2F* vertices = attachmentVertices->_triangles->verts; + for (int i = 0, ii = 0; i < 4; ++i, ii += 2) { + vertices[i].texCoords.u = attachment->getUVs()[ii]; + vertices[i].texCoords.v = attachment->getUVs()[ii + 1]; + } + attachment->setRendererObject(attachmentVertices, deleteAttachmentVertices); + } } +static void setAttachmentVertices(MeshAttachment* attachment) { + AtlasRegion* region = (AtlasRegion*)attachment->getRendererObject(); + AttachmentVertices* attachmentVertices = new AttachmentVertices((Texture2D*)region->page->getRendererObject(), + attachment->getWorldVerticesLength() >> 1, attachment->getTriangles().buffer(), attachment->getTriangles().size()); + V3F_C4B_T2F* vertices = attachmentVertices->_triangles->verts; + for (int i = 0, ii = 0, nn = attachment->getWorldVerticesLength(); ii < nn; ++i, ii += 2) { + vertices[i].texCoords.u = attachment->getUVs()[ii]; + vertices[i].texCoords.v = attachment->getUVs()[ii + 1]; + } + attachment->setRendererObject(attachmentVertices, deleteAttachmentVertices); +} + void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t transformFlags) { SkeletonBatch* batch = SkeletonBatch::getInstance(); SkeletonTwoColorBatch* twoColorBatch = SkeletonTwoColorBatch::getInstance(); bool isTwoColorTint = this->isTwoColorTint(); - if (_effect) _effect->begin(_effect, _skeleton); + if (_effect) _effect->begin(*_skeleton); Color4F nodeColor; nodeColor.r = getDisplayedColor().r / (float)255; @@ -280,34 +310,34 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t AttachmentVertices* attachmentVertices = nullptr; TwoColorTrianglesCommand* lastTwoColorTrianglesCommand = nullptr; bool inRange = _startSlotIndex != -1 || _endSlotIndex != -1 ? false : true; - for (int i = 0, n = _skeleton->slotsCount; i < n; ++i) { - spSlot* slot = _skeleton->drawOrder[i]; + for (int i = 0, n = _skeleton->getSlots().size(); i < n; ++i) { + Slot* slot = _skeleton->getDrawOrder()[i]; - if (_startSlotIndex >= 0 && _startSlotIndex == slot->data->index) { + if (_startSlotIndex >= 0 && _startSlotIndex == slot->getData().getIndex()) { inRange = true; } if (!inRange) { - spSkeletonClipping_clipEnd(_clipper, slot); + _clipper->clipEnd(*slot); continue; } - if (_endSlotIndex >= 0 && _endSlotIndex == slot->data->index) { + if (_endSlotIndex >= 0 && _endSlotIndex == slot->getData().getIndex()) { inRange = false; } - if (!slot->attachment) { - spSkeletonClipping_clipEnd(_clipper, slot); + if (!slot->getAttachment()) { + _clipper->clipEnd(*slot); continue; } cocos2d::TrianglesCommand::Triangles triangles; TwoColorTriangles trianglesTwoColor; - switch (slot->attachment->type) { - case SP_ATTACHMENT_REGION: { - spRegionAttachment* attachment = (spRegionAttachment*)slot->attachment; - attachmentVertices = getAttachmentVertices(attachment); + if (slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) { + RegionAttachment* attachment = (RegionAttachment*)slot->getAttachment(); + setAttachmentVertices(attachment); + attachmentVertices = (AttachmentVertices*)attachment->getRendererObject(); if (!isTwoColorTint) { triangles.indices = attachmentVertices->_triangles->indices; @@ -315,7 +345,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t triangles.verts = batch->allocateVertices(attachmentVertices->_triangles->vertCount); triangles.vertCount = attachmentVertices->_triangles->vertCount; memcpy(triangles.verts, attachmentVertices->_triangles->verts, sizeof(cocos2d::V3F_C4B_T2F) * attachmentVertices->_triangles->vertCount); - spRegionAttachment_computeWorldVertices(attachment, slot->bone, (float*)triangles.verts, 0, 6); + attachment->computeWorldVertices(slot->getBone(), (float*)triangles.verts, 0, 6); } else { trianglesTwoColor.indices = attachmentVertices->_triangles->indices; trianglesTwoColor.indexCount = attachmentVertices->_triangles->indexCount; @@ -324,19 +354,18 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t for (int i = 0; i < trianglesTwoColor.vertCount; i++) { trianglesTwoColor.verts[i].texCoords = attachmentVertices->_triangles->verts[i].texCoords; } - spRegionAttachment_computeWorldVertices(attachment, slot->bone, (float*)trianglesTwoColor.verts, 0, 7); + attachment->computeWorldVertices(slot->getBone(), (float*)trianglesTwoColor.verts, 0, 7); } - color.r = attachment->color.r; - color.g = attachment->color.g; - color.b = attachment->color.b; - color.a = attachment->color.a; - - break; + color.r = attachment->getColor().r; + color.g = attachment->getColor().g; + color.b = attachment->getColor().b; + color.a = attachment->getColor().a; } - case SP_ATTACHMENT_MESH: { - spMeshAttachment* attachment = (spMeshAttachment*)slot->attachment; - attachmentVertices = getAttachmentVertices(attachment); + else if (slot->getAttachment()->getRTTI().isExactly(MeshAttachment::rtti)) { + MeshAttachment* attachment = (MeshAttachment*)slot->getAttachment(); + setAttachmentVertices(attachment); + attachmentVertices = (AttachmentVertices*)attachment->getRendererObject(); if (!isTwoColorTint) { triangles.indices = attachmentVertices->_triangles->indices; @@ -344,7 +373,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t triangles.verts = batch->allocateVertices(attachmentVertices->_triangles->vertCount); triangles.vertCount = attachmentVertices->_triangles->vertCount; memcpy(triangles.verts, attachmentVertices->_triangles->verts, sizeof(cocos2d::V3F_C4B_T2F) * attachmentVertices->_triangles->vertCount); - spVertexAttachment_computeWorldVertices(SUPER(attachment), slot, 0, triangles.vertCount * sizeof(cocos2d::V3F_C4B_T2F) / 4, (float*)triangles.verts, 0, 6); + attachment->computeWorldVertices(*slot, 0, triangles.vertCount * sizeof(cocos2d::V3F_C4B_T2F) / 4, (float*)triangles.verts, 0, 6); } else { trianglesTwoColor.indices = attachmentVertices->_triangles->indices; trianglesTwoColor.indexCount = attachmentVertices->_triangles->indexCount; @@ -353,30 +382,27 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t for (int i = 0; i < trianglesTwoColor.vertCount; i++) { trianglesTwoColor.verts[i].texCoords = attachmentVertices->_triangles->verts[i].texCoords; } - spVertexAttachment_computeWorldVertices(SUPER(attachment), slot, 0, trianglesTwoColor.vertCount * sizeof(V3F_C4B_C4B_T2F) / 4, (float*)trianglesTwoColor.verts, 0, 7); + attachment->computeWorldVertices(*slot, 0, trianglesTwoColor.vertCount * sizeof(V3F_C4B_C4B_T2F) / 4, (float*)trianglesTwoColor.verts, 0, 7); } - color.r = attachment->color.r; - color.g = attachment->color.g; - color.b = attachment->color.b; - color.a = attachment->color.a; - - break; + color.r = attachment->getColor().r; + color.g = attachment->getColor().g; + color.b = attachment->getColor().b; + color.a = attachment->getColor().a; } - case SP_ATTACHMENT_CLIPPING: { - spClippingAttachment* clip = (spClippingAttachment*)slot->attachment; - spSkeletonClipping_clipStart(_clipper, slot, clip); + else if (slot->getAttachment()->getRTTI().isExactly(ClippingAttachment::rtti)) { + ClippingAttachment* clip = (ClippingAttachment*)slot->getAttachment(); + _clipper->clipStart(*slot, clip); continue; - } - default: - spSkeletonClipping_clipEnd(_clipper, slot); + } else { + _clipper->clipEnd(*slot); continue; } - if (slot->darkColor) { - darkColor.r = slot->darkColor->r * 255; - darkColor.g = slot->darkColor->g * 255; - darkColor.b = slot->darkColor->b * 255; + if (slot->hasDarkColor()) { + darkColor.r = slot->getDarkColor().r * 255; + darkColor.g = slot->getDarkColor().g * 255; + darkColor.b = slot->getDarkColor().b * 255; } else { darkColor.r = 0; darkColor.g = 0; @@ -384,28 +410,28 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t } darkColor.a = darkPremultipliedAlpha; - color.a *= nodeColor.a * _skeleton->color.a * slot->color.a * 255; + color.a *= nodeColor.a * _skeleton->getColor().a * slot->getColor().a * 255; // skip rendering if the color of this attachment is 0 if (color.a == 0){ - spSkeletonClipping_clipEnd(_clipper, slot); + _clipper->clipEnd(*slot); continue; } float multiplier = _premultipliedAlpha ? color.a : 255; - color.r *= nodeColor.r * _skeleton->color.r * slot->color.r * multiplier; - color.g *= nodeColor.g * _skeleton->color.g * slot->color.g * multiplier; - color.b *= nodeColor.b * _skeleton->color.b * slot->color.b * multiplier; + color.r *= nodeColor.r * _skeleton->getColor().r * slot->getColor().r * multiplier; + color.g *= nodeColor.g * _skeleton->getColor().g * slot->getColor().g * multiplier; + color.b *= nodeColor.b * _skeleton->getColor().b * slot->getColor().b * multiplier; BlendFunc blendFunc; - switch (slot->data->blendMode) { - case SP_BLEND_MODE_ADDITIVE: + switch (slot->getData().getBlendMode()) { + case BlendMode_Additive: blendFunc.src = _premultipliedAlpha ? GL_ONE : GL_SRC_ALPHA; blendFunc.dst = GL_ONE; break; - case SP_BLEND_MODE_MULTIPLY: + case BlendMode_Multiply: blendFunc.src = GL_DST_COLOR; blendFunc.dst = GL_ONE_MINUS_SRC_ALPHA; break; - case SP_BLEND_MODE_SCREEN: + case BlendMode_Screen: blendFunc.src = GL_ONE; blendFunc.dst = GL_ONE_MINUS_SRC_COLOR; break; @@ -415,28 +441,28 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t } if (!isTwoColorTint) { - if (spSkeletonClipping_isClipping(_clipper)) { - spSkeletonClipping_clipTriangles(_clipper, (float*)&triangles.verts[0].vertices, triangles.vertCount * sizeof(cocos2d::V3F_C4B_T2F) / 4, triangles.indices, triangles.indexCount, (float*)&triangles.verts[0].texCoords, 6); + if (_clipper->isClipping()) { + _clipper->clipTriangles((float*)&triangles.verts[0].vertices, triangles.indices, triangles.indexCount, (float*)&triangles.verts[0].texCoords, triangles.vertCount * sizeof(cocos2d::V3F_C4B_T2F) / 4); batch->deallocateVertices(triangles.vertCount); - if (_clipper->clippedTriangles->size == 0){ - spSkeletonClipping_clipEnd(_clipper, slot); + if (_clipper->getClippedTriangles().size() == 0){ + _clipper->clipEnd(*slot); continue; } - triangles.vertCount = _clipper->clippedVertices->size >> 1; + triangles.vertCount = _clipper->getClippedVertices().size() >> 1; triangles.verts = batch->allocateVertices(triangles.vertCount); - triangles.indexCount = _clipper->clippedTriangles->size; + triangles.indexCount = _clipper->getClippedTriangles().size(); triangles.indices = batch->allocateIndices(triangles.indexCount); - memcpy(triangles.indices, _clipper->clippedTriangles->items, sizeof(unsigned short) * _clipper->clippedTriangles->size); + memcpy(triangles.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size()); cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, _glProgramState, blendFunc, triangles, transform, transformFlags); - float* verts = _clipper->clippedVertices->items; - float* uvs = _clipper->clippedUVs->items; + float* verts = _clipper->getClippedVertices().buffer(); + float* uvs = _clipper->getClippedUVs().buffer(); if (_effect) { - spColor light; - spColor dark; + Color light; + Color dark; light.r = color.r / 255.0f; light.g = color.g / 255.0f; light.b = color.b / 255.0f; @@ -444,13 +470,13 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t dark.r = dark.g = dark.b = dark.a = 0; for (int v = 0, vn = batchedTriangles->getTriangles().vertCount, vv = 0; v < vn; ++v, vv+=2) { V3F_C4B_T2F* vertex = batchedTriangles->getTriangles().verts + v; - spColor lightCopy = light; - spColor darkCopy = dark; + Color lightCopy = light; + Color darkCopy = dark; vertex->vertices.x = verts[vv]; vertex->vertices.y = verts[vv + 1]; vertex->texCoords.u = uvs[vv]; vertex->texCoords.v = uvs[vv + 1]; - _effect->transform(_effect, &vertex->vertices.x, &vertex->vertices.y, &vertex->texCoords.u, &vertex->texCoords.v, &lightCopy, &darkCopy); + _effect->transform(vertex->vertices.x, vertex->vertices.y, vertex->texCoords.u, vertex->texCoords.v, lightCopy, darkCopy); vertex->colors.r = (GLubyte)(lightCopy.r * 255); vertex->colors.g = (GLubyte)(lightCopy.g * 255); vertex->colors.b = (GLubyte)(lightCopy.b * 255); @@ -473,8 +499,8 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t cocos2d::TrianglesCommand* batchedTriangles = batch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture, _glProgramState, blendFunc, triangles, transform, transformFlags); if (_effect) { - spColor light; - spColor dark; + Color light; + Color dark; light.r = color.r / 255.0f; light.g = color.g / 255.0f; light.b = color.b / 255.0f; @@ -482,9 +508,9 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t dark.r = dark.g = dark.b = dark.a = 0; for (int v = 0, vn = batchedTriangles->getTriangles().vertCount; v < vn; ++v) { V3F_C4B_T2F* vertex = batchedTriangles->getTriangles().verts + v; - spColor lightCopy = light; - spColor darkCopy = dark; - _effect->transform(_effect, &vertex->vertices.x, &vertex->vertices.y, &vertex->texCoords.u, &vertex->texCoords.v, &lightCopy, &darkCopy); + Color lightCopy = light; + Color darkCopy = dark; + _effect->transform(vertex->vertices.x, vertex->vertices.y, vertex->texCoords.u, vertex->texCoords.v, lightCopy, darkCopy); vertex->colors.r = (GLubyte)(lightCopy.r * 255); vertex->colors.g = (GLubyte)(lightCopy.g * 255); vertex->colors.b = (GLubyte)(lightCopy.b * 255); @@ -501,29 +527,29 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t } } } else { - if (spSkeletonClipping_isClipping(_clipper)) { - spSkeletonClipping_clipTriangles(_clipper, (float*)&trianglesTwoColor.verts[0].position, trianglesTwoColor.vertCount * sizeof(V3F_C4B_C4B_T2F) / 4, trianglesTwoColor.indices, trianglesTwoColor.indexCount, (float*)&trianglesTwoColor.verts[0].texCoords, 7); + if (_clipper->isClipping()) { + _clipper->clipTriangles((float*)&trianglesTwoColor.verts[0].position, trianglesTwoColor.indices, trianglesTwoColor.indexCount, (float*)&trianglesTwoColor.verts[0].texCoords, trianglesTwoColor.vertCount * sizeof(V3F_C4B_C4B_T2F) / 4); twoColorBatch->deallocateVertices(trianglesTwoColor.vertCount); - if (_clipper->clippedTriangles->size == 0){ - spSkeletonClipping_clipEnd(_clipper, slot); + if (_clipper->getClippedTriangles().size() == 0){ + _clipper->clipEnd(*slot); continue; } - trianglesTwoColor.vertCount = _clipper->clippedVertices->size >> 1; + trianglesTwoColor.vertCount = _clipper->getClippedVertices().size() >> 1; trianglesTwoColor.verts = twoColorBatch->allocateVertices(trianglesTwoColor.vertCount); - trianglesTwoColor.indexCount = _clipper->clippedTriangles->size; + trianglesTwoColor.indexCount = _clipper->getClippedTriangles().size(); trianglesTwoColor.indices = twoColorBatch->allocateIndices(trianglesTwoColor.indexCount); - memcpy(trianglesTwoColor.indices, _clipper->clippedTriangles->items, sizeof(unsigned short) * _clipper->clippedTriangles->size); + memcpy(trianglesTwoColor.indices, _clipper->getClippedTriangles().buffer(), sizeof(unsigned short) * _clipper->getClippedTriangles().size()); TwoColorTrianglesCommand* batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags); - float* verts = _clipper->clippedVertices->items; - float* uvs = _clipper->clippedUVs->items; + float* verts = _clipper->getClippedVertices().buffer(); + float* uvs = _clipper->getClippedUVs().buffer(); if (_effect) { - spColor light; - spColor dark; + Color light; + Color dark; light.r = color.r / 255.0f; light.g = color.g / 255.0f; light.b = color.b / 255.0f; @@ -534,13 +560,13 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t dark.a = darkColor.a / 255.0f; for (int v = 0, vn = batchedTriangles->getTriangles().vertCount, vv = 0; v < vn; ++v, vv += 2) { V3F_C4B_C4B_T2F* vertex = batchedTriangles->getTriangles().verts + v; - spColor lightCopy = light; - spColor darkCopy = dark; + Color lightCopy = light; + Color darkCopy = dark; vertex->position.x = verts[vv]; vertex->position.y = verts[vv + 1]; vertex->texCoords.u = uvs[vv]; vertex->texCoords.v = uvs[vv + 1]; - _effect->transform(_effect, &vertex->position.x, &vertex->position.y, &vertex->texCoords.u, &vertex->texCoords.v, &lightCopy, &darkCopy); + _effect->transform(vertex->position.x, vertex->position.y, vertex->texCoords.u, vertex->texCoords.v, lightCopy, darkCopy); vertex->color.r = (GLubyte)(lightCopy.r * 255); vertex->color.g = (GLubyte)(lightCopy.g * 255); vertex->color.b = (GLubyte)(lightCopy.b * 255); @@ -571,8 +597,8 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t TwoColorTrianglesCommand* batchedTriangles = lastTwoColorTrianglesCommand = twoColorBatch->addCommand(renderer, _globalZOrder, attachmentVertices->_texture->getName(), _glProgramState, blendFunc, trianglesTwoColor, transform, transformFlags); if (_effect) { - spColor light; - spColor dark; + Color light; + Color dark; light.r = color.r / 255.0f; light.g = color.g / 255.0f; light.b = color.b / 255.0f; @@ -584,9 +610,9 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t for (int v = 0, vn = batchedTriangles->getTriangles().vertCount; v < vn; ++v) { V3F_C4B_C4B_T2F* vertex = batchedTriangles->getTriangles().verts + v; - spColor lightCopy = light; - spColor darkCopy = dark; - _effect->transform(_effect, &vertex->position.x, &vertex->position.y, &vertex->texCoords.u, &vertex->texCoords.v, &lightCopy, &darkCopy); + Color lightCopy = light; + Color darkCopy = dark; + _effect->transform(vertex->position.x, vertex->position.y, vertex->texCoords.u, vertex->texCoords.v, lightCopy, darkCopy); vertex->color.r = (GLubyte)(lightCopy.r * 255); vertex->color.g = (GLubyte)(lightCopy.g * 255); vertex->color.b = (GLubyte)(lightCopy.b * 255); @@ -611,9 +637,9 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t } } } - spSkeletonClipping_clipEnd(_clipper, slot); + _clipper->clipEnd(*slot); } - spSkeletonClipping_clipEnd2(_clipper); + _clipper->clipEnd(); if (lastTwoColorTrianglesCommand) { Node* parent = this->getParent(); @@ -628,7 +654,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t if (!parent || parent->getChildrenCount() > 100 || getChildrenCount() != 0) { lastTwoColorTrianglesCommand->setForceFlush(true); } else { - Vector& children = parent->getChildren(); + cocos2d::Vector& children = parent->getChildren(); Node* sibling = nullptr; for (ssize_t i = 0; i < children.size(); i++) { if (children.at(i) == this) { @@ -652,7 +678,7 @@ void SkeletonRenderer::draw (Renderer* renderer, const Mat4& transform, uint32_t } } - if (_effect) _effect->end(_effect); + if (_effect) _effect->end(); if (_debugSlots || _debugBones || _debugMeshes) { drawDebug(renderer, transform, transformFlags); @@ -673,11 +699,11 @@ void SkeletonRenderer::drawDebug (Renderer* renderer, const Mat4 &transform, uin glLineWidth(1); Vec2 points[4]; V3F_C4B_T2F_Quad quad; - for (int i = 0, n = _skeleton->slotsCount; i < n; i++) { - spSlot* slot = _skeleton->drawOrder[i]; - if (!slot->attachment || slot->attachment->type != SP_ATTACHMENT_REGION) continue; - spRegionAttachment* attachment = (spRegionAttachment*)slot->attachment; - spRegionAttachment_computeWorldVertices(attachment, slot->bone, worldVertices, 0, 2); + for (int i = 0, n = _skeleton->getSlots().size(); i < n; i++) { + Slot* slot = _skeleton->getDrawOrder()[i]; + if (!slot->getAttachment() || !slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) continue; + RegionAttachment* attachment = (RegionAttachment*)slot->getAttachment(); + attachment->computeWorldVertices(slot->getBone(), worldVertices, 0, 2); points[0] = Vec2(worldVertices[0], worldVertices[1]); points[1] = Vec2(worldVertices[2], worldVertices[3]); points[2] = Vec2(worldVertices[4], worldVertices[5]); @@ -688,17 +714,17 @@ void SkeletonRenderer::drawDebug (Renderer* renderer, const Mat4 &transform, uin if (_debugBones) { // Bone lengths. glLineWidth(2); - for (int i = 0, n = _skeleton->bonesCount; i < n; i++) { - spBone *bone = _skeleton->bones[i]; - float x = bone->data->length * bone->a + bone->worldX; - float y = bone->data->length * bone->c + bone->worldY; - drawNode->drawLine(Vec2(bone->worldX, bone->worldY), Vec2(x, y), Color4F::RED); + for (int i = 0, n = _skeleton->getBones().size(); i < n; i++) { + Bone *bone = _skeleton->getBones()[i]; + float x = bone->getData().getLength() * bone->getA() + bone->getWorldX(); + float y = bone->getData().getLength() * bone->getC() + bone->getWorldY(); + drawNode->drawLine(Vec2(bone->getWorldX(), bone->getWorldY()), Vec2(x, y), Color4F::RED); } // Bone origins. auto color = Color4F::BLUE; // Root bone is blue. - for (int i = 0, n = _skeleton->bonesCount; i < n; i++) { - spBone *bone = _skeleton->bones[i]; - drawNode->drawPoint(Vec2(bone->worldX, bone->worldY), 4, color); + for (int i = 0, n = _skeleton->getBones().size(); i < n; i++) { + Bone *bone = _skeleton->getBones()[i]; + drawNode->drawPoint(Vec2(bone->getWorldX(), bone->getWorldY()), 4, color); if (i == 0) color = Color4F::GREEN; } } @@ -706,16 +732,16 @@ void SkeletonRenderer::drawDebug (Renderer* renderer, const Mat4 &transform, uin if (_debugMeshes) { // Meshes. glLineWidth(1); - for (int i = 0, n = _skeleton->slotsCount; i < n; ++i) { - spSlot* slot = _skeleton->drawOrder[i]; - if (!slot->attachment || slot->attachment->type != SP_ATTACHMENT_MESH) continue; - spMeshAttachment* attachment = (spMeshAttachment*)slot->attachment; - ensureWorldVerticesCapacity(attachment->super.worldVerticesLength); - spVertexAttachment_computeWorldVertices(SUPER(attachment), slot, 0, attachment->super.worldVerticesLength, worldVertices, 0, 2); - for (int ii = 0; ii < attachment->trianglesCount;) { - Vec2 v1(worldVertices + (attachment->triangles[ii++] * 2)); - Vec2 v2(worldVertices + (attachment->triangles[ii++] * 2)); - Vec2 v3(worldVertices + (attachment->triangles[ii++] * 2)); + for (int i = 0, n = _skeleton->getSlots().size(); i < n; ++i) { + Slot* slot = _skeleton->getDrawOrder()[i]; + if (!slot->getAttachment() || !slot->getAttachment()->getRTTI().isExactly(MeshAttachment::rtti)) continue; + MeshAttachment* attachment = (MeshAttachment*)slot->getAttachment(); + ensureWorldVerticesCapacity(attachment->getWorldVerticesLength()); + attachment->computeWorldVertices(*slot, 0, attachment->getWorldVerticesLength(), worldVertices, 0, 2); + for (int ii = 0; ii < attachment->getTriangles().size();) { + Vec2 v1(worldVertices + (attachment->getTriangles()[ii++] * 2)); + Vec2 v2(worldVertices + (attachment->getTriangles()[ii++] * 2)); + Vec2 v3(worldVertices + (attachment->getTriangles()[ii++] * 2)); drawNode->drawLine(v1, v2, Color4F::YELLOW); drawNode->drawLine(v2, v3, Color4F::YELLOW); drawNode->drawLine(v3, v1, Color4F::YELLOW); @@ -727,31 +753,23 @@ void SkeletonRenderer::drawDebug (Renderer* renderer, const Mat4 &transform, uin drawNode->draw(renderer, transform, transformFlags); director->popMatrix(MATRIX_STACK_TYPE::MATRIX_STACK_MODELVIEW); } - -AttachmentVertices* SkeletonRenderer::getAttachmentVertices (spRegionAttachment* attachment) const { - return (AttachmentVertices*)attachment->rendererObject; -} - -AttachmentVertices* SkeletonRenderer::getAttachmentVertices (spMeshAttachment* attachment) const { - return (AttachmentVertices*)attachment->rendererObject; -} - + Rect SkeletonRenderer::getBoundingBox () const { float minX = FLT_MAX, minY = FLT_MAX, maxX = -FLT_MAX, maxY = -FLT_MAX; float scaleX = getScaleX(), scaleY = getScaleY(); - for (int i = 0; i < _skeleton->slotsCount; ++i) { - spSlot* slot = _skeleton->slots[i]; - if (!slot->attachment) continue; + for (int i = 0; i < _skeleton->getSlots().size(); ++i) { + Slot* slot = _skeleton->getSlots()[i]; + if (!slot->getAttachment()) continue; int verticesCount; - if (slot->attachment->type == SP_ATTACHMENT_REGION) { - spRegionAttachment* attachment = (spRegionAttachment*)slot->attachment; - spRegionAttachment_computeWorldVertices(attachment, slot->bone, worldVertices, 0, 2); + if (slot->getAttachment()->getRTTI().isExactly(RegionAttachment::rtti)) { + RegionAttachment* attachment = (RegionAttachment*)slot->getAttachment(); + attachment->computeWorldVertices(slot->getBone(), worldVertices, 0, 2); verticesCount = 8; - } else if (slot->attachment->type == SP_ATTACHMENT_MESH) { - spMeshAttachment* mesh = (spMeshAttachment*)slot->attachment; - ensureWorldVerticesCapacity(mesh->super.worldVerticesLength); - spVertexAttachment_computeWorldVertices(SUPER(mesh), slot, 0, mesh->super.worldVerticesLength, worldVertices, 0, 2); - verticesCount = mesh->super.worldVerticesLength; + } else if (slot->getAttachment()->getRTTI().isExactly(MeshAttachment::rtti)) { + MeshAttachment* mesh = (MeshAttachment*)slot->getAttachment(); + ensureWorldVerticesCapacity(mesh->getWorldVerticesLength()); + mesh->computeWorldVertices(*slot, 0, mesh->getWorldVerticesLength(), worldVertices, 0, 2); + verticesCount = mesh->getWorldVerticesLength(); } else continue; for (int ii = 0; ii < verticesCount; ii += 2) { @@ -770,42 +788,42 @@ Rect SkeletonRenderer::getBoundingBox () const { // --- Convenience methods for Skeleton_* functions. void SkeletonRenderer::updateWorldTransform () { - spSkeleton_updateWorldTransform(_skeleton); + _skeleton->updateWorldTransform(); } void SkeletonRenderer::setToSetupPose () { - spSkeleton_setToSetupPose(_skeleton); + _skeleton->setToSetupPose(); } void SkeletonRenderer::setBonesToSetupPose () { - spSkeleton_setBonesToSetupPose(_skeleton); + _skeleton->setBonesToSetupPose(); } void SkeletonRenderer::setSlotsToSetupPose () { - spSkeleton_setSlotsToSetupPose(_skeleton); + _skeleton->setSlotsToSetupPose(); } -spBone* SkeletonRenderer::findBone (const std::string& boneName) const { - return spSkeleton_findBone(_skeleton, boneName.c_str()); +Bone* SkeletonRenderer::findBone (const std::string& boneName) const { + return _skeleton->findBone(boneName.c_str()); } -spSlot* SkeletonRenderer::findSlot (const std::string& slotName) const { - return spSkeleton_findSlot(_skeleton, slotName.c_str()); +Slot* SkeletonRenderer::findSlot (const std::string& slotName) const { + return _skeleton->findSlot(slotName.c_str()); } -bool SkeletonRenderer::setSkin (const std::string& skinName) { - return spSkeleton_setSkinByName(_skeleton, skinName.empty() ? 0 : skinName.c_str()) ? true : false; +void SkeletonRenderer::setSkin (const std::string& skinName) { + _skeleton->setSkin(skinName.empty() ? 0 : skinName.c_str()); } -bool SkeletonRenderer::setSkin (const char* skinName) { - return spSkeleton_setSkinByName(_skeleton, skinName) ? true : false; +void SkeletonRenderer::setSkin (const char* skinName) { + _skeleton->setSkin(skinName); } -spAttachment* SkeletonRenderer::getAttachment (const std::string& slotName, const std::string& attachmentName) const { - return spSkeleton_getAttachmentForSlotName(_skeleton, slotName.c_str(), attachmentName.c_str()); +Attachment* SkeletonRenderer::getAttachment (const std::string& slotName, const std::string& attachmentName) const { + return _skeleton->getAttachment(slotName.c_str(), attachmentName.c_str()); } bool SkeletonRenderer::setAttachment (const std::string& slotName, const std::string& attachmentName) { - return spSkeleton_setAttachment(_skeleton, slotName.c_str(), attachmentName.empty() ? 0 : attachmentName.c_str()) ? true : false; + return _skeleton->getAttachment(slotName.c_str(), attachmentName.empty() ? 0 : attachmentName.c_str()) ? true : false; } bool SkeletonRenderer::setAttachment (const std::string& slotName, const char* attachmentName) { - return spSkeleton_setAttachment(_skeleton, slotName.c_str(), attachmentName) ? true : false; + return _skeleton->getAttachment(slotName.c_str(), attachmentName) ? true : false; } void SkeletonRenderer::setTwoColorTint(bool enabled) { @@ -816,7 +834,7 @@ bool SkeletonRenderer::isTwoColorTint() { return getGLProgramState() == SkeletonTwoColorBatch::getInstance()->getTwoColorTintProgramState(); } -void SkeletonRenderer::setVertexEffect(spVertexEffect *effect) { +void SkeletonRenderer::setVertexEffect(VertexEffect *effect) { this->_effect = effect; } @@ -825,7 +843,7 @@ void SkeletonRenderer::setSlotsRange(int startSlotIndex, int endSlotIndex) { this->_endSlotIndex = endSlotIndex; } -spSkeleton* SkeletonRenderer::getSkeleton () { +Skeleton* SkeletonRenderer::getSkeleton () { return _skeleton; } diff --git a/spine-cocos2dx/src/spine/SkeletonRenderer.h b/spine-cocos2dx/src/spine/SkeletonRenderer.h index 3f41e4a5d..20fd4fe40 100644 --- a/spine-cocos2dx/src/spine/SkeletonRenderer.h +++ b/spine-cocos2dx/src/spine/SkeletonRenderer.h @@ -42,9 +42,9 @@ class AttachmentVertices; class SkeletonRenderer: public cocos2d::Node, public cocos2d::BlendProtocol { public: CREATE_FUNC(SkeletonRenderer); - static SkeletonRenderer* createWithSkeleton(spSkeleton* skeleton, bool ownsSkeleton = false, bool ownsSkeletonData = false); - static SkeletonRenderer* createWithData (spSkeletonData* skeletonData, bool ownsSkeletonData = false); - static SkeletonRenderer* createWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale = 1); + static SkeletonRenderer* createWithSkeleton(Skeleton* skeleton, bool ownsSkeleton = false, bool ownsSkeletonData = false); + static SkeletonRenderer* createWithData (SkeletonData* skeletonData, bool ownsSkeletonData = false); + static SkeletonRenderer* createWithFile (const std::string& skeletonDataFile, Atlas* atlas, float scale = 1); static SkeletonRenderer* createWithFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1); virtual void update (float deltaTime) override; @@ -54,7 +54,7 @@ public: virtual void onEnter () override; virtual void onExit () override; - spSkeleton* getSkeleton(); + Skeleton* getSkeleton(); void setTimeScale(float scale); float getTimeScale() const; @@ -77,19 +77,19 @@ public: void setSlotsToSetupPose (); /* Returns 0 if the bone was not found. */ - spBone* findBone (const std::string& boneName) const; + Bone* findBone (const std::string& boneName) const; /* Returns 0 if the slot was not found. */ - spSlot* findSlot (const std::string& slotName) const; + Slot* findSlot (const std::string& slotName) const; /* Sets the skin used to look up attachments not found in the SkeletonData defaultSkin. Attachments from the new skin are - * attached if the corresponding attachment from the old skin was attached. Returns false if the skin was not found. + * attached if the corresponding attachment from the old skin was attached. * @param skin May be empty string ("") for no skin.*/ - bool setSkin (const std::string& skinName); + void setSkin (const std::string& skinName); /** @param skin May be 0 for no skin.*/ - bool setSkin (const char* skinName); + void setSkin (const char* skinName); /* Returns 0 if the slot or attachment was not found. */ - spAttachment* getAttachment (const std::string& slotName, const std::string& attachmentName) const; + Attachment* getAttachment (const std::string& slotName, const std::string& attachmentName) const; /* Returns false if the slot or attachment was not found. * @param attachmentName May be empty string ("") for no attachment. */ bool setAttachment (const std::string& slotName, const std::string& attachmentName); @@ -102,7 +102,7 @@ public: bool isTwoColorTint(); /* Sets the vertex effect to be used, set to 0 to disable vertex effects */ - void setVertexEffect(spVertexEffect* effect); + void setVertexEffect(VertexEffect* effect); /* Sets the range of slots that should be rendered. Use -1, -1 to clear the range */ void setSlotsRange(int startSlotIndex, int endSlotIndex); @@ -118,42 +118,41 @@ public: CC_CONSTRUCTOR_ACCESS: SkeletonRenderer (); - SkeletonRenderer(spSkeleton* skeleton, bool ownsSkeleton = false, bool ownsSkeletonData = false); - SkeletonRenderer (spSkeletonData* skeletonData, bool ownsSkeletonData = false); - SkeletonRenderer (const std::string& skeletonDataFile, spAtlas* atlas, float scale = 1); + SkeletonRenderer(Skeleton* skeleton, bool ownsSkeleton = false, bool ownsSkeletonData = false, bool ownsAtlas = false); + SkeletonRenderer (SkeletonData* skeletonData, bool ownsSkeletonData = false); + SkeletonRenderer (const std::string& skeletonDataFile, Atlas* atlas, float scale = 1); SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1); virtual ~SkeletonRenderer (); - void initWithSkeleton(spSkeleton* skeleton, bool ownsSkeleton = false, bool ownsSkeletonData = false); - void initWithData (spSkeletonData* skeletonData, bool ownsSkeletonData = false); - void initWithJsonFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale = 1); + void initWithSkeleton(Skeleton* skeleton, bool ownsSkeleton = false, bool ownsSkeletonData = false, bool ownsAtlas = false); + void initWithData (SkeletonData* skeletonData, bool ownsSkeletonData = false); + void initWithJsonFile (const std::string& skeletonDataFile, Atlas* atlas, float scale = 1); void initWithJsonFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1); - void initWithBinaryFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale = 1); + void initWithBinaryFile (const std::string& skeletonDataFile, Atlas* atlas, float scale = 1); void initWithBinaryFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1); virtual void initialize (); protected: - void setSkeletonData (spSkeletonData* skeletonData, bool ownsSkeletonData); - virtual AttachmentVertices* getAttachmentVertices (spRegionAttachment* attachment) const; - virtual AttachmentVertices* getAttachmentVertices (spMeshAttachment* attachment) const; + void setSkeletonData (SkeletonData* skeletonData, bool ownsSkeletonData); void setupGLProgramState(bool twoColorTintEnabled); bool _ownsSkeletonData; bool _ownsSkeleton; - spAtlas* _atlas; - spAttachmentLoader* _attachmentLoader; + bool _ownsAtlas; + Atlas* _atlas; + AttachmentLoader* _attachmentLoader; cocos2d::CustomCommand _debugCommand; cocos2d::BlendFunc _blendFunc; bool _premultipliedAlpha; - spSkeleton* _skeleton; + Skeleton* _skeleton; float _timeScale; bool _debugSlots; bool _debugBones; bool _debugMeshes; - spSkeletonClipping* _clipper; - spVertexEffect* _effect; + SkeletonClipping* _clipper; + VertexEffect* _effect; int _startSlotIndex; int _endSlotIndex; diff --git a/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.cpp b/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.cpp index 41b323494..86f2d60a9 100644 --- a/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.cpp +++ b/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.cpp @@ -28,7 +28,7 @@ * POSSIBILITY OF SUCH DAMAGE. *****************************************************************************/ #include -#include +#include #include USING_NS_CC; @@ -168,15 +168,13 @@ SkeletonTwoColorBatch::SkeletonTwoColorBatch () { _commandsPool.push_back(new TwoColorTrianglesCommand()); } - _indices = spUnsignedShortArray_create(8); - reset (); // callback after drawing is finished so we can clear out the batch state // for the next frame Director::getInstance()->getEventDispatcher()->addCustomEventListener(EVENT_AFTER_DRAW_RESET_POSITION, [this](EventCustom* eventCustom){ this->update(0); - });; + }); _twoColorTintShader = cocos2d::GLProgram::createWithByteArrays(TWO_COLOR_TINT_VERTEX_SHADER, TWO_COLOR_TINT_FRAGMENT_SHADER); _twoColorTintShaderState = GLProgramState::getOrCreateWithGLProgram(_twoColorTintShader); @@ -195,8 +193,6 @@ SkeletonTwoColorBatch::SkeletonTwoColorBatch () { SkeletonTwoColorBatch::~SkeletonTwoColorBatch () { Director::getInstance()->getEventDispatcher()->removeCustomEventListeners(EVENT_AFTER_DRAW_RESET_POSITION); - spUnsignedShortArray_dispose(_indices); - for (unsigned int i = 0; i < _commandsPool.size(); i++) { delete _commandsPool[i]; _commandsPool[i] = nullptr; @@ -234,11 +230,11 @@ void SkeletonTwoColorBatch::deallocateVertices(uint32_t numVertices) { unsigned short* SkeletonTwoColorBatch::allocateIndices(uint32_t numIndices) { - if (_indices->capacity - _indices->size < numIndices) { - unsigned short* oldData = _indices->items; - int oldSize =_indices->size; - spUnsignedShortArray_ensureCapacity(_indices, _indices->size + numIndices); - unsigned short* newData = _indices->items; + if (_indices.getCapacity() - _indices.size() < numIndices) { + unsigned short* oldData = _indices.buffer(); + int oldSize =_indices.size(); + _indices.setSize(_indices.size() + numIndices, 0); + unsigned short* newData = _indices.buffer(); for (uint32_t i = 0; i < this->_nextFreeCommand; i++) { TwoColorTrianglesCommand* command = _commandsPool[i]; TwoColorTriangles& triangles = (TwoColorTriangles&)command->getTriangles(); @@ -248,13 +244,12 @@ unsigned short* SkeletonTwoColorBatch::allocateIndices(uint32_t numIndices) { } } - unsigned short* indices = _indices->items + _indices->size; - _indices->size += numIndices; + unsigned short* indices = _indices.buffer() + _indices.size() - numIndices; return indices; } void SkeletonTwoColorBatch::deallocateIndices(uint32_t numIndices) { - _indices->size -= numIndices; + _indices.setSize(_indices.size() - numIndices, 0); } TwoColorTrianglesCommand* SkeletonTwoColorBatch::addCommand(cocos2d::Renderer* renderer, float globalOrder, GLuint textureID, cocos2d::GLProgramState* glProgramState, cocos2d::BlendFunc blendType, const TwoColorTriangles& triangles, const cocos2d::Mat4& mv, uint32_t flags) { @@ -330,7 +325,7 @@ void SkeletonTwoColorBatch::flush (TwoColorTrianglesCommand* materialCommand) { void SkeletonTwoColorBatch::reset() { _nextFreeCommand = 0; _numVertices = 0; - _indices->size = 0; + _indices.setSize(0, 0); _numVerticesBuffer = 0; _numIndicesBuffer = 0; _lastCommand = nullptr; diff --git a/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.h b/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.h index 8035fad47..da0f0af25 100644 --- a/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.h +++ b/spine-cocos2dx/src/spine/SkeletonTwoColorBatch.h @@ -140,7 +140,7 @@ namespace spine { uint32_t _numVertices; // pool of indices - spUnsignedShortArray* _indices; + Vector _indices; // two color tint shader and state cocos2d::GLProgram* _twoColorTintShader; diff --git a/spine-cocos2dx/src/spine/spine-cocos2dx.cpp b/spine-cocos2dx/src/spine/spine-cocos2dx.cpp index 150700261..93f59f429 100644 --- a/spine-cocos2dx/src/spine/spine-cocos2dx.cpp +++ b/spine-cocos2dx/src/spine/spine-cocos2dx.cpp @@ -29,80 +29,86 @@ *****************************************************************************/ #include -#include +#include +#include + +USING_NS_CC; +using namespace spine; + +GLuint wrap (TextureWrap wrap) { + return wrap == TextureWrap_ClampToEdge ? GL_CLAMP_TO_EDGE : GL_REPEAT; +} + +GLuint filter (TextureFilter filter) { + switch (filter) { + case TextureFilter_Unknown: + break; + case TextureFilter_Nearest: + return GL_NEAREST; + case TextureFilter_Linear: + return GL_LINEAR; + case TextureFilter_MipMap: + return GL_LINEAR_MIPMAP_LINEAR; + case TextureFilter_MipMapNearestNearest: + return GL_NEAREST_MIPMAP_NEAREST; + case TextureFilter_MipMapLinearNearest: + return GL_LINEAR_MIPMAP_NEAREST; + case TextureFilter_MipMapNearestLinear: + return GL_NEAREST_MIPMAP_LINEAR; + case TextureFilter_MipMapLinearLinear: + return GL_LINEAR_MIPMAP_LINEAR; + } + return GL_LINEAR; +} + +Cocos2dTextureLoader::Cocos2dTextureLoader() : TextureLoader() { } +Cocos2dTextureLoader::~Cocos2dTextureLoader() { } + +static void unloadTexture (void* texture) { + ((Texture2D*)texture)->release(); +} + +void Cocos2dTextureLoader::load(AtlasPage& page, const String& path) { + Texture2D* texture = Director::getInstance()->getTextureCache()->addImage(path.buffer()); + CCASSERT(texture != nullptr, "Invalid image"); + texture->retain(); + + Texture2D::TexParams textureParams = {filter(page.minFilter), filter(page.magFilter), wrap(page.uWrap), wrap(page.vWrap)}; + texture->setTexParameters(textureParams); + + page.setRendererObject(texture, unloadTexture); + page.width = texture->getPixelsWide(); + page.height = texture->getPixelsHigh(); +} + +void Cocos2dTextureLoader::unload(void* texture) { + unloadTexture(texture); +} + + +Cocos2dExtension::Cocos2dExtension() : DefaultSpineExtension() { } + +Cocos2dExtension::~Cocos2dExtension() { } + +char *Cocos2dExtension::_readFile(const String &path, int *length) { + Data data = FileUtils::getInstance()->getDataFromFile(FileUtils::getInstance()->fullPathForFilename(path.buffer())); + if (data.isNull()) return 0; + + // avoid buffer overflow (int is shorter than ssize_t in certain platforms) +#if COCOS2D_VERSION >= 0x00031200 + ssize_t tmpLen; + char *ret = (char*)data.takeBuffer(&tmpLen); + *length = static_cast(tmpLen); + return ret; +#else + *length = static_cast(data.getSize()); + char* bytes = MALLOC(char, *length); + memcpy(bytes, data.getBytes(), *length); + return bytes; +#endif +} + +SpineExtension *spine::getDefaultExtension () { + return new Cocos2dExtension(); +} -namespace spine { - static CustomTextureLoader _customTextureLoader = nullptr; - void spAtlasPage_setCustomTextureLoader (CustomTextureLoader texLoader) { - _customTextureLoader = texLoader; - } -} - -USING_NS_CC; - -GLuint wrap (spAtlasWrap wrap) { - return wrap == SP_ATLAS_CLAMPTOEDGE ? GL_CLAMP_TO_EDGE : GL_REPEAT; -} - -GLuint filter (spAtlasFilter filter) { - switch (filter) { - case SP_ATLAS_UNKNOWN_FILTER: - break; - case SP_ATLAS_NEAREST: - return GL_NEAREST; - case SP_ATLAS_LINEAR: - return GL_LINEAR; - case SP_ATLAS_MIPMAP: - return GL_LINEAR_MIPMAP_LINEAR; - case SP_ATLAS_MIPMAP_NEAREST_NEAREST: - return GL_NEAREST_MIPMAP_NEAREST; - case SP_ATLAS_MIPMAP_LINEAR_NEAREST: - return GL_LINEAR_MIPMAP_NEAREST; - case SP_ATLAS_MIPMAP_NEAREST_LINEAR: - return GL_NEAREST_MIPMAP_LINEAR; - case SP_ATLAS_MIPMAP_LINEAR_LINEAR: - return GL_LINEAR_MIPMAP_LINEAR; - } - return GL_LINEAR; -} - -void _spAtlasPage_createTexture (spAtlasPage* self, const char* path) { - Texture2D* texture = nullptr; - if (spine::_customTextureLoader) { - texture = spine::_customTextureLoader(path); - } - if (!texture) { - texture = Director::getInstance()->getTextureCache()->addImage(path); - } - CCASSERT(texture != nullptr, "Invalid image"); - texture->retain(); - - Texture2D::TexParams textureParams = {filter(self->minFilter), filter(self->magFilter), wrap(self->uWrap), wrap(self->vWrap)}; - texture->setTexParameters(textureParams); - - self->rendererObject = texture; - self->width = texture->getPixelsWide(); - self->height = texture->getPixelsHigh(); -} - -void _spAtlasPage_disposeTexture (spAtlasPage* self) { - ((Texture2D*)self->rendererObject)->release(); -} - -char* _spUtil_readFile (const char* path, int* length) { - Data data = FileUtils::getInstance()->getDataFromFile(FileUtils::getInstance()->fullPathForFilename(path)); - if (data.isNull()) return 0; - - // avoid buffer overflow (int is shorter than ssize_t in certain platforms) -#if COCOS2D_VERSION >= 0x00031200 - ssize_t tmpLen; - char *ret = (char*)data.takeBuffer(&tmpLen); - *length = static_cast(tmpLen); - return ret; -#else - *length = static_cast(data.getSize()); - char* bytes = MALLOC(char, *length); - memcpy(bytes, data.getBytes(), *length); - return bytes; -#endif -} diff --git a/spine-cocos2dx/src/spine/spine-cocos2dx.h b/spine-cocos2dx/src/spine/spine-cocos2dx.h index 497d12796..0b03cf4af 100644 --- a/spine-cocos2dx/src/spine/spine-cocos2dx.h +++ b/spine-cocos2dx/src/spine/spine-cocos2dx.h @@ -32,16 +32,33 @@ #define SPINE_COCOS2DX_H_ #include -#include "cocos2d.h" -#include -#include -#include +#include "cocos2d.h" + +#include +#include #include -namespace spine { - typedef cocos2d::Texture2D* (*CustomTextureLoader)(const char* path); - // set custom texture loader for _spAtlasPage_createTexture - void spAtlasPage_setCustomTextureLoader(CustomTextureLoader texLoader); +namespace spine { + class Cocos2dTextureLoader: public TextureLoader { + public: + Cocos2dTextureLoader(); + + virtual ~Cocos2dTextureLoader(); + + virtual void load(AtlasPage& page, const String& path); + + virtual void unload(void* texture); + }; + + class Cocos2dExtension: public DefaultSpineExtension { + public: + Cocos2dExtension(); + + virtual ~Cocos2dExtension(); + + protected: + virtual char *_readFile(const String &path, int *length); + }; } #endif /* SPINE_COCOS2DX_H_ */ diff --git a/spine-cpp/LICENSE b/spine-cpp/LICENSE index daceab94a..9ea5ef41c 100644 --- a/spine-cpp/LICENSE +++ b/spine-cpp/LICENSE @@ -1,15 +1,15 @@ -Spine Runtimes Software License v2.5 +spine Runtimes Software License v2.5 Copyright (c) 2013-2016, Esoteric Software All rights reserved. You are granted a perpetual, non-exclusive, non-sublicensable, and -non-transferable license to use, install, execute, and perform the Spine +non-transferable license to use, install, execute, and perform the spine Runtimes software and derivative works solely for personal or internal use. Without the written permission of Esoteric Software (see Section 2 of -the Spine Software License Agreement), you may not (a) modify, translate, -adapt, or develop new applications using the Spine Runtimes or otherwise -create derivative works or improvements of the Spine Runtimes or (b) remove, +the spine Software License Agreement), you may not (a) modify, translate, +adapt, or develop new applications using the spine Runtimes or otherwise +create derivative works or improvements of the spine Runtimes or (b) remove, delete, alter, or obscure any trademarks or any copyright, trademark, patent, or other intellectual property or proprietary rights notices on or in the Software, including any copy thereof. Redistributions in binary or source diff --git a/spine-cpp/README.md b/spine-cpp/README.md index 498677724..29153cf4d 100644 --- a/spine-cpp/README.md +++ b/spine-cpp/README.md @@ -1,22 +1,22 @@ # spine-cpp -The spine-cpp runtime provides basic functionality to load and manipulate [Spine](http://esotericsoftware.com) skeletal animation data using C++. It does not perform rendering but can be extended to enable Spine animations for other projects that utilize C++. Note, this library uses C++03 for maximum portability and therefore does not take advantage of any C++11 or newer features such as std::unique_ptr. +The spine-cpp runtime provides basic functionality to load and manipulate [spine](http://esotericsoftware.com) skeletal animation data using C++. It does not perform rendering but can be extended to enable spine animations for other projects that utilize C++. Note, this library uses C++03 for maximum portability and therefore does not take advantage of any C++11 or newer features such as std::unique_ptr. ## Licensing -This Spine Runtime may only be used for personal or internal use, typically to evaluate Spine before purchasing. If you would like to incorporate a Spine Runtime into your applications, distribute software containing a Spine Runtime, or modify a Spine Runtime, then you will need a valid [Spine license](https://esotericsoftware.com/spine-purchase). Please see the [Spine Runtimes Software License](http://esotericsoftware.com/git/spine-runtimes/blob/LICENSE) for detailed information. +This spine Runtime may only be used for personal or internal use, typically to evaluate spine before purchasing. If you would like to incorporate a spine Runtime into your applications, distribute software containing a spine Runtime, or modify a spine Runtime, then you will need a valid [spine license](https://esotericsoftware.com/spine-purchase). Please see the [spine Runtimes Software License](http://esotericsoftware.com/git/spine-runtimes/blob/LICENSE) for detailed information. -The Spine Runtimes are developed with the intent to be used with data exported from Spine. By purchasing Spine, `Section 2` of the [Spine Software License](https://esotericsoftware.com/files/license.txt) grants the right to create and distribute derivative works of the Spine Runtimes. +The spine Runtimes are developed with the intent to be used with data exported from spine. By purchasing spine, `Section 2` of the [spine Software License](https://esotericsoftware.com/files/license.txt) grants the right to create and distribute derivative works of the spine Runtimes. -## Spine version +## spine version -spine-cpp works with data exported from Spine 3.6.xx. +spine-cpp works with data exported from spine 3.6.xx. -spine-cpp supports all Spine features. +spine-cpp supports all spine features. ## Setup -1. Download the Spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it as a zip via the download button above. +1. Download the spine Runtimes source using [git](https://help.github.com/articles/set-up-git) or by downloading it as a zip via the download button above. 2. Create a new project and import the source. Alternatively, the contents of the `spine-cpp/spine-cpp/src` and `spine-cpp/spine-cpp/include` directories can be copied into your project. Be sure your header search is configured to find the contents of the `spine-cpp/spine-cpp/include` directory. Note that the includes use `spine/Xxx.h`, so the `spine` directory cannot be omitted when copying the files. @@ -25,7 +25,7 @@ Alternatively, the contents of the `spine-cpp/spine-cpp/src` and `spine-cpp/spin Extending spine-cpp requires implementing both the SpineExtension class (which has a handy default instance) and the TextureLoader class: -Spine::SpineExtension::setInstance(Spine::DefaultSpineExtension::getInstance()); +spine::SpineExtension::setInstance(spine::DefaultSpineExtension::getInstance()); class MyTextureLoader : public TextureLoader { diff --git a/spine-cpp/spine-cpp-unit-tests/README.md b/spine-cpp/spine-cpp-unit-tests/README.md index bfe38c489..a7d6efb7c 100755 --- a/spine-cpp/spine-cpp-unit-tests/README.md +++ b/spine-cpp/spine-cpp-unit-tests/README.md @@ -1,6 +1,6 @@ # spine-cpp-unit-tests -The spine-cpp-unit-tests project is to test the [Spine](http://esotericsoftware.com) skeletal animation system. It does not perform rendering. It is primarily used for regression testing and leak detection. It is designed to be run from a Continuous Integration server and to passively verify changes automatically on check-in. +The spine-cpp-unit-tests project is to test the [spine](http://esotericsoftware.com) skeletal animation system. It does not perform rendering. It is primarily used for regression testing and leak detection. It is designed to be run from a Continuous Integration server and to passively verify changes automatically on check-in. ## Mini CPP Unit Testing [MiniCppUnit](https://sourceforge.net/p/minicppunit/wiki/Home/) is a minimal unit testing framework similar to JUnit. It is used here to avoid large dependancies. @@ -42,9 +42,9 @@ msbuild spine_unit_test.sln /t:spine_unit_test /p:Configuration="Debug" /p:Platf ## Licensing -This Spine Runtime may only be used for personal or internal use, typically to evaluate Spine before purchasing. If you would like to incorporate a Spine Runtime into your applications, distribute software containing a Spine Runtime, or modify a Spine Runtime, then you will need a valid [Spine license](https://esotericsoftware.com/spine-purchase). Please see the [Spine Runtimes Software License](https://github.com/EsotericSoftware/spine-runtimes/blob/master/LICENSE) for detailed information. +This spine Runtime may only be used for personal or internal use, typically to evaluate spine before purchasing. If you would like to incorporate a spine Runtime into your applications, distribute software containing a spine Runtime, or modify a spine Runtime, then you will need a valid [spine license](https://esotericsoftware.com/spine-purchase). Please see the [spine Runtimes Software License](https://github.com/EsotericSoftware/spine-runtimes/blob/master/LICENSE) for detailed information. -The Spine Runtimes are developed with the intent to be used with data exported from Spine. By purchasing Spine, `Section 2` of the [Spine Software License](https://esotericsoftware.com/files/license.txt) grants the right to create and distribute derivative works of the Spine Runtimes. +The spine Runtimes are developed with the intent to be used with data exported from spine. By purchasing spine, `Section 2` of the [spine Software License](https://esotericsoftware.com/files/license.txt) grants the right to create and distribute derivative works of the spine Runtimes. original "walk"": 330 second "walk": 0d0 diff --git a/spine-cpp/spine-cpp-unit-tests/src/main.cpp b/spine-cpp/spine-cpp-unit-tests/src/main.cpp index 023ad4661..dcd2f96dd 100644 --- a/spine-cpp/spine-cpp-unit-tests/src/main.cpp +++ b/spine-cpp/spine-cpp-unit-tests/src/main.cpp @@ -34,7 +34,7 @@ #pragma warning ( disable : 4710 ) -using namespace Spine; +using namespace spine; void loadBinary(const String &binaryFile, const String &atlasFile, Atlas *&atlas, SkeletonData *&skeletonData, AnimationStateData *&stateData, Skeleton *&skeleton, AnimationState *&state) { @@ -123,11 +123,17 @@ void testLoading() { } } +namespace spine { + SpineExtension* getDefaultExtension() { + return new DefaultSpineExtension(); + } +} + int main(int argc, char **argv) { - DebugExtension *ext = new DebugExtension(); - SpineExtension::setInstance(ext); + DebugExtension debug(SpineExtension::getInstance()); + SpineExtension::setInstance(&debug); testLoading(); - ext->reportLeaks(); + debug.reportLeaks(); } diff --git a/spine-cpp/spine-cpp/include/spine/Animation.h b/spine-cpp/spine-cpp/include/spine/Animation.h index b623cc287..993c41f1c 100644 --- a/spine-cpp/spine-cpp/include/spine/Animation.h +++ b/spine-cpp/spine-cpp/include/spine/Animation.h @@ -37,7 +37,7 @@ #include #include -namespace Spine { +namespace spine { class Timeline; class Skeleton; diff --git a/spine-cpp/spine-cpp/include/spine/AnimationState.h b/spine-cpp/spine-cpp/include/spine/AnimationState.h index 5eaa5e2fc..efe752d11 100644 --- a/spine-cpp/spine-cpp/include/spine/AnimationState.h +++ b/spine-cpp/spine-cpp/include/spine/AnimationState.h @@ -36,8 +36,9 @@ #include #include #include +#include -namespace Spine { +namespace spine { enum EventType { EventType_Start, EventType_Interrupt, @@ -56,15 +57,17 @@ namespace Spine { class Skeleton; class RotateTimeline; - typedef void (*OnAnimationEventFunc) (AnimationState* state, EventType type, TrackEntry* entry, Event* event); + typedef void (*AnimationStateListener) (AnimationState* state, EventType type, TrackEntry* entry, Event* event); /// State for the playback of an animation - class TrackEntry : public SpineObject { + class TrackEntry : public SpineObject, public HasRendererObject { friend class EventQueue; friend class AnimationState; public: TrackEntry(); + + virtual ~TrackEntry(); /// The index of the track where this entry is either current or queued. int getTrackIndex(); @@ -216,8 +219,7 @@ namespace Spine { /// TrackEntry chooses the short way the first time it is applied and remembers that direction. void resetRotationDirections(); - void setOnAnimationEventFunc(OnAnimationEventFunc inValue); - + void setListener(AnimationStateListener listener); private: Animation* _animation; @@ -235,7 +237,7 @@ namespace Spine { Vector _timelineData; Vector _timelineDipMix; Vector _timelinesRotation; - OnAnimationEventFunc _onAnimationEventFunc; + AnimationStateListener _listener; /// Sets the timeline data. /// @param to May be NULL. @@ -290,7 +292,7 @@ namespace Spine { void drain(); }; - class AnimationState : public SpineObject { + class AnimationState : public SpineObject, public HasRendererObject { friend class TrackEntry; friend class EventQueue; @@ -378,10 +380,7 @@ namespace Spine { float getTimeScale(); void setTimeScale(float inValue); - void setOnAnimationEventFunc(OnAnimationEventFunc inValue); - - void setRendererObject(void* inValue); - void* getRendererObject(); + void setListener(AnimationStateListener listener); private: static const int Subsequent, First, Dip, DipMix; @@ -396,10 +395,8 @@ namespace Spine { Vector _propertyIDs; Vector _mixingTo; bool _animationsChanged; - - void* _rendererObject; - OnAnimationEventFunc _onAnimationEventFunc; + AnimationStateListener _listener; float _timeScale; diff --git a/spine-cpp/spine-cpp/include/spine/AnimationStateData.h b/spine-cpp/spine-cpp/include/spine/AnimationStateData.h index ad745c448..a87979bc3 100644 --- a/spine-cpp/spine-cpp/include/spine/AnimationStateData.h +++ b/spine-cpp/spine-cpp/include/spine/AnimationStateData.h @@ -37,7 +37,7 @@ #include -namespace Spine { +namespace spine { class SkeletonData; class Animation; @@ -46,14 +46,14 @@ namespace Spine { friend class AnimationState; public: + explicit AnimationStateData(SkeletonData* skeletonData); + /// The SkeletonData to look up animations when they are specified by name. SkeletonData* getSkeletonData(); /// The mix duration to use when no mix duration has been specifically defined between two animations. float getDefaultMix(); void setDefaultMix(float inValue); - - explicit AnimationStateData(SkeletonData* skeletonData); /// Sets a mix duration by animation names. void setMix(const String& fromName, const String& toName, float duration); diff --git a/spine-cpp/spine-cpp/include/spine/Atlas.h b/spine-cpp/spine-cpp/include/spine/Atlas.h index e720417d2..8cf23a6ec 100644 --- a/spine-cpp/spine-cpp/include/spine/Atlas.h +++ b/spine-cpp/spine-cpp/include/spine/Atlas.h @@ -35,8 +35,9 @@ #include #include #include +#include -namespace Spine { +namespace spine { enum Format { Format_Alpha, Format_Intensity, @@ -64,7 +65,7 @@ enum TextureWrap { TextureWrap_Repeat }; -class AtlasPage : public SpineObject { +class AtlasPage : public SpineObject, public HasRendererObject { public: String name; Format format; @@ -72,13 +73,14 @@ public: TextureFilter magFilter; TextureWrap uWrap; TextureWrap vWrap; - void *rendererObject; int width, height; explicit AtlasPage(const String &inName) : name(inName), format(Format_RGBA8888), minFilter(TextureFilter_Nearest), magFilter(TextureFilter_Nearest), uWrap(TextureWrap_ClampToEdge), vWrap(TextureWrap_ClampToEdge) { } + + virtual ~AtlasPage() { } }; class AtlasRegion : public SpineObject { @@ -112,10 +114,6 @@ public: /// @return The region, or NULL. AtlasRegion *findRegion(const String &name); - void dispose(); - - - private: Vector _pages; Vector _regions; diff --git a/spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h b/spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h index c01725da1..0a3f7d364 100644 --- a/spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h +++ b/spine-cpp/spine-cpp/include/spine/AtlasAttachmentLoader.h @@ -36,7 +36,7 @@ #include -namespace Spine { +namespace spine { class Atlas; class AtlasRegion; @@ -44,10 +44,10 @@ namespace Spine { /// An AttachmentLoader that configures attachments using texture regions from an Atlas. /// See http://esotericsoftware.com/spine-loading-skeleton-data#JSON-and-binary-data about Loading Skeleton Data in the Spine Runtimes Guide. /// - class AtlasAttachmentLoader : public AttachmentLoader { - RTTI_DECL - + class AtlasAttachmentLoader : public AttachmentLoader { public: + RTTI_DECL + explicit AtlasAttachmentLoader(Atlas* atlas); virtual RegionAttachment* newRegionAttachment(Skin& skin, const String& name, const String& path); diff --git a/spine-cpp/spine-cpp/include/spine/Attachment.h b/spine-cpp/spine-cpp/include/spine/Attachment.h index 16a17c704..a03f23478 100644 --- a/spine-cpp/spine-cpp/include/spine/Attachment.h +++ b/spine-cpp/spine-cpp/include/spine/Attachment.h @@ -35,7 +35,7 @@ #include #include -namespace Spine { +namespace spine { class Attachment : public SpineObject { RTTI_DECL diff --git a/spine-cpp/spine-cpp/include/spine/AttachmentLoader.h b/spine-cpp/spine-cpp/include/spine/AttachmentLoader.h index 42408209b..be75836c7 100644 --- a/spine-cpp/spine-cpp/include/spine/AttachmentLoader.h +++ b/spine-cpp/spine-cpp/include/spine/AttachmentLoader.h @@ -35,7 +35,7 @@ #include #include -namespace Spine { +namespace spine { class Skin; class RegionAttachment; class MeshAttachment; @@ -45,6 +45,7 @@ namespace Spine { class ClippingAttachment; class AttachmentLoader : public SpineObject { + public: RTTI_DECL AttachmentLoader(); diff --git a/spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h b/spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h index ac356df5d..ee4f9cc08 100644 --- a/spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/AttachmentTimeline.h @@ -38,7 +38,7 @@ #include #include -namespace Spine { +namespace spine { class Skeleton; class Event; diff --git a/spine-cpp/spine-cpp/include/spine/AttachmentType.h b/spine-cpp/spine-cpp/include/spine/AttachmentType.h index 76ecb42d9..c77f36b8c 100644 --- a/spine-cpp/spine-cpp/include/spine/AttachmentType.h +++ b/spine-cpp/spine-cpp/include/spine/AttachmentType.h @@ -31,7 +31,7 @@ #ifndef Spine_AttachmentType_h #define Spine_AttachmentType_h -namespace Spine { +namespace spine { enum AttachmentType { AttachmentType_Region, AttachmentType_Boundingbox, diff --git a/spine-cpp/spine-cpp/include/spine/BlendMode.h b/spine-cpp/spine-cpp/include/spine/BlendMode.h index 38c6b0821..729fdcf06 100644 --- a/spine-cpp/spine-cpp/include/spine/BlendMode.h +++ b/spine-cpp/spine-cpp/include/spine/BlendMode.h @@ -31,7 +31,7 @@ #ifndef Spine_BlendMode_h #define Spine_BlendMode_h -namespace Spine { +namespace spine { enum BlendMode { BlendMode_Normal = 0, BlendMode_Additive, diff --git a/spine-cpp/spine-cpp/include/spine/Bone.h b/spine-cpp/spine-cpp/include/spine/Bone.h index 1950e6250..e3064eaf0 100644 --- a/spine-cpp/spine-cpp/include/spine/Bone.h +++ b/spine-cpp/spine-cpp/include/spine/Bone.h @@ -35,7 +35,7 @@ #include #include -namespace Spine { +namespace spine { class BoneData; class Skeleton; diff --git a/spine-cpp/spine-cpp/include/spine/BoneData.h b/spine-cpp/spine-cpp/include/spine/BoneData.h index 903679384..8bc976635 100644 --- a/spine-cpp/spine-cpp/include/spine/BoneData.h +++ b/spine-cpp/spine-cpp/include/spine/BoneData.h @@ -35,7 +35,7 @@ #include #include -namespace Spine { +namespace spine { class BoneData : public SpineObject { friend class SkeletonBinary; diff --git a/spine-cpp/spine-cpp/include/spine/BoundingBoxAttachment.h b/spine-cpp/spine-cpp/include/spine/BoundingBoxAttachment.h index 066aa0487..2f849a622 100644 --- a/spine-cpp/spine-cpp/include/spine/BoundingBoxAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/BoundingBoxAttachment.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { /// Attachment that has a polygon for bounds checking. class BoundingBoxAttachment : public VertexAttachment { RTTI_DECL diff --git a/spine-cpp/spine-cpp/include/spine/ClippingAttachment.h b/spine-cpp/spine-cpp/include/spine/ClippingAttachment.h index 7d69efc8f..d162dd396 100644 --- a/spine-cpp/spine-cpp/include/spine/ClippingAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/ClippingAttachment.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class SlotData; class ClippingAttachment : public VertexAttachment { diff --git a/spine-cpp/spine-cpp/include/spine/Color.h b/spine-cpp/spine-cpp/include/spine/Color.h index 745e9cb39..e4d05da27 100644 --- a/spine-cpp/spine-cpp/include/spine/Color.h +++ b/spine-cpp/spine-cpp/include/spine/Color.h @@ -32,7 +32,7 @@ #include -namespace Spine { +namespace spine { class Color : public SpineObject { public: Color() : r(0), g(0), b(0), a(0) { diff --git a/spine-cpp/spine-cpp/include/spine/ColorTimeline.h b/spine-cpp/spine-cpp/include/spine/ColorTimeline.h index bd32dd853..a4fef6ee9 100644 --- a/spine-cpp/spine-cpp/include/spine/ColorTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/ColorTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class ColorTimeline : public CurveTimeline { friend class SkeletonBinary; diff --git a/spine-cpp/spine-cpp/include/spine/Constraint.h b/spine-cpp/spine-cpp/include/spine/Constraint.h index 028f2f151..d68df37e8 100644 --- a/spine-cpp/spine-cpp/include/spine/Constraint.h +++ b/spine-cpp/spine-cpp/include/spine/Constraint.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { /// The interface for all constraints. class Constraint : public Updatable { RTTI_DECL diff --git a/spine-cpp/spine-cpp/include/spine/ContainerUtil.h b/spine-cpp/spine-cpp/include/spine/ContainerUtil.h index c7e8bc125..f5d8a2589 100644 --- a/spine-cpp/spine-cpp/include/spine/ContainerUtil.h +++ b/spine-cpp/spine-cpp/include/spine/ContainerUtil.h @@ -39,7 +39,7 @@ #include -namespace Spine { +namespace spine { class ContainerUtil : public SpineObject { public: /// Finds an item by comparing each item's name. diff --git a/spine-cpp/spine-cpp/include/spine/CurveTimeline.h b/spine-cpp/spine-cpp/include/spine/CurveTimeline.h index 5169051fc..f0d351b3c 100644 --- a/spine-cpp/spine-cpp/include/spine/CurveTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/CurveTimeline.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { /// Base class for frames that use an interpolation bezier curve. class CurveTimeline : public Timeline { RTTI_DECL diff --git a/spine-cpp/spine-cpp/include/spine/Debug.h b/spine-cpp/spine-cpp/include/spine/Debug.h index 19a8c9c9d..a90a02bca 100644 --- a/spine-cpp/spine-cpp/include/spine/Debug.h +++ b/spine-cpp/spine-cpp/include/spine/Debug.h @@ -35,8 +35,8 @@ #include -namespace Spine { -class DebugExtension : public DefaultSpineExtension { +namespace spine { +class DebugExtension : public SpineExtension { struct Allocation { void *address; size_t size; @@ -51,7 +51,7 @@ class DebugExtension : public DefaultSpineExtension { }; public: - DebugExtension(): _allocations(0), _reallocations(0), _frees(0) { + DebugExtension(SpineExtension* extension): _extension(extension), _allocations(0), _reallocations(0), _frees(0) { } void reportLeaks() { @@ -66,16 +66,15 @@ public: _allocated.clear(); } -protected: virtual void *_alloc(size_t size, const char *file, int line) { - void *result = DefaultSpineExtension::_alloc(size, file, line); + void *result = _extension->_alloc(size, file, line); _allocated[result] = Allocation(result, size, file, line); _allocations++; return result; } virtual void *_calloc(size_t size, const char *file, int line) { - void *result = DefaultSpineExtension::_calloc(size, file, line); + void *result = _extension->_calloc(size, file, line); _allocated[result] = Allocation(result, size, file, line); _allocations++; return result; @@ -83,7 +82,7 @@ protected: virtual void *_realloc(void *ptr, size_t size, const char *file, int line) { _allocated.erase(ptr); - void *result = DefaultSpineExtension::_realloc(ptr, size, file, line); + void *result = _extension->_realloc(ptr, size, file, line); _reallocations++; _allocated[result] = Allocation(result, size, file, line); return result; @@ -91,17 +90,22 @@ protected: virtual void _free(void *mem, const char *file, int line) { if (_allocated.count(mem)) { - DefaultSpineExtension::_free(mem, file, line); + _extension->_free(mem, file, line); _frees++; _allocated.erase(mem); return; } printf("%s:%i (address %p): Double free or not allocated through SpineExtension\n", file, line, mem); - DefaultSpineExtension::_free(mem, file, line); + _extension->_free(mem, file, line); + } + + virtual char *_readFile(const String &path, int *length) { + return _extension->_readFile(path, length); } private: + SpineExtension* _extension; std::map _allocated; size_t _allocations; size_t _reallocations; diff --git a/spine-cpp/spine-cpp/include/spine/DeformTimeline.h b/spine-cpp/spine-cpp/include/spine/DeformTimeline.h index 3f05cebbc..63c2e469f 100644 --- a/spine-cpp/spine-cpp/include/spine/DeformTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/DeformTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class VertexAttachment; class DeformTimeline : public CurveTimeline { diff --git a/spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h b/spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h index 368e0b922..c99c6032a 100644 --- a/spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/DrawOrderTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class DrawOrderTimeline : public Timeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/Event.h b/spine-cpp/spine-cpp/include/spine/Event.h index c0263771a..e39911bdd 100644 --- a/spine-cpp/spine-cpp/include/spine/Event.h +++ b/spine-cpp/spine-cpp/include/spine/Event.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { class EventData; /// Stores the current pose values for an Event. diff --git a/spine-cpp/spine-cpp/include/spine/EventData.h b/spine-cpp/spine-cpp/include/spine/EventData.h index 3de4a7591..8164e4b61 100644 --- a/spine-cpp/spine-cpp/include/spine/EventData.h +++ b/spine-cpp/spine-cpp/include/spine/EventData.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { /// Stores the setup pose values for an Event. class EventData : public SpineObject { friend class SkeletonBinary; diff --git a/spine-cpp/spine-cpp/include/spine/EventTimeline.h b/spine-cpp/spine-cpp/include/spine/EventTimeline.h index cd2681716..cbc1c148c 100644 --- a/spine-cpp/spine-cpp/include/spine/EventTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/EventTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class EventTimeline : public Timeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/Extension.h b/spine-cpp/spine-cpp/include/spine/Extension.h index 5829d5710..f932522db 100644 --- a/spine-cpp/spine-cpp/include/spine/Extension.h +++ b/spine-cpp/spine-cpp/include/spine/Extension.h @@ -35,7 +35,7 @@ #define SP_UNUSED(x) (void)(x) -namespace Spine { +namespace spine { class String; class SpineExtension { @@ -70,7 +70,6 @@ public: virtual ~SpineExtension(); -protected: /// Implement this function to use your own memory allocator virtual void *_alloc(size_t size, const char *file, int line) = 0; @@ -83,6 +82,7 @@ protected: virtual char *_readFile(const String &path, int *length) = 0; +protected: SpineExtension(); private: @@ -107,18 +107,11 @@ protected: virtual char *_readFile(const String &path, int *length); }; -struct Allocation { - void *address; - size_t size; - const char *fileName; - int line; - - Allocation() : address(NULL), size(0), fileName(NULL), line(0) { - } - - Allocation(void *a, size_t s, const char *f, int l) : address(a), size(s), fileName(f), line(l) { - } -}; +// This function is to be implemented by engine specific runtimes to provide +// the default extension for that engine. It is called the first time +// SpineExtension::getInstance() is called, when no instance has been set +// yet. +extern SpineExtension *getDefaultExtension(); } #endif /* Spine_Extension_h */ diff --git a/spine-cocos2dx/src/spine/Cocos2dAttachmentLoader.h b/spine-cpp/spine-cpp/include/spine/HasRendererObject.h similarity index 75% rename from spine-cocos2dx/src/spine/Cocos2dAttachmentLoader.h rename to spine-cpp/spine-cpp/include/spine/HasRendererObject.h index 92454a6a8..b636cf987 100644 --- a/spine-cocos2dx/src/spine/Cocos2dAttachmentLoader.h +++ b/spine-cpp/spine-cpp/include/spine/HasRendererObject.h @@ -1,48 +1,59 @@ -/****************************************************************************** - * Spine Runtimes Software License v2.5 - * - * Copyright (c) 2013-2016, Esoteric Software - * All rights reserved. - * - * You are granted a perpetual, non-exclusive, non-sublicensable, and - * non-transferable license to use, install, execute, and perform the Spine - * Runtimes software and derivative works solely for personal or internal - * use. Without the written permission of Esoteric Software (see Section 2 of - * the Spine Software License Agreement), you may not (a) modify, translate, - * adapt, or develop new applications using the Spine Runtimes or otherwise - * create derivative works or improvements of the Spine Runtimes or (b) remove, - * delete, alter, or obscure any trademarks or any copyright, trademark, patent, - * or other intellectual property or proprietary rights notices on or in the - * Software, including any copy thereof. Redistributions in binary or source - * form must include this license and terms. - * - * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO - * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF - * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER - * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - *****************************************************************************/ - -#ifndef SPINE_COCOS2DATTACHMENTLOADER_H_ -#define SPINE_COCOS2DATTACHMENTLOADER_H_ - -#include - -extern "C" { - -typedef struct Cocos2dAttachmentLoader { - spAttachmentLoader super; - spAtlasAttachmentLoader* atlasAttachmentLoader; -} Cocos2dAttachmentLoader; - -/* The Cocos2dAttachmentLoader must not be disposed until after the skeleton data has been disposed. */ -Cocos2dAttachmentLoader* Cocos2dAttachmentLoader_create (spAtlas* atlas); - -} - -#endif /* SPINE_COCOS2DATTACHMENTLOADER_H_ */ +/****************************************************************************** + * Spine Runtimes Software License v2.5 + * + * Copyright (c) 2013-2016, Esoteric Software + * All rights reserved. + * + * You are granted a perpetual, non-exclusive, non-sublicensable, and + * non-transferable license to use, install, execute, and perform the Spine + * Runtimes software and derivative works solely for personal or internal + * use. Without the written permission of Esoteric Software (see Section 2 of + * the Spine Software License Agreement), you may not (a) modify, translate, + * adapt, or develop new applications using the Spine Runtimes or otherwise + * create derivative works or improvements of the Spine Runtimes or (b) remove, + * delete, alter, or obscure any trademarks or any copyright, trademark, patent, + * or other intellectual property or proprietary rights notices on or in the + * Software, including any copy thereof. Redistributions in binary or source + * form must include this license and terms. + * + * THIS SOFTWARE IS PROVIDED BY ESOTERIC SOFTWARE "AS IS" AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO + * EVENT SHALL ESOTERIC SOFTWARE BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, BUSINESS INTERRUPTION, OR LOSS OF + * USE, DATA, OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER + * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + *****************************************************************************/ + +#ifndef Spine_HasRendererObject_h +#define Spine_HasRendererObject_h + +namespace spine { + +typedef void (*DisposeRendererObject) (void* rendererObject); + +class HasRendererObject { +public: + explicit HasRendererObject() : _rendererObject(NULL) {}; + + virtual ~HasRendererObject() { + if (_dispose) + _dispose(_rendererObject); + } + + void* getRendererObject() { return _rendererObject; } + void setRendererObject(void* rendererObject, DisposeRendererObject dispose = NULL) { + _rendererObject = rendererObject; + _dispose = dispose; + } +private: + void *_rendererObject; + DisposeRendererObject _dispose; +}; + +} + +#endif diff --git a/spine-cpp/spine-cpp/include/spine/HashMap.h b/spine-cpp/spine-cpp/include/spine/HashMap.h index 31c37155c..f29eec09b 100755 --- a/spine-cpp/spine-cpp/include/spine/HashMap.h +++ b/spine-cpp/spine-cpp/include/spine/HashMap.h @@ -40,7 +40,7 @@ #pragma warning(disable:4291) #endif -namespace Spine { +namespace spine { template class HashMap : public SpineObject { private: diff --git a/spine-cpp/spine-cpp/include/spine/IkConstraint.h b/spine-cpp/spine-cpp/include/spine/IkConstraint.h index 6ec13ce6e..43b1b47cb 100644 --- a/spine-cpp/spine-cpp/include/spine/IkConstraint.h +++ b/spine-cpp/spine-cpp/include/spine/IkConstraint.h @@ -35,7 +35,7 @@ #include -namespace Spine { +namespace spine { class IkConstraintData; class Skeleton; diff --git a/spine-cpp/spine-cpp/include/spine/IkConstraintData.h b/spine-cpp/spine-cpp/include/spine/IkConstraintData.h index a385b9ab3..be900310a 100644 --- a/spine-cpp/spine-cpp/include/spine/IkConstraintData.h +++ b/spine-cpp/spine-cpp/include/spine/IkConstraintData.h @@ -35,7 +35,7 @@ #include #include -namespace Spine { +namespace spine { class BoneData; class IkConstraintData : public SpineObject { diff --git a/spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h b/spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h index 02686b2d4..0b638f0c7 100644 --- a/spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/IkConstraintTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class IkConstraintTimeline : public CurveTimeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/Json.h b/spine-cpp/spine-cpp/include/spine/Json.h index b67b2e51f..0ff2db67a 100644 --- a/spine-cpp/spine-cpp/include/spine/Json.h +++ b/spine-cpp/spine-cpp/include/spine/Json.h @@ -34,11 +34,11 @@ #include #ifndef SPINE_JSON_HAVE_PREV -/* Spine doesn't use the "prev" link in the Json sibling lists. */ +/* spine doesn't use the "prev" link in the Json sibling lists. */ #define SPINE_JSON_HAVE_PREV 0 #endif -namespace Spine { +namespace spine { class Json : public SpineObject { friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/LinkedMesh.h b/spine-cpp/spine-cpp/include/spine/LinkedMesh.h index d3a2392f4..deb0a99ac 100644 --- a/spine-cpp/spine-cpp/include/spine/LinkedMesh.h +++ b/spine-cpp/spine-cpp/include/spine/LinkedMesh.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { class MeshAttachment; class LinkedMesh : public SpineObject { diff --git a/spine-cpp/spine-cpp/include/spine/MathUtil.h b/spine-cpp/spine-cpp/include/spine/MathUtil.h index 99983ad82..6daf45651 100644 --- a/spine-cpp/spine-cpp/include/spine/MathUtil.h +++ b/spine-cpp/spine-cpp/include/spine/MathUtil.h @@ -36,7 +36,7 @@ #include #include -namespace Spine { +namespace spine { static const float PI = 3.1415926535897932385f; static const float PI_2 = PI * 2; static const float DEG_RAD = (PI / 180.0f); diff --git a/spine-cpp/spine-cpp/include/spine/MeshAttachment.h b/spine-cpp/spine-cpp/include/spine/MeshAttachment.h index 793638cd9..cef5cd7a7 100644 --- a/spine-cpp/spine-cpp/include/spine/MeshAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/MeshAttachment.h @@ -34,10 +34,11 @@ #include #include #include +#include -namespace Spine { +namespace spine { /// Attachment that displays a texture region using a mesh. - class MeshAttachment : public VertexAttachment { + class MeshAttachment : public VertexAttachment, public HasRendererObject { friend class SkeletonBinary; friend class SkeletonJson; friend class AtlasAttachmentLoader; @@ -47,6 +48,8 @@ namespace Spine { public: explicit MeshAttachment(const String& name); + virtual ~MeshAttachment(); + void updateUVs(); virtual bool applyDeform(VertexAttachment* sourceAttachment); @@ -65,8 +68,6 @@ namespace Spine { const String& getPath(); void setPath(const String& inValue); - void* getRendererObject(); - void setRendererObject(void* inValue); float getRegionU(); void setRegionU(float inValue); @@ -124,7 +125,6 @@ namespace Spine { Vector _regionUVs; Vector _triangles; Vector _edges; - void* _rendererObject; String _path; float _regionU; float _regionV; diff --git a/spine-cpp/spine-cpp/include/spine/MixBlend.h b/spine-cpp/spine-cpp/include/spine/MixBlend.h index 6354f86e2..937f1d40e 100644 --- a/spine-cpp/spine-cpp/include/spine/MixBlend.h +++ b/spine-cpp/spine-cpp/include/spine/MixBlend.h @@ -31,7 +31,7 @@ #ifndef Spine_MixPose_h #define Spine_MixPose_h -namespace Spine { +namespace spine { /// /// Controls how a timeline is mixed with the setup or current pose. /// See also Timeline::apply(Skeleton&, float, float, Vector&, float, Blend, MixDirection) diff --git a/spine-cpp/spine-cpp/include/spine/MixDirection.h b/spine-cpp/spine-cpp/include/spine/MixDirection.h index a488ff691..6c758d0a8 100644 --- a/spine-cpp/spine-cpp/include/spine/MixDirection.h +++ b/spine-cpp/spine-cpp/include/spine/MixDirection.h @@ -31,7 +31,7 @@ #ifndef Spine_MixDirection_h #define Spine_MixDirection_h -namespace Spine { +namespace spine { /// /// Indicates whether a timeline's alpha is mixing out over time toward 0 (the setup or current pose) or mixing in toward 1 (the timeline's pose). /// See also Timeline::apply(Skeleton&, float, float, Vector&, float, MixPose, MixDirection) diff --git a/spine-cpp/spine-cpp/include/spine/PathAttachment.h b/spine-cpp/spine-cpp/include/spine/PathAttachment.h index 5d927310e..165a058ba 100644 --- a/spine-cpp/spine-cpp/include/spine/PathAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/PathAttachment.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class PathAttachment : public VertexAttachment { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraint.h b/spine-cpp/spine-cpp/include/spine/PathConstraint.h index bfaadbdf8..c966cf9d5 100644 --- a/spine-cpp/spine-cpp/include/spine/PathConstraint.h +++ b/spine-cpp/spine-cpp/include/spine/PathConstraint.h @@ -35,7 +35,7 @@ #include -namespace Spine { +namespace spine { class PathConstraintData; class Skeleton; class PathAttachment; diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraintData.h b/spine-cpp/spine-cpp/include/spine/PathConstraintData.h index 1051b8156..6d11a1693 100644 --- a/spine-cpp/spine-cpp/include/spine/PathConstraintData.h +++ b/spine-cpp/spine-cpp/include/spine/PathConstraintData.h @@ -38,7 +38,7 @@ #include #include -namespace Spine { +namespace spine { class BoneData; class SlotData; diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h b/spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h index e9da5f6bc..6391d7fd7 100644 --- a/spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/PathConstraintMixTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class PathConstraintMixTimeline : public CurveTimeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h b/spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h index e70ad9d8c..461ae06c6 100644 --- a/spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/PathConstraintPositionTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class PathConstraintPositionTimeline : public CurveTimeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h b/spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h index 69675361a..eff28cb6e 100644 --- a/spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/PathConstraintSpacingTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class PathConstraintSpacingTimeline : public PathConstraintPositionTimeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/PointAttachment.h b/spine-cpp/spine-cpp/include/spine/PointAttachment.h index 61ae21ba0..38e65ed07 100644 --- a/spine-cpp/spine-cpp/include/spine/PointAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/PointAttachment.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class Bone; /// diff --git a/spine-cpp/spine-cpp/include/spine/Pool.h b/spine-cpp/spine-cpp/include/spine/Pool.h index 946b6f7bc..b28f5553b 100644 --- a/spine-cpp/spine-cpp/include/spine/Pool.h +++ b/spine-cpp/spine-cpp/include/spine/Pool.h @@ -36,7 +36,7 @@ #include #include -namespace Spine { +namespace spine { template class Pool : public SpineObject { public: diff --git a/spine-cpp/spine-cpp/include/spine/PositionMode.h b/spine-cpp/spine-cpp/include/spine/PositionMode.h index 35437dac8..46fb89646 100644 --- a/spine-cpp/spine-cpp/include/spine/PositionMode.h +++ b/spine-cpp/spine-cpp/include/spine/PositionMode.h @@ -31,7 +31,7 @@ #ifndef Spine_PositionMode_h #define Spine_PositionMode_h -namespace Spine { +namespace spine { enum PositionMode { PositionMode_Fixed = 0, PositionMode_Percent diff --git a/spine-cpp/spine-cpp/include/spine/RTTI.h b/spine-cpp/spine-cpp/include/spine/RTTI.h index fd3413eb0..48fa9bffd 100644 --- a/spine-cpp/spine-cpp/include/spine/RTTI.h +++ b/spine-cpp/spine-cpp/include/spine/RTTI.h @@ -35,7 +35,7 @@ #include -namespace Spine { +namespace spine { class RTTI : public SpineObject { public: explicit RTTI(const std::string &className); @@ -61,16 +61,16 @@ private: #define RTTI_DECL \ public: \ -static const Spine::RTTI rtti; \ -virtual const Spine::RTTI& getRTTI() const; +static const spine::RTTI rtti; \ +virtual const spine::RTTI& getRTTI() const; #define RTTI_IMPL_NOPARENT(name) \ -const Spine::RTTI name::rtti(#name); \ -const Spine::RTTI& name::getRTTI() const { return rtti; } +const spine::RTTI name::rtti(#name); \ +const spine::RTTI& name::getRTTI() const { return rtti; } #define RTTI_IMPL(name, parent) \ -const Spine::RTTI name::rtti(#name, parent::rtti); \ -const Spine::RTTI& name::getRTTI() const { return rtti; } +const spine::RTTI name::rtti(#name, parent::rtti); \ +const spine::RTTI& name::getRTTI() const { return rtti; } #endif /* Spine_RTTI_h */ diff --git a/spine-cpp/spine-cpp/include/spine/RegionAttachment.h b/spine-cpp/spine-cpp/include/spine/RegionAttachment.h index 58d81353c..75ebfe4f1 100644 --- a/spine-cpp/spine-cpp/include/spine/RegionAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/RegionAttachment.h @@ -36,14 +36,15 @@ #include #include +#include #define NUM_UVS 8 -namespace Spine { +namespace spine { class Bone; /// Attachment that displays a texture region. - class RegionAttachment : public Attachment { + class RegionAttachment : public Attachment, public HasRendererObject { friend class SkeletonBinary; friend class SkeletonJson; friend class AtlasAttachmentLoader; @@ -62,6 +63,7 @@ namespace Spine { /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + 8. /// @param offset The worldVertices index to begin writing values. /// @param stride The number of worldVertices entries between the value pairs written. + void computeWorldVertices(Bone& bone, float *worldVertices, size_t offset, size_t stride = 2); void computeWorldVertices(Bone& bone, Vector& worldVertices, size_t offset, size_t stride = 2); float getX(); @@ -83,24 +85,22 @@ namespace Spine { const String& getPath(); void setPath(const String& inValue); - void* getRendererObject(); - void setRendererObject(void* inValue); + float getRegionOffsetX(); void setRegionOffsetX(float inValue); - - // Pixels stripped from the bottom left, unrotated. + float getRegionOffsetY(); void setRegionOffsetY(float inValue); + float getRegionWidth(); void setRegionWidth(float inValue); - - // Unrotated, stripped size. + float getRegionHeight(); void setRegionHeight(float inValue); + float getRegionOriginalWidth(); void setRegionOriginalWidth(float inValue); - - // Unrotated, unstripped size. + float getRegionOriginalHeight(); void setRegionOriginalHeight(float inValue); @@ -121,7 +121,6 @@ namespace Spine { float _regionOffsetX, _regionOffsetY, _regionWidth, _regionHeight, _regionOriginalWidth, _regionOriginalHeight; Vector _vertexOffset; Vector _uvs; - void* _rendererObject; String _path; float _regionU; float _regionV; diff --git a/spine-cpp/spine-cpp/include/spine/RotateMode.h b/spine-cpp/spine-cpp/include/spine/RotateMode.h index ff715b94e..a9a78f665 100644 --- a/spine-cpp/spine-cpp/include/spine/RotateMode.h +++ b/spine-cpp/spine-cpp/include/spine/RotateMode.h @@ -31,7 +31,7 @@ #ifndef Spine_RotateMode_h #define Spine_RotateMode_h -namespace Spine { +namespace spine { enum RotateMode { RotateMode_Tangent = 0, RotateMode_Chain, diff --git a/spine-cpp/spine-cpp/include/spine/RotateTimeline.h b/spine-cpp/spine-cpp/include/spine/RotateTimeline.h index f8c14fbd8..5cb3bd389 100644 --- a/spine-cpp/spine-cpp/include/spine/RotateTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/RotateTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class RotateTimeline : public CurveTimeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/ScaleTimeline.h b/spine-cpp/spine-cpp/include/spine/ScaleTimeline.h index 3aeb5731b..05963fe2b 100644 --- a/spine-cpp/spine-cpp/include/spine/ScaleTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/ScaleTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class ScaleTimeline : public TranslateTimeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/ShearTimeline.h b/spine-cpp/spine-cpp/include/spine/ShearTimeline.h index ac8b650d0..a5dcd3fbc 100644 --- a/spine-cpp/spine-cpp/include/spine/ShearTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/ShearTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class ShearTimeline : public TranslateTimeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/Skeleton.h b/spine-cpp/spine-cpp/include/spine/Skeleton.h index 594436a16..ee1d303f9 100644 --- a/spine-cpp/spine-cpp/include/spine/Skeleton.h +++ b/spine-cpp/spine-cpp/include/spine/Skeleton.h @@ -39,7 +39,7 @@ #include // std::numeric_limits -namespace Spine { +namespace spine { class SkeletonData; class Bone; @@ -170,7 +170,7 @@ public: Bone *getRootBone(); - const SkeletonData *getData(); + SkeletonData *getData(); Vector &getBones(); diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonBinary.h b/spine-cpp/spine-cpp/include/spine/SkeletonBinary.h index f58f1390e..612654831 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonBinary.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonBinary.h @@ -37,7 +37,7 @@ #include #include -namespace Spine { +namespace spine { class SkeletonData; class Atlas; class AttachmentLoader; diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonBounds.h b/spine-cpp/spine-cpp/include/spine/SkeletonBounds.h index 205198823..e10d3fe8e 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonBounds.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonBounds.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { class Skeleton; class BoundingBoxAttachment; class Polygon; diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonClipping.h b/spine-cpp/spine-cpp/include/spine/SkeletonClipping.h index ec59f5d88..79fa38bae 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonClipping.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonClipping.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { class Slot; class ClippingAttachment; @@ -47,8 +47,10 @@ namespace Spine { void clipEnd(Slot& slot); void clipEnd(); - - void clipTriangles(Vector& vertices, size_t verticesLength, Vector& triangles, size_t trianglesLength, Vector& uvs); + + void clipTriangles(float* vertices, unsigned short* triangles, size_t trianglesLength, float* uvs, size_t stride); + + void clipTriangles(Vector& vertices, Vector& triangles, Vector& uvs, size_t stride); bool isClipping(); diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonData.h b/spine-cpp/spine-cpp/include/spine/SkeletonData.h index 05160ea41..ae9c6f171 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonData.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonData.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { class BoneData; class SlotData; diff --git a/spine-cpp/spine-cpp/include/spine/SkeletonJson.h b/spine-cpp/spine-cpp/include/spine/SkeletonJson.h index 948b07feb..63b9f1108 100644 --- a/spine-cpp/spine-cpp/include/spine/SkeletonJson.h +++ b/spine-cpp/spine-cpp/include/spine/SkeletonJson.h @@ -35,7 +35,7 @@ #include #include -namespace Spine { +namespace spine { class CurveTimeline; class VertexAttachment; diff --git a/spine-cpp/spine-cpp/include/spine/Skin.h b/spine-cpp/spine-cpp/include/spine/Skin.h index e22256a95..acb12dd17 100644 --- a/spine-cpp/spine-cpp/include/spine/Skin.h +++ b/spine-cpp/spine-cpp/include/spine/Skin.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { class Attachment; class Skeleton; diff --git a/spine-cpp/spine-cpp/include/spine/Slot.h b/spine-cpp/spine-cpp/include/spine/Slot.h index b5248414b..c69656987 100644 --- a/spine-cpp/spine-cpp/include/spine/Slot.h +++ b/spine-cpp/spine-cpp/include/spine/Slot.h @@ -37,7 +37,7 @@ #include -namespace Spine { +namespace spine { class SlotData; class Bone; diff --git a/spine-cpp/spine-cpp/include/spine/SlotData.h b/spine-cpp/spine-cpp/include/spine/SlotData.h index 7551d30ae..f2952651e 100644 --- a/spine-cpp/spine-cpp/include/spine/SlotData.h +++ b/spine-cpp/spine-cpp/include/spine/SlotData.h @@ -36,7 +36,7 @@ #include #include -namespace Spine { +namespace spine { class BoneData; class SlotData : public SpineObject { diff --git a/spine-cpp/spine-cpp/include/spine/SpacingMode.h b/spine-cpp/spine-cpp/include/spine/SpacingMode.h index 333f678ca..0bb5c4ebf 100644 --- a/spine-cpp/spine-cpp/include/spine/SpacingMode.h +++ b/spine-cpp/spine-cpp/include/spine/SpacingMode.h @@ -31,7 +31,7 @@ #ifndef Spine_SpacingMode_h #define Spine_SpacingMode_h -namespace Spine { +namespace spine { enum SpacingMode { SpacingMode_Length = 0, SpacingMode_Fixed, diff --git a/spine-cpp/spine-cpp/include/spine/SpineObject.h b/spine-cpp/spine-cpp/include/spine/SpineObject.h index da5039c09..1b5928dba 100644 --- a/spine-cpp/spine-cpp/include/spine/SpineObject.h +++ b/spine-cpp/spine-cpp/include/spine/SpineObject.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class String; class SpineObject { diff --git a/spine-cpp/spine-cpp/include/spine/String.h b/spine-cpp/spine-cpp/include/spine/String.h index 08e56f45d..e8cb87129 100644 --- a/spine-cpp/spine-cpp/include/spine/String.h +++ b/spine-cpp/spine-cpp/include/spine/String.h @@ -42,7 +42,7 @@ #pragma warning(disable:4996) #endif -namespace Spine { +namespace spine { class String : public SpineObject { public: String() : _length(0), _buffer(NULL) { diff --git a/spine-cpp/spine-cpp/include/spine/TextureLoader.h b/spine-cpp/spine-cpp/include/spine/TextureLoader.h index feb5fbbfc..4327364bf 100644 --- a/spine-cpp/spine-cpp/include/spine/TextureLoader.h +++ b/spine-cpp/spine-cpp/include/spine/TextureLoader.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { class AtlasPage; class TextureLoader : public SpineObject { diff --git a/spine-cpp/spine-cpp/include/spine/Timeline.h b/spine-cpp/spine-cpp/include/spine/Timeline.h index 41182d6b8..87b3d168a 100644 --- a/spine-cpp/spine-cpp/include/spine/Timeline.h +++ b/spine-cpp/spine-cpp/include/spine/Timeline.h @@ -37,7 +37,7 @@ #include #include -namespace Spine { +namespace spine { class Skeleton; class Event; diff --git a/spine-cpp/spine-cpp/include/spine/TimelineType.h b/spine-cpp/spine-cpp/include/spine/TimelineType.h index d64f8427b..0f227cecf 100644 --- a/spine-cpp/spine-cpp/include/spine/TimelineType.h +++ b/spine-cpp/spine-cpp/include/spine/TimelineType.h @@ -31,7 +31,7 @@ #ifndef Spine_TimelineType_h #define Spine_TimelineType_h -namespace Spine { +namespace spine { enum TimelineType { TimelineType_Rotate = 0, TimelineType_Translate, diff --git a/spine-cpp/spine-cpp/include/spine/TransformConstraint.h b/spine-cpp/spine-cpp/include/spine/TransformConstraint.h index 69dc172ff..59c74536c 100644 --- a/spine-cpp/spine-cpp/include/spine/TransformConstraint.h +++ b/spine-cpp/spine-cpp/include/spine/TransformConstraint.h @@ -35,7 +35,7 @@ #include -namespace Spine { +namespace spine { class TransformConstraintData; class Skeleton; class Bone; diff --git a/spine-cpp/spine-cpp/include/spine/TransformConstraintData.h b/spine-cpp/spine-cpp/include/spine/TransformConstraintData.h index 7fb0cfcb3..0a8358234 100644 --- a/spine-cpp/spine-cpp/include/spine/TransformConstraintData.h +++ b/spine-cpp/spine-cpp/include/spine/TransformConstraintData.h @@ -35,7 +35,7 @@ #include #include -namespace Spine { +namespace spine { class BoneData; class TransformConstraintData : public SpineObject { diff --git a/spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h b/spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h index 45a435f37..0e4c97167 100644 --- a/spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/TransformConstraintTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class TransformConstraintTimeline : public CurveTimeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/TransformMode.h b/spine-cpp/spine-cpp/include/spine/TransformMode.h index cf7d96c3a..27c4fd5c4 100644 --- a/spine-cpp/spine-cpp/include/spine/TransformMode.h +++ b/spine-cpp/spine-cpp/include/spine/TransformMode.h @@ -31,7 +31,7 @@ #ifndef Spine_TransformMode_h #define Spine_TransformMode_h -namespace Spine { +namespace spine { enum TransformMode { TransformMode_Normal = 0, TransformMode_OnlyTranslation, diff --git a/spine-cpp/spine-cpp/include/spine/TranslateTimeline.h b/spine-cpp/spine-cpp/include/spine/TranslateTimeline.h index 610b5b329..27d00afad 100644 --- a/spine-cpp/spine-cpp/include/spine/TranslateTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/TranslateTimeline.h @@ -36,7 +36,7 @@ #include #include -namespace Spine { +namespace spine { class TranslateTimeline : public CurveTimeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/Triangulator.h b/spine-cpp/spine-cpp/include/spine/Triangulator.h index a888677d5..9de01bc68 100644 --- a/spine-cpp/spine-cpp/include/spine/Triangulator.h +++ b/spine-cpp/spine-cpp/include/spine/Triangulator.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { class Triangulator : public SpineObject { public: ~Triangulator(); diff --git a/spine-cpp/spine-cpp/include/spine/TwoColorTimeline.h b/spine-cpp/spine-cpp/include/spine/TwoColorTimeline.h index 8c46e37a7..ca5d591a3 100644 --- a/spine-cpp/spine-cpp/include/spine/TwoColorTimeline.h +++ b/spine-cpp/spine-cpp/include/spine/TwoColorTimeline.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class TwoColorTimeline : public CurveTimeline { friend class SkeletonBinary; friend class SkeletonJson; diff --git a/spine-cpp/spine-cpp/include/spine/Updatable.h b/spine-cpp/spine-cpp/include/spine/Updatable.h index 35b629951..1aaf4ec82 100644 --- a/spine-cpp/spine-cpp/include/spine/Updatable.h +++ b/spine-cpp/spine-cpp/include/spine/Updatable.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { class Updatable : public SpineObject { RTTI_DECL diff --git a/spine-cpp/spine-cpp/include/spine/Vector.h b/spine-cpp/spine-cpp/include/spine/Vector.h index 468aaacef..e4687b3e1 100644 --- a/spine-cpp/spine-cpp/include/spine/Vector.h +++ b/spine-cpp/spine-cpp/include/spine/Vector.h @@ -38,7 +38,7 @@ #include #include -namespace Spine { +namespace spine { template class Vector : public SpineObject { public: @@ -67,6 +67,10 @@ public: _size = 0; } + inline size_t getCapacity() const { + return _capacity; + } + inline size_t size() const { return _size; } @@ -78,7 +82,7 @@ public: if (_capacity < newSize) { _capacity = (int) (_size * 1.75f); if (_capacity < 8) _capacity = 8; - _buffer = Spine::SpineExtension::realloc(_buffer, _capacity, __FILE__, __LINE__); + _buffer = spine::SpineExtension::realloc(_buffer, _capacity, __FILE__, __LINE__); } if (oldSize < _size) { for (size_t i = oldSize; i < _size; i++) { @@ -97,7 +101,7 @@ public: if (_size == _capacity) { _capacity = (int) (_size * 1.75f); if (_capacity < 8) _capacity = 8; - _buffer = Spine::SpineExtension::realloc(_buffer, _capacity, __FILE__, __LINE__); + _buffer = spine::SpineExtension::realloc(_buffer, _capacity, __FILE__, __LINE__); } construct(_buffer + _size++, inValue); } diff --git a/spine-cpp/spine-cpp/include/spine/VertexAttachment.h b/spine-cpp/spine-cpp/include/spine/VertexAttachment.h index c3188d23f..e105897a8 100644 --- a/spine-cpp/spine-cpp/include/spine/VertexAttachment.h +++ b/spine-cpp/spine-cpp/include/spine/VertexAttachment.h @@ -35,7 +35,7 @@ #include -namespace Spine { +namespace spine { class Slot; /// An attachment with vertices that are transformed by one or more bones and can be deformed by a slot's vertices. @@ -50,7 +50,8 @@ namespace Spine { explicit VertexAttachment(const String& name); virtual ~VertexAttachment(); - + + void computeWorldVertices(Slot& slot, float* worldVertices); void computeWorldVertices(Slot& slot, Vector& worldVertices); /// Transforms local vertices to world coordinates. @@ -59,6 +60,7 @@ namespace Spine { /// @param worldVertices The output world vertices. Must have a length greater than or equal to offset + count. /// @param offset The worldVertices index to begin writing values. /// @param stride The number of worldVertices entries between the value pairs written. + void computeWorldVertices(Slot& slot, size_t start, size_t count, float* worldVertices, size_t offset, size_t stride = 2); void computeWorldVertices(Slot& slot, size_t start, size_t count, Vector& worldVertices, size_t offset, size_t stride = 2); /// @return true if a deform originally applied to the specified attachment should be applied to this attachment. diff --git a/spine-cpp/spine-cpp/include/spine/VertexEffect.h b/spine-cpp/spine-cpp/include/spine/VertexEffect.h index ffbdb97dd..84b2a5859 100644 --- a/spine-cpp/spine-cpp/include/spine/VertexEffect.h +++ b/spine-cpp/spine-cpp/include/spine/VertexEffect.h @@ -34,7 +34,7 @@ #include #include -namespace Spine { +namespace spine { class Skeleton; class Color; diff --git a/spine-cpp/spine-cpp/include/spine/Vertices.h b/spine-cpp/spine-cpp/include/spine/Vertices.h index 0ae9d3b9a..0e582cfc0 100644 --- a/spine-cpp/spine-cpp/include/spine/Vertices.h +++ b/spine-cpp/spine-cpp/include/spine/Vertices.h @@ -33,7 +33,7 @@ #include -namespace Spine { +namespace spine { class Vertices : public SpineObject { public: Vector _bones; diff --git a/spine-cpp/spine-cpp/src/spine/Animation.cpp b/spine-cpp/spine-cpp/src/spine/Animation.cpp index 7ee8588ea..cf9e0cf36 100644 --- a/spine-cpp/spine-cpp/src/spine/Animation.cpp +++ b/spine-cpp/spine-cpp/src/spine/Animation.cpp @@ -36,7 +36,7 @@ #include -using namespace Spine; +using namespace spine; Animation::Animation(const String &name, Vector &timelines, float duration) : _timelines(timelines), diff --git a/spine-cpp/spine-cpp/src/spine/AnimationState.cpp b/spine-cpp/spine-cpp/src/spine/AnimationState.cpp index 8386787c5..6905eed14 100644 --- a/spine-cpp/spine-cpp/src/spine/AnimationState.cpp +++ b/spine-cpp/spine-cpp/src/spine/AnimationState.cpp @@ -42,7 +42,7 @@ #include #include -using namespace Spine; +using namespace spine; void dummyOnAnimationEventFunc(AnimationState *state, EventType type, TrackEntry *entry, Event *event = NULL) { SP_UNUSED(state); @@ -56,9 +56,11 @@ TrackEntry::TrackEntry() : _animation(NULL), _next(NULL), _mixingFrom(NULL), _tr _animationEnd(0), _animationLast(0), _nextAnimationLast(0), _delay(0), _trackTime(0), _trackLast(0), _nextTrackLast(0), _trackEnd(0), _timeScale(1.0f), _alpha(0), _mixTime(0), _mixDuration(0), _interruptAlpha(0), _totalAlpha(0), _mixBlend(MixBlend_Replace), - _onAnimationEventFunc(dummyOnAnimationEventFunc) { + _listener(dummyOnAnimationEventFunc) { } +TrackEntry::~TrackEntry() { } + int TrackEntry::getTrackIndex() { return _trackIndex; } Animation *TrackEntry::getAnimation() { return _animation; } @@ -151,8 +153,8 @@ void TrackEntry::resetRotationDirections() { _timelinesRotation.clear(); } -void TrackEntry::setOnAnimationEventFunc(OnAnimationEventFunc inValue) { - _onAnimationEventFunc = inValue; +void TrackEntry::setListener(AnimationStateListener inValue) { + _listener = inValue; } TrackEntry *TrackEntry::setTimelineData(TrackEntry *to, Vector &mixingToArray, Vector &propertyIDs) { @@ -218,7 +220,7 @@ void TrackEntry::reset() { _timelineDipMix.clear(); _timelinesRotation.clear(); - _onAnimationEventFunc = dummyOnAnimationEventFunc; + _listener = dummyOnAnimationEventFunc; } EventQueueEntry::EventQueueEntry(EventType eventType, TrackEntry *trackEntry, Event *event) : @@ -288,22 +290,22 @@ void EventQueue::drain() { case EventType_Start: case EventType_Interrupt: case EventType_Complete: - trackEntry->_onAnimationEventFunc(&state, queueEntry->_type, trackEntry, NULL); - state._onAnimationEventFunc(&state, queueEntry->_type, trackEntry, NULL); + trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL); + state._listener(&state, queueEntry->_type, trackEntry, NULL); break; case EventType_End: - trackEntry->_onAnimationEventFunc(&state, queueEntry->_type, trackEntry, NULL); - state._onAnimationEventFunc(&state, queueEntry->_type, trackEntry, NULL); + trackEntry->_listener(&state, queueEntry->_type, trackEntry, NULL); + state._listener(&state, queueEntry->_type, trackEntry, NULL); /* Yes, we want to fall through here */ case EventType_Dispose: - trackEntry->_onAnimationEventFunc(&state, EventType_Dispose, trackEntry, NULL); - state._onAnimationEventFunc(&state, EventType_Dispose, trackEntry, NULL); + trackEntry->_listener(&state, EventType_Dispose, trackEntry, NULL); + state._listener(&state, EventType_Dispose, trackEntry, NULL); trackEntry->reset(); _trackEntryPool.free(trackEntry); break; case EventType_Event: - trackEntry->_onAnimationEventFunc(&state, queueEntry->_type, trackEntry, queueEntry->_event); - state._onAnimationEventFunc(&state, queueEntry->_type, trackEntry, queueEntry->_event); + trackEntry->_listener(&state, queueEntry->_type, trackEntry, queueEntry->_event); + state._listener(&state, queueEntry->_type, trackEntry, queueEntry->_event); break; } } @@ -321,8 +323,7 @@ AnimationState::AnimationState(AnimationStateData *data) : _data(data), _queue(EventQueue::newEventQueue(*this, _trackEntryPool)), _animationsChanged(false), - _rendererObject(NULL), - _onAnimationEventFunc(dummyOnAnimationEventFunc), + _listener(dummyOnAnimationEventFunc), _timeScale(1) { } @@ -654,16 +655,8 @@ void AnimationState::setTimeScale(float inValue) { _timeScale = inValue; } -void AnimationState::setOnAnimationEventFunc(OnAnimationEventFunc inValue) { - _onAnimationEventFunc = inValue; -} - -void AnimationState::setRendererObject(void *inValue) { - _rendererObject = inValue; -} - -void *AnimationState::getRendererObject() { - return _rendererObject; +void AnimationState::setListener(AnimationStateListener inValue) { + _listener = inValue; } Animation *AnimationState::getEmptyAnimation() { diff --git a/spine-cpp/spine-cpp/src/spine/AnimationStateData.cpp b/spine-cpp/spine-cpp/src/spine/AnimationStateData.cpp index e89b68090..0ade4dc7e 100644 --- a/spine-cpp/spine-cpp/src/spine/AnimationStateData.cpp +++ b/spine-cpp/spine-cpp/src/spine/AnimationStateData.cpp @@ -33,7 +33,7 @@ #include #include -using namespace Spine; +using namespace spine; AnimationStateData::AnimationStateData(SkeletonData *skeletonData) : _skeletonData(skeletonData), _defaultMix(0) { } diff --git a/spine-cpp/spine-cpp/src/spine/Atlas.cpp b/spine-cpp/spine-cpp/src/spine/Atlas.cpp index 648376fd6..ad7619c67 100644 --- a/spine-cpp/spine-cpp/src/spine/Atlas.cpp +++ b/spine-cpp/spine-cpp/src/spine/Atlas.cpp @@ -36,7 +36,7 @@ #include -using namespace Spine; +using namespace spine; Atlas::Atlas(const String &path, TextureLoader *textureLoader) : _textureLoader(textureLoader) { int dirLength; @@ -92,13 +92,6 @@ AtlasRegion *Atlas::findRegion(const String &name) { return NULL; } -void Atlas::dispose() { - if (!_textureLoader) return; - for (size_t i = 0, n = _pages.size(); i < n; ++i) { - _textureLoader->unload(_pages[i]->rendererObject); - } -} - void Atlas::load(const char *begin, int length, const char *dir) { static const char *formatNames[] = {"", "Alpha", "Intensity", "LuminanceAlpha", "RGB565", "RGBA4444", "RGB888", "RGBA8888"}; diff --git a/spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp b/spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp index a5839f898..04fafba51 100644 --- a/spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp +++ b/spine-cpp/spine-cpp/src/spine/AtlasAttachmentLoader.cpp @@ -40,7 +40,7 @@ #include -namespace Spine { +namespace spine { RTTI_IMPL(AtlasAttachmentLoader, AttachmentLoader) AtlasAttachmentLoader::AtlasAttachmentLoader(Atlas *atlas) : AttachmentLoader(), _atlas(atlas) { @@ -57,7 +57,7 @@ RegionAttachment *AtlasAttachmentLoader::newRegionAttachment(Skin &skin, const S RegionAttachment *attachmentP = new(__FILE__, __LINE__) RegionAttachment(name); RegionAttachment &attachment = *attachmentP; - attachment._rendererObject = regionP; + attachment.setRendererObject(regionP); attachment.setUVs(region.u, region.v, region.u2, region.v2, region.rotate); attachment._regionOffsetX = region.offsetX; attachment._regionOffsetY = region.offsetY; @@ -79,7 +79,7 @@ MeshAttachment *AtlasAttachmentLoader::newMeshAttachment(Skin &skin, const Strin MeshAttachment *attachmentP = new(__FILE__, __LINE__) MeshAttachment(name); MeshAttachment &attachment = *attachmentP; - attachment._rendererObject = regionP; + attachment.setRendererObject(regionP); attachment._regionU = region.u; attachment._regionV = region.v; attachment._regionU2 = region.u2; diff --git a/spine-cpp/spine-cpp/src/spine/Attachment.cpp b/spine-cpp/spine-cpp/src/spine/Attachment.cpp index 48d39eeeb..0f9a51d22 100644 --- a/spine-cpp/spine-cpp/src/spine/Attachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/Attachment.cpp @@ -32,7 +32,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL_NOPARENT(Attachment) diff --git a/spine-cpp/spine-cpp/src/spine/AttachmentLoader.cpp b/spine-cpp/spine-cpp/src/spine/AttachmentLoader.cpp index df3824911..c117d433d 100644 --- a/spine-cpp/spine-cpp/src/spine/AttachmentLoader.cpp +++ b/spine-cpp/spine-cpp/src/spine/AttachmentLoader.cpp @@ -38,7 +38,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL_NOPARENT(AttachmentLoader) diff --git a/spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp b/spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp index d4811fa9a..7b94ef31d 100644 --- a/spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/AttachmentTimeline.cpp @@ -38,7 +38,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(AttachmentTimeline, Timeline) diff --git a/spine-cpp/spine-cpp/src/spine/Bone.cpp b/spine-cpp/spine-cpp/src/spine/Bone.cpp index d92898d3e..6801dd0fa 100644 --- a/spine-cpp/spine-cpp/src/spine/Bone.cpp +++ b/spine-cpp/spine-cpp/src/spine/Bone.cpp @@ -33,7 +33,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(Bone, Updatable) diff --git a/spine-cpp/spine-cpp/src/spine/BoneData.cpp b/spine-cpp/spine-cpp/src/spine/BoneData.cpp index 584116b9f..33d212774 100644 --- a/spine-cpp/spine-cpp/src/spine/BoneData.cpp +++ b/spine-cpp/spine-cpp/src/spine/BoneData.cpp @@ -32,7 +32,7 @@ #include -using namespace Spine; +using namespace spine; BoneData::BoneData(int index, const String &name, BoneData *parent) : _index(index), diff --git a/spine-cpp/spine-cpp/src/spine/BoundingBoxAttachment.cpp b/spine-cpp/spine-cpp/src/spine/BoundingBoxAttachment.cpp index 980133579..3309bcb9e 100644 --- a/spine-cpp/spine-cpp/src/spine/BoundingBoxAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/BoundingBoxAttachment.cpp @@ -30,7 +30,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL(BoundingBoxAttachment, VertexAttachment) diff --git a/spine-cpp/spine-cpp/src/spine/ClippingAttachment.cpp b/spine-cpp/spine-cpp/src/spine/ClippingAttachment.cpp index 737f34d7b..1342bbbdd 100644 --- a/spine-cpp/spine-cpp/src/spine/ClippingAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/ClippingAttachment.cpp @@ -32,7 +32,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL(ClippingAttachment, VertexAttachment) diff --git a/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp b/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp index 5f4f06275..9fec4426a 100644 --- a/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/ColorTimeline.cpp @@ -38,7 +38,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(ColorTimeline, CurveTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/Constraint.cpp b/spine-cpp/spine-cpp/src/spine/Constraint.cpp index 21327eb95..7927533d0 100644 --- a/spine-cpp/spine-cpp/src/spine/Constraint.cpp +++ b/spine-cpp/spine-cpp/src/spine/Constraint.cpp @@ -30,7 +30,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL(Constraint, Updatable) diff --git a/spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp b/spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp index dd3e4cf04..0f5a4486c 100644 --- a/spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/CurveTimeline.cpp @@ -32,7 +32,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL(CurveTimeline, Timeline) diff --git a/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp b/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp index d4078a55e..9b8b16eeb 100644 --- a/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/DeformTimeline.cpp @@ -40,7 +40,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(DeformTimeline, CurveTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp b/spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp index 12168f337..ec1c7bebb 100644 --- a/spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/DrawOrderTimeline.cpp @@ -38,7 +38,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(DrawOrderTimeline, Timeline) diff --git a/spine-cpp/spine-cpp/src/spine/Event.cpp b/spine-cpp/spine-cpp/src/spine/Event.cpp index 67d5fe918..98b2872a0 100644 --- a/spine-cpp/spine-cpp/src/spine/Event.cpp +++ b/spine-cpp/spine-cpp/src/spine/Event.cpp @@ -32,7 +32,7 @@ #include -using namespace Spine; +using namespace spine; Event::Event(float time, const EventData &data) : _data(data), diff --git a/spine-cpp/spine-cpp/src/spine/EventData.cpp b/spine-cpp/spine-cpp/src/spine/EventData.cpp index aa6f10cc4..43cba06ed 100644 --- a/spine-cpp/spine-cpp/src/spine/EventData.cpp +++ b/spine-cpp/spine-cpp/src/spine/EventData.cpp @@ -32,7 +32,7 @@ #include -using namespace Spine; +using namespace spine; EventData::EventData(const String &name) : _name(name), diff --git a/spine-cpp/spine-cpp/src/spine/EventTimeline.cpp b/spine-cpp/spine-cpp/src/spine/EventTimeline.cpp index ab6823ed6..dd82d4c75 100644 --- a/spine-cpp/spine-cpp/src/spine/EventTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/EventTimeline.cpp @@ -40,7 +40,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(EventTimeline, Timeline) diff --git a/spine-cpp/spine-cpp/src/spine/Extension.cpp b/spine-cpp/spine-cpp/src/spine/Extension.cpp index e8131ff89..634460f5f 100644 --- a/spine-cpp/spine-cpp/src/spine/Extension.cpp +++ b/spine-cpp/spine-cpp/src/spine/Extension.cpp @@ -33,10 +33,9 @@ #include -using namespace Spine; +using namespace spine; -DefaultSpineExtension _defaultExtension; -SpineExtension *SpineExtension::_instance = &_defaultExtension; +SpineExtension *SpineExtension::_instance = NULL; void SpineExtension::setInstance(SpineExtension *inValue) { assert(inValue); @@ -45,6 +44,7 @@ void SpineExtension::setInstance(SpineExtension *inValue) { } SpineExtension *SpineExtension::getInstance() { + if (!_instance) _instance = spine::getDefaultExtension(); assert(_instance); return _instance; diff --git a/spine-cpp/spine-cpp/src/spine/IkConstraint.cpp b/spine-cpp/spine-cpp/src/spine/IkConstraint.cpp index 29e15477a..c0f6c3c3f 100644 --- a/spine-cpp/spine-cpp/src/spine/IkConstraint.cpp +++ b/spine-cpp/spine-cpp/src/spine/IkConstraint.cpp @@ -36,7 +36,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL(IkConstraint, Constraint) diff --git a/spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp b/spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp index bac5f6f1f..9f6518fa2 100644 --- a/spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp +++ b/spine-cpp/spine-cpp/src/spine/IkConstraintData.cpp @@ -32,7 +32,7 @@ #include -using namespace Spine; +using namespace spine; IkConstraintData::IkConstraintData(const String &name) : _name(name), diff --git a/spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp b/spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp index d1384c9df..bf4804cb7 100644 --- a/spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/IkConstraintTimeline.cpp @@ -40,7 +40,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(IkConstraintTimeline, CurveTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/Json.cpp b/spine-cpp/spine-cpp/src/spine/Json.cpp index 1b8a5bad3..2f5935050 100644 --- a/spine-cpp/spine-cpp/src/spine/Json.cpp +++ b/spine-cpp/spine-cpp/src/spine/Json.cpp @@ -48,7 +48,7 @@ #include #include -using namespace Spine; +using namespace spine; const int Json::JSON_FALSE = 0; const int Json::JSON_TRUE = 1; diff --git a/spine-cpp/spine-cpp/src/spine/LinkedMesh.cpp b/spine-cpp/spine-cpp/src/spine/LinkedMesh.cpp index f4c0f193c..c0d020c2b 100644 --- a/spine-cpp/spine-cpp/src/spine/LinkedMesh.cpp +++ b/spine-cpp/spine-cpp/src/spine/LinkedMesh.cpp @@ -32,7 +32,7 @@ #include -using namespace Spine; +using namespace spine; LinkedMesh::LinkedMesh(MeshAttachment *mesh, const String &skin, size_t slotIndex, const String &parent) : _mesh(mesh), diff --git a/spine-cpp/spine-cpp/src/spine/MathUtil.cpp b/spine-cpp/spine-cpp/src/spine/MathUtil.cpp index 9536b8939..18d64fbde 100644 --- a/spine-cpp/spine-cpp/src/spine/MathUtil.cpp +++ b/spine-cpp/spine-cpp/src/spine/MathUtil.cpp @@ -31,7 +31,7 @@ #include #include -using namespace Spine; +using namespace spine; float MathUtil::abs(float v) { return ((v) < 0 ? -(v) : (v)); diff --git a/spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp b/spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp index 30428eaed..a0140bb30 100644 --- a/spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/MeshAttachment.cpp @@ -29,12 +29,13 @@ *****************************************************************************/ #include +#include -using namespace Spine; +using namespace spine; RTTI_IMPL(MeshAttachment, VertexAttachment) -MeshAttachment::MeshAttachment(const String &name) : VertexAttachment(name), +MeshAttachment::MeshAttachment(const String &name) : VertexAttachment(name), HasRendererObject(), _regionOffsetX(0), _regionOffsetY(0), _regionWidth(0), @@ -42,7 +43,6 @@ MeshAttachment::MeshAttachment(const String &name) : VertexAttachment(name), _regionOriginalWidth(0), _regionOriginalHeight(0), _parentMesh(NULL), - _rendererObject(NULL), _path(), _regionU(0), _regionV(0), @@ -56,6 +56,8 @@ MeshAttachment::MeshAttachment(const String &name) : VertexAttachment(name), _regionRotate(false) { } +MeshAttachment::~MeshAttachment() {} + void MeshAttachment::updateUVs() { float u = _regionU, v = _regionV, width = _regionU2 - _regionU, height = _regionV2 - _regionV; if (_uvs.size() != _regionUVs.size()) { @@ -107,14 +109,6 @@ void MeshAttachment::setPath(const String &inValue) { _path = inValue; } -void *MeshAttachment::getRendererObject() { - return _rendererObject; -} - -void MeshAttachment::setRendererObject(void *inValue) { - _rendererObject = inValue; -} - float MeshAttachment::getRegionU() { return _regionU; } @@ -250,6 +244,6 @@ void MeshAttachment::setHeight(float inValue) { _height = inValue; } -Spine::Color &MeshAttachment::getColor() { +spine::Color &MeshAttachment::getColor() { return _color; } diff --git a/spine-cpp/spine-cpp/src/spine/PathAttachment.cpp b/spine-cpp/spine-cpp/src/spine/PathAttachment.cpp index 7560537c9..af7b07308 100644 --- a/spine-cpp/spine-cpp/src/spine/PathAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathAttachment.cpp @@ -30,7 +30,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL(PathAttachment, VertexAttachment) diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraint.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraint.cpp index b94884dfe..5417dc65b 100644 --- a/spine-cpp/spine-cpp/src/spine/PathConstraint.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathConstraint.cpp @@ -39,7 +39,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(PathConstraint, Constraint) diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp index 810e795b1..20a6643df 100644 --- a/spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathConstraintData.cpp @@ -35,7 +35,7 @@ #include -using namespace Spine; +using namespace spine; PathConstraintData::PathConstraintData(const String &name) : _name(name), diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp index 244b8110e..64d666b7d 100644 --- a/spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathConstraintMixTimeline.cpp @@ -40,7 +40,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(PathConstraintMixTimeline, CurveTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp index 316355430..3b26ce1a7 100644 --- a/spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathConstraintPositionTimeline.cpp @@ -40,7 +40,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(PathConstraintPositionTimeline, CurveTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp b/spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp index 5be88722d..7e1c5017c 100644 --- a/spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/PathConstraintSpacingTimeline.cpp @@ -40,7 +40,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(PathConstraintSpacingTimeline, PathConstraintPositionTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/PointAttachment.cpp b/spine-cpp/spine-cpp/src/spine/PointAttachment.cpp index 150b85f1d..9a0f3778d 100644 --- a/spine-cpp/spine-cpp/src/spine/PointAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/PointAttachment.cpp @@ -34,7 +34,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL(PointAttachment, Attachment) diff --git a/spine-cpp/spine-cpp/src/spine/RTTI.cpp b/spine-cpp/spine-cpp/src/spine/RTTI.cpp index 8d1b1e145..5b68c1279 100644 --- a/spine-cpp/spine-cpp/src/spine/RTTI.cpp +++ b/spine-cpp/spine-cpp/src/spine/RTTI.cpp @@ -31,7 +31,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI::RTTI(const std::string &className) : _className(className), _pBaseRTTI(NULL) { } diff --git a/spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp b/spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp index f5224410d..2e21a5314 100644 --- a/spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/RegionAttachment.cpp @@ -34,7 +34,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL(RegionAttachment, Attachment) @@ -47,7 +47,7 @@ const int RegionAttachment::URY = 5; const int RegionAttachment::BRX = 6; const int RegionAttachment::BRY = 7; -RegionAttachment::RegionAttachment(const String &name) : Attachment(name), +RegionAttachment::RegionAttachment(const String &name) : Attachment(name), HasRendererObject(), _x(0), _y(0), _rotation(0), @@ -61,7 +61,6 @@ RegionAttachment::RegionAttachment(const String &name) : Attachment(name), _regionHeight(0), _regionOriginalWidth(0), _regionOriginalHeight(0), - _rendererObject(NULL), _path(), _regionU(0), _regionV(0), @@ -124,7 +123,10 @@ void RegionAttachment::setUVs(float u, float v, float u2, float v2, bool rotate) void RegionAttachment::computeWorldVertices(Bone &bone, Vector &worldVertices, size_t offset, size_t stride) { assert(worldVertices.size() >= (offset + 8)); + computeWorldVertices(bone, worldVertices.buffer(), offset, stride); +} +void RegionAttachment::computeWorldVertices(Bone &bone, float* worldVertices, size_t offset, size_t stride) { float x = bone.getWorldX(), y = bone.getWorldY(); float a = bone.getA(), b = bone.getB(), c = bone.getC(), d = bone.getD(); float offsetX, offsetY; @@ -217,14 +219,6 @@ void RegionAttachment::setPath(const String &inValue) { _path = inValue; } -void *RegionAttachment::getRendererObject() { - return _rendererObject; -} - -void RegionAttachment::setRendererObject(void *inValue) { - _rendererObject = inValue; -} - float RegionAttachment::getRegionOffsetX() { return _regionOffsetX; } @@ -281,6 +275,6 @@ Vector &RegionAttachment::getUVs() { return _uvs; } -Spine::Color &RegionAttachment::getColor() { +spine::Color &RegionAttachment::getColor() { return _color; } diff --git a/spine-cpp/spine-cpp/src/spine/RotateTimeline.cpp b/spine-cpp/spine-cpp/src/spine/RotateTimeline.cpp index d333b8706..5eed65ffe 100644 --- a/spine-cpp/spine-cpp/src/spine/RotateTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/RotateTimeline.cpp @@ -38,7 +38,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(RotateTimeline, CurveTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/ScaleTimeline.cpp b/spine-cpp/spine-cpp/src/spine/ScaleTimeline.cpp index b3a2c53ff..8a7ed78b4 100644 --- a/spine-cpp/spine-cpp/src/spine/ScaleTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/ScaleTimeline.cpp @@ -38,7 +38,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(ScaleTimeline, TranslateTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/ShearTimeline.cpp b/spine-cpp/spine-cpp/src/spine/ShearTimeline.cpp index 27aa07713..07f1864da 100644 --- a/spine-cpp/spine-cpp/src/spine/ShearTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/ShearTimeline.cpp @@ -38,7 +38,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(ShearTimeline, TranslateTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/Skeleton.cpp b/spine-cpp/spine-cpp/src/spine/Skeleton.cpp index 9dcacd0b1..f285ea4b8 100644 --- a/spine-cpp/spine-cpp/src/spine/Skeleton.cpp +++ b/spine-cpp/spine-cpp/src/spine/Skeleton.cpp @@ -50,7 +50,7 @@ #include -using namespace Spine; +using namespace spine; Skeleton::Skeleton(SkeletonData *skeletonData) : _data(skeletonData), @@ -444,7 +444,7 @@ Bone *Skeleton::getRootBone() { return _bones.size() == 0 ? NULL : _bones[0]; } -const SkeletonData *Skeleton::getData() { +SkeletonData *Skeleton::getData() { return _data; } diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp index 1464c5aa7..aa133b361 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonBinary.cpp @@ -71,7 +71,7 @@ #include #include -using namespace Spine; +using namespace spine; const int SkeletonBinary::BONE_ROTATE = 0; const int SkeletonBinary::BONE_TRANSLATE = 1; diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp index 4ba7307e6..14bbca86b 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonBounds.cpp @@ -35,7 +35,7 @@ #include -using namespace Spine; +using namespace spine; SkeletonBounds::SkeletonBounds() : _minX(0), _minY(0), _maxX(0), _maxY(0) { } diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp index 29586a5bb..dd2a96944 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonClipping.cpp @@ -33,7 +33,7 @@ #include #include -using namespace Spine; +using namespace spine; SkeletonClipping::SkeletonClipping() : _clipAttachment(NULL) { _clipOutput.ensureCapacity(128); @@ -85,10 +85,12 @@ void SkeletonClipping::clipEnd() { _clippingPolygon.clear(); } -void SkeletonClipping::clipTriangles(Vector &vertices, size_t verticesLength, Vector &triangles, - size_t trianglesLength, Vector &uvs) { - SP_UNUSED(verticesLength); +void SkeletonClipping::clipTriangles(Vector &vertices, Vector &triangles, Vector &uvs, size_t stride) { + clipTriangles(vertices.buffer(), triangles.buffer(), triangles.size(), uvs.buffer(), stride); +} +void SkeletonClipping::clipTriangles(float *vertices, unsigned short *triangles, + size_t trianglesLength, float *uvs, size_t stride) { Vector &clipOutput = _clipOutput; Vector &clippedVertices = _clippedVertices; Vector &clippedTriangles = _clippedTriangles; diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonData.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonData.cpp index 19e70caef..18034d49a 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonData.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonData.cpp @@ -41,7 +41,7 @@ #include -using namespace Spine; +using namespace spine; SkeletonData::SkeletonData() : _name(), diff --git a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp index c1c9159a2..062a1473a 100644 --- a/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp +++ b/spine-cpp/spine-cpp/src/spine/SkeletonJson.cpp @@ -75,7 +75,7 @@ #define strdup _strdup #endif -using namespace Spine; +using namespace spine; SkeletonJson::SkeletonJson(Atlas *atlas) : _attachmentLoader(new(__FILE__, __LINE__) AtlasAttachmentLoader(atlas)), _scale(1), _ownsLoader(true) { diff --git a/spine-cpp/spine-cpp/src/spine/Skin.cpp b/spine-cpp/spine-cpp/src/spine/Skin.cpp index 4e7524339..65c382d7a 100644 --- a/spine-cpp/spine-cpp/src/spine/Skin.cpp +++ b/spine-cpp/spine-cpp/src/spine/Skin.cpp @@ -37,7 +37,7 @@ #include -using namespace Spine; +using namespace spine; Skin::AttachmentMap::AttachmentMap() { } diff --git a/spine-cpp/spine-cpp/src/spine/Slot.cpp b/spine-cpp/spine-cpp/src/spine/Slot.cpp index bc80fb06e..3fa57f3ed 100644 --- a/spine-cpp/spine-cpp/src/spine/Slot.cpp +++ b/spine-cpp/spine-cpp/src/spine/Slot.cpp @@ -35,7 +35,7 @@ #include #include -using namespace Spine; +using namespace spine; Slot::Slot(SlotData &data, Bone &bone) : _data(data), diff --git a/spine-cpp/spine-cpp/src/spine/SlotData.cpp b/spine-cpp/spine-cpp/src/spine/SlotData.cpp index 6c770e970..b1c11280b 100644 --- a/spine-cpp/spine-cpp/src/spine/SlotData.cpp +++ b/spine-cpp/spine-cpp/src/spine/SlotData.cpp @@ -32,7 +32,7 @@ #include -using namespace Spine; +using namespace spine; SlotData::SlotData(int index, const String &name, BoneData &boneData) : _index(index), diff --git a/spine-cpp/spine-cpp/src/spine/SpineObject.cpp b/spine-cpp/spine-cpp/src/spine/SpineObject.cpp index 409ab3e01..e54811d9d 100644 --- a/spine-cpp/spine-cpp/src/spine/SpineObject.cpp +++ b/spine-cpp/spine-cpp/src/spine/SpineObject.cpp @@ -31,7 +31,7 @@ #include #include -using namespace Spine; +using namespace spine; void *SpineObject::operator new(size_t sz, const char *file, int line) { return SpineExtension::calloc(sz, file, line); diff --git a/spine-cpp/spine-cpp/src/spine/TextureLoader.cpp b/spine-cpp/spine-cpp/src/spine/TextureLoader.cpp index 6154c14d7..a7a2b451c 100644 --- a/spine-cpp/spine-cpp/src/spine/TextureLoader.cpp +++ b/spine-cpp/spine-cpp/src/spine/TextureLoader.cpp @@ -30,7 +30,7 @@ #include -namespace Spine { +namespace spine { TextureLoader::TextureLoader() { } diff --git a/spine-cpp/spine-cpp/src/spine/Timeline.cpp b/spine-cpp/spine-cpp/src/spine/Timeline.cpp index f8db7a65f..6b6598503 100644 --- a/spine-cpp/spine-cpp/src/spine/Timeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/Timeline.cpp @@ -33,7 +33,7 @@ #include #include -namespace Spine { +namespace spine { RTTI_IMPL_NOPARENT(Timeline) Timeline::Timeline() { diff --git a/spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp b/spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp index 2d4f52ea6..561555530 100644 --- a/spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp +++ b/spine-cpp/spine-cpp/src/spine/TransformConstraint.cpp @@ -36,7 +36,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL(TransformConstraint, Constraint) diff --git a/spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp b/spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp index 4c94f2177..b45d3fb8d 100644 --- a/spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp +++ b/spine-cpp/spine-cpp/src/spine/TransformConstraintData.cpp @@ -34,7 +34,7 @@ #include -using namespace Spine; +using namespace spine; TransformConstraintData::TransformConstraintData(const String &name) : _name(name), _order(0), diff --git a/spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp b/spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp index 208596b97..84a181e73 100644 --- a/spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/TransformConstraintTimeline.cpp @@ -40,7 +40,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(TransformConstraintTimeline, CurveTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/TranslateTimeline.cpp b/spine-cpp/spine-cpp/src/spine/TranslateTimeline.cpp index e9f295803..970d4586e 100644 --- a/spine-cpp/spine-cpp/src/spine/TranslateTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/TranslateTimeline.cpp @@ -38,7 +38,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(TranslateTimeline, CurveTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/Triangulator.cpp b/spine-cpp/spine-cpp/src/spine/Triangulator.cpp index 3b1db44d7..755a01fe0 100644 --- a/spine-cpp/spine-cpp/src/spine/Triangulator.cpp +++ b/spine-cpp/spine-cpp/src/spine/Triangulator.cpp @@ -32,7 +32,7 @@ #include -using namespace Spine; +using namespace spine; Triangulator::~Triangulator() { ContainerUtil::cleanUpVectorOfPointers(_convexPolygons); diff --git a/spine-cpp/spine-cpp/src/spine/TwoColorTimeline.cpp b/spine-cpp/spine-cpp/src/spine/TwoColorTimeline.cpp index cff5e49ac..6a2d09d24 100644 --- a/spine-cpp/spine-cpp/src/spine/TwoColorTimeline.cpp +++ b/spine-cpp/spine-cpp/src/spine/TwoColorTimeline.cpp @@ -38,7 +38,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(TwoColorTimeline, CurveTimeline) diff --git a/spine-cpp/spine-cpp/src/spine/Updatable.cpp b/spine-cpp/spine-cpp/src/spine/Updatable.cpp index bf172805f..a061eadcd 100644 --- a/spine-cpp/spine-cpp/src/spine/Updatable.cpp +++ b/spine-cpp/spine-cpp/src/spine/Updatable.cpp @@ -30,7 +30,7 @@ #include -using namespace Spine; +using namespace spine; RTTI_IMPL_NOPARENT(Updatable) diff --git a/spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp b/spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp index 1b31e2eb8..6aaa3edb8 100644 --- a/spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp +++ b/spine-cpp/spine-cpp/src/spine/VertexAttachment.cpp @@ -35,7 +35,7 @@ #include #include -using namespace Spine; +using namespace spine; RTTI_IMPL(VertexAttachment, Attachment) @@ -49,7 +49,16 @@ void VertexAttachment::computeWorldVertices(Slot &slot, Vector &worldVert computeWorldVertices(slot, 0, _worldVerticesLength, worldVertices, 0); } +void VertexAttachment::computeWorldVertices(Slot &slot, float *worldVertices) { + computeWorldVertices(slot, 0, _worldVerticesLength, worldVertices, 0); +} + void VertexAttachment::computeWorldVertices(Slot &slot, size_t start, size_t count, Vector &worldVertices, size_t offset, + size_t stride) { + computeWorldVertices(slot, start, count, worldVertices.buffer(), offset, stride); +} + +void VertexAttachment::computeWorldVertices(Slot &slot, size_t start, size_t count, float *worldVertices, size_t offset, size_t stride) { count = offset + (count >> 1) * stride; Skeleton &skeleton = slot._bone._skeleton; diff --git a/spine-cpp/spine-cpp/src/spine/VertexEffect.cpp b/spine-cpp/spine-cpp/src/spine/VertexEffect.cpp index c0c8b693b..e3906342e 100644 --- a/spine-cpp/spine-cpp/src/spine/VertexEffect.cpp +++ b/spine-cpp/spine-cpp/src/spine/VertexEffect.cpp @@ -32,7 +32,7 @@ #include #include -using namespace Spine; +using namespace spine; JitterVertexEffect::JitterVertexEffect(float jitterX, float jitterY): _jitterX(jitterX), _jitterY(jitterY) { } @@ -132,7 +132,7 @@ float SwirlVertexEffect::getRadius() { } void SwirlVertexEffect::setAngle(float angle) { - _angle = angle * Spine::DEG_RAD; + _angle = angle * spine::DEG_RAD; } float SwirlVertexEffect::getAngle() {