So close!

This commit is contained in:
Stephen Gowen 2017-12-04 17:37:31 -05:00
parent be2dfc7ff4
commit 517c48a2d5
7 changed files with 541 additions and 499 deletions

View File

@ -40,6 +40,8 @@ namespace Spine
{
class Json
{
friend class SkeletonJson;
public:
/* Json Types: */
static const int JSON_FALSE;
@ -68,7 +70,7 @@ namespace Spine
~Json();
private:
static const char* JSON_ERROR;
static const char* _error;
Json* _next;
#if SPINE_JSON_HAVE_PREV

View File

@ -81,13 +81,6 @@ namespace Spine
SkeletonData* readSkeletonDataFile(const char* path);
private:
class Vertices
{
public:
Vector<int> _bones;
Vector<float> _vertices;
};
struct DataInput
{
const unsigned char* cursor;

View File

@ -37,7 +37,6 @@
namespace Spine
{
class MeshAttachment;
class CurveTimeline;
class VertexAttachment;
class Animation;
@ -71,8 +70,6 @@ namespace Spine
static void readCurve(Json* frame, CurveTimeline* timeline, int frameIndex);
void addLinkedMesh(MeshAttachment* mesh, const char* skin, int slotIndex, const char* parent);
Animation* readAnimation(Json* root, SkeletonData *skeletonData);
void readVertices(Json* attachmentMap, VertexAttachment* attachment, int verticesLength);

View File

@ -0,0 +1,46 @@
/******************************************************************************
* 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_Vertices_h
#define Spine_Vertices_h
#include <spine/Vector.h>
namespace Spine
{
class Vertices
{
public:
Vector<int> _bones;
Vector<float> _vertices;
};
}
#endif /* Spine_Vertices_h */

View File

@ -62,7 +62,7 @@ namespace Spine
const int Json::JSON_ARRAY = 5;
const int Json::JSON_OBJECT = 6;
const char* Json::JSON_ERROR = NULL;
const char* Json::_error = NULL;
Json* Json::getItem(Json *object, const char* string)
{
@ -99,7 +99,7 @@ namespace Spine
const char* Json::getError()
{
return JSON_ERROR;
return _error;
}
Json::Json(const char* value) :
@ -227,7 +227,7 @@ namespace Spine
break;
}
JSON_ERROR = value;
_error = value;
return NULL; /* failure. */
}
@ -242,7 +242,7 @@ namespace Spine
if (*str != '\"')
{
/* TODO: don't need this check when called from parseValue, but do need from parseObject */
JSON_ERROR = str;
_error = str;
return 0;
} /* not a string! */
@ -453,8 +453,8 @@ namespace Spine
}
else
{
/* Parse failure, JSON_ERROR is set. */
JSON_ERROR = num;
/* Parse failure, _error is set. */
_error = num;
return NULL;
}
}
@ -520,7 +520,7 @@ namespace Spine
return value + 1; /* end of array */
}
JSON_ERROR = value;
_error = value;
return NULL; /* malformed. */
}
@ -560,7 +560,7 @@ namespace Spine
child->_valueString = 0;
if (*value != ':')
{
JSON_ERROR = value;
_error = value;
return NULL;
} /* fail! */
@ -594,7 +594,7 @@ namespace Spine
child->_valueString = 0;
if (*value != ':')
{
JSON_ERROR = value;
_error = value;
return NULL;
} /* fail! */
@ -611,7 +611,7 @@ namespace Spine
return value + 1; /* end of array */
}
JSON_ERROR = value;
_error = value;
return NULL; /* malformed. */
}

View File

@ -38,6 +38,7 @@
#include <spine/Attachment.h>
#include <spine/VertexAttachment.h>
#include <spine/Animation.h>
#include <spine/CurveTimeline.h>
#include <spine/Extension.h>
#include <spine/ContainerUtil.h>
@ -75,6 +76,7 @@
#include <spine/DrawOrderTimeline.h>
#include <spine/EventTimeline.h>
#include <spine/Event.h>
#include <spine/Vertices.h>
namespace Spine
{

File diff suppressed because it is too large Load Diff