mirror of
https://github.com/EsotericSoftware/spine-runtimes.git
synced 2026-03-26 22:49:01 +08:00
So close!
This commit is contained in:
parent
be2dfc7ff4
commit
517c48a2d5
@ -40,6 +40,8 @@ namespace Spine
|
|||||||
{
|
{
|
||||||
class Json
|
class Json
|
||||||
{
|
{
|
||||||
|
friend class SkeletonJson;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
/* Json Types: */
|
/* Json Types: */
|
||||||
static const int JSON_FALSE;
|
static const int JSON_FALSE;
|
||||||
@ -68,7 +70,7 @@ namespace Spine
|
|||||||
~Json();
|
~Json();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const char* JSON_ERROR;
|
static const char* _error;
|
||||||
|
|
||||||
Json* _next;
|
Json* _next;
|
||||||
#if SPINE_JSON_HAVE_PREV
|
#if SPINE_JSON_HAVE_PREV
|
||||||
|
|||||||
@ -81,13 +81,6 @@ namespace Spine
|
|||||||
SkeletonData* readSkeletonDataFile(const char* path);
|
SkeletonData* readSkeletonDataFile(const char* path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
class Vertices
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Vector<int> _bones;
|
|
||||||
Vector<float> _vertices;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct DataInput
|
struct DataInput
|
||||||
{
|
{
|
||||||
const unsigned char* cursor;
|
const unsigned char* cursor;
|
||||||
|
|||||||
@ -37,7 +37,6 @@
|
|||||||
|
|
||||||
namespace Spine
|
namespace Spine
|
||||||
{
|
{
|
||||||
class MeshAttachment;
|
|
||||||
class CurveTimeline;
|
class CurveTimeline;
|
||||||
class VertexAttachment;
|
class VertexAttachment;
|
||||||
class Animation;
|
class Animation;
|
||||||
@ -71,8 +70,6 @@ namespace Spine
|
|||||||
|
|
||||||
static void readCurve(Json* frame, CurveTimeline* timeline, int frameIndex);
|
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);
|
Animation* readAnimation(Json* root, SkeletonData *skeletonData);
|
||||||
|
|
||||||
void readVertices(Json* attachmentMap, VertexAttachment* attachment, int verticesLength);
|
void readVertices(Json* attachmentMap, VertexAttachment* attachment, int verticesLength);
|
||||||
|
|||||||
46
spine-cpp/spine-cpp/include/spine/Vertices.h
Normal file
46
spine-cpp/spine-cpp/include/spine/Vertices.h
Normal 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 */
|
||||||
@ -62,7 +62,7 @@ namespace Spine
|
|||||||
const int Json::JSON_ARRAY = 5;
|
const int Json::JSON_ARRAY = 5;
|
||||||
const int Json::JSON_OBJECT = 6;
|
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)
|
Json* Json::getItem(Json *object, const char* string)
|
||||||
{
|
{
|
||||||
@ -99,7 +99,7 @@ namespace Spine
|
|||||||
|
|
||||||
const char* Json::getError()
|
const char* Json::getError()
|
||||||
{
|
{
|
||||||
return JSON_ERROR;
|
return _error;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Json(const char* value) :
|
Json::Json(const char* value) :
|
||||||
@ -227,7 +227,7 @@ namespace Spine
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
JSON_ERROR = value;
|
_error = value;
|
||||||
return NULL; /* failure. */
|
return NULL; /* failure. */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ namespace Spine
|
|||||||
if (*str != '\"')
|
if (*str != '\"')
|
||||||
{
|
{
|
||||||
/* TODO: don't need this check when called from parseValue, but do need from parseObject */
|
/* TODO: don't need this check when called from parseValue, but do need from parseObject */
|
||||||
JSON_ERROR = str;
|
_error = str;
|
||||||
return 0;
|
return 0;
|
||||||
} /* not a string! */
|
} /* not a string! */
|
||||||
|
|
||||||
@ -453,8 +453,8 @@ namespace Spine
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Parse failure, JSON_ERROR is set. */
|
/* Parse failure, _error is set. */
|
||||||
JSON_ERROR = num;
|
_error = num;
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -520,7 +520,7 @@ namespace Spine
|
|||||||
return value + 1; /* end of array */
|
return value + 1; /* end of array */
|
||||||
}
|
}
|
||||||
|
|
||||||
JSON_ERROR = value;
|
_error = value;
|
||||||
|
|
||||||
return NULL; /* malformed. */
|
return NULL; /* malformed. */
|
||||||
}
|
}
|
||||||
@ -560,7 +560,7 @@ namespace Spine
|
|||||||
child->_valueString = 0;
|
child->_valueString = 0;
|
||||||
if (*value != ':')
|
if (*value != ':')
|
||||||
{
|
{
|
||||||
JSON_ERROR = value;
|
_error = value;
|
||||||
return NULL;
|
return NULL;
|
||||||
} /* fail! */
|
} /* fail! */
|
||||||
|
|
||||||
@ -594,7 +594,7 @@ namespace Spine
|
|||||||
child->_valueString = 0;
|
child->_valueString = 0;
|
||||||
if (*value != ':')
|
if (*value != ':')
|
||||||
{
|
{
|
||||||
JSON_ERROR = value;
|
_error = value;
|
||||||
return NULL;
|
return NULL;
|
||||||
} /* fail! */
|
} /* fail! */
|
||||||
|
|
||||||
@ -611,7 +611,7 @@ namespace Spine
|
|||||||
return value + 1; /* end of array */
|
return value + 1; /* end of array */
|
||||||
}
|
}
|
||||||
|
|
||||||
JSON_ERROR = value;
|
_error = value;
|
||||||
|
|
||||||
return NULL; /* malformed. */
|
return NULL; /* malformed. */
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,6 +38,7 @@
|
|||||||
#include <spine/Attachment.h>
|
#include <spine/Attachment.h>
|
||||||
#include <spine/VertexAttachment.h>
|
#include <spine/VertexAttachment.h>
|
||||||
#include <spine/Animation.h>
|
#include <spine/Animation.h>
|
||||||
|
#include <spine/CurveTimeline.h>
|
||||||
|
|
||||||
#include <spine/Extension.h>
|
#include <spine/Extension.h>
|
||||||
#include <spine/ContainerUtil.h>
|
#include <spine/ContainerUtil.h>
|
||||||
@ -75,6 +76,7 @@
|
|||||||
#include <spine/DrawOrderTimeline.h>
|
#include <spine/DrawOrderTimeline.h>
|
||||||
#include <spine/EventTimeline.h>
|
#include <spine/EventTimeline.h>
|
||||||
#include <spine/Event.h>
|
#include <spine/Event.h>
|
||||||
|
#include <spine/Vertices.h>
|
||||||
|
|
||||||
namespace Spine
|
namespace Spine
|
||||||
{
|
{
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user