merge cocos

This commit is contained in:
yangxiao 2015-04-15 16:19:07 +08:00
commit ebcd4daf6a
68 changed files with 3472 additions and 487 deletions

View File

@ -369,6 +369,7 @@ Developers:
giginet
Fix CCRepeat#create is recieved bad argument on Lua binding.
Added a feature that CCSSceneReader can load name properties as node names.
Added Rect::intersectsCircle().
neokim
Adds 'setFont' and 'setAnchorPoint' to CCEditBox.

View File

@ -1,11 +1,17 @@
cocos2d-x-3.6beta0 Apr.14 2015
[NEW] 3rd: update Spine runtime to v2.1.25
[NEW] MotionStreak: add `MotionStreak::getStroke()` and `MotionStreak::setStroke()`
[NEW] Rect: added `Rect::intersectsCircle()`
[NEW] UI:Text: add `Text::disableEffect(LabelEffect)` to disable a specific effect
[FIX] 3rd: link error on VS2012 caused by libpng
[FIX] Label: position is wrong if it is visited by a new camera
[FIX] Particle3D: make particle local does not work, rotation accumulates for some types of particle quad render, wrong position calculation for Ribbon Trail
[FIX] Particle3D: "make local" now working correctly. "Make local" is a properties that toggles particle coordination between local and global.
[FIX] Particle3D: particle rotation now no longer stacks up on each other
[FIX] Particle3D: Ribbon Trail now positions correctly
[FIX] Physics: rigid body's rotation is wrong if it is attatched to a node which rotation is not 0
[FIX] Renderer: RenderQueue command buffer optimizing
[FIX] UI:Button: use too much memory
[FIX] UI:Text: content size is wrong after setting outline effect
cocos2d-x-3.6alpha0 Apr.8 2015

View File

@ -33,6 +33,8 @@
#include "3d/CCSkybox.h"
#include "3d/CCTextureCube.h"
#include "2d/CCCamera.h"
NS_CC_BEGIN
Skybox::Skybox()
@ -150,19 +152,32 @@ void Skybox::draw(Renderer* renderer, const Mat4& transform, uint32_t flags)
void Skybox::onDraw(const Mat4& transform, uint32_t flags)
{
Mat4 trans(transform);
const cocos2d::Vec3 pos(Camera::getVisitingCamera()->getPosition3D());
trans.m[12] = pos.x;
trans.m[13] = pos.y;
trans.m[14] = pos.z;
auto state = getGLProgramState();
state->apply(transform);
state->apply(trans);
Vec4 color(_displayedColor.r / 255.f, _displayedColor.g / 255.f, _displayedColor.b / 255.f, 1.f);
state->setUniformVec4("u_color", color);
GLboolean depthFlag = glIsEnabled(GL_DEPTH_TEST);
GLint depthFunc;
GLboolean depthFlag = glIsEnabled(GL_DEPTH_TEST);
GLint depthFunc;
glGetIntegerv(GL_DEPTH_FUNC, &depthFunc);
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
GLboolean cullFlag = glIsEnabled(GL_CULL_FACE);
GLint cullMode;
glGetIntegerv(GL_CULL_FACE_MODE, &cullMode);
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
if (Configuration::getInstance()->supportsShareableVAO())
{
GL::bindVAO(_vao);
@ -191,6 +206,10 @@ void Skybox::onDraw(const Mat4& transform, uint32_t flags)
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, 8);
glCullFace(cullMode);
if (!cullFlag)
glDisable(GL_CULL_FACE);
glDepthFunc(depthFunc);
if (!depthFlag)
glDisable(GL_DEPTH_TEST);

View File

@ -602,7 +602,7 @@ void _spDrawOrderTimeline_apply (const spTimeline* timeline, spSkeleton* skeleto
drawOrderToSetupIndex = self->drawOrders[frameIndex];
if (!drawOrderToSetupIndex)
memcpy(skeleton->drawOrder, skeleton->slots, self->slotsCount * sizeof(int));
memcpy(skeleton->drawOrder, skeleton->slots, self->slotsCount * sizeof(spSlot*));
else {
for (i = 0; i < self->slotsCount; ++i)
skeleton->drawOrder[i] = skeleton->slots[drawOrderToSetupIndex[i]];
@ -659,12 +659,8 @@ void _spFFDTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, flo
spSlot *slot = skeleton->slots[self->slotIndex];
if (slot->attachment != self->attachment) return;
if (time < self->frames[0]) {
slot->attachmentVerticesCount = 0;
return; /* Time is before first frame. */
}
if (time < self->frames[0]) return; /* Time is before first frame. */
if (slot->attachmentVerticesCount != self->frameVerticesCount) alpha = 1; // Don't mix from uninitialized slot vertices.
if (slot->attachmentVerticesCount < self->frameVerticesCount) {
if (slot->attachmentVerticesCapacity < self->frameVerticesCount) {
FREE(slot->attachmentVertices);
@ -672,6 +668,7 @@ void _spFFDTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, flo
slot->attachmentVerticesCapacity = self->frameVerticesCount;
}
}
if (slot->attachmentVerticesCount != self->frameVerticesCount) alpha = 1; /* Don't mix from uninitialized slot vertices. */
slot->attachmentVerticesCount = self->frameVerticesCount;
if (time >= self->frames[self->framesCount - 1]) {
@ -789,3 +786,51 @@ void spIkConstraintTimeline_setFrame (spIkConstraintTimeline* self, int frameInd
self->frames[frameIndex + 1] = mix;
self->frames[frameIndex + 2] = (float)bendDirection;
}
/**/
void _spFlipTimeline_apply (const spTimeline* timeline, spSkeleton* skeleton, float lastTime, float time,
spEvent** firedEvents, int* eventsCount, float alpha) {
int frameIndex;
spFlipTimeline* self = (spFlipTimeline*)timeline;
if (time < self->frames[0]) {
if (lastTime > time) _spFlipTimeline_apply(timeline, skeleton, lastTime, (float)INT_MAX, 0, 0, 0);
return;
} else if (lastTime > time) /**/
lastTime = -1;
frameIndex = (time >= self->frames[self->framesCount - 2] ?
self->framesCount : binarySearch(self->frames, self->framesCount, time, 2)) - 2;
if (self->frames[frameIndex] < lastTime) return;
if (self->x)
skeleton->bones[self->boneIndex]->flipX = (int)self->frames[frameIndex + 1];
else
skeleton->bones[self->boneIndex]->flipY = (int)self->frames[frameIndex + 1];
}
void _spFlipTimeline_dispose (spTimeline* timeline) {
spFlipTimeline* self = SUB_CAST(spFlipTimeline, timeline);
_spTimeline_deinit(SUPER(self));
FREE(self->frames);
FREE(self);
}
spFlipTimeline* spFlipTimeline_create (int framesCount, int/*bool*/x) {
spFlipTimeline* self = NEW(spFlipTimeline);
_spTimeline_init(SUPER(self), x ? SP_TIMELINE_FLIPX : SP_TIMELINE_FLIPY, _spFlipTimeline_dispose, _spFlipTimeline_apply);
CONST_CAST(int, self->x) = x;
CONST_CAST(int, self->framesCount) = framesCount << 1;
CONST_CAST(float*, self->frames) = CALLOC(float, self->framesCount);
return self;
}
void spFlipTimeline_setFrame (spFlipTimeline* self, int frameIndex, float time, int/*bool*/flip) {
frameIndex <<= 1;
self->frames[frameIndex] = time;
self->frames[frameIndex + 1] = (float)flip;
}
/**/

View File

@ -41,12 +41,21 @@ extern "C" {
typedef struct spTimeline spTimeline;
struct spSkeleton;
typedef struct {
typedef struct spAnimation {
const char* const name;
float duration;
int timelinesCount;
spTimeline** timelines;
#ifdef __cplusplus
spAnimation() :
name(0),
duration(0),
timelinesCount(0),
timelines(0) {
}
#endif
} spAnimation;
spAnimation* spAnimation_create (const char* name, int timelinesCount);
@ -84,13 +93,21 @@ typedef enum {
SP_TIMELINE_EVENT,
SP_TIMELINE_DRAWORDER,
SP_TIMELINE_FFD,
SP_TIMELINE_IKCONSTRAINT
SP_TIMELINE_IKCONSTRAINT,
SP_TIMELINE_FLIPX,
SP_TIMELINE_FLIPY
} spTimelineType;
struct spTimeline {
const spTimelineType type;
const void* const vtable;
#ifdef __cplusplus
spTimeline() :
type(SP_TIMELINE_SCALE),
vtable(0) {
}
#endif
};
void spTimeline_dispose (spTimeline* self);
@ -112,9 +129,16 @@ typedef spTimeline Timeline;
/**/
typedef struct {
typedef struct spCurveTimeline {
spTimeline super;
float* curves; /* type, x, y, ... */
#ifdef __cplusplus
spCurveTimeline() :
super(),
curves(0) {
}
#endif
} spCurveTimeline;
void spCurveTimeline_setLinear (spCurveTimeline* self, int frameIndex);
@ -141,7 +165,20 @@ typedef struct spBaseTimeline {
int const framesCount;
float* const frames; /* time, angle, ... for rotate. time, x, y, ... for translate and scale. */
int boneIndex;
} spRotateTimeline;
#ifdef __cplusplus
spBaseTimeline() :
super(),
framesCount(0),
frames(0),
boneIndex(0) {
}
#endif
} spBaseTimeline;
/**/
typedef struct spBaseTimeline spRotateTimeline;
spRotateTimeline* spRotateTimeline_create (int framesCount);
@ -183,11 +220,20 @@ typedef spScaleTimeline ScaleTimeline;
/**/
typedef struct {
typedef struct spColorTimeline {
spCurveTimeline super;
int const framesCount;
float* const frames; /* time, r, g, b, a, ... */
int slotIndex;
#ifdef __cplusplus
spColorTimeline() :
super(),
framesCount(0),
frames(0),
slotIndex(0) {
}
#endif
} spColorTimeline;
spColorTimeline* spColorTimeline_create (int framesCount);
@ -202,12 +248,22 @@ typedef spColorTimeline ColorTimeline;
/**/
typedef struct {
typedef struct spAttachmentTimeline {
spTimeline super;
int const framesCount;
float* const frames; /* time, ... */
int slotIndex;
const char** const attachmentNames;
#ifdef __cplusplus
spAttachmentTimeline() :
super(),
framesCount(0),
frames(0),
slotIndex(0),
attachmentNames(0) {
}
#endif
} spAttachmentTimeline;
spAttachmentTimeline* spAttachmentTimeline_create (int framesCount);
@ -223,11 +279,20 @@ typedef spAttachmentTimeline AttachmentTimeline;
/**/
typedef struct {
typedef struct spEventTimeline {
spTimeline super;
int const framesCount;
float* const frames; /* time, ... */
spEvent** const events;
#ifdef __cplusplus
spEventTimeline() :
super(),
framesCount(0),
frames(0),
events(0) {
}
#endif
} spEventTimeline;
spEventTimeline* spEventTimeline_create (int framesCount);
@ -242,12 +307,22 @@ typedef spEventTimeline EventTimeline;
/**/
typedef struct {
typedef struct spDrawOrderTimeline {
spTimeline super;
int const framesCount;
float* const frames; /* time, ... */
const int** const drawOrders;
int const slotsCount;
#ifdef __cplusplus
spDrawOrderTimeline() :
super(),
framesCount(0),
frames(0),
drawOrders(0),
slotsCount(0) {
}
#endif
} spDrawOrderTimeline;
spDrawOrderTimeline* spDrawOrderTimeline_create (int framesCount, int slotsCount);
@ -262,7 +337,7 @@ typedef spDrawOrderTimeline DrawOrderTimeline;
/**/
typedef struct {
typedef struct spFFDTimeline {
spCurveTimeline super;
int const framesCount;
float* const frames; /* time, ... */
@ -270,6 +345,17 @@ typedef struct {
const float** const frameVertices;
int slotIndex;
spAttachment* attachment;
#ifdef __cplusplus
spFFDTimeline() :
super(),
framesCount(0),
frames(0),
frameVerticesCount(0),
frameVertices(0),
slotIndex(0) {
}
#endif
} spFFDTimeline;
spFFDTimeline* spFFDTimeline_create (int framesCount, int frameVerticesCount);
@ -284,11 +370,20 @@ typedef spFFDTimeline FFDTimeline;
/**/
typedef struct {
typedef struct spIkConstraintTimeline {
spCurveTimeline super;
int const framesCount;
float* const frames; /* time, mix, bendDirection, ... */
int ikConstraintIndex;
#ifdef __cplusplus
spIkConstraintTimeline() :
super(),
framesCount(0),
frames(0),
ikConstraintIndex(0) {
}
#endif
} spIkConstraintTimeline;
spIkConstraintTimeline* spIkConstraintTimeline_create (int framesCount);
@ -304,6 +399,36 @@ typedef spIkConstraintTimeline IkConstraintTimeline;
/**/
typedef struct spFlipTimeline {
spTimeline super;
int const x;
int const framesCount;
float* const frames; /* time, flip, ... */
int boneIndex;
#ifdef __cplusplus
spFlipTimeline() :
super(),
x(0),
framesCount(0),
frames(0),
boneIndex(0) {
}
#endif
} spFlipTimeline;
spFlipTimeline* spFlipTimeline_create (int framesCount, int/*bool*/x);
void spFlipTimeline_setFrame (spFlipTimeline* self, int frameIndex, float time, int/*bool*/flip);
#ifdef SPINE_SHORT_NAMES
typedef spFlipTimeline FlipTimeline;
#define FlipTimeline_create(...) spFlipTimeline_create(__VA_ARGS__)
#define FlipTimeline_setFrame(...) spFlipTimeline_setFrame(__VA_ARGS__)
#endif
/**/
#ifdef __cplusplus
}
#endif

View File

@ -60,6 +60,20 @@ struct spTrackEntry {
float mixTime, mixDuration, mix;
void* rendererObject;
#ifdef __cplusplus
spTrackEntry() :
state(0),
next(0),
previous(0),
animation(0),
loop(0),
delay(0), time(0), lastTime(0), endTime(0), timeScale(0),
listener(0),
mixTime(0), mixDuration(0), mix(0),
rendererObject(0) {
}
#endif
};
struct spAnimationState {
@ -71,6 +85,17 @@ struct spAnimationState {
spTrackEntry** tracks;
void* rendererObject;
#ifdef __cplusplus
spAnimationState() :
data(0),
timeScale(0),
listener(0),
tracksCount(0),
tracks(0),
rendererObject(0) {
}
#endif
};
/* @param data May be 0 for no mixing. */

View File

@ -38,10 +38,18 @@
extern "C" {
#endif
typedef struct {
typedef struct spAnimationStateData {
spSkeletonData* const skeletonData;
float defaultMix;
const void* const entries;
#ifdef __cplusplus
spAnimationStateData() :
skeletonData(0),
defaultMix(0),
entries(0) {
}
#endif
} spAnimationStateData;
spAnimationStateData* spAnimationStateData_create (spSkeletonData* skeletonData);

View File

@ -120,7 +120,7 @@ static int readValue (const char* end, Str* str) {
/* Returns the number of tuple values read (1, 2, 4, or 0 for failure). */
static int readTuple (const char* end, Str tuple[]) {
int i;
Str str;
Str str = {NULL, NULL};
readLine(0, end, &str);
if (!beginPast(&str, ':')) return 0;

View File

@ -38,7 +38,7 @@
extern "C" {
#endif
typedef struct {
typedef struct spAtlasAttachmentLoader {
spAttachmentLoader super;
spAtlas* atlas;
} spAtlasAttachmentLoader;

View File

@ -35,19 +35,23 @@
extern "C" {
#endif
struct spSlot;
typedef enum {
SP_ATTACHMENT_REGION, SP_ATTACHMENT_BOUNDING_BOX, SP_ATTACHMENT_MESH, SP_ATTACHMENT_SKINNED_MESH
} spAttachmentType;
typedef struct spAttachment spAttachment;
struct spAttachment {
typedef struct spAttachment {
const char* const name;
const spAttachmentType type;
const void* const vtable;
};
#ifdef __cplusplus
spAttachment() :
name(0),
type(SP_ATTACHMENT_REGION),
vtable(0) {
}
#endif
} spAttachment;
void spAttachment_dispose (spAttachment* self);

View File

@ -38,8 +38,7 @@
extern "C" {
#endif
typedef struct spAttachmentLoader spAttachmentLoader;
struct spAttachmentLoader {
typedef struct spAttachmentLoader {
const char* error1;
const char* error2;
@ -51,7 +50,7 @@ struct spAttachmentLoader {
vtable(0) {
}
#endif
};
} spAttachmentLoader;
void spAttachmentLoader_dispose (spAttachmentLoader* self);

View File

@ -37,6 +37,10 @@ void spBone_setYDown (int value) {
yDown = value;
}
int spBone_isYDown () {
return yDown;
}
spBone* spBone_create (spBoneData* data, spSkeleton* skeleton, spBone* parent) {
spBone* self = NEW(spBone);
CONST_CAST(spBoneData*, self->data) = data;
@ -64,24 +68,29 @@ void spBone_updateWorldTransform (spBone* self) {
}
CONST_CAST(float, self->worldRotation) =
self->data->inheritRotation ? self->parent->worldRotation + self->rotationIK : self->rotationIK;
CONST_CAST(int, self->worldFlipX) = self->parent->worldFlipX ^ self->flipX;
CONST_CAST(int, self->worldFlipY) = self->parent->worldFlipY ^ self->flipY;
} else {
int skeletonFlipX = self->skeleton->flipX, skeletonFlipY = self->skeleton->flipY;
CONST_CAST(float, self->worldX) = self->skeleton->flipX ? -self->x : self->x;
CONST_CAST(float, self->worldY) = self->skeleton->flipY != yDown ? -self->y : self->y;
CONST_CAST(float, self->worldScaleX) = self->scaleX;
CONST_CAST(float, self->worldScaleY) = self->scaleY;
CONST_CAST(float, self->worldRotation) = self->rotationIK;
CONST_CAST(int, self->worldFlipX) = skeletonFlipX ^ self->flipX;
CONST_CAST(int, self->worldFlipY) = skeletonFlipY ^ self->flipY;
}
radians = self->worldRotation * DEG_RAD;
cosine = COS(radians);
sine = SIN(radians);
if (self->skeleton->flipX) {
if (self->worldFlipX) {
CONST_CAST(float, self->m00) = -cosine * self->worldScaleX;
CONST_CAST(float, self->m01) = sine * self->worldScaleY;
} else {
CONST_CAST(float, self->m00) = cosine * self->worldScaleX;
CONST_CAST(float, self->m01) = -sine * self->worldScaleY;
}
if (self->skeleton->flipY != yDown) {
if (self->worldFlipY != yDown) {
CONST_CAST(float, self->m10) = -sine * self->worldScaleX;
CONST_CAST(float, self->m11) = -cosine * self->worldScaleY;
} else {
@ -97,13 +106,15 @@ void spBone_setToSetupPose (spBone* self) {
self->rotationIK = self->rotation;
self->scaleX = self->data->scaleX;
self->scaleY = self->data->scaleY;
self->flipX = self->data->flipX;
self->flipY = self->data->flipY;
}
void spBone_worldToLocal (spBone* self, float worldX, float worldY, float* localX, float* localY) {
float invDet;
float dx = worldX - self->worldX, dy = worldY - self->worldY;
float m00 = self->m00, m11 = self->m11;
if (self->skeleton->flipX != (self->skeleton->flipY != yDown)) {
if (self->worldFlipX != (self->worldFlipY != yDown)) {
m00 *= -1;
m11 *= -1;
}

View File

@ -47,14 +47,35 @@ struct spBone {
float x, y;
float rotation, rotationIK;
float scaleX, scaleY;
int/*bool*/flipX, flipY;
float const m00, m01, worldX; /* a b x */
float const m10, m11, worldY; /* c d y */
float const worldRotation;
float const worldScaleX, worldScaleY;
int/*bool*/const worldFlipX, worldFlipY;
#ifdef __cplusplus
spBone() :
data(0),
skeleton(0),
parent(0),
x(0), y(0),
rotation(0), rotationIK(0),
scaleX(0), scaleY(0),
flipX(0), flipY(0),
m00(0), m01(0), worldX(0),
m10(0), m11(0), worldY(0),
worldRotation(0),
worldScaleX(0), worldScaleY(0),
worldFlipX(0), worldFlipY(0) {
}
#endif
};
void spBone_setYDown (int/*bool*/yDown);
int/*bool*/spBone_isYDown ();
/* @param parent May be 0. */
spBone* spBone_create (spBoneData* data, struct spSkeleton* skeleton, spBone* parent);
@ -70,6 +91,7 @@ void spBone_localToWorld (spBone* self, float localX, float localY, float* world
#ifdef SPINE_SHORT_NAMES
typedef spBone Bone;
#define Bone_setYDown(...) spBone_setYDown(__VA_ARGS__)
#define Bone_isYDown() spBone_isYDown()
#define Bone_create(...) spBone_create(__VA_ARGS__)
#define Bone_dispose(...) spBone_dispose(__VA_ARGS__)
#define Bone_setToSetupPose(...) spBone_setToSetupPose(__VA_ARGS__)

View File

@ -43,7 +43,21 @@ struct spBoneData {
float x, y;
float rotation;
float scaleX, scaleY;
int/*bool*/flipX, flipY;
int/*bool*/inheritScale, inheritRotation;
#ifdef __cplusplus
spBoneData() :
name(0),
parent(0),
length(0),
x(0), y(0),
rotation(0),
scaleX(0), scaleY(0),
flipX(0), flipY(0),
inheritScale(0), inheritRotation(0) {
}
#endif
};
spBoneData* spBoneData_create (const char* name, spBoneData* parent);

View File

@ -39,12 +39,11 @@
extern "C" {
#endif
typedef struct spBoundingBoxAttachment spBoundingBoxAttachment;
struct spBoundingBoxAttachment {
typedef struct spBoundingBoxAttachment {
spAttachment super;
int verticesCount;
float* vertices;
};
} spBoundingBoxAttachment;
spBoundingBoxAttachment* spBoundingBoxAttachment_create (const char* name);
void spBoundingBoxAttachment_computeWorldVertices (spBoundingBoxAttachment* self, spBone* bone, float* vertices);

View File

@ -37,13 +37,21 @@
extern "C" {
#endif
typedef struct spEvent spEvent;
struct spEvent {
typedef struct spEvent {
spEventData* const data;
int intValue;
float floatValue;
const char* stringValue;
};
#ifdef __cplusplus
spEvent() :
data(0),
intValue(0),
floatValue(0),
stringValue(0) {
}
#endif
} spEvent;
spEvent* spEvent_create (spEventData* data);
void spEvent_dispose (spEvent* self);

View File

@ -35,13 +35,21 @@
extern "C" {
#endif
typedef struct spEventData spEventData;
struct spEventData {
typedef struct spEventData {
const char* const name;
int intValue;
float floatValue;
const char* stringValue;
};
#ifdef __cplusplus
spEventData() :
name(0),
intValue(0),
floatValue(0),
stringValue(0) {
}
#endif
} spEventData;
spEventData* spEventData_create (const char* name);
void spEventData_dispose (spEventData* self);

View File

@ -69,7 +69,9 @@ void spIkConstraint_apply (spIkConstraint* self) {
void spIkConstraint_apply1 (spBone* bone, float targetX, float targetY, float alpha) {
float parentRotation = (!bone->data->inheritRotation || !bone->parent) ? 0 : bone->parent->worldRotation;
float rotation = bone->rotation;
float rotationIK = ATAN2(targetY - bone->worldY, targetX - bone->worldX) * RAD_DEG - parentRotation;
float rotationIK = ATAN2(targetY - bone->worldY, targetX - bone->worldX) * RAD_DEG;
if (bone->worldFlipX != (bone->worldFlipY != spBone_isYDown())) rotationIK = -rotationIK;
rotationIK -= parentRotation;
bone->rotationIK = rotation + (rotationIK - rotation) * alpha;
}

View File

@ -40,8 +40,7 @@ extern "C" {
struct spSkeleton;
typedef struct spIkConstraint spIkConstraint;
struct spIkConstraint {
typedef struct spIkConstraint {
spIkConstraintData* const data;
int bonesCount;
@ -50,7 +49,18 @@ struct spIkConstraint {
spBone* target;
int bendDirection;
float mix;
};
#ifdef __cplusplus
spIkConstraint() :
data(0),
bonesCount(0),
bones(0),
target(0),
bendDirection(0),
mix(0) {
}
#endif
} spIkConstraint;
spIkConstraint* spIkConstraint_create (spIkConstraintData* data, const struct spSkeleton* skeleton);
void spIkConstraint_dispose (spIkConstraint* self);

View File

@ -37,8 +37,7 @@
extern "C" {
#endif
typedef struct spIkConstraintData spIkConstraintData;
struct spIkConstraintData {
typedef struct spIkConstraintData {
const char* const name;
int bonesCount;
@ -47,7 +46,18 @@ struct spIkConstraintData {
spBoneData* target;
int bendDirection;
float mix;
};
#ifdef __cplusplus
spIkConstraintData() :
name(0),
bonesCount(0),
bones(0),
target(0),
bendDirection(0),
mix(0) {
}
#endif
} spIkConstraintData;
spIkConstraintData* spIkConstraintData_create (const char* name);
void spIkConstraintData_dispose (spIkConstraintData* self);

View File

@ -39,8 +39,7 @@
extern "C" {
#endif
typedef struct spMeshAttachment spMeshAttachment;
struct spMeshAttachment {
typedef struct spMeshAttachment {
spAttachment super;
const char* path;
@ -67,7 +66,7 @@ struct spMeshAttachment {
int edgesCount;
int* edges;
float width, height;
};
} spMeshAttachment;
spMeshAttachment* spMeshAttachment_create (const char* name);
void spMeshAttachment_updateUVs (spMeshAttachment* self);

View File

@ -43,8 +43,7 @@ typedef enum {
SP_VERTEX_X1 = 0, SP_VERTEX_Y1, SP_VERTEX_X2, SP_VERTEX_Y2, SP_VERTEX_X3, SP_VERTEX_Y3, SP_VERTEX_X4, SP_VERTEX_Y4
} spVertexIndex;
typedef struct spRegionAttachment spRegionAttachment;
struct spRegionAttachment {
typedef struct spRegionAttachment {
spAttachment super;
const char* path;
float x, y, scaleX, scaleY, rotation, width, height;
@ -57,7 +56,7 @@ struct spRegionAttachment {
float offset[8];
float uvs[8];
};
} spRegionAttachment;
spRegionAttachment* spRegionAttachment_create (const char* name);
void spRegionAttachment_setUVs (spRegionAttachment* self, float u, float v, float u2, float v2, int/*bool*/rotate);

View File

@ -40,8 +40,7 @@
extern "C" {
#endif
typedef struct spSkeleton spSkeleton;
struct spSkeleton {
typedef struct spSkeleton {
spSkeletonData* const data;
int bonesCount;
@ -60,7 +59,29 @@ struct spSkeleton {
float time;
int/*bool*/flipX, flipY;
float x, y;
};
#ifdef __cplusplus
spSkeleton() :
data(0),
bonesCount(0),
bones(0),
root(0),
slotsCount(0),
slots(0),
drawOrder(0),
ikConstraintsCount(0),
ikConstraints(0),
skin(0),
r(0), g(0), b(0), a(0),
time(0),
flipX(0),
flipY(0),
x(0), y(0) {
}
#endif
} spSkeleton;
spSkeleton* spSkeleton_create (spSkeletonData* data);
void spSkeleton_dispose (spSkeleton* self);
@ -83,8 +104,9 @@ spSlot* spSkeleton_findSlot (const spSkeleton* self, const char* slotName);
/* Returns -1 if the slot was not found. */
int spSkeleton_findSlotIndex (const spSkeleton* self, const char* slotName);
/* 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.
/* Sets the skin used to look up attachments before looking in the SkeletonData defaultSkin. Attachments from the new skin are
* attached if the corresponding attachment from the old skin was attached. If there was no old skin, each slot's setup mode
* attachment is attached from the new skin.
* @param skin May be 0.*/
void spSkeleton_setSkin (spSkeleton* self, spSkin* skin);
/* Returns 0 if the skin was not found. See spSkeleton_setSkin.
@ -95,7 +117,8 @@ int spSkeleton_setSkinByName (spSkeleton* self, const char* skinName);
spAttachment* spSkeleton_getAttachmentForSlotName (const spSkeleton* self, const char* slotName, const char* attachmentName);
/* Returns 0 if the slot or attachment was not found. */
spAttachment* spSkeleton_getAttachmentForSlotIndex (const spSkeleton* self, int slotIndex, const char* attachmentName);
/* Returns 0 if the slot or attachment was not found. */
/* Returns 0 if the slot or attachment was not found.
* @param attachmentName May be 0. */
int spSkeleton_setAttachment (spSkeleton* self, const char* slotName, const char* attachmentName);
/* Returns 0 if the IK constraint was not found. */

View File

@ -98,6 +98,10 @@ void SkeletonAnimation::initialize () {
stateInternal->disposeTrackEntry = disposeTrackEntry;
}
SkeletonAnimation::SkeletonAnimation ()
: SkeletonRenderer() {
}
SkeletonAnimation::SkeletonAnimation (spSkeletonData *skeletonData)
: SkeletonRenderer(skeletonData) {
initialize();

View File

@ -76,7 +76,7 @@ public:
spAnimationState* getState() const;
protected:
CC_CONSTRUCTOR_ACCESS:
SkeletonAnimation ();
SkeletonAnimation (spSkeletonData* skeletonData);
SkeletonAnimation (const std::string&skeletonDataFile, spAtlas* atlas, float scale = 1);
@ -84,6 +84,7 @@ protected:
virtual ~SkeletonAnimation ();
void initialize ();
protected:
spAnimationState* _state;
bool _ownsAnimationStateData;

View File

@ -38,7 +38,7 @@
extern "C" {
#endif
typedef struct {
typedef struct spPolygon {
float* const vertices;
int count;
int capacity;
@ -60,7 +60,7 @@ typedef spPolygon Polygon;
/**/
typedef struct {
typedef struct spSkeletonBounds {
int count;
spBoundingBoxAttachment** boundingBoxes;
spPolygon** polygons;

View File

@ -62,6 +62,9 @@ void spSkeletonData_dispose (spSkeletonData* self) {
spIkConstraintData_dispose(self->ikConstraints[i]);
FREE(self->ikConstraints);
FREE(self->hash);
FREE(self->version);
FREE(self);
}

View File

@ -42,7 +42,7 @@
extern "C" {
#endif
typedef struct {
typedef struct spSkeletonData {
const char* version;
const char* hash;
float width, height;

View File

@ -65,7 +65,7 @@ void _spSkeletonJson_setError (spSkeletonJson* self, Json* root, const char* val
FREE(self->error);
strcpy(message, value1);
length = (int)strlen(value1);
if (value2) strncat(message + length, value2, 256 - length);
if (value2) strncat(message + length, value2, 255 - length);
MALLOC_STR(self->error, message);
if (root) Json_dispose(root);
}
@ -106,16 +106,19 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
spAnimation* animation;
Json* frame;
float duration;
int timelinesCount = 0;
Json* bones = Json_getItem(root, "bones");
Json* slots = Json_getItem(root, "slots");
Json* ik = Json_getItem(root, "ik");
Json* ffd = Json_getItem(root, "ffd");
Json* drawOrder = Json_getItem(root, "draworder");
Json* drawOrder = Json_getItem(root, "drawOrder");
Json* events = Json_getItem(root, "events");
Json* flipX = Json_getItem(root, "flipx");
Json* flipY = Json_getItem(root, "flipy");
Json *boneMap, *slotMap, *ikMap, *ffdMap;
if (!drawOrder) drawOrder = Json_getItem(root, "draworder");
int timelinesCount = 0;
for (boneMap = bones ? bones->child : 0; boneMap; boneMap = boneMap->next)
timelinesCount += boneMap->size;
for (slotMap = slots ? slots->child : 0; slotMap; slotMap = slotMap->next)
@ -124,8 +127,10 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
for (ffdMap = ffd ? ffd->child : 0; ffdMap; ffdMap = ffdMap->next)
for (slotMap = ffdMap->child; slotMap; slotMap = slotMap->next)
timelinesCount += slotMap->size;
if (events) ++timelinesCount;
if (drawOrder) ++timelinesCount;
if (events) ++timelinesCount;
if (flipX) ++timelinesCount;
if (flipY) ++timelinesCount;
animation = spAnimation_create(root->name, timelinesCount);
animation->timelinesCount = 0;
@ -214,6 +219,17 @@ static spAnimation* _spSkeletonJson_readAnimation (spSkeletonJson* self, Json* r
animation->timelines[animation->timelinesCount++] = SUPER_CAST(spTimeline, timeline);
duration = timeline->frames[timelineArray->size * 3 - 3];
if (duration > animation->duration) animation->duration = duration;
} else if (strcmp(timelineArray->name, "flipX") == 0 || strcmp(timelineArray->name, "flipY") == 0) {
int x = strcmp(timelineArray->name, "flipX") == 0;
const char* field = x ? "x" : "y";
spFlipTimeline *timeline = spFlipTimeline_create(timelineArray->size, x);
timeline->boneIndex = boneIndex;
for (frame = timelineArray->child, i = 0; frame; frame = frame->next, ++i)
spFlipTimeline_setFrame(timeline, i, Json_getFloat(frame, "time", 0), Json_getInt(frame, field, 0));
animation->timelines[animation->timelinesCount++] = SUPER_CAST(spTimeline, timeline);
duration = timeline->frames[timelineArray->size * 2 - 2];
if (duration > animation->duration) animation->duration = duration;
} else {
spAnimation_dispose(animation);
_spSkeletonJson_setError(self, 0, "Invalid timeline type for a bone: ", timelineArray->name);
@ -418,8 +434,8 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
skeleton = Json_getItem(root, "skeleton");
if (skeleton) {
skeletonData->hash = Json_getString(skeleton, "hash", 0);
skeletonData->version = Json_getString(skeleton, "spine", 0);
MALLOC_STR(skeletonData->hash, Json_getString(skeleton, "hash", 0));
MALLOC_STR(skeletonData->version, Json_getString(skeleton, "spine", 0));
skeletonData->width = Json_getFloat(skeleton, "width", 0);
skeletonData->height = Json_getFloat(skeleton, "height", 0);
}
@ -450,6 +466,8 @@ spSkeletonData* spSkeletonJson_readSkeletonData (spSkeletonJson* self, const cha
boneData->scaleY = Json_getFloat(boneMap, "scaleY", 1);
boneData->inheritScale = Json_getInt(boneMap, "inheritScale", 1);
boneData->inheritRotation = Json_getInt(boneMap, "inheritRotation", 1);
boneData->flipX = Json_getInt(boneMap, "flipX", 0);
boneData->flipY = Json_getInt(boneMap, "flipY", 0);
skeletonData->bones[i] = boneData;
skeletonData->bonesCount++;

View File

@ -41,7 +41,7 @@
extern "C" {
#endif
typedef struct {
typedef struct spSkeletonJson {
float scale;
spAttachmentLoader* attachmentLoader;
const char* const error;

View File

@ -75,7 +75,6 @@ void SkeletonRenderer::initialize () {
setOpacityModifyRGB(true);
setGLProgram(ShaderCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR));
scheduleUpdate();
}
void SkeletonRenderer::setSkeletonData (spSkeletonData *skeletonData, bool ownsSkeletonData) {
@ -84,18 +83,35 @@ void SkeletonRenderer::setSkeletonData (spSkeletonData *skeletonData, bool ownsS
}
SkeletonRenderer::SkeletonRenderer () {
initialize();
}
SkeletonRenderer::SkeletonRenderer (spSkeletonData *skeletonData, bool ownsSkeletonData) {
initialize();
setSkeletonData(skeletonData, ownsSkeletonData);
initWithData(skeletonData, ownsSkeletonData);
}
SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, spAtlas* atlas, float scale) {
initialize();
initWithFile(skeletonDataFile, atlas, scale);
}
SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) {
initWithFile(skeletonDataFile, atlasFile, scale);
}
SkeletonRenderer::~SkeletonRenderer () {
if (_ownsSkeletonData) spSkeletonData_dispose(_skeleton->data);
if (_atlas) spAtlas_dispose(_atlas);
spSkeleton_dispose(_skeleton);
_batch->release();
FREE(_worldVertices);
}
void SkeletonRenderer::initWithData (spSkeletonData* skeletonData, bool ownsSkeletonData) {
setSkeletonData(skeletonData, ownsSkeletonData);
initialize();
}
void SkeletonRenderer::initWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale) {
spSkeletonJson* json = spSkeletonJson_create(atlas);
json->scale = scale;
spSkeletonData* skeletonData = spSkeletonJson_readSkeletonDataFile(json, skeletonDataFile.c_str());
@ -103,11 +119,11 @@ SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, spAtlas
spSkeletonJson_dispose(json);
setSkeletonData(skeletonData, true);
initialize();
}
SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) {
initialize();
void SkeletonRenderer::initWithFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale) {
_atlas = spAtlas_createFromFile(atlasFile.c_str(), 0);
CCASSERT(_atlas, "Error reading atlas file.");
@ -118,15 +134,10 @@ SkeletonRenderer::SkeletonRenderer (const std::string& skeletonDataFile, const s
spSkeletonJson_dispose(json);
setSkeletonData(skeletonData, true);
initialize();
}
SkeletonRenderer::~SkeletonRenderer () {
if (_ownsSkeletonData) spSkeletonData_dispose(_skeleton->data);
if (_atlas) spAtlas_dispose(_atlas);
spSkeleton_dispose(_skeleton);
_batch->release();
FREE(_worldVertices);
}
void SkeletonRenderer::update (float deltaTime) {
spSkeleton_update(_skeleton, deltaTime * _timeScale);
@ -335,14 +346,20 @@ spSlot* SkeletonRenderer::findSlot (const std::string& slotName) const {
}
bool SkeletonRenderer::setSkin (const std::string& skinName) {
return spSkeleton_setSkinByName(_skeleton, skinName.c_str()) ? true : false;
return spSkeleton_setSkinByName(_skeleton, skinName.empty() ? 0 : skinName.c_str()) ? true : false;
}
bool SkeletonRenderer::setSkin (const char* skinName) {
return spSkeleton_setSkinByName(_skeleton, skinName) ? true : false;
}
spAttachment* SkeletonRenderer::getAttachment (const std::string& slotName, const std::string& attachmentName) const {
return spSkeleton_getAttachmentForSlotName(_skeleton, 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.c_str()) ? true : false;
return spSkeleton_setAttachment(_skeleton, 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;
}
spSkeleton* SkeletonRenderer::getSkeleton () {
@ -370,6 +387,16 @@ bool SkeletonRenderer::getDebugBonesEnabled () const {
return _debugBones;
}
void SkeletonRenderer::onEnter () {
Node::onEnter();
scheduleUpdate();
}
void SkeletonRenderer::onExit () {
Node::onExit();
unscheduleUpdate();
}
// --- CCBlendProtocol
const BlendFunc& SkeletonRenderer::getBlendFunc () const {

View File

@ -49,6 +49,8 @@ public:
virtual void draw (cocos2d::Renderer* renderer, const cocos2d::Mat4& transform, uint32_t transformFlags) override;
virtual void drawSkeleton (const cocos2d::Mat4& transform, uint32_t transformFlags);
virtual cocos2d::Rect getBoundingBox () const override;
virtual void onEnter () override;
virtual void onExit () override;
spSkeleton* getSkeleton();
@ -75,13 +77,18 @@ public:
/* 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.
* @param skin May be 0.*/
* @param skin May be empty string ("") for no skin.*/
bool setSkin (const std::string& skinName);
/** @param skin May be 0 for no skin.*/
bool 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;
/* Returns false if the slot or attachment was not found. */
/* 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);
/* @param attachmentName May be 0 for no attachment. */
bool setAttachment (const std::string& slotName, const char* attachmentName);
// --- BlendProtocol
virtual void setBlendFunc (const cocos2d::BlendFunc& blendFunc);
@ -89,14 +96,21 @@ public:
virtual void setOpacityModifyRGB (bool value);
virtual bool isOpacityModifyRGB () const;
protected:
CC_CONSTRUCTOR_ACCESS:
SkeletonRenderer ();
SkeletonRenderer (spSkeletonData* skeletonData, bool ownsSkeletonData = false);
SkeletonRenderer (const std::string& skeletonDataFile, spAtlas* atlas, float scale = 1);
SkeletonRenderer (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1);
virtual ~SkeletonRenderer ();
void initWithData (spSkeletonData* skeletonData, bool ownsSkeletonData = false);
void initWithFile (const std::string& skeletonDataFile, spAtlas* atlas, float scale = 1);
void initWithFile (const std::string& skeletonDataFile, const std::string& atlasFile, float scale = 1);
void initialize ();
protected:
void setSkeletonData (spSkeletonData* skeletonData, bool ownsSkeletonData);
virtual cocos2d::Texture2D* getTexture (spRegionAttachment* attachment) const;
virtual cocos2d::Texture2D* getTexture (spMeshAttachment* attachment) const;

View File

@ -39,8 +39,14 @@ extern "C" {
struct spSkeleton;
typedef struct {
typedef struct spSkin {
const char* const name;
#ifdef __cplusplus
spSkin() :
name(0) {
}
#endif
} spSkin;
spSkin* spSkin_create (const char* name);

View File

@ -38,8 +38,7 @@
extern "C" {
#endif
typedef struct spSkinnedMeshAttachment spSkinnedMeshAttachment;
struct spSkinnedMeshAttachment {
typedef struct spSkinnedMeshAttachment {
spAttachment super;
const char* path;
@ -70,7 +69,7 @@ struct spSkinnedMeshAttachment {
int edgesCount;
int* edges;
float width, height;
};
} spSkinnedMeshAttachment;
spSkinnedMeshAttachment* spSkinnedMeshAttachment_create (const char* name);
void spSkinnedMeshAttachment_updateUVs (spSkinnedMeshAttachment* self);

View File

@ -48,6 +48,18 @@ typedef struct spSlot {
int attachmentVerticesCapacity;
int attachmentVerticesCount;
float* attachmentVertices;
#ifdef __cplusplus
spSlot() :
data(0),
bone(0),
r(0), b(0), g(0), a(0),
attachment(0),
attachmentVerticesCapacity(0),
attachmentVerticesCount(0),
attachmentVertices(0) {
}
#endif
} spSlot;
spSlot* spSlot_create (spSlotData* data, spBone* bone);

View File

@ -37,12 +37,22 @@
extern "C" {
#endif
typedef struct {
typedef struct spSlotData {
const char* const name;
const spBoneData* const boneData;
const char* attachmentName;
float r, g, b, a;
int/*bool*/additiveBlending;
#ifdef __cplusplus
spSlotData() :
name(0),
boneData(0),
attachmentName(0),
r(0), g(0), b(0), a(0),
additiveBlending(0) {
}
#endif
} spSlotData;
spSlotData* spSlotData_create (const char* name, spBoneData* boneData);

View File

@ -124,12 +124,21 @@ char* _readFile (const char* path, int* length);
/**/
typedef struct {
typedef struct _spAnimationState {
spAnimationState super;
spEvent** events;
spTrackEntry* (*createTrackEntry) (spAnimationState* self);
void (*disposeTrackEntry) (spTrackEntry* entry);
#ifdef __cplusplus
_spAnimationState() :
super(),
events(0),
createTrackEntry(0),
disposeTrackEntry(0) {
}
#endif
} _spAnimationState;
spTrackEntry* _spTrackEntry_create (spAnimationState* self);

View File

@ -188,6 +188,40 @@ bool Rect::intersectsRect(const Rect& rect) const
rect.getMaxY() < getMinY());
}
bool Rect::intersectsCircle(const cocos2d::Vec2 &center, float radius) const
{
Vec2 rectangleCenter((origin.x + size.width / 2),
(origin.y + size.height / 2));
float w = size.width / 2;
float h = size.height / 2;
float dx = fabs(center.x - rectangleCenter.x);
float dy = fabs(center.y - rectangleCenter.y);
if (dx > (radius + w) || dy > (radius + h))
{
return false;
}
Vec2 circleDistance(fabs(center.x - origin.x - w),
fabs(center.y - origin.y - h));
if (circleDistance.x <= (w))
{
return true;
}
if (circleDistance.y <= (h))
{
return true;
}
float cornerDistanceSq = powf(circleDistance.x - w, 2) + powf(circleDistance.y - h, 2);
return (cornerDistanceSq <= (powf(radius, 2)));
}
void Rect::merge(const Rect& rect)
{
float top1 = getMaxY();

View File

@ -196,6 +196,11 @@ public:
*/
bool intersectsRect(const Rect& rect) const;
/**
Check the intersect status of the rect and a circle.
* @js NA
*/
bool intersectsCircle(const Vec2& center, float radius) const;
/**
Get the min rect which can contain this and rect.
* @js NA
* @lua NA

View File

@ -1,18 +1,11 @@
const char* cc3D_Skybox_vert = STRINGIFY(
attribute vec4 a_position;
attribute vec3 a_position;
varying vec3 v_reflect;
void main(void)
{
mat4 MVMatrixLimited = CC_MVMatrix;
MVMatrixLimited[0][3] = 0.0;
MVMatrixLimited[1][3] = 0.0;
MVMatrixLimited[2][3] = 0.0;
vec4 position = MVMatrixLimited* a_position;
v_reflect = a_position.xyz;
gl_Position = position.xyww;
v_reflect = normalize(CC_NormalMatrix * a_position);
gl_Position = CC_MVPMatrix * vec4(a_position, 1.0);
}
);

View File

@ -36,7 +36,7 @@
-- @return Label#Label ret (return value: cc.Label)
--------------------------------
-- brief Return a zoom scale <br>
-- brief Return a zoom scale<br>
-- return the zoom scale in float<br>
-- since v3.3
-- @function [parent=#Button] getZoomScale

View File

@ -49,12 +49,13 @@
-- @return BlendFunc#BlendFunc ret (return value: cc.BlendFunc)
--------------------------------
--
-- @function [parent=#SkeletonRenderer] setSkin
-- @overload self, char
-- @overload self, string
-- @function [parent=#SkeletonRenderer] setSkin
-- @param self
-- @param #string skinName
-- @return bool#bool ret (return value: bool)
--------------------------------
--
-- @function [parent=#SkeletonRenderer] setToSetupPose
@ -116,4 +117,16 @@
-- @param self
-- @return rect_table#rect_table ret (return value: rect_table)
--------------------------------
--
-- @function [parent=#SkeletonRenderer] onEnter
-- @param self
-- @return SkeletonRenderer#SkeletonRenderer self (return value: sp.SkeletonRenderer)
--------------------------------
--
-- @function [parent=#SkeletonRenderer] onExit
-- @param self
-- @return SkeletonRenderer#SkeletonRenderer self (return value: sp.SkeletonRenderer)
return nil

View File

@ -345,42 +345,47 @@ int lua_cocos2dx_spine_SkeletonRenderer_setSkin(lua_State* tolua_S)
int argc = 0;
spine::SkeletonRenderer* cobj = nullptr;
bool ok = true;
#if COCOS2D_DEBUG >= 1
tolua_Error tolua_err;
#endif
#if COCOS2D_DEBUG >= 1
if (!tolua_isusertype(tolua_S,1,"sp.SkeletonRenderer",0,&tolua_err)) goto tolua_lerror;
#endif
cobj = (spine::SkeletonRenderer*)tolua_tousertype(tolua_S,1,0);
#if COCOS2D_DEBUG >= 1
if (!cobj)
if (!cobj)
{
tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_spine_SkeletonRenderer_setSkin'", nullptr);
return 0;
}
#endif
argc = lua_gettop(tolua_S)-1;
if (argc == 1)
{
std::string arg0;
do{
if (argc == 1) {
const char* arg0;
std::string arg0_tmp; ok &= luaval_to_std_string(tolua_S, 2, &arg0_tmp, "sp.SkeletonRenderer:setSkin"); arg0 = arg0_tmp.c_str();
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "sp.SkeletonRenderer:setSkin");
if(!ok)
{
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_spine_SkeletonRenderer_setSkin'", nullptr);
return 0;
if (!ok) { break; }
bool ret = cobj->setSkin(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
bool ret = cobj->setSkin(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "sp.SkeletonRenderer:setSkin",argc, 1);
}while(0);
ok = true;
do{
if (argc == 1) {
std::string arg0;
ok &= luaval_to_std_string(tolua_S, 2,&arg0, "sp.SkeletonRenderer:setSkin");
if (!ok) { break; }
bool ret = cobj->setSkin(arg0);
tolua_pushboolean(tolua_S,(bool)ret);
return 1;
}
}while(0);
ok = true;
luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "sp.SkeletonRenderer:setSkin",argc, 1);
return 0;
#if COCOS2D_DEBUG >= 1

View File

@ -5871,7 +5871,7 @@ int lua_cocos2dx_ui_Button_getTitleText(lua_State* tolua_S)
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Button_getTitleText'", nullptr);
return 0;
}
const std::string& ret = cobj->getTitleText();
const std::string ret = cobj->getTitleText();
tolua_pushcppstring(tolua_S,ret);
return 1;
}
@ -6994,7 +6994,7 @@ int lua_cocos2dx_ui_Button_getTitleFontName(lua_State* tolua_S)
tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_ui_Button_getTitleFontName'", nullptr);
return 0;
}
const std::string& ret = cobj->getTitleFontName();
const std::string ret = cobj->getTitleFontName();
tolua_pushcppstring(tolua_S,ret);
return 1;
}

View File

@ -39,30 +39,24 @@ static const int PRESSED_RENDERER_Z = (-2);
static const int DISABLED_RENDERER_Z = (-2);
static const int TITLE_RENDERER_Z = (-1);
static const float ZOOM_ACTION_TIME_STEP = 0.05f;
IMPLEMENT_CLASS_GUI_INFO(Button)
Button::Button():
_buttonNormalRenderer(nullptr),
_buttonClickedRenderer(nullptr),
_buttonDisableRenderer(nullptr),
_titleRenderer(nullptr),
_zoomScale(0.1f),
_normalFileName(""),
_clickedFileName(""),
_disabledFileName(""),
_prevIgnoreSize(true),
_scale9Enabled(false),
_pressedActionEnabled(false),
_capInsetsNormal(Rect::ZERO),
_capInsetsPressed(Rect::ZERO),
_capInsetsDisabled(Rect::ZERO),
_normalTexType(TextureResType::LOCAL),
_pressedTexType(TextureResType::LOCAL),
_disabledTexType(TextureResType::LOCAL),
_normalTextureSize(_contentSize),
_pressedTextureSize(_contentSize),
_disabledTextureSize(_contentSize),
_pressedActionEnabled(false),
_normalTextureScaleXInSize(1.0f),
_normalTextureScaleYInSize(1.0f),
_pressedTextureScaleXInSize(1.0f),
@ -73,7 +67,6 @@ _disabledTextureLoaded(false),
_normalTextureAdaptDirty(true),
_pressedTextureAdaptDirty(true),
_disabledTextureAdaptDirty(true),
_fontName("Thonburi"),
_fontSize(10),
_type(FontType::SYSTEM)
{
@ -95,7 +88,7 @@ Button* Button::create()
CC_SAFE_DELETE(widget);
return nullptr;
}
Button* Button::create(const std::string &normalImage,
const std::string& selectedImage ,
const std::string& disableImage,
@ -110,7 +103,7 @@ Button* Button::create(const std::string &normalImage,
CC_SAFE_DELETE(btn);
return nullptr;
}
bool Button::init(const std::string &normalImage,
const std::string& selectedImage ,
const std::string& disableImage,
@ -124,7 +117,7 @@ bool Button::init(const std::string &normalImage,
ret = false;
break;
}
this->loadTextures(normalImage, selectedImage, disableImage,texType);
} while (0);
return ret;
@ -147,13 +140,16 @@ void Button::initRenderer()
_buttonClickedRenderer->setScale9Enabled(false);
_buttonNormalRenderer->setScale9Enabled(false);
_buttonDisableRenderer->setScale9Enabled(false);
_titleRenderer = Label::create();
_titleRenderer->setAnchorPoint(Vec2::ANCHOR_MIDDLE);
addProtectedChild(_buttonNormalRenderer, NORMAL_RENDERER_Z, -1);
addProtectedChild(_buttonClickedRenderer, PRESSED_RENDERER_Z, -1);
addProtectedChild(_buttonDisableRenderer, DISABLED_RENDERER_Z, -1);
}
void Button::createTitleRenderer()
{
_titleRenderer = Label::create();
_titleRenderer->setAnchorPoint(Vec2::ANCHOR_MIDDLE);
addProtectedChild(_titleRenderer, TITLE_RENDERER_Z, -1);
}
@ -163,13 +159,13 @@ void Button::setScale9Enabled(bool able)
{
return;
}
_scale9Enabled = able;
_buttonNormalRenderer->setScale9Enabled(_scale9Enabled);
_buttonClickedRenderer->setScale9Enabled(_scale9Enabled);
_buttonDisableRenderer->setScale9Enabled(_scale9Enabled);
if (_scale9Enabled)
{
bool ignoreBefore = _ignoreSize;
@ -180,11 +176,11 @@ void Button::setScale9Enabled(bool able)
{
ignoreContentAdaptWithSize(_prevIgnoreSize);
}
setCapInsetsNormalRenderer(_capInsetsNormal);
setCapInsetsPressedRenderer(_capInsetsPressed);
setCapInsetsDisabledRenderer(_capInsetsDisabled);
_brightStyle = BrightStyle::NONE;
setBright(_bright);
@ -205,7 +201,7 @@ void Button::ignoreContentAdaptWithSize(bool ignore)
this->updateContentSize();
return;
}
if (!_scale9Enabled || (_scale9Enabled && !ignore))
{
Widget::ignoreContentAdaptWithSize(ignore);
@ -225,14 +221,11 @@ void Button::loadTextures(const std::string& normal,
void Button::loadTextureNormal(const std::string& normal,TextureResType texType)
{
if (normal.empty() || (_normalFileName == normal && _normalTexType == texType))
if(normal.empty())
{
return;
}
_normalFileName = normal;
_normalTexType = texType;
switch (_normalTexType)
switch (texType)
{
case TextureResType::LOCAL:
_buttonNormalRenderer->initWithFile(normal);
@ -243,11 +236,16 @@ void Button::loadTextureNormal(const std::string& normal,TextureResType texType)
default:
break;
}
this->setupNormalTexture();
}
void Button::setupNormalTexture()
{
_normalTextureSize = _buttonNormalRenderer->getContentSize();
this->updateChildrenDisplayedRGBA();
if (_unifySize )
{
if (!_scale9Enabled)
@ -263,16 +261,20 @@ void Button::loadTextureNormal(const std::string& normal,TextureResType texType)
_normalTextureAdaptDirty = true;
}
void Button::loadTextureNormal(SpriteFrame* normalSpriteFrame)
{
_buttonNormalRenderer->initWithSpriteFrame(normalSpriteFrame);
this->setupNormalTexture();
}
void Button::loadTexturePressed(const std::string& selected,TextureResType texType)
{
if (selected.empty() || (_clickedFileName == selected && _pressedTexType == texType))
if (selected.empty())
{
return;
}
_clickedFileName = selected;
_pressedTexType = texType;
switch (_pressedTexType)
switch (texType)
{
case TextureResType::LOCAL:
_buttonClickedRenderer->initWithFile(selected);
@ -283,25 +285,34 @@ void Button::loadTexturePressed(const std::string& selected,TextureResType texTy
default:
break;
}
this->setupPressedTexture();
}
void Button::setupPressedTexture()
{
_pressedTextureSize = _buttonClickedRenderer->getContentSize();
this->updateChildrenDisplayedRGBA();
_pressedTextureLoaded = true;
_pressedTextureAdaptDirty = true;
}
void Button::loadTexturePressed(SpriteFrame* pressedSpriteFrame)
{
_buttonClickedRenderer->initWithSpriteFrame(pressedSpriteFrame);
this->setupPressedTexture();
}
void Button::loadTextureDisabled(const std::string& disabled,TextureResType texType)
{
if (disabled.empty() || (_disabledFileName == disabled && _disabledTexType == texType))
if (disabled.empty())
{
return;
}
_disabledFileName = disabled;
_disabledTexType = texType;
switch (_disabledTexType)
switch (texType)
{
case TextureResType::LOCAL:
_buttonDisableRenderer->initWithFile(disabled);
@ -312,15 +323,25 @@ void Button::loadTextureDisabled(const std::string& disabled,TextureResType texT
default:
break;
}
this->setupDisabledTexture();
}
void Button::setupDisabledTexture()
{
_disabledTextureSize = _buttonDisableRenderer->getContentSize();
this->updateChildrenDisplayedRGBA();
_disabledTextureLoaded = true;
_disabledTextureAdaptDirty = true;
}
void Button::loadTextureDisabled(SpriteFrame* disabledSpriteFrame)
{
_buttonDisableRenderer->initWithSpriteFrame(disabledSpriteFrame);
this->setupDisabledTexture();
}
void Button::setCapInsets(const Rect &capInsets)
{
setCapInsetsNormalRenderer(capInsets);
@ -329,11 +350,10 @@ void Button::setCapInsets(const Rect &capInsets)
}
void Button::setCapInsetsNormalRenderer(const Rect &capInsets)
{
_capInsetsNormal = Helper::restrictCapInsetRect(capInsets, this->_normalTextureSize);
//for performance issue
if (!_scale9Enabled)
{
@ -345,7 +365,7 @@ void Button::setCapInsetsNormalRenderer(const Rect &capInsets)
void Button::setCapInsetsPressedRenderer(const Rect &capInsets)
{
_capInsetsPressed = Helper::restrictCapInsetRect(capInsets, this->_pressedTextureSize);
//for performance issue
if (!_scale9Enabled)
{
@ -357,7 +377,7 @@ void Button::setCapInsetsPressedRenderer(const Rect &capInsets)
void Button::setCapInsetsDisabledRenderer(const Rect &capInsets)
{
_capInsetsDisabled = Helper::restrictCapInsetRect(capInsets, this->_disabledTextureSize);
//for performance issue
if (!_scale9Enabled)
{
@ -370,12 +390,12 @@ const Rect& Button::getCapInsetsNormalRenderer()const
{
return _capInsetsNormal;
}
const Rect& Button::getCapInsetsPressedRenderer()const
{
return _capInsetsPressed;
}
const Rect& Button::getCapInsetsDisabledRenderer()const
{
return _capInsetsDisabled;
@ -387,29 +407,32 @@ void Button::onPressStateChangedToNormal()
_buttonClickedRenderer->setVisible(false);
_buttonDisableRenderer->setVisible(false);
_buttonNormalRenderer->setState(Scale9Sprite::State::NORMAL);
if (_pressedTextureLoaded)
{
if (_pressedActionEnabled)
{
_buttonNormalRenderer->stopAllActions();
_buttonClickedRenderer->stopAllActions();
// Action *zoomAction = ScaleTo::create(ZOOM_ACTION_TIME_STEP, _normalTextureScaleXInSize, _normalTextureScaleYInSize);
//fixme: the zoomAction will run in the next frame which will cause the _buttonNormalRenderer to a wrong scale
_buttonNormalRenderer->setScale(_normalTextureScaleXInSize, _normalTextureScaleYInSize);
_buttonClickedRenderer->setScale(_pressedTextureScaleXInSize, _pressedTextureScaleYInSize);
_titleRenderer->stopAllActions();
if (_unifySize)
if(nullptr != _titleRenderer)
{
Action *zoomTitleAction = ScaleTo::create(ZOOM_ACTION_TIME_STEP, 1.0f, 1.0f);
_titleRenderer->runAction(zoomTitleAction);
}
else
{
_titleRenderer->setScaleX(1.0f);
_titleRenderer->setScaleY(1.0f);
_titleRenderer->stopAllActions();
if (_unifySize)
{
Action *zoomTitleAction = ScaleTo::create(ZOOM_ACTION_TIME_STEP, 1.0f, 1.0f);
_titleRenderer->runAction(zoomTitleAction);
}
else
{
_titleRenderer->setScaleX(1.0f);
_titleRenderer->setScaleY(1.0f);
}
}
}
}
@ -417,41 +440,47 @@ void Button::onPressStateChangedToNormal()
{
_buttonNormalRenderer->stopAllActions();
_buttonNormalRenderer->setScale(_normalTextureScaleXInSize, _normalTextureScaleYInSize);
_titleRenderer->stopAllActions();
_titleRenderer->setScaleX(1.0f);
_titleRenderer->setScaleY(1.0f);
if(nullptr != _titleRenderer)
{
_titleRenderer->stopAllActions();
_titleRenderer->setScaleX(1.0f);
_titleRenderer->setScaleY(1.0f);
}
}
}
void Button::onPressStateChangedToPressed()
{
_buttonNormalRenderer->setState(Scale9Sprite::State::NORMAL);
if (_pressedTextureLoaded)
{
_buttonNormalRenderer->setVisible(false);
_buttonClickedRenderer->setVisible(true);
_buttonDisableRenderer->setVisible(false);
if (_pressedActionEnabled)
{
_buttonNormalRenderer->stopAllActions();
_buttonClickedRenderer->stopAllActions();
Action *zoomAction = ScaleTo::create(ZOOM_ACTION_TIME_STEP,
_pressedTextureScaleXInSize + _zoomScale,
_pressedTextureScaleYInSize + _zoomScale);
_buttonClickedRenderer->runAction(zoomAction);
_buttonNormalRenderer->setScale(_pressedTextureScaleXInSize + _zoomScale, _pressedTextureScaleYInSize + _zoomScale);
_titleRenderer->stopAllActions();
Action *zoomTitleAction = ScaleTo::create(ZOOM_ACTION_TIME_STEP, 1.0f + _zoomScale, 1.0f + _zoomScale);
_titleRenderer->runAction(zoomTitleAction);
_buttonNormalRenderer->setScale(_pressedTextureScaleXInSize + _zoomScale,
_pressedTextureScaleYInSize + _zoomScale);
if(nullptr != _titleRenderer)
{
_titleRenderer->stopAllActions();
Action *zoomTitleAction = ScaleTo::create(ZOOM_ACTION_TIME_STEP,
1.0f + _zoomScale, 1.0f + _zoomScale);
_titleRenderer->runAction(zoomTitleAction);
}
}
}
else
@ -459,14 +488,16 @@ void Button::onPressStateChangedToPressed()
_buttonNormalRenderer->setVisible(true);
_buttonClickedRenderer->setVisible(true);
_buttonDisableRenderer->setVisible(false);
_buttonNormalRenderer->stopAllActions();
_buttonNormalRenderer->setScale(_normalTextureScaleXInSize +_zoomScale, _normalTextureScaleYInSize + _zoomScale);
_titleRenderer->stopAllActions();
_titleRenderer->setScaleX(1.0f + _zoomScale);
_titleRenderer->setScaleY(1.0f + _zoomScale);
if(nullptr != _titleRenderer)
{
_titleRenderer->stopAllActions();
_titleRenderer->setScaleX(1.0f + _zoomScale);
_titleRenderer->setScaleY(1.0f + _zoomScale);
}
}
}
@ -485,12 +516,12 @@ void Button::onPressStateChangedToDisabled()
_buttonNormalRenderer->setVisible(false);
_buttonDisableRenderer->setVisible(true);
}
_buttonClickedRenderer->setVisible(false);
_buttonNormalRenderer->setScale(_normalTextureScaleXInSize, _normalTextureScaleYInSize);
_buttonClickedRenderer->setScale(_pressedTextureScaleXInSize, _pressedTextureScaleYInSize);
}
void Button::updateTitleLocation()
{
_titleRenderer->setPosition(_contentSize.width * 0.5f, _contentSize.height * 0.5f);
@ -512,7 +543,7 @@ void Button::updateContentSize()
onSizeChanged();
return;
}
if (_ignoreSize)
{
this->setContentSize(getVirtualRendererSize());
@ -522,12 +553,15 @@ void Button::updateContentSize()
void Button::onSizeChanged()
{
Widget::onSizeChanged();
updateTitleLocation();
if(nullptr != _titleRenderer)
{
updateTitleLocation();
}
_normalTextureAdaptDirty = true;
_pressedTextureAdaptDirty = true;
_disabledTextureAdaptDirty = true;
}
void Button::adaptRenderers()
{
if (_normalTextureAdaptDirty)
@ -535,13 +569,13 @@ void Button::adaptRenderers()
normalTextureScaleChangedWithSize();
_normalTextureAdaptDirty = false;
}
if (_pressedTextureAdaptDirty)
{
pressedTextureScaleChangedWithSize();
_pressedTextureAdaptDirty = false;
}
if (_disabledTextureAdaptDirty)
{
disabledTextureScaleChangedWithSize();
@ -555,11 +589,14 @@ Size Button::getVirtualRendererSize() const
{
return this->getNormalSize();
}
Size titleSize = _titleRenderer->getContentSize();
if (!_normalTextureLoaded && _titleRenderer->getString().size() > 0)
if(nullptr != _titleRenderer)
{
return titleSize;
Size titleSize = _titleRenderer->getContentSize();
if (!_normalTextureLoaded && _titleRenderer->getString().size() > 0)
{
return titleSize;
}
}
return _normalTextureSize;
}
@ -706,27 +743,47 @@ void Button::setTitleText(const std::string& text)
{
return;
}
if(nullptr == _titleRenderer)
{
this->createTitleRenderer();
}
_titleRenderer->setString(text);
updateContentSize();
}
const std::string& Button::getTitleText() const
const std::string Button::getTitleText() const
{
if(nullptr == _titleRenderer)
{
return "";
}
return _titleRenderer->getString();
}
void Button::setTitleColor(const Color3B& color)
{
if(nullptr == _titleRenderer)
{
this->createTitleRenderer();
}
_titleRenderer->setTextColor(Color4B(color));
}
Color3B Button::getTitleColor() const
{
if(nullptr == _titleRenderer)
{
return Color3B::WHITE;
}
return Color3B(_titleRenderer->getTextColor());
}
void Button::setTitleFontSize(float size)
{
if(nullptr == _titleRenderer)
{
this->createTitleRenderer();
}
if (_type == FontType::SYSTEM)
{
_titleRenderer->setSystemFontSize(size);
@ -745,12 +802,12 @@ float Button::getTitleFontSize() const
{
return _fontSize;
}
void Button::setZoomScale(float scale)
{
_zoomScale = scale;
}
float Button::getZoomScale()const
{
return _zoomScale;
@ -758,6 +815,10 @@ float Button::getZoomScale()const
void Button::setTitleFontName(const std::string& fontName)
{
if(nullptr == _titleRenderer)
{
this->createTitleRenderer();
}
if(FileUtils::getInstance()->isFileExist(fontName))
{
TTFConfig config = _titleRenderer->getTTFConfig();
@ -776,20 +837,33 @@ void Button::setTitleFontName(const std::string& fontName)
_titleRenderer->setSystemFontSize(_fontSize);
_type = FontType::SYSTEM;
}
_fontName = fontName;
this->updateContentSize();
this->updateContentSize();
}
Label* Button::getTitleRenderer()const
{
return _titleRenderer;
}
const std::string& Button::getTitleFontName() const
const std::string Button::getTitleFontName() const
{
return _fontName;
if (nullptr != _titleRenderer)
{
if(this->_type == FontType::SYSTEM)
{
return _titleRenderer->getSystemFontName();
}
else
{
return _titleRenderer->getTTFConfig().fontFilePath;
}
}
else
{
return "";
}
}
std::string Button::getDescription() const
{
return "Button";
@ -807,9 +881,21 @@ void Button::copySpecialProperties(Widget *widget)
{
_prevIgnoreSize = button->_prevIgnoreSize;
setScale9Enabled(button->_scale9Enabled);
loadTextureNormal(button->_normalFileName, button->_normalTexType);
loadTexturePressed(button->_clickedFileName, button->_pressedTexType);
loadTextureDisabled(button->_disabledFileName, button->_disabledTexType);
auto normalSprite = button->_buttonNormalRenderer->getSprite();
if (nullptr != normalSprite)
{
loadTextureNormal(normalSprite->getSpriteFrame());
}
auto clickedSprite = button->_buttonClickedRenderer->getSprite();
if (nullptr != clickedSprite)
{
loadTexturePressed(clickedSprite->getSpriteFrame());
}
auto disabledSprite = button->_buttonDisableRenderer->getSprite();
if (nullptr != disabledSprite)
{
loadTextureDisabled(disabledSprite->getSpriteFrame());
}
setCapInsetsNormalRenderer(button->_capInsetsNormal);
setCapInsetsPressedRenderer(button->_capInsetsPressed);
setCapInsetsDisabledRenderer(button->_capInsetsDisabled);
@ -820,7 +906,7 @@ void Button::copySpecialProperties(Widget *widget)
setPressedActionEnabled(button->_pressedActionEnabled);
setZoomScale(button->_zoomScale);
}
}
Size Button::getNormalSize() const
{

View File

@ -35,18 +35,20 @@ THE SOFTWARE.
NS_CC_BEGIN
class Label;
class SpriteFrame;
namespace ui{
class Scale9Sprite;
/**
* Represents a push-button widget. Push-buttons can be pressed, or clicked, by the user to perform an action.
* Represents a push-button widget.
* Push-buttons can be pressed, or clicked, by the user to perform an action.
*/
class CC_GUI_DLL Button : public Widget
{
DECLARE_CLASS_GUI_INFO
public:
/**
@ -66,7 +68,7 @@ public:
*@return A empty Button instance.
*/
static Button* create();
/**
* Create a button with custom textures.
* @param normalImage normal state texture name.
@ -79,7 +81,7 @@ public:
const std::string& selectedImage = "",
const std::string& disableImage = "",
TextureResType texType = TextureResType::LOCAL);
/**
* Load textures for button.
*
@ -189,7 +191,7 @@ public:
virtual Size getVirtualRendererSize() const override;
virtual Node* getVirtualRenderer() override;
virtual std::string getDescription() const override;
/**
* Return the inner title renderer of Button.
* @return The button title.
@ -207,7 +209,7 @@ public:
* Query the button title content.
*@return Get the button's title content.
*/
const std::string& getTitleText() const;
const std::string getTitleText() const;
/**
* Change the color of button's title.
@ -243,7 +245,7 @@ public:
* Query the font name of button's title
*@return font name in std::string
*/
const std::string& getTitleFontName() const;
const std::string getTitleFontName() const;
/** @brief When user pressed the button, the button will zoom to a scale.
* The final scale of the button equals (button original scale + _zoomScale)
@ -252,12 +254,12 @@ public:
void setZoomScale(float scale);
/**
* @brief Return a zoom scale
* @brief Return a zoom scale
* @return the zoom scale in float
* @since v3.3
*/
float getZoomScale()const;
CC_CONSTRUCTOR_ACCESS:
virtual bool init() override;
virtual bool init(const std::string& normalImage,
@ -273,45 +275,51 @@ protected:
virtual void onPressStateChangedToPressed() override;
virtual void onPressStateChangedToDisabled() override;
virtual void onSizeChanged() override;
void loadTextureNormal(SpriteFrame* normalSpriteFrame);
void setupNormalTexture();
void loadTexturePressed(SpriteFrame* pressedSpriteFrame);
void setupPressedTexture();
void loadTextureDisabled(SpriteFrame* disabledSpriteFrame);
void setupDisabledTexture();
void normalTextureScaleChangedWithSize();
void pressedTextureScaleChangedWithSize();
void disabledTextureScaleChangedWithSize();
virtual void adaptRenderers() override;
void updateTitleLocation();
void updateContentSize();
void createTitleRenderer();
virtual Widget* createCloneInstance() override;
virtual void copySpecialProperties(Widget* model) override;
virtual Size getNormalSize() const;
protected:
Scale9Sprite* _buttonNormalRenderer;
Scale9Sprite* _buttonClickedRenderer;
Scale9Sprite* _buttonDisableRenderer;
Label* _titleRenderer;
float _zoomScale;
std::string _normalFileName;
std::string _clickedFileName;
std::string _disabledFileName;
bool _prevIgnoreSize;
bool _scale9Enabled;
bool _pressedActionEnabled;
Rect _capInsetsNormal;
Rect _capInsetsPressed;
Rect _capInsetsDisabled;
TextureResType _normalTexType;
TextureResType _pressedTexType;
TextureResType _disabledTexType;
Size _normalTextureSize;
Size _pressedTextureSize;
Size _disabledTextureSize;
bool _pressedActionEnabled;
float _normalTextureScaleXInSize;
float _normalTextureScaleYInSize;
float _pressedTextureScaleXInSize;
float _pressedTextureScaleYInSize;
bool _normalTextureLoaded;
bool _pressedTextureLoaded;
bool _disabledTextureLoaded;
@ -326,7 +334,6 @@ private:
TTF
};
std::string _fontName;
int _fontSize;
FontType _type;
};

View File

@ -1,5 +1,5 @@
{
"version":"v3-deps-38",
"version":"v3-deps-39",
"zip_file_size":"87419231",
"repo_name":"cocos2d-x-3rd-party-libs-bin",
"repo_parent":"https://github.com/cocos2d/",

View File

@ -2599,6 +2599,850 @@
"external/png/prebuilt/wp8/Win32/libpng.lib",
"external/png/prebuilt/wp_8.1/arm/libpng.lib",
"external/png/prebuilt/wp_8.1/win32/libpng.lib",
"external/spidermonkey/README.md",
"external/spidermonkey/include/android/js-config.h",
"external/spidermonkey/include/android/js.msg",
"external/spidermonkey/include/android/js/Anchor.h",
"external/spidermonkey/include/android/js/CallArgs.h",
"external/spidermonkey/include/android/js/CallNonGenericMethod.h",
"external/spidermonkey/include/android/js/CharacterEncoding.h",
"external/spidermonkey/include/android/js/Class.h",
"external/spidermonkey/include/android/js/Date.h",
"external/spidermonkey/include/android/js/GCAPI.h",
"external/spidermonkey/include/android/js/HashTable.h",
"external/spidermonkey/include/android/js/HeapAPI.h",
"external/spidermonkey/include/android/js/Id.h",
"external/spidermonkey/include/android/js/LegacyIntTypes.h",
"external/spidermonkey/include/android/js/MemoryMetrics.h",
"external/spidermonkey/include/android/js/OldDebugAPI.h",
"external/spidermonkey/include/android/js/Principals.h",
"external/spidermonkey/include/android/js/ProfilingStack.h",
"external/spidermonkey/include/android/js/PropertyKey.h",
"external/spidermonkey/include/android/js/RequiredDefines.h",
"external/spidermonkey/include/android/js/RootingAPI.h",
"external/spidermonkey/include/android/js/SliceBudget.h",
"external/spidermonkey/include/android/js/StructuredClone.h",
"external/spidermonkey/include/android/js/TracingAPI.h",
"external/spidermonkey/include/android/js/TypeDecls.h",
"external/spidermonkey/include/android/js/UbiNode.h",
"external/spidermonkey/include/android/js/UbiNodeTraverse.h",
"external/spidermonkey/include/android/js/Utility.h",
"external/spidermonkey/include/android/js/Value.h",
"external/spidermonkey/include/android/js/Vector.h",
"external/spidermonkey/include/android/js/WeakMapPtr.h",
"external/spidermonkey/include/android/jsalloc.h",
"external/spidermonkey/include/android/jsapi.h",
"external/spidermonkey/include/android/jsbytecode.h",
"external/spidermonkey/include/android/jsclist.h",
"external/spidermonkey/include/android/jscpucfg.h",
"external/spidermonkey/include/android/jsfriendapi.h",
"external/spidermonkey/include/android/jsperf.h",
"external/spidermonkey/include/android/jsprf.h",
"external/spidermonkey/include/android/jsprototypes.h",
"external/spidermonkey/include/android/jsproxy.h",
"external/spidermonkey/include/android/jspubtd.h",
"external/spidermonkey/include/android/jstypes.h",
"external/spidermonkey/include/android/jsversion.h",
"external/spidermonkey/include/android/jswrapper.h",
"external/spidermonkey/include/android/mozilla/Alignment.h",
"external/spidermonkey/include/android/mozilla/AllocPolicy.h",
"external/spidermonkey/include/android/mozilla/Array.h",
"external/spidermonkey/include/android/mozilla/ArrayUtils.h",
"external/spidermonkey/include/android/mozilla/Assertions.h",
"external/spidermonkey/include/android/mozilla/Atomics.h",
"external/spidermonkey/include/android/mozilla/Attributes.h",
"external/spidermonkey/include/android/mozilla/BinarySearch.h",
"external/spidermonkey/include/android/mozilla/BloomFilter.h",
"external/spidermonkey/include/android/mozilla/Casting.h",
"external/spidermonkey/include/android/mozilla/ChaosMode.h",
"external/spidermonkey/include/android/mozilla/Char16.h",
"external/spidermonkey/include/android/mozilla/CheckedInt.h",
"external/spidermonkey/include/android/mozilla/Compiler.h",
"external/spidermonkey/include/android/mozilla/Compression.h",
"external/spidermonkey/include/android/mozilla/Constants.h",
"external/spidermonkey/include/android/mozilla/DebugOnly.h",
"external/spidermonkey/include/android/mozilla/Decimal.h",
"external/spidermonkey/include/android/mozilla/Endian.h",
"external/spidermonkey/include/android/mozilla/EnumSet.h",
"external/spidermonkey/include/android/mozilla/EnumeratedArray.h",
"external/spidermonkey/include/android/mozilla/FloatingPoint.h",
"external/spidermonkey/include/android/mozilla/GuardObjects.h",
"external/spidermonkey/include/android/mozilla/HashFunctions.h",
"external/spidermonkey/include/android/mozilla/IntegerPrintfMacros.h",
"external/spidermonkey/include/android/mozilla/IntegerTypeTraits.h",
"external/spidermonkey/include/android/mozilla/Likely.h",
"external/spidermonkey/include/android/mozilla/LinkedList.h",
"external/spidermonkey/include/android/mozilla/LinuxSignal.h",
"external/spidermonkey/include/android/mozilla/MSIntTypes.h",
"external/spidermonkey/include/android/mozilla/MacroArgs.h",
"external/spidermonkey/include/android/mozilla/MacroForEach.h",
"external/spidermonkey/include/android/mozilla/MathAlgorithms.h",
"external/spidermonkey/include/android/mozilla/Maybe.h",
"external/spidermonkey/include/android/mozilla/MaybeOneOf.h",
"external/spidermonkey/include/android/mozilla/MemoryChecking.h",
"external/spidermonkey/include/android/mozilla/MemoryReporting.h",
"external/spidermonkey/include/android/mozilla/Move.h",
"external/spidermonkey/include/android/mozilla/NullPtr.h",
"external/spidermonkey/include/android/mozilla/NumericLimits.h",
"external/spidermonkey/include/android/mozilla/Pair.h",
"external/spidermonkey/include/android/mozilla/PodOperations.h",
"external/spidermonkey/include/android/mozilla/Poison.h",
"external/spidermonkey/include/android/mozilla/Range.h",
"external/spidermonkey/include/android/mozilla/RangedPtr.h",
"external/spidermonkey/include/android/mozilla/ReentrancyGuard.h",
"external/spidermonkey/include/android/mozilla/RefCountType.h",
"external/spidermonkey/include/android/mozilla/RefPtr.h",
"external/spidermonkey/include/android/mozilla/RollingMean.h",
"external/spidermonkey/include/android/mozilla/SHA1.h",
"external/spidermonkey/include/android/mozilla/Scoped.h",
"external/spidermonkey/include/android/mozilla/SplayTree.h",
"external/spidermonkey/include/android/mozilla/TaggedAnonymousMemory.h",
"external/spidermonkey/include/android/mozilla/TemplateLib.h",
"external/spidermonkey/include/android/mozilla/ThreadLocal.h",
"external/spidermonkey/include/android/mozilla/ToString.h",
"external/spidermonkey/include/android/mozilla/TypeTraits.h",
"external/spidermonkey/include/android/mozilla/TypedEnum.h",
"external/spidermonkey/include/android/mozilla/TypedEnumBits.h",
"external/spidermonkey/include/android/mozilla/TypedEnumInternal.h",
"external/spidermonkey/include/android/mozilla/Types.h",
"external/spidermonkey/include/android/mozilla/UniquePtr.h",
"external/spidermonkey/include/android/mozilla/Vector.h",
"external/spidermonkey/include/android/mozilla/WeakPtr.h",
"external/spidermonkey/include/ios/js-config-32.h",
"external/spidermonkey/include/ios/js-config-64.h",
"external/spidermonkey/include/ios/js-config.h",
"external/spidermonkey/include/ios/js.msg",
"external/spidermonkey/include/ios/js/Anchor.h",
"external/spidermonkey/include/ios/js/CallArgs.h",
"external/spidermonkey/include/ios/js/CallNonGenericMethod.h",
"external/spidermonkey/include/ios/js/CharacterEncoding.h",
"external/spidermonkey/include/ios/js/Class.h",
"external/spidermonkey/include/ios/js/Date.h",
"external/spidermonkey/include/ios/js/GCAPI.h",
"external/spidermonkey/include/ios/js/HashTable.h",
"external/spidermonkey/include/ios/js/HeapAPI.h",
"external/spidermonkey/include/ios/js/Id.h",
"external/spidermonkey/include/ios/js/LegacyIntTypes.h",
"external/spidermonkey/include/ios/js/MemoryMetrics.h",
"external/spidermonkey/include/ios/js/OldDebugAPI.h",
"external/spidermonkey/include/ios/js/Principals.h",
"external/spidermonkey/include/ios/js/ProfilingStack.h",
"external/spidermonkey/include/ios/js/PropertyKey.h",
"external/spidermonkey/include/ios/js/RequiredDefines.h",
"external/spidermonkey/include/ios/js/RootingAPI.h",
"external/spidermonkey/include/ios/js/SliceBudget.h",
"external/spidermonkey/include/ios/js/StructuredClone.h",
"external/spidermonkey/include/ios/js/TracingAPI.h",
"external/spidermonkey/include/ios/js/TypeDecls.h",
"external/spidermonkey/include/ios/js/UbiNode.h",
"external/spidermonkey/include/ios/js/UbiNodeTraverse.h",
"external/spidermonkey/include/ios/js/Utility.h",
"external/spidermonkey/include/ios/js/Value.h",
"external/spidermonkey/include/ios/js/Vector.h",
"external/spidermonkey/include/ios/js/WeakMapPtr.h",
"external/spidermonkey/include/ios/jsalloc.h",
"external/spidermonkey/include/ios/jsapi.h",
"external/spidermonkey/include/ios/jsbytecode.h",
"external/spidermonkey/include/ios/jsclist.h",
"external/spidermonkey/include/ios/jscpucfg.h",
"external/spidermonkey/include/ios/jsfriendapi.h",
"external/spidermonkey/include/ios/jsperf.h",
"external/spidermonkey/include/ios/jsprf.h",
"external/spidermonkey/include/ios/jsprototypes.h",
"external/spidermonkey/include/ios/jsproxy.h",
"external/spidermonkey/include/ios/jspubtd.h",
"external/spidermonkey/include/ios/jstypes.h",
"external/spidermonkey/include/ios/jsversion.h",
"external/spidermonkey/include/ios/jswrapper.h",
"external/spidermonkey/include/ios/mozilla/Alignment.h",
"external/spidermonkey/include/ios/mozilla/AllocPolicy.h",
"external/spidermonkey/include/ios/mozilla/Array.h",
"external/spidermonkey/include/ios/mozilla/ArrayUtils.h",
"external/spidermonkey/include/ios/mozilla/Assertions.h",
"external/spidermonkey/include/ios/mozilla/Atomics.h",
"external/spidermonkey/include/ios/mozilla/Attributes.h",
"external/spidermonkey/include/ios/mozilla/BinarySearch.h",
"external/spidermonkey/include/ios/mozilla/BloomFilter.h",
"external/spidermonkey/include/ios/mozilla/Casting.h",
"external/spidermonkey/include/ios/mozilla/ChaosMode.h",
"external/spidermonkey/include/ios/mozilla/Char16.h",
"external/spidermonkey/include/ios/mozilla/CheckedInt.h",
"external/spidermonkey/include/ios/mozilla/Compiler.h",
"external/spidermonkey/include/ios/mozilla/Compression.h",
"external/spidermonkey/include/ios/mozilla/Constants.h",
"external/spidermonkey/include/ios/mozilla/DebugOnly.h",
"external/spidermonkey/include/ios/mozilla/Decimal.h",
"external/spidermonkey/include/ios/mozilla/Endian.h",
"external/spidermonkey/include/ios/mozilla/EnumSet.h",
"external/spidermonkey/include/ios/mozilla/EnumeratedArray.h",
"external/spidermonkey/include/ios/mozilla/FloatingPoint.h",
"external/spidermonkey/include/ios/mozilla/GuardObjects.h",
"external/spidermonkey/include/ios/mozilla/HashFunctions.h",
"external/spidermonkey/include/ios/mozilla/IntegerPrintfMacros.h",
"external/spidermonkey/include/ios/mozilla/IntegerTypeTraits.h",
"external/spidermonkey/include/ios/mozilla/Likely.h",
"external/spidermonkey/include/ios/mozilla/LinkedList.h",
"external/spidermonkey/include/ios/mozilla/MSIntTypes.h",
"external/spidermonkey/include/ios/mozilla/MacroArgs.h",
"external/spidermonkey/include/ios/mozilla/MacroForEach.h",
"external/spidermonkey/include/ios/mozilla/MathAlgorithms.h",
"external/spidermonkey/include/ios/mozilla/Maybe.h",
"external/spidermonkey/include/ios/mozilla/MaybeOneOf.h",
"external/spidermonkey/include/ios/mozilla/MemoryChecking.h",
"external/spidermonkey/include/ios/mozilla/MemoryReporting.h",
"external/spidermonkey/include/ios/mozilla/Move.h",
"external/spidermonkey/include/ios/mozilla/NullPtr.h",
"external/spidermonkey/include/ios/mozilla/NumericLimits.h",
"external/spidermonkey/include/ios/mozilla/Pair.h",
"external/spidermonkey/include/ios/mozilla/PodOperations.h",
"external/spidermonkey/include/ios/mozilla/Poison.h",
"external/spidermonkey/include/ios/mozilla/Range.h",
"external/spidermonkey/include/ios/mozilla/RangedPtr.h",
"external/spidermonkey/include/ios/mozilla/ReentrancyGuard.h",
"external/spidermonkey/include/ios/mozilla/RefCountType.h",
"external/spidermonkey/include/ios/mozilla/RefPtr.h",
"external/spidermonkey/include/ios/mozilla/RollingMean.h",
"external/spidermonkey/include/ios/mozilla/SHA1.h",
"external/spidermonkey/include/ios/mozilla/Scoped.h",
"external/spidermonkey/include/ios/mozilla/SplayTree.h",
"external/spidermonkey/include/ios/mozilla/TaggedAnonymousMemory.h",
"external/spidermonkey/include/ios/mozilla/TemplateLib.h",
"external/spidermonkey/include/ios/mozilla/ThreadLocal.h",
"external/spidermonkey/include/ios/mozilla/ToString.h",
"external/spidermonkey/include/ios/mozilla/TypeTraits.h",
"external/spidermonkey/include/ios/mozilla/TypedEnum.h",
"external/spidermonkey/include/ios/mozilla/TypedEnumBits.h",
"external/spidermonkey/include/ios/mozilla/TypedEnumInternal.h",
"external/spidermonkey/include/ios/mozilla/Types.h",
"external/spidermonkey/include/ios/mozilla/UniquePtr.h",
"external/spidermonkey/include/ios/mozilla/Vector.h",
"external/spidermonkey/include/ios/mozilla/WeakPtr.h",
"external/spidermonkey/include/linux/js-config.h",
"external/spidermonkey/include/linux/js.msg",
"external/spidermonkey/include/linux/js/Anchor.h",
"external/spidermonkey/include/linux/js/CallArgs.h",
"external/spidermonkey/include/linux/js/CallNonGenericMethod.h",
"external/spidermonkey/include/linux/js/CharacterEncoding.h",
"external/spidermonkey/include/linux/js/Class.h",
"external/spidermonkey/include/linux/js/Date.h",
"external/spidermonkey/include/linux/js/GCAPI.h",
"external/spidermonkey/include/linux/js/HashTable.h",
"external/spidermonkey/include/linux/js/HeapAPI.h",
"external/spidermonkey/include/linux/js/Id.h",
"external/spidermonkey/include/linux/js/LegacyIntTypes.h",
"external/spidermonkey/include/linux/js/MemoryMetrics.h",
"external/spidermonkey/include/linux/js/OldDebugAPI.h",
"external/spidermonkey/include/linux/js/Principals.h",
"external/spidermonkey/include/linux/js/ProfilingStack.h",
"external/spidermonkey/include/linux/js/PropertyKey.h",
"external/spidermonkey/include/linux/js/RequiredDefines.h",
"external/spidermonkey/include/linux/js/RootingAPI.h",
"external/spidermonkey/include/linux/js/SliceBudget.h",
"external/spidermonkey/include/linux/js/StructuredClone.h",
"external/spidermonkey/include/linux/js/TracingAPI.h",
"external/spidermonkey/include/linux/js/TypeDecls.h",
"external/spidermonkey/include/linux/js/UbiNode.h",
"external/spidermonkey/include/linux/js/UbiNodeTraverse.h",
"external/spidermonkey/include/linux/js/Utility.h",
"external/spidermonkey/include/linux/js/Value.h",
"external/spidermonkey/include/linux/js/Vector.h",
"external/spidermonkey/include/linux/js/WeakMapPtr.h",
"external/spidermonkey/include/linux/jsalloc.h",
"external/spidermonkey/include/linux/jsapi.h",
"external/spidermonkey/include/linux/jsbytecode.h",
"external/spidermonkey/include/linux/jsclist.h",
"external/spidermonkey/include/linux/jscpucfg.h",
"external/spidermonkey/include/linux/jsfriendapi.h",
"external/spidermonkey/include/linux/jsperf.h",
"external/spidermonkey/include/linux/jsprf.h",
"external/spidermonkey/include/linux/jsprototypes.h",
"external/spidermonkey/include/linux/jsproxy.h",
"external/spidermonkey/include/linux/jspubtd.h",
"external/spidermonkey/include/linux/jstypes.h",
"external/spidermonkey/include/linux/jsversion.h",
"external/spidermonkey/include/linux/jswrapper.h",
"external/spidermonkey/include/linux/mozilla/Alignment.h",
"external/spidermonkey/include/linux/mozilla/AllocPolicy.h",
"external/spidermonkey/include/linux/mozilla/Array.h",
"external/spidermonkey/include/linux/mozilla/ArrayUtils.h",
"external/spidermonkey/include/linux/mozilla/Assertions.h",
"external/spidermonkey/include/linux/mozilla/Atomics.h",
"external/spidermonkey/include/linux/mozilla/Attributes.h",
"external/spidermonkey/include/linux/mozilla/BinarySearch.h",
"external/spidermonkey/include/linux/mozilla/BloomFilter.h",
"external/spidermonkey/include/linux/mozilla/Casting.h",
"external/spidermonkey/include/linux/mozilla/ChaosMode.h",
"external/spidermonkey/include/linux/mozilla/Char16.h",
"external/spidermonkey/include/linux/mozilla/CheckedInt.h",
"external/spidermonkey/include/linux/mozilla/Compiler.h",
"external/spidermonkey/include/linux/mozilla/Compression.h",
"external/spidermonkey/include/linux/mozilla/Constants.h",
"external/spidermonkey/include/linux/mozilla/DebugOnly.h",
"external/spidermonkey/include/linux/mozilla/Decimal.h",
"external/spidermonkey/include/linux/mozilla/Endian.h",
"external/spidermonkey/include/linux/mozilla/EnumSet.h",
"external/spidermonkey/include/linux/mozilla/EnumeratedArray.h",
"external/spidermonkey/include/linux/mozilla/FloatingPoint.h",
"external/spidermonkey/include/linux/mozilla/GuardObjects.h",
"external/spidermonkey/include/linux/mozilla/HashFunctions.h",
"external/spidermonkey/include/linux/mozilla/IntegerPrintfMacros.h",
"external/spidermonkey/include/linux/mozilla/IntegerTypeTraits.h",
"external/spidermonkey/include/linux/mozilla/Likely.h",
"external/spidermonkey/include/linux/mozilla/LinkedList.h",
"external/spidermonkey/include/linux/mozilla/LinuxSignal.h",
"external/spidermonkey/include/linux/mozilla/MSIntTypes.h",
"external/spidermonkey/include/linux/mozilla/MacroArgs.h",
"external/spidermonkey/include/linux/mozilla/MacroForEach.h",
"external/spidermonkey/include/linux/mozilla/MathAlgorithms.h",
"external/spidermonkey/include/linux/mozilla/Maybe.h",
"external/spidermonkey/include/linux/mozilla/MaybeOneOf.h",
"external/spidermonkey/include/linux/mozilla/MemoryChecking.h",
"external/spidermonkey/include/linux/mozilla/MemoryReporting.h",
"external/spidermonkey/include/linux/mozilla/Move.h",
"external/spidermonkey/include/linux/mozilla/NullPtr.h",
"external/spidermonkey/include/linux/mozilla/NumericLimits.h",
"external/spidermonkey/include/linux/mozilla/Pair.h",
"external/spidermonkey/include/linux/mozilla/PodOperations.h",
"external/spidermonkey/include/linux/mozilla/Poison.h",
"external/spidermonkey/include/linux/mozilla/Range.h",
"external/spidermonkey/include/linux/mozilla/RangedPtr.h",
"external/spidermonkey/include/linux/mozilla/ReentrancyGuard.h",
"external/spidermonkey/include/linux/mozilla/RefCountType.h",
"external/spidermonkey/include/linux/mozilla/RefPtr.h",
"external/spidermonkey/include/linux/mozilla/RollingMean.h",
"external/spidermonkey/include/linux/mozilla/SHA1.h",
"external/spidermonkey/include/linux/mozilla/Scoped.h",
"external/spidermonkey/include/linux/mozilla/SplayTree.h",
"external/spidermonkey/include/linux/mozilla/TaggedAnonymousMemory.h",
"external/spidermonkey/include/linux/mozilla/TemplateLib.h",
"external/spidermonkey/include/linux/mozilla/ThreadLocal.h",
"external/spidermonkey/include/linux/mozilla/ToString.h",
"external/spidermonkey/include/linux/mozilla/TypeTraits.h",
"external/spidermonkey/include/linux/mozilla/TypedEnum.h",
"external/spidermonkey/include/linux/mozilla/TypedEnumBits.h",
"external/spidermonkey/include/linux/mozilla/TypedEnumInternal.h",
"external/spidermonkey/include/linux/mozilla/Types.h",
"external/spidermonkey/include/linux/mozilla/UniquePtr.h",
"external/spidermonkey/include/linux/mozilla/Vector.h",
"external/spidermonkey/include/linux/mozilla/WeakPtr.h",
"external/spidermonkey/include/mac/js-config.h",
"external/spidermonkey/include/mac/js.msg",
"external/spidermonkey/include/mac/js/Anchor.h",
"external/spidermonkey/include/mac/js/CallArgs.h",
"external/spidermonkey/include/mac/js/CallNonGenericMethod.h",
"external/spidermonkey/include/mac/js/CharacterEncoding.h",
"external/spidermonkey/include/mac/js/Class.h",
"external/spidermonkey/include/mac/js/Date.h",
"external/spidermonkey/include/mac/js/GCAPI.h",
"external/spidermonkey/include/mac/js/HashTable.h",
"external/spidermonkey/include/mac/js/HeapAPI.h",
"external/spidermonkey/include/mac/js/Id.h",
"external/spidermonkey/include/mac/js/LegacyIntTypes.h",
"external/spidermonkey/include/mac/js/MemoryMetrics.h",
"external/spidermonkey/include/mac/js/OldDebugAPI.h",
"external/spidermonkey/include/mac/js/Principals.h",
"external/spidermonkey/include/mac/js/ProfilingStack.h",
"external/spidermonkey/include/mac/js/PropertyKey.h",
"external/spidermonkey/include/mac/js/RequiredDefines.h",
"external/spidermonkey/include/mac/js/RootingAPI.h",
"external/spidermonkey/include/mac/js/SliceBudget.h",
"external/spidermonkey/include/mac/js/StructuredClone.h",
"external/spidermonkey/include/mac/js/TracingAPI.h",
"external/spidermonkey/include/mac/js/TypeDecls.h",
"external/spidermonkey/include/mac/js/UbiNode.h",
"external/spidermonkey/include/mac/js/UbiNodeTraverse.h",
"external/spidermonkey/include/mac/js/Utility.h",
"external/spidermonkey/include/mac/js/Value.h",
"external/spidermonkey/include/mac/js/Vector.h",
"external/spidermonkey/include/mac/js/WeakMapPtr.h",
"external/spidermonkey/include/mac/jsalloc.h",
"external/spidermonkey/include/mac/jsapi.h",
"external/spidermonkey/include/mac/jsbytecode.h",
"external/spidermonkey/include/mac/jsclist.h",
"external/spidermonkey/include/mac/jscpucfg.h",
"external/spidermonkey/include/mac/jsfriendapi.h",
"external/spidermonkey/include/mac/jsperf.h",
"external/spidermonkey/include/mac/jsprf.h",
"external/spidermonkey/include/mac/jsprototypes.h",
"external/spidermonkey/include/mac/jsproxy.h",
"external/spidermonkey/include/mac/jspubtd.h",
"external/spidermonkey/include/mac/jstypes.h",
"external/spidermonkey/include/mac/jsversion.h",
"external/spidermonkey/include/mac/jswrapper.h",
"external/spidermonkey/include/mac/mozilla/Alignment.h",
"external/spidermonkey/include/mac/mozilla/AllocPolicy.h",
"external/spidermonkey/include/mac/mozilla/Array.h",
"external/spidermonkey/include/mac/mozilla/ArrayUtils.h",
"external/spidermonkey/include/mac/mozilla/Assertions.h",
"external/spidermonkey/include/mac/mozilla/Atomics.h",
"external/spidermonkey/include/mac/mozilla/Attributes.h",
"external/spidermonkey/include/mac/mozilla/BinarySearch.h",
"external/spidermonkey/include/mac/mozilla/BloomFilter.h",
"external/spidermonkey/include/mac/mozilla/Casting.h",
"external/spidermonkey/include/mac/mozilla/ChaosMode.h",
"external/spidermonkey/include/mac/mozilla/Char16.h",
"external/spidermonkey/include/mac/mozilla/CheckedInt.h",
"external/spidermonkey/include/mac/mozilla/Compiler.h",
"external/spidermonkey/include/mac/mozilla/Compression.h",
"external/spidermonkey/include/mac/mozilla/Constants.h",
"external/spidermonkey/include/mac/mozilla/DebugOnly.h",
"external/spidermonkey/include/mac/mozilla/Decimal.h",
"external/spidermonkey/include/mac/mozilla/Endian.h",
"external/spidermonkey/include/mac/mozilla/EnumSet.h",
"external/spidermonkey/include/mac/mozilla/EnumeratedArray.h",
"external/spidermonkey/include/mac/mozilla/FloatingPoint.h",
"external/spidermonkey/include/mac/mozilla/GuardObjects.h",
"external/spidermonkey/include/mac/mozilla/HashFunctions.h",
"external/spidermonkey/include/mac/mozilla/IntegerPrintfMacros.h",
"external/spidermonkey/include/mac/mozilla/IntegerTypeTraits.h",
"external/spidermonkey/include/mac/mozilla/Likely.h",
"external/spidermonkey/include/mac/mozilla/LinkedList.h",
"external/spidermonkey/include/mac/mozilla/MSIntTypes.h",
"external/spidermonkey/include/mac/mozilla/MacroArgs.h",
"external/spidermonkey/include/mac/mozilla/MacroForEach.h",
"external/spidermonkey/include/mac/mozilla/MathAlgorithms.h",
"external/spidermonkey/include/mac/mozilla/Maybe.h",
"external/spidermonkey/include/mac/mozilla/MaybeOneOf.h",
"external/spidermonkey/include/mac/mozilla/MemoryChecking.h",
"external/spidermonkey/include/mac/mozilla/MemoryReporting.h",
"external/spidermonkey/include/mac/mozilla/Move.h",
"external/spidermonkey/include/mac/mozilla/NullPtr.h",
"external/spidermonkey/include/mac/mozilla/NumericLimits.h",
"external/spidermonkey/include/mac/mozilla/Pair.h",
"external/spidermonkey/include/mac/mozilla/PodOperations.h",
"external/spidermonkey/include/mac/mozilla/Poison.h",
"external/spidermonkey/include/mac/mozilla/Range.h",
"external/spidermonkey/include/mac/mozilla/RangedPtr.h",
"external/spidermonkey/include/mac/mozilla/ReentrancyGuard.h",
"external/spidermonkey/include/mac/mozilla/RefCountType.h",
"external/spidermonkey/include/mac/mozilla/RefPtr.h",
"external/spidermonkey/include/mac/mozilla/RollingMean.h",
"external/spidermonkey/include/mac/mozilla/SHA1.h",
"external/spidermonkey/include/mac/mozilla/Scoped.h",
"external/spidermonkey/include/mac/mozilla/SplayTree.h",
"external/spidermonkey/include/mac/mozilla/TaggedAnonymousMemory.h",
"external/spidermonkey/include/mac/mozilla/TemplateLib.h",
"external/spidermonkey/include/mac/mozilla/ThreadLocal.h",
"external/spidermonkey/include/mac/mozilla/ToString.h",
"external/spidermonkey/include/mac/mozilla/TypeTraits.h",
"external/spidermonkey/include/mac/mozilla/TypedEnum.h",
"external/spidermonkey/include/mac/mozilla/TypedEnumBits.h",
"external/spidermonkey/include/mac/mozilla/TypedEnumInternal.h",
"external/spidermonkey/include/mac/mozilla/Types.h",
"external/spidermonkey/include/mac/mozilla/UniquePtr.h",
"external/spidermonkey/include/mac/mozilla/Vector.h",
"external/spidermonkey/include/mac/mozilla/WeakPtr.h",
"external/spidermonkey/include/win32/js-config.h",
"external/spidermonkey/include/win32/js.msg",
"external/spidermonkey/include/win32/js/Anchor.h",
"external/spidermonkey/include/win32/js/CallArgs.h",
"external/spidermonkey/include/win32/js/CallNonGenericMethod.h",
"external/spidermonkey/include/win32/js/CharacterEncoding.h",
"external/spidermonkey/include/win32/js/Class.h",
"external/spidermonkey/include/win32/js/Date.h",
"external/spidermonkey/include/win32/js/GCAPI.h",
"external/spidermonkey/include/win32/js/HashTable.h",
"external/spidermonkey/include/win32/js/HeapAPI.h",
"external/spidermonkey/include/win32/js/Id.h",
"external/spidermonkey/include/win32/js/LegacyIntTypes.h",
"external/spidermonkey/include/win32/js/MemoryMetrics.h",
"external/spidermonkey/include/win32/js/OldDebugAPI.h",
"external/spidermonkey/include/win32/js/Principals.h",
"external/spidermonkey/include/win32/js/ProfilingStack.h",
"external/spidermonkey/include/win32/js/PropertyKey.h",
"external/spidermonkey/include/win32/js/RequiredDefines.h",
"external/spidermonkey/include/win32/js/RootingAPI.h",
"external/spidermonkey/include/win32/js/SliceBudget.h",
"external/spidermonkey/include/win32/js/StructuredClone.h",
"external/spidermonkey/include/win32/js/TracingAPI.h",
"external/spidermonkey/include/win32/js/TypeDecls.h",
"external/spidermonkey/include/win32/js/UbiNode.h",
"external/spidermonkey/include/win32/js/UbiNodeTraverse.h",
"external/spidermonkey/include/win32/js/Utility.h",
"external/spidermonkey/include/win32/js/Value.h",
"external/spidermonkey/include/win32/js/Vector.h",
"external/spidermonkey/include/win32/js/WeakMapPtr.h",
"external/spidermonkey/include/win32/jsalloc.h",
"external/spidermonkey/include/win32/jsapi.h",
"external/spidermonkey/include/win32/jsbytecode.h",
"external/spidermonkey/include/win32/jsclist.h",
"external/spidermonkey/include/win32/jscpucfg.h",
"external/spidermonkey/include/win32/jsfriendapi.h",
"external/spidermonkey/include/win32/jsperf.h",
"external/spidermonkey/include/win32/jsprf.h",
"external/spidermonkey/include/win32/jsprototypes.h",
"external/spidermonkey/include/win32/jsproxy.h",
"external/spidermonkey/include/win32/jspubtd.h",
"external/spidermonkey/include/win32/jstypes.h",
"external/spidermonkey/include/win32/jsversion.h",
"external/spidermonkey/include/win32/jswrapper.h",
"external/spidermonkey/include/win32/mozilla/Alignment.h",
"external/spidermonkey/include/win32/mozilla/AllocPolicy.h",
"external/spidermonkey/include/win32/mozilla/Array.h",
"external/spidermonkey/include/win32/mozilla/ArrayUtils.h",
"external/spidermonkey/include/win32/mozilla/Assertions.h",
"external/spidermonkey/include/win32/mozilla/Atomics.h",
"external/spidermonkey/include/win32/mozilla/Attributes.h",
"external/spidermonkey/include/win32/mozilla/BinarySearch.h",
"external/spidermonkey/include/win32/mozilla/BloomFilter.h",
"external/spidermonkey/include/win32/mozilla/Casting.h",
"external/spidermonkey/include/win32/mozilla/ChaosMode.h",
"external/spidermonkey/include/win32/mozilla/Char16.h",
"external/spidermonkey/include/win32/mozilla/CheckedInt.h",
"external/spidermonkey/include/win32/mozilla/Compiler.h",
"external/spidermonkey/include/win32/mozilla/Compression.h",
"external/spidermonkey/include/win32/mozilla/Constants.h",
"external/spidermonkey/include/win32/mozilla/DebugOnly.h",
"external/spidermonkey/include/win32/mozilla/Decimal.h",
"external/spidermonkey/include/win32/mozilla/Endian.h",
"external/spidermonkey/include/win32/mozilla/EnumSet.h",
"external/spidermonkey/include/win32/mozilla/EnumeratedArray.h",
"external/spidermonkey/include/win32/mozilla/FloatingPoint.h",
"external/spidermonkey/include/win32/mozilla/GuardObjects.h",
"external/spidermonkey/include/win32/mozilla/HashFunctions.h",
"external/spidermonkey/include/win32/mozilla/IntegerPrintfMacros.h",
"external/spidermonkey/include/win32/mozilla/IntegerTypeTraits.h",
"external/spidermonkey/include/win32/mozilla/Likely.h",
"external/spidermonkey/include/win32/mozilla/LinkedList.h",
"external/spidermonkey/include/win32/mozilla/MSIntTypes.h",
"external/spidermonkey/include/win32/mozilla/MacroArgs.h",
"external/spidermonkey/include/win32/mozilla/MacroForEach.h",
"external/spidermonkey/include/win32/mozilla/MathAlgorithms.h",
"external/spidermonkey/include/win32/mozilla/Maybe.h",
"external/spidermonkey/include/win32/mozilla/MaybeOneOf.h",
"external/spidermonkey/include/win32/mozilla/MemoryChecking.h",
"external/spidermonkey/include/win32/mozilla/MemoryReporting.h",
"external/spidermonkey/include/win32/mozilla/Move.h",
"external/spidermonkey/include/win32/mozilla/NullPtr.h",
"external/spidermonkey/include/win32/mozilla/NumericLimits.h",
"external/spidermonkey/include/win32/mozilla/Pair.h",
"external/spidermonkey/include/win32/mozilla/PodOperations.h",
"external/spidermonkey/include/win32/mozilla/Poison.h",
"external/spidermonkey/include/win32/mozilla/Range.h",
"external/spidermonkey/include/win32/mozilla/RangedPtr.h",
"external/spidermonkey/include/win32/mozilla/ReentrancyGuard.h",
"external/spidermonkey/include/win32/mozilla/RefCountType.h",
"external/spidermonkey/include/win32/mozilla/RefPtr.h",
"external/spidermonkey/include/win32/mozilla/RollingMean.h",
"external/spidermonkey/include/win32/mozilla/SHA1.h",
"external/spidermonkey/include/win32/mozilla/Scoped.h",
"external/spidermonkey/include/win32/mozilla/SplayTree.h",
"external/spidermonkey/include/win32/mozilla/TaggedAnonymousMemory.h",
"external/spidermonkey/include/win32/mozilla/TemplateLib.h",
"external/spidermonkey/include/win32/mozilla/ThreadLocal.h",
"external/spidermonkey/include/win32/mozilla/ToString.h",
"external/spidermonkey/include/win32/mozilla/TypeTraits.h",
"external/spidermonkey/include/win32/mozilla/TypedEnum.h",
"external/spidermonkey/include/win32/mozilla/TypedEnumBits.h",
"external/spidermonkey/include/win32/mozilla/TypedEnumInternal.h",
"external/spidermonkey/include/win32/mozilla/Types.h",
"external/spidermonkey/include/win32/mozilla/UniquePtr.h",
"external/spidermonkey/include/win32/mozilla/Vector.h",
"external/spidermonkey/include/win32/mozilla/WeakPtr.h",
"external/spidermonkey/include/win32/mozilla/WindowsVersion.h",
"external/spidermonkey/include/win32/mozzconf.h",
"external/spidermonkey/include/win32/zconf.h",
"external/spidermonkey/include/win32/zlib.h",
"external/spidermonkey/include/winrt_8.1/js-config.h",
"external/spidermonkey/include/winrt_8.1/js.msg",
"external/spidermonkey/include/winrt_8.1/js/Anchor.h",
"external/spidermonkey/include/winrt_8.1/js/CallArgs.h",
"external/spidermonkey/include/winrt_8.1/js/CallNonGenericMethod.h",
"external/spidermonkey/include/winrt_8.1/js/CharacterEncoding.h",
"external/spidermonkey/include/winrt_8.1/js/Class.h",
"external/spidermonkey/include/winrt_8.1/js/Date.h",
"external/spidermonkey/include/winrt_8.1/js/GCAPI.h",
"external/spidermonkey/include/winrt_8.1/js/HashTable.h",
"external/spidermonkey/include/winrt_8.1/js/HeapAPI.h",
"external/spidermonkey/include/winrt_8.1/js/Id.h",
"external/spidermonkey/include/winrt_8.1/js/LegacyIntTypes.h",
"external/spidermonkey/include/winrt_8.1/js/MemoryMetrics.h",
"external/spidermonkey/include/winrt_8.1/js/OldDebugAPI.h",
"external/spidermonkey/include/winrt_8.1/js/Principals.h",
"external/spidermonkey/include/winrt_8.1/js/ProfilingStack.h",
"external/spidermonkey/include/winrt_8.1/js/PropertyKey.h",
"external/spidermonkey/include/winrt_8.1/js/RequiredDefines.h",
"external/spidermonkey/include/winrt_8.1/js/RootingAPI.h",
"external/spidermonkey/include/winrt_8.1/js/SliceBudget.h",
"external/spidermonkey/include/winrt_8.1/js/StructuredClone.h",
"external/spidermonkey/include/winrt_8.1/js/TracingAPI.h",
"external/spidermonkey/include/winrt_8.1/js/TypeDecls.h",
"external/spidermonkey/include/winrt_8.1/js/Utility.h",
"external/spidermonkey/include/winrt_8.1/js/Value.h",
"external/spidermonkey/include/winrt_8.1/js/Vector.h",
"external/spidermonkey/include/winrt_8.1/jsalloc.h",
"external/spidermonkey/include/winrt_8.1/jsapi.h",
"external/spidermonkey/include/winrt_8.1/jsbytecode.h",
"external/spidermonkey/include/winrt_8.1/jsclist.h",
"external/spidermonkey/include/winrt_8.1/jscpucfg.h",
"external/spidermonkey/include/winrt_8.1/jsfriendapi.h",
"external/spidermonkey/include/winrt_8.1/jsprf.h",
"external/spidermonkey/include/winrt_8.1/jsprototypes.h",
"external/spidermonkey/include/winrt_8.1/jsproxy.h",
"external/spidermonkey/include/winrt_8.1/jspubtd.h",
"external/spidermonkey/include/winrt_8.1/jstypes.h",
"external/spidermonkey/include/winrt_8.1/jsversion.h",
"external/spidermonkey/include/winrt_8.1/jswrapper.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Alignment.h",
"external/spidermonkey/include/winrt_8.1/mozilla/AllocPolicy.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Array.h",
"external/spidermonkey/include/winrt_8.1/mozilla/ArrayUtils.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Assertions.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Atomics.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Attributes.h",
"external/spidermonkey/include/winrt_8.1/mozilla/BloomFilter.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Casting.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Char16.h",
"external/spidermonkey/include/winrt_8.1/mozilla/CheckedInt.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Compiler.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Compression.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Constants.h",
"external/spidermonkey/include/winrt_8.1/mozilla/DebugOnly.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Endian.h",
"external/spidermonkey/include/winrt_8.1/mozilla/EnumSet.h",
"external/spidermonkey/include/winrt_8.1/mozilla/FloatingPoint.h",
"external/spidermonkey/include/winrt_8.1/mozilla/GuardObjects.h",
"external/spidermonkey/include/winrt_8.1/mozilla/HashFunctions.h",
"external/spidermonkey/include/winrt_8.1/mozilla/IntegerPrintfMacros.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Likely.h",
"external/spidermonkey/include/winrt_8.1/mozilla/LinkedList.h",
"external/spidermonkey/include/winrt_8.1/mozilla/MSIntTypes.h",
"external/spidermonkey/include/winrt_8.1/mozilla/MacroArgs.h",
"external/spidermonkey/include/winrt_8.1/mozilla/MathAlgorithms.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Maybe.h",
"external/spidermonkey/include/winrt_8.1/mozilla/MemoryChecking.h",
"external/spidermonkey/include/winrt_8.1/mozilla/MemoryReporting.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Move.h",
"external/spidermonkey/include/winrt_8.1/mozilla/NullPtr.h",
"external/spidermonkey/include/winrt_8.1/mozilla/NumericLimits.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Pair.h",
"external/spidermonkey/include/winrt_8.1/mozilla/PodOperations.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Poison.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Range.h",
"external/spidermonkey/include/winrt_8.1/mozilla/RangedPtr.h",
"external/spidermonkey/include/winrt_8.1/mozilla/ReentrancyGuard.h",
"external/spidermonkey/include/winrt_8.1/mozilla/RefPtr.h",
"external/spidermonkey/include/winrt_8.1/mozilla/RollingMean.h",
"external/spidermonkey/include/winrt_8.1/mozilla/SHA1.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Scoped.h",
"external/spidermonkey/include/winrt_8.1/mozilla/SplayTree.h",
"external/spidermonkey/include/winrt_8.1/mozilla/TemplateLib.h",
"external/spidermonkey/include/winrt_8.1/mozilla/ThreadLocal.h",
"external/spidermonkey/include/winrt_8.1/mozilla/TypeTraits.h",
"external/spidermonkey/include/winrt_8.1/mozilla/TypedEnum.h",
"external/spidermonkey/include/winrt_8.1/mozilla/TypedEnumInternal.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Types.h",
"external/spidermonkey/include/winrt_8.1/mozilla/UniquePtr.h",
"external/spidermonkey/include/winrt_8.1/mozilla/Vector.h",
"external/spidermonkey/include/winrt_8.1/mozilla/WeakPtr.h",
"external/spidermonkey/include/wp8/js-config.h",
"external/spidermonkey/include/wp8/js.msg",
"external/spidermonkey/include/wp8/js/Anchor.h",
"external/spidermonkey/include/wp8/js/CallArgs.h",
"external/spidermonkey/include/wp8/js/CallNonGenericMethod.h",
"external/spidermonkey/include/wp8/js/CharacterEncoding.h",
"external/spidermonkey/include/wp8/js/Class.h",
"external/spidermonkey/include/wp8/js/Date.h",
"external/spidermonkey/include/wp8/js/GCAPI.h",
"external/spidermonkey/include/wp8/js/HashTable.h",
"external/spidermonkey/include/wp8/js/HeapAPI.h",
"external/spidermonkey/include/wp8/js/Id.h",
"external/spidermonkey/include/wp8/js/LegacyIntTypes.h",
"external/spidermonkey/include/wp8/js/MemoryMetrics.h",
"external/spidermonkey/include/wp8/js/OldDebugAPI.h",
"external/spidermonkey/include/wp8/js/Principals.h",
"external/spidermonkey/include/wp8/js/ProfilingStack.h",
"external/spidermonkey/include/wp8/js/PropertyKey.h",
"external/spidermonkey/include/wp8/js/RequiredDefines.h",
"external/spidermonkey/include/wp8/js/RootingAPI.h",
"external/spidermonkey/include/wp8/js/SliceBudget.h",
"external/spidermonkey/include/wp8/js/StructuredClone.h",
"external/spidermonkey/include/wp8/js/TracingAPI.h",
"external/spidermonkey/include/wp8/js/TypeDecls.h",
"external/spidermonkey/include/wp8/js/Utility.h",
"external/spidermonkey/include/wp8/js/Value.h",
"external/spidermonkey/include/wp8/js/Vector.h",
"external/spidermonkey/include/wp8/jsalloc.h",
"external/spidermonkey/include/wp8/jsapi.h",
"external/spidermonkey/include/wp8/jsbytecode.h",
"external/spidermonkey/include/wp8/jsclist.h",
"external/spidermonkey/include/wp8/jscpucfg.h",
"external/spidermonkey/include/wp8/jsfriendapi.h",
"external/spidermonkey/include/wp8/jsprf.h",
"external/spidermonkey/include/wp8/jsprototypes.h",
"external/spidermonkey/include/wp8/jsproxy.h",
"external/spidermonkey/include/wp8/jspubtd.h",
"external/spidermonkey/include/wp8/jstypes.h",
"external/spidermonkey/include/wp8/jsversion.h",
"external/spidermonkey/include/wp8/jswrapper.h",
"external/spidermonkey/include/wp8/mozilla/Alignment.h",
"external/spidermonkey/include/wp8/mozilla/AllocPolicy.h",
"external/spidermonkey/include/wp8/mozilla/Array.h",
"external/spidermonkey/include/wp8/mozilla/ArrayUtils.h",
"external/spidermonkey/include/wp8/mozilla/Assertions.h",
"external/spidermonkey/include/wp8/mozilla/Atomics.h",
"external/spidermonkey/include/wp8/mozilla/Attributes.h",
"external/spidermonkey/include/wp8/mozilla/BloomFilter.h",
"external/spidermonkey/include/wp8/mozilla/Casting.h",
"external/spidermonkey/include/wp8/mozilla/Char16.h",
"external/spidermonkey/include/wp8/mozilla/CheckedInt.h",
"external/spidermonkey/include/wp8/mozilla/Compiler.h",
"external/spidermonkey/include/wp8/mozilla/Compression.h",
"external/spidermonkey/include/wp8/mozilla/Constants.h",
"external/spidermonkey/include/wp8/mozilla/DebugOnly.h",
"external/spidermonkey/include/wp8/mozilla/Endian.h",
"external/spidermonkey/include/wp8/mozilla/EnumSet.h",
"external/spidermonkey/include/wp8/mozilla/FloatingPoint.h",
"external/spidermonkey/include/wp8/mozilla/GuardObjects.h",
"external/spidermonkey/include/wp8/mozilla/HashFunctions.h",
"external/spidermonkey/include/wp8/mozilla/IntegerPrintfMacros.h",
"external/spidermonkey/include/wp8/mozilla/Likely.h",
"external/spidermonkey/include/wp8/mozilla/LinkedList.h",
"external/spidermonkey/include/wp8/mozilla/MSIntTypes.h",
"external/spidermonkey/include/wp8/mozilla/MacroArgs.h",
"external/spidermonkey/include/wp8/mozilla/MathAlgorithms.h",
"external/spidermonkey/include/wp8/mozilla/Maybe.h",
"external/spidermonkey/include/wp8/mozilla/MemoryChecking.h",
"external/spidermonkey/include/wp8/mozilla/MemoryReporting.h",
"external/spidermonkey/include/wp8/mozilla/Move.h",
"external/spidermonkey/include/wp8/mozilla/NullPtr.h",
"external/spidermonkey/include/wp8/mozilla/NumericLimits.h",
"external/spidermonkey/include/wp8/mozilla/Pair.h",
"external/spidermonkey/include/wp8/mozilla/PodOperations.h",
"external/spidermonkey/include/wp8/mozilla/Poison.h",
"external/spidermonkey/include/wp8/mozilla/Range.h",
"external/spidermonkey/include/wp8/mozilla/RangedPtr.h",
"external/spidermonkey/include/wp8/mozilla/ReentrancyGuard.h",
"external/spidermonkey/include/wp8/mozilla/RefPtr.h",
"external/spidermonkey/include/wp8/mozilla/RollingMean.h",
"external/spidermonkey/include/wp8/mozilla/SHA1.h",
"external/spidermonkey/include/wp8/mozilla/Scoped.h",
"external/spidermonkey/include/wp8/mozilla/SplayTree.h",
"external/spidermonkey/include/wp8/mozilla/TemplateLib.h",
"external/spidermonkey/include/wp8/mozilla/ThreadLocal.h",
"external/spidermonkey/include/wp8/mozilla/TypeTraits.h",
"external/spidermonkey/include/wp8/mozilla/TypedEnum.h",
"external/spidermonkey/include/wp8/mozilla/TypedEnumInternal.h",
"external/spidermonkey/include/wp8/mozilla/Types.h",
"external/spidermonkey/include/wp8/mozilla/UniquePtr.h",
"external/spidermonkey/include/wp8/mozilla/Vector.h",
"external/spidermonkey/include/wp8/mozilla/WeakPtr.h",
"external/spidermonkey/include/wp_8.1/js-config.h",
"external/spidermonkey/include/wp_8.1/js.msg",
"external/spidermonkey/include/wp_8.1/js/Anchor.h",
"external/spidermonkey/include/wp_8.1/js/CallArgs.h",
"external/spidermonkey/include/wp_8.1/js/CallNonGenericMethod.h",
"external/spidermonkey/include/wp_8.1/js/CharacterEncoding.h",
"external/spidermonkey/include/wp_8.1/js/Class.h",
"external/spidermonkey/include/wp_8.1/js/Date.h",
"external/spidermonkey/include/wp_8.1/js/GCAPI.h",
"external/spidermonkey/include/wp_8.1/js/HashTable.h",
"external/spidermonkey/include/wp_8.1/js/HeapAPI.h",
"external/spidermonkey/include/wp_8.1/js/Id.h",
"external/spidermonkey/include/wp_8.1/js/LegacyIntTypes.h",
"external/spidermonkey/include/wp_8.1/js/MemoryMetrics.h",
"external/spidermonkey/include/wp_8.1/js/OldDebugAPI.h",
"external/spidermonkey/include/wp_8.1/js/Principals.h",
"external/spidermonkey/include/wp_8.1/js/ProfilingStack.h",
"external/spidermonkey/include/wp_8.1/js/PropertyKey.h",
"external/spidermonkey/include/wp_8.1/js/RequiredDefines.h",
"external/spidermonkey/include/wp_8.1/js/RootingAPI.h",
"external/spidermonkey/include/wp_8.1/js/SliceBudget.h",
"external/spidermonkey/include/wp_8.1/js/StructuredClone.h",
"external/spidermonkey/include/wp_8.1/js/TracingAPI.h",
"external/spidermonkey/include/wp_8.1/js/TypeDecls.h",
"external/spidermonkey/include/wp_8.1/js/Utility.h",
"external/spidermonkey/include/wp_8.1/js/Value.h",
"external/spidermonkey/include/wp_8.1/js/Vector.h",
"external/spidermonkey/include/wp_8.1/jsalloc.h",
"external/spidermonkey/include/wp_8.1/jsapi.h",
"external/spidermonkey/include/wp_8.1/jsbytecode.h",
"external/spidermonkey/include/wp_8.1/jsclist.h",
"external/spidermonkey/include/wp_8.1/jscpucfg.h",
"external/spidermonkey/include/wp_8.1/jsfriendapi.h",
"external/spidermonkey/include/wp_8.1/jsprf.h",
"external/spidermonkey/include/wp_8.1/jsprototypes.h",
"external/spidermonkey/include/wp_8.1/jsproxy.h",
"external/spidermonkey/include/wp_8.1/jspubtd.h",
"external/spidermonkey/include/wp_8.1/jstypes.h",
"external/spidermonkey/include/wp_8.1/jsversion.h",
"external/spidermonkey/include/wp_8.1/jswrapper.h",
"external/spidermonkey/include/wp_8.1/mozilla/Alignment.h",
"external/spidermonkey/include/wp_8.1/mozilla/AllocPolicy.h",
"external/spidermonkey/include/wp_8.1/mozilla/Array.h",
"external/spidermonkey/include/wp_8.1/mozilla/ArrayUtils.h",
"external/spidermonkey/include/wp_8.1/mozilla/Assertions.h",
"external/spidermonkey/include/wp_8.1/mozilla/Atomics.h",
"external/spidermonkey/include/wp_8.1/mozilla/Attributes.h",
"external/spidermonkey/include/wp_8.1/mozilla/BloomFilter.h",
"external/spidermonkey/include/wp_8.1/mozilla/Casting.h",
"external/spidermonkey/include/wp_8.1/mozilla/Char16.h",
"external/spidermonkey/include/wp_8.1/mozilla/CheckedInt.h",
"external/spidermonkey/include/wp_8.1/mozilla/Compiler.h",
"external/spidermonkey/include/wp_8.1/mozilla/Compression.h",
"external/spidermonkey/include/wp_8.1/mozilla/Constants.h",
"external/spidermonkey/include/wp_8.1/mozilla/DebugOnly.h",
"external/spidermonkey/include/wp_8.1/mozilla/Endian.h",
"external/spidermonkey/include/wp_8.1/mozilla/EnumSet.h",
"external/spidermonkey/include/wp_8.1/mozilla/FloatingPoint.h",
"external/spidermonkey/include/wp_8.1/mozilla/GuardObjects.h",
"external/spidermonkey/include/wp_8.1/mozilla/HashFunctions.h",
"external/spidermonkey/include/wp_8.1/mozilla/IntegerPrintfMacros.h",
"external/spidermonkey/include/wp_8.1/mozilla/Likely.h",
"external/spidermonkey/include/wp_8.1/mozilla/LinkedList.h",
"external/spidermonkey/include/wp_8.1/mozilla/MSIntTypes.h",
"external/spidermonkey/include/wp_8.1/mozilla/MacroArgs.h",
"external/spidermonkey/include/wp_8.1/mozilla/MathAlgorithms.h",
"external/spidermonkey/include/wp_8.1/mozilla/Maybe.h",
"external/spidermonkey/include/wp_8.1/mozilla/MemoryChecking.h",
"external/spidermonkey/include/wp_8.1/mozilla/MemoryReporting.h",
"external/spidermonkey/include/wp_8.1/mozilla/Move.h",
"external/spidermonkey/include/wp_8.1/mozilla/NullPtr.h",
"external/spidermonkey/include/wp_8.1/mozilla/NumericLimits.h",
"external/spidermonkey/include/wp_8.1/mozilla/Pair.h",
"external/spidermonkey/include/wp_8.1/mozilla/PodOperations.h",
"external/spidermonkey/include/wp_8.1/mozilla/Poison.h",
"external/spidermonkey/include/wp_8.1/mozilla/Range.h",
"external/spidermonkey/include/wp_8.1/mozilla/RangedPtr.h",
"external/spidermonkey/include/wp_8.1/mozilla/ReentrancyGuard.h",
"external/spidermonkey/include/wp_8.1/mozilla/RefPtr.h",
"external/spidermonkey/include/wp_8.1/mozilla/RollingMean.h",
"external/spidermonkey/include/wp_8.1/mozilla/SHA1.h",
"external/spidermonkey/include/wp_8.1/mozilla/Scoped.h",
"external/spidermonkey/include/wp_8.1/mozilla/SplayTree.h",
"external/spidermonkey/include/wp_8.1/mozilla/TemplateLib.h",
"external/spidermonkey/include/wp_8.1/mozilla/ThreadLocal.h",
"external/spidermonkey/include/wp_8.1/mozilla/TypeTraits.h",
"external/spidermonkey/include/wp_8.1/mozilla/TypedEnum.h",
"external/spidermonkey/include/wp_8.1/mozilla/TypedEnumInternal.h",
"external/spidermonkey/include/wp_8.1/mozilla/Types.h",
"external/spidermonkey/include/wp_8.1/mozilla/UniquePtr.h",
"external/spidermonkey/include/wp_8.1/mozilla/Vector.h",
"external/spidermonkey/include/wp_8.1/mozilla/WeakPtr.h",
"external/spidermonkey/prebuilt/android/Android.mk",
"external/spidermonkey/prebuilt/android/armeabi-v7a/libjs_static.a",
"external/spidermonkey/prebuilt/android/armeabi/libjs_static.a",
"external/spidermonkey/prebuilt/android/x86/libjs_static.a",
"external/spidermonkey/prebuilt/ios/libjs_static.a",
"external/spidermonkey/prebuilt/linux/32-bit/libjs_static.a",
"external/spidermonkey/prebuilt/linux/64-bit/libjs_static.a",
"external/spidermonkey/prebuilt/mac/libjs_static.a",
"external/spidermonkey/prebuilt/win32/debug-build/mozjs-33.dll",
"external/spidermonkey/prebuilt/win32/debug-build/mozjs-33.lib",
"external/spidermonkey/prebuilt/win32/release-build/mozjs-33.dll",
"external/spidermonkey/prebuilt/win32/release-build/mozjs-33.lib",
"external/spidermonkey/prebuilt/winrt_8.1/arm/mozjs-33.dll",
"external/spidermonkey/prebuilt/winrt_8.1/arm/mozjs-33.lib",
"external/spidermonkey/prebuilt/winrt_8.1/win32/mozjs-33.dll",
"external/spidermonkey/prebuilt/winrt_8.1/win32/mozjs-33.lib",
"external/spidermonkey/prebuilt/wp8/arm/mozjs-33.dll",
"external/spidermonkey/prebuilt/wp8/arm/mozjs-33.lib",
"external/spidermonkey/prebuilt/wp8/win32/mozjs-33.dll",
"external/spidermonkey/prebuilt/wp8/win32/mozjs-33.lib",
"external/spidermonkey/prebuilt/wp_8.1/arm/mozjs-33.dll",
"external/spidermonkey/prebuilt/wp_8.1/arm/mozjs-33.lib",
"external/spidermonkey/prebuilt/wp_8.1/win32/mozjs-33.dll",
"external/spidermonkey/prebuilt/wp_8.1/win32/mozjs-33.lib",
"external/sqlite3/Android.mk",
"external/sqlite3/include/sqlite3.h",
"external/sqlite3/include/sqlite3ext.h",

View File

@ -44,6 +44,7 @@ SpineTests::SpineTests()
ADD_TEST_CASE(SpineTestLayerNormal);
ADD_TEST_CASE(SpineTestLayerFFD);
ADD_TEST_CASE(SpineTestPerformanceLayer);
ADD_TEST_CASE(SpineTestLayerRapor);
}
bool SpineTestLayerNormal::init () {
@ -168,4 +169,34 @@ bool SpineTestPerformanceLayer::init () {
void SpineTestPerformanceLayer::update (float deltaTime) {
}
}
bool SpineTestLayerRapor::init () {
if (!SpineTestLayer::init()) return false;
skeletonNode = SkeletonAnimation::createWithFile("spine/raptor.json", "spine/raptor.atlas", 0.5f);
skeletonNode->setAnimation(0, "walk", true);
skeletonNode->setAnimation(1, "empty", false);
skeletonNode->addAnimation(1, "gungrab", false, 2);
skeletonNode->setScale(0.5);
Size windowSize = Director::getInstance()->getWinSize();
skeletonNode->setPosition(Vec2(windowSize.width / 2, 20));
addChild(skeletonNode);
scheduleUpdate();
EventListenerTouchOneByOne* listener = EventListenerTouchOneByOne::create();
listener->onTouchBegan = [this] (Touch* touch, Event* event) -> bool {
if (!skeletonNode->getDebugBonesEnabled())
skeletonNode->setDebugBonesEnabled(true);
else if (skeletonNode->getTimeScale() == 1)
skeletonNode->setTimeScale(0.3f);
else
skeletonNode->setDebugBonesEnabled(false);
return true;
};
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
return true;
}

View File

@ -78,6 +78,25 @@ public:
CREATE_FUNC (SpineTestLayerFFD);
};
class SpineTestLayerRapor: public SpineTestLayer
{
public:
virtual std::string title() const override
{
return "Spine Test";
}
virtual std::string subtitle() const override
{
return "Raptor Test";
}
virtual bool init () override;
CREATE_FUNC (SpineTestLayerRapor);
private:
spine::SkeletonAnimation* skeletonNode;
};
class SpineTestPerformanceLayer: public SpineTestLayer
{
public:

View File

@ -2413,9 +2413,14 @@ std::string Sprite3DCubeMapTest::subtitle() const
void Sprite3DCubeMapTest::addNewSpriteWithCoords(Vec2 p)
{
Size visibleSize = Director::getInstance()->getVisibleSize();
auto _camera = Camera::createPerspective(60, visibleSize.width / visibleSize.height, 0.1f, 200);
_camera = Camera::createPerspective(60, visibleSize.width / visibleSize.height, 10, 1000);
_camera->setPosition3D(Vec3(0.f, 0.f, 50.f));
_camera->setCameraFlag(CameraFlag::USER1);
auto listener = EventListenerTouchAllAtOnce::create();
listener->onTouchesMoved = CC_CALLBACK_2(Sprite3DCubeMapTest::onTouchesMoved, this);
_eventDispatcher->addEventListenerWithSceneGraphPriority(listener, this);
// create a teapot
_teapot = Sprite3D::create("Sprite3DTest/teapot.c3b");
_teapot->retain();
@ -2433,8 +2438,8 @@ void Sprite3DCubeMapTest::addNewSpriteWithCoords(Vec2 p)
//set texture parameters
Texture2D::TexParams tRepeatParams;
tRepeatParams.magFilter = GL_NEAREST;
tRepeatParams.minFilter = GL_NEAREST;
tRepeatParams.magFilter = GL_LINEAR;
tRepeatParams.minFilter = GL_LINEAR;
tRepeatParams.wrapS = GL_MIRRORED_REPEAT;
tRepeatParams.wrapT = GL_MIRRORED_REPEAT;
_textureCube->setTexParameters(tRepeatParams);
@ -2443,7 +2448,7 @@ void Sprite3DCubeMapTest::addNewSpriteWithCoords(Vec2 p)
state->setUniformTexture("u_cubeTex", _textureCube);
_teapot->setGLProgramState(state);
_teapot->setPosition3D(Vec3(0, -5, -20));
_teapot->setPosition3D(Vec3(0, -5, 0));
_teapot->setRotation3D(Vec3(-90, 180, 0));
auto rotate_action = RotateBy::create(1.5, Vec3(0, 30, 0));
@ -2465,8 +2470,6 @@ void Sprite3DCubeMapTest::addNewSpriteWithCoords(Vec2 p)
offset += meshattribute.attribSizeBytes;
}
addChild(_teapot);
addChild(_camera);
setCameraMask(2);
{
// config skybox
@ -2475,8 +2478,13 @@ void Sprite3DCubeMapTest::addNewSpriteWithCoords(Vec2 p)
_skyBox->setTexture(_textureCube);
addChild(_skyBox);
_skyBox->setScale(700.f);
}
addChild(_camera);
setCameraMask(2);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
_backToForegroundListener = EventListenerCustom::create(EVENT_RENDERER_RECREATED,
[this](EventCustom*)
@ -2504,3 +2512,17 @@ void Sprite3DCubeMapTest::addNewSpriteWithCoords(Vec2 p)
Director::getInstance()->getEventDispatcher()->addEventListenerWithFixedPriority(_backToForegroundListener, 1);
#endif
}
void Sprite3DCubeMapTest::onTouchesMoved(const std::vector<Touch*>& touches, cocos2d::Event *event)
{
if (touches.size())
{
auto touch = touches[0];
auto delta = touch->getDelta();
static float _angle = 0.f;
_angle -= CC_DEGREES_TO_RADIANS(delta.x);
_camera->setPosition3D(Vec3(50.0f * sinf(_angle), 0.0f, 50.0f * cosf(_angle)));
_camera->lookAt(Vec3(0.0f, 0.0f, 0.0f), Vec3(0.0f, 1.0f, 0.0f));
}
}

View File

@ -519,10 +519,13 @@ public:
void addNewSpriteWithCoords(cocos2d::Vec2);
void onTouchesMoved(const std::vector<cocos2d::Touch*>& touches, cocos2d::Event *event);
protected:
cocos2d::TextureCube* _textureCube;
cocos2d::Skybox* _skyBox;
cocos2d::Sprite3D* _teapot;
cocos2d::TextureCube* _textureCube;
cocos2d::Skybox* _skyBox;
cocos2d::Sprite3D* _teapot;
cocos2d::Camera *_camera;
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || CC_TARGET_PLATFORM == CC_PLATFORM_WINRT)
cocos2d::EventListenerCustom* _backToForegroundListener;

View File

@ -107,10 +107,10 @@ void KeyboardNotificationLayer::onTouchEnded(Touch *touch, Event *event)
// decide the trackNode is clicked.
Rect rect;
auto point = convertTouchToNodeSpaceAR(touch);
auto point = _trackNode->convertTouchToNodeSpace(touch);
CCLOG("KeyboardNotificationLayer:clickedAt(%f,%f)", point.x, point.y);
rect = getRect(_trackNode);
rect.size = _trackNode->getContentSize();
CCLOG("KeyboardNotificationLayer:TrackNode at(origin:%f,%f, size:%f,%f)",
rect.origin.x, rect.origin.y, rect.size.width, rect.size.height);

View File

@ -18,12 +18,11 @@ UIFocusTests::UIFocusTests()
ADD_TEST_CASE(UIFocusTestNestedLayout1);
ADD_TEST_CASE(UIFocusTestNestedLayout2);
ADD_TEST_CASE(UIFocusTestNestedLayout3);
ADD_TEST_CASE(UIFocusTestListView);
}
UIFocusTestBase::UIFocusTestBase()
{
}
UIFocusTestBase::~UIFocusTestBase()
@ -35,44 +34,44 @@ bool UIFocusTestBase::init()
{
if (UIScene::init()) {
Layout* root = static_cast<Layout*>(_uiLayer->getChildByTag(81));
Layout* background = dynamic_cast<Layout*>(root->getChildByName("background_Panel"));
background->removeFromParentAndCleanup(true);
_dpadMenu = Menu::create();
auto winSize = Director::getInstance()->getVisibleSize();
auto leftItem = MenuItemFont::create("Left", CC_CALLBACK_0(UIFocusTestBase::onLeftKeyPressed, this));
leftItem->setPosition(Vec2(winSize.width - 100, winSize.height/2));
_dpadMenu->addChild(leftItem);
auto rightItem = MenuItemFont::create("Right", CC_CALLBACK_0(UIFocusTestBase::onRightKeyPressed, this));
rightItem->setPosition(Vec2(winSize.width - 30, winSize.height/2));
_dpadMenu->addChild(rightItem);
auto upItem = MenuItemFont::create("Up", CC_CALLBACK_0(UIFocusTestBase::onUpKeyPressed, this));
upItem->setPosition(Vec2(winSize.width - 60, winSize.height/2 + 50));
_dpadMenu->addChild(upItem);
auto downItem = MenuItemFont::create("Down", CC_CALLBACK_0(UIFocusTestBase::onDownKeyPressed, this));
downItem->setPosition(Vec2(winSize.width - 60, winSize.height/2 - 50));
_dpadMenu->addChild(downItem);
_dpadMenu->setPosition(Vec2::ZERO);
_uiLayer->addChild(_dpadMenu);
//call this method to enable Dpad focus navigation
Widget::enableDpadNavigation(true);
_eventListener = EventListenerFocus::create();
_eventListener->onFocusChanged = CC_CALLBACK_2(UIFocusTestBase::onFocusChanged, this);
_eventDispatcher->addEventListenerWithFixedPriority(_eventListener, 1);
return true;
}
return false;
}
@ -109,7 +108,7 @@ void UIFocusTestBase::onUpKeyPressed()
cocos2d::EventKeyboard::KeyCode cocos2dKey =EventKeyboard::KeyCode::KEY_DPAD_UP;
cocos2d::EventKeyboard event(cocos2dKey, false);
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);
}
void UIFocusTestBase::onDownKeyPressed()
@ -117,7 +116,7 @@ void UIFocusTestBase::onDownKeyPressed()
cocos2d::EventKeyboard::KeyCode cocos2dKey =EventKeyboard::KeyCode::KEY_DPAD_DOWN;
cocos2d::EventKeyboard event(cocos2dKey, false);
cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&event);
}
void UIFocusTestBase::onFocusChanged(cocos2d::ui::Widget *widgetLostFocus, cocos2d::ui::Widget *widgetGetFocus)
@ -125,11 +124,11 @@ void UIFocusTestBase::onFocusChanged(cocos2d::ui::Widget *widgetLostFocus, cocos
if (widgetGetFocus && widgetGetFocus->isFocusEnabled()) {
widgetGetFocus->setColor(Color3B::RED);
}
if (widgetLostFocus && widgetLostFocus->isFocusEnabled()) {
widgetLostFocus->setColor(Color3B::WHITE);
}
if (widgetLostFocus && widgetGetFocus) {
CCLOG("on focus change, %d widget get focus, %d widget lose focus", widgetGetFocus->getTag(), widgetLostFocus->getTag());
}
@ -139,29 +138,29 @@ void UIFocusTestBase::onFocusChanged(cocos2d::ui::Widget *widgetLostFocus, cocos
//UIFocusTestHorizontal
UIFocusTestHorizontal::UIFocusTestHorizontal()
{
}
UIFocusTestHorizontal::~UIFocusTestHorizontal()
{
}
bool UIFocusTestHorizontal::init()
{
if (UIFocusTestBase::init()) {
Size winSize = Director::getInstance()->getVisibleSize();
_horizontalLayout = HBox::create();
_horizontalLayout->setPosition(Vec2(20, winSize.height/2 + 40));
_uiLayer->addChild(_horizontalLayout);
_horizontalLayout->setFocused(true);
_horizontalLayout->setLoopFocus(true);
_horizontalLayout->setTag(100);
_firstFocusedWidget = _horizontalLayout;
int count = 3;
for (int i=0; i<count; ++i) {
ImageView *w = ImageView::create("cocosui/scrollviewbg.png");
@ -170,20 +169,20 @@ bool UIFocusTestHorizontal::init()
w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestHorizontal::onImageViewClicked, this));
_horizontalLayout->addChild(w);
}
_loopText = Text::create("loop enabled", "Arial", 20);
_loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50));
_loopText->setColor(Color3B::GREEN);
this->addChild(_loopText);
auto btn = Button::create("cocosui/switch-mask.png");
btn->setTitleText("Toggle Loop");
btn->setPosition(Vec2(60, winSize.height - 50));
btn->setTitleColor(Color3B::RED);
btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestHorizontal::toggleFocusLoop,this));
this->addChild(btn);
return true;
}
return false;
@ -208,30 +207,30 @@ void UIFocusTestHorizontal::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::TouchE
//UIFocusTestVertical
UIFocusTestVertical::UIFocusTestVertical()
{
}
UIFocusTestVertical::~UIFocusTestVertical()
{
}
bool UIFocusTestVertical::init()
{
if (UIFocusTestBase::init()) {
Size winSize = Director::getInstance()->getVisibleSize();
_verticalLayout = VBox::create();
_verticalLayout->setPosition(Vec2(winSize.width/2 - 100, winSize.height - 70));
_uiLayer->addChild(_verticalLayout);
_verticalLayout->setTag(100);
_verticalLayout->setScale(0.5);
_verticalLayout->setFocused(true);
_verticalLayout->setLoopFocus(true);
_firstFocusedWidget = _verticalLayout;
int count = 3;
for (int i=0; i<count; ++i) {
ImageView *w = ImageView::create("cocosui/scrollviewbg.png");
@ -243,20 +242,20 @@ bool UIFocusTestVertical::init()
w->requestFocus();
}
}
_loopText = Text::create("loop enabled", "Arial", 20);
_loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50));
_loopText->setColor(Color3B::GREEN);
this->addChild(_loopText);
auto btn = Button::create("cocosui/switch-mask.png");
btn->setTitleText("Toggle Loop");
btn->setPosition(Vec2(60, winSize.height - 50));
btn->setTitleColor(Color3B::RED);
btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestVertical::toggleFocusLoop, this));
this->addChild(btn);
return true;
}
return false;
@ -278,30 +277,30 @@ void UIFocusTestVertical::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::TouchEve
//UIFocusTestNestedLayout1
UIFocusTestNestedLayout1::UIFocusTestNestedLayout1()
{
}
UIFocusTestNestedLayout1::~UIFocusTestNestedLayout1()
{
}
bool UIFocusTestNestedLayout1::init()
{
if (UIFocusTestBase::init()) {
Size winSize = Director::getInstance()->getVisibleSize();
_verticalLayout = VBox::create();
_verticalLayout->setPosition(Vec2(winSize.width/2 - 80, winSize.height - 70));
_uiLayer->addChild(_verticalLayout);
_verticalLayout->setScale(0.5);
_verticalLayout->setFocused(true);
_verticalLayout->setLoopFocus(true);
_verticalLayout->setTag(100);
_firstFocusedWidget = _verticalLayout;
int count1 = 1;
for (int i=0; i<count1; ++i) {
ImageView *w = ImageView::create("cocosui/scrollviewbg.png");
@ -312,13 +311,13 @@ bool UIFocusTestNestedLayout1::init()
w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this));
_verticalLayout->addChild(w);
}
//add HBox into VBox
HBox *hbox = HBox::create();
hbox->setScale(0.8f);
hbox->setTag(101);
_verticalLayout->addChild(hbox);
int count2 = 2;
for (int i=0; i < count2; ++i) {
ImageView *w = ImageView::create("cocosui/scrollviewbg.png");
@ -329,14 +328,14 @@ bool UIFocusTestNestedLayout1::init()
w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::onImageViewClicked, this));
hbox->addChild(w);
}
VBox *innerVBox = VBox::create();
hbox->addChild(innerVBox);
innerVBox->setTag(102);
// innerVBox->setPassFocusToChild(false);
// innerVBox->setFocusEnabled(false);
int count3 = 2;
for (int i=0; i<count3; ++i) {
ImageView *w = ImageView::create("cocosui/scrollviewbg.png");
@ -350,15 +349,15 @@ bool UIFocusTestNestedLayout1::init()
_loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50));
_loopText->setColor(Color3B::GREEN);
this->addChild(_loopText);
auto btn = Button::create("cocosui/switch-mask.png");
btn->setTitleText("Toggle Loop");
btn->setPosition(Vec2(60, winSize.height - 50));
btn->setTitleColor(Color3B::RED);
btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout1::toggleFocusLoop, this));
this->addChild(btn);
return true;
}
return false;
@ -380,30 +379,30 @@ void UIFocusTestNestedLayout1::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::Tou
//UIFocusTestNestedLayout2
UIFocusTestNestedLayout2::UIFocusTestNestedLayout2()
{
}
UIFocusTestNestedLayout2::~UIFocusTestNestedLayout2()
{
}
bool UIFocusTestNestedLayout2::init()
{
if (UIFocusTestBase::init()) {
Size winSize = Director::getInstance()->getVisibleSize();
_horizontalLayout = HBox::create();
_horizontalLayout->setPosition(Vec2(winSize.width/2 - 200, winSize.height - 70));
_uiLayer->addChild(_horizontalLayout);
_horizontalLayout->setScale(0.6f);
_horizontalLayout->setFocused(true);
_horizontalLayout->setLoopFocus(true);
_horizontalLayout->setTag(100);
_firstFocusedWidget = _horizontalLayout;
int count1 = 2;
for (int i=0; i<count1; ++i) {
ImageView *w = ImageView::create("cocosui/scrollviewbg.png");
@ -414,13 +413,13 @@ bool UIFocusTestNestedLayout2::init()
w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this));
_horizontalLayout->addChild(w);
}
//add HBox into VBox
VBox *vbox = VBox::create();
vbox->setScale(0.8f);
vbox->setTag(101);
_horizontalLayout->addChild(vbox);
int count2 = 2;
for (int i=0; i < count2; ++i) {
ImageView *w = ImageView::create("cocosui/scrollviewbg.png");
@ -431,14 +430,14 @@ bool UIFocusTestNestedLayout2::init()
w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this));
vbox->addChild(w);
}
HBox *innerHBox = HBox::create();
vbox->addChild(innerHBox);
innerHBox->setTag(102);
// innerVBox->setPassFocusToChild(false);
// innerVBox->setFocusEnabled(false);
int count3 = 2;
for (int i=0; i<count3; ++i) {
ImageView *w = ImageView::create("cocosui/scrollviewbg.png");
@ -447,20 +446,20 @@ bool UIFocusTestNestedLayout2::init()
w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::onImageViewClicked, this));
innerHBox->addChild(w);
}
_loopText = Text::create("loop enabled", "Arial", 20);
_loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50));
_loopText->setColor(Color3B::GREEN);
this->addChild(_loopText);
auto btn = Button::create("cocosui/switch-mask.png");
btn->setTitleText("Toggle Loop");
btn->setPosition(Vec2(60, winSize.height - 50));
btn->setTitleColor(Color3B::RED);
btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout2::toggleFocusLoop, this));
this->addChild(btn);
return true;
}
return false;
@ -482,49 +481,49 @@ void UIFocusTestNestedLayout2::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::Tou
//UIFocusTestNestedLayout3
UIFocusTestNestedLayout3::UIFocusTestNestedLayout3()
{
}
UIFocusTestNestedLayout3::~UIFocusTestNestedLayout3()
{
}
bool UIFocusTestNestedLayout3::init()
{
if (UIFocusTestBase::init()) {
Size winSize = Director::getInstance()->getVisibleSize();
_verticalLayout = VBox::create();
_verticalLayout->setPosition(Vec2(40, winSize.height - 70));
_uiLayer->addChild(_verticalLayout);
_verticalLayout->setScale(0.8f);
_verticalLayout->setFocused(true);
_verticalLayout->setLoopFocus(true);
_verticalLayout->setTag(-1000);
_firstFocusedWidget = _verticalLayout;
HBox *upperHBox = HBox::create();
upperHBox->setTag(-200);
_verticalLayout->addChild(upperHBox);
LinearLayoutParameter *params = LinearLayoutParameter::create();
params->setMargin(Margin(0,0,50,0));
LinearLayoutParameter *vparams = LinearLayoutParameter::create();
vparams->setMargin(Margin(10, 0, 0, 140));
upperHBox->setLayoutParameter(vparams);
int count = 3;
for (int i=0; i<count; ++i) {
VBox *firstVbox = VBox::create();
firstVbox->setScale(0.5);
firstVbox->setLayoutParameter(params);
firstVbox->setTag((i+1) * 100);
int count1 = 3;
for (int j=0; j<count1; ++j) {
ImageView *w = ImageView::create("cocosui/scrollviewbg.png");
@ -533,15 +532,15 @@ bool UIFocusTestNestedLayout3::init()
w->addTouchEventListener(CC_CALLBACK_2(UIFocusTestBase::onImageViewClicked, this));
firstVbox->addChild(w);
}
upperHBox->addChild(firstVbox);
}
HBox *bottomHBox = HBox::create();
bottomHBox->setScale(0.5);
bottomHBox->setTag(600);
bottomHBox->setLayoutParameter(vparams);
count = 3;
LinearLayoutParameter *bottomParams = LinearLayoutParameter::create();
@ -555,22 +554,22 @@ bool UIFocusTestNestedLayout3::init()
bottomHBox->addChild(w);
}
_verticalLayout->addChild(bottomHBox);
_loopText = Text::create("loop enabled", "Arial", 20);
_loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50));
_loopText->setColor(Color3B::GREEN);
this->addChild(_loopText);
auto btn = Button::create("cocosui/switch-mask.png");
btn->setTitleText("Toggle Loop");
btn->setPosition(Vec2(60, winSize.height - 50));
btn->setTitleColor(Color3B::RED);
btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestNestedLayout3::toggleFocusLoop, this));
this->addChild(btn);
return true;
}
return false;
@ -588,89 +587,3 @@ void UIFocusTestNestedLayout3::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::Tou
}
}
}
//UIFocusTestListView
UIFocusTestListView::UIFocusTestListView()
{
}
UIFocusTestListView::~UIFocusTestListView()
{
}
bool UIFocusTestListView::init()
{
if (UIFocusTestBase::init()) {
Size winSize = Director::getInstance()->getVisibleSize();
_listView = ListView::create();
_listView->setDirection(ui::ScrollView::Direction::VERTICAL);
_listView->setBounceEnabled(true);
_listView->setBackGroundImage("cocosui/green_edit.png");
_listView->setBackGroundImageScale9Enabled(true);
_listView->setContentSize(Size(240, 130));
_listView->setPosition(Vec2(40, 70));
_uiLayer->addChild(_listView);
_listView->setScale(0.8f);
_listView->setFocused(true);
_listView->setLoopFocus(true);
_listView->setTag(-1000);
_firstFocusedWidget = _listView;
// create model
Button* default_button = Button::create("cocosui/backtotoppressed.png", "cocosui/backtotopnormal.png");
default_button->setName("Title Button");
// set model
_listView->setItemModel(default_button);
// add default item
ssize_t count = 20;
for (int i = 0; i < count / 4; ++i)
{
_listView->pushBackDefaultItem();
}
// insert default item
for (int i = 0; i < count / 4; ++i)
{
_listView->insertDefaultItem(0);
}
_loopText = Text::create("loop enabled", "Arial", 20);
_loopText->setPosition(Vec2(winSize.width/2, winSize.height - 50));
_loopText->setColor(Color3B::GREEN);
this->addChild(_loopText);
auto btn = Button::create("cocosui/switch-mask.png");
btn->setTitleText("Toggle Loop");
btn->setPosition(Vec2(60, winSize.height - 50));
btn->setTitleColor(Color3B::RED);
btn->addTouchEventListener(CC_CALLBACK_2(UIFocusTestListView::toggleFocusLoop, this));
this->addChild(btn);
return true;
}
return false;
}
void UIFocusTestListView::toggleFocusLoop(cocos2d::Ref * pObjc, Widget::TouchEventType type)
{
if (type == Widget::TouchEventType::ENDED) {
_listView->setLoopFocus(!_listView->isLoopFocus());
if (_listView->isLoopFocus()) {
_loopText->setString("loop enabled");
}else{
_loopText->setString("loop disabled");
}
}
}

View File

@ -20,7 +20,7 @@ public:
virtual ~UIFocusTestBase();
virtual bool init() override;
virtual void onLeftKeyPressed();
virtual void onRightKeyPressed();
virtual void onUpKeyPressed();
@ -44,9 +44,9 @@ public:
virtual ~UIFocusTestHorizontal();
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
cocos2d::ui::Layout* _horizontalLayout;
cocos2d::ui::Text* _loopText;
@ -61,7 +61,7 @@ public:
virtual ~UIFocusTestVertical();
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
cocos2d::ui::Layout* _verticalLayout;
@ -77,7 +77,7 @@ public:
virtual ~UIFocusTestNestedLayout1();
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
cocos2d::ui::Layout* _verticalLayout;
@ -93,7 +93,7 @@ public:
virtual ~UIFocusTestNestedLayout2();
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
cocos2d::ui::Layout* _horizontalLayout;
@ -109,29 +109,13 @@ public:
virtual ~UIFocusTestNestedLayout3();
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
cocos2d::ui::Layout* _verticalLayout;
cocos2d::ui::Text* _loopText;
};
class UIFocusTestListView : public UIFocusTestBase
{
public:
CREATE_FUNC(UIFocusTestListView);
UIFocusTestListView();
virtual ~UIFocusTestListView();
virtual bool init() override;
void toggleFocusLoop(cocos2d::Ref*,cocos2d::ui::Widget::TouchEventType);
protected:
cocos2d::ui::ListView* _listView;
cocos2d::ui::Text* _loopText;
};
#endif /* defined(__cocos2d_tests__UIFocusTest__) */

View File

@ -9,8 +9,8 @@ void main(void)
// compute reflect
vec4 positionWorldViewSpace = CC_MVMatrix * a_position;;
vec3 vEyeVertex = normalize(positionWorldViewSpace.xyz / positionWorldViewSpace.w);
vec3 vEyeVertex = normalize(positionWorldViewSpace.xyz);
vec3 v_normalVector = CC_NormalMatrix * a_normal;
v_reflect = normalize(reflect(vEyeVertex, v_normalVector));
v_reflect = normalize(reflect(-vEyeVertex, v_normalVector));
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 6.7 KiB

View File

@ -0,0 +1,251 @@
raptor.png
size: 1022,1022
format: RGBA8888
filter: Linear,Linear
repeat: none
back_arm
rotate: false
xy: 410, 545
size: 46, 29
orig: 46, 29
offset: 0, 0
index: -1
back_bracer
rotate: false
xy: 540, 548
size: 39, 28
orig: 39, 28
offset: 0, 0
index: -1
back_hand
rotate: true
xy: 504, 538
size: 36, 34
orig: 36, 34
offset: 0, 0
index: -1
back_knee
rotate: false
xy: 299, 478
size: 49, 67
orig: 49, 67
offset: 0, 0
index: -1
back_thigh
rotate: true
xy: 140, 247
size: 39, 24
orig: 39, 24
offset: 0, 0
index: -1
eyes_open
rotate: true
xy: 2, 2
size: 47, 45
orig: 47, 45
offset: 0, 0
index: -1
front_arm
rotate: false
xy: 360, 544
size: 48, 30
orig: 48, 30
offset: 0, 0
index: -1
front_bracer
rotate: false
xy: 538, 578
size: 41, 29
orig: 41, 29
offset: 0, 0
index: -1
front_hand
rotate: false
xy: 538, 609
size: 41, 38
orig: 41, 38
offset: 0, 0
index: -1
front_open_hand
rotate: false
xy: 894, 782
size: 43, 44
orig: 43, 44
offset: 0, 0
index: -1
front_thigh
rotate: false
xy: 942, 849
size: 57, 29
orig: 57, 29
offset: 0, 0
index: -1
gun
rotate: false
xy: 785, 774
size: 107, 103
orig: 107, 103
offset: 0, 0
index: -1
gun_nohand
rotate: false
xy: 614, 703
size: 105, 102
orig: 105, 102
offset: 0, 0
index: -1
head
rotate: false
xy: 2, 137
size: 136, 149
orig: 136, 149
offset: 0, 0
index: -1
lower_leg
rotate: true
xy: 780, 699
size: 73, 98
orig: 73, 98
offset: 0, 0
index: -1
mouth_smile
rotate: true
xy: 49, 2
size: 47, 30
orig: 47, 30
offset: 0, 0
index: -1
neck
rotate: true
xy: 1001, 860
size: 18, 21
orig: 18, 21
offset: 0, 0
index: -1
raptor_arm_back
rotate: false
xy: 940, 936
size: 82, 86
orig: 82, 86
offset: 0, 0
index: -1
raptor_body
rotate: false
xy: 2, 737
size: 610, 285
orig: 610, 285
offset: 0, 0
index: -1
raptor_front_arm
rotate: true
xy: 195, 464
size: 81, 102
orig: 81, 102
offset: 0, 0
index: -1
raptor_front_leg
rotate: false
xy: 2, 478
size: 191, 257
orig: 191, 257
offset: 0, 0
index: -1
raptor_hindleg_back
rotate: false
xy: 614, 807
size: 169, 215
orig: 169, 215
offset: 0, 0
index: -1
raptor_horn
rotate: false
xy: 360, 655
size: 182, 80
orig: 182, 80
offset: 0, 0
index: -1
raptor_horn_back
rotate: false
xy: 360, 576
size: 176, 77
orig: 176, 77
offset: 0, 0
index: -1
raptor_jaw
rotate: false
xy: 785, 879
size: 153, 143
orig: 153, 143
offset: 0, 0
index: -1
raptor_saddle_noshadow
rotate: false
xy: 2, 288
size: 163, 188
orig: 163, 188
offset: 0, 0
index: -1
raptor_saddle_strap_front
rotate: false
xy: 721, 710
size: 57, 95
orig: 57, 95
offset: 0, 0
index: -1
raptor_saddle_strap_rear
rotate: true
xy: 940, 880
size: 54, 74
orig: 54, 74
offset: 0, 0
index: -1
raptor_saddle_w_shadow
rotate: false
xy: 195, 547
size: 163, 188
orig: 163, 188
offset: 0, 0
index: -1
raptor_tongue
rotate: true
xy: 544, 649
size: 86, 64
orig: 86, 64
offset: 0, 0
index: -1
stirrup_back
rotate: false
xy: 458, 539
size: 44, 35
orig: 44, 35
offset: 0, 0
index: -1
stirrup_front
rotate: true
xy: 81, 4
size: 45, 50
orig: 45, 50
offset: 0, 0
index: -1
stirrup_strap
rotate: true
xy: 894, 828
size: 49, 46
orig: 49, 46
offset: 0, 0
index: -1
torso
rotate: true
xy: 610, 647
size: 54, 91
orig: 54, 91
offset: 0, 0
index: -1
visor
rotate: false
xy: 2, 51
size: 131, 84
orig: 131, 84
offset: 0, 0
index: -1

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 550 KiB

View File

@ -1032,7 +1032,6 @@ end
----------------------------------------
local Sprite3DCubeMapTest = class("Sprite3DCubeMapTest", function ()
local layer = cc.Layer:create()
Helper.initWithLayer(layer)
return layer
end)
@ -1045,9 +1044,6 @@ function Sprite3DCubeMapTest:ctor()
end
function Sprite3DCubeMapTest:init()
Helper.titleLabel:setString(self:title())
Helper.subtitleLabel:setString(self:subtitle())
self:registerScriptHandler(function (event)
if event == "enter" then
self:onEnter()
@ -1068,6 +1064,9 @@ end
function Sprite3DCubeMapTest:onEnter()
local s = cc.Director:getInstance():getWinSize()
self:addNewSpriteWithCoords(cc.p(s.width / 2, s.height / 2))
Helper.initWithLayer(self)
Helper.titleLabel:setString(self:title())
Helper.subtitleLabel:setString(self:subtitle())
end
function Sprite3DCubeMapTest:onExit()

View File

@ -5,7 +5,7 @@ require "cocos.3d.3dConstants"
----------------------------------------
local TerrainSimple = class("TerrainSimple", function ()
local layer = cc.Layer:create()
Helper.initWithLayer(layer)
return layer
end)
@ -15,8 +15,7 @@ function TerrainSimple:ctor()
end
function TerrainSimple:init()
Helper.titleLabel:setString(self:title())
Helper.subtitleLabel:setString(self:subtitle())
local visibleSize = cc.Director:getInstance():getVisibleSize()
@ -26,6 +25,10 @@ function TerrainSimple:init()
self._camera:setPosition3D(cc.vec3(-1, 1.6, 4))
self:addChild(self._camera)
Helper.initWithLayer(self)
Helper.titleLabel:setString(self:title())
Helper.subtitleLabel:setString(self:subtitle())
local detailMapR = { _detailMapSrc = "TerrainTest/dirt.jpg", _detailMapSize = 35}
local detailMapG = { _detailMapSrc = "TerrainTest/Grass2.jpg", _detailMapSize = 35}
local detailMapB = { _detailMapSrc = "TerrainTest/road.jpg", _detailMapSize = 35}

View File

@ -29,7 +29,7 @@ headers = %(cocosdir)s/cocos/ui/UIVideoPlayer.h
# what classes to produce code for. You can use regular expressions here. When testing the regular
# expression, it will be enclosed in "^$", like this: "^Menu*$".
classes = VideoPlayer FastTMXLayer FastTMXTiledMap
classes = VideoPlayer
# what should we skip? in the format ClassName::[function function]
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also