Merge remote-tracking branch 'upstream/v3' into v3

This commit is contained in:
cpascal 2015-01-27 11:04:58 +09:00
commit 985db1cd21
510 changed files with 6084 additions and 1950 deletions

View File

@ -1071,6 +1071,12 @@ Developers:
AknEp
Fix FileUtils::fullPathForFilename return empty string if file not found
kompjoefriek
Fix compiling warnings
tmr111116
fix random int overflow
Retired Core Developers:
WenSheng Yang

View File

@ -1,3 +1,24 @@
cocos2d-x-3.4 xxx
[FIX] Animate3D: `setSpeed` has not effect if `Animate3D` is used in Sequence
[FIX] C++: will crash if built with armeabi-v7a enabled on Android devices that with armeabi-v7a architecture but doesn't support NEON instructions
[FIX] C++: may crash if VAO is not supported
[FIX] EditBox: content is not clipped correctly on windows
[FIX] GLProgram: will cause crash on some devices that don't support more than 8 atrributes
[FIX] Label: alpha channel of text color of system font has not effect
[FIX] Label: use int for dimensions that will lose the precision
[FIX] Label: labels will become white block after resume from background on some Android devices, such as xiaomi3
[FIX] Label: improved parsing performance of bitmap font
[FIX] Lua-binding:studio-support: AnimationInfo is not binded
[FIX] New audio: not close file descriptor leads to that may causes game freeze if playing two many times(may be more than 1000) on Android
[FIX] Node: anchor point has not effect to rotation, it always rotate along (0, 0)
[FIX] SpriteFrameCache: `addSpriteFramesWithFil`e may crash if plist file doesn't exist
[FIX] Sprite3D: material files (.mtl) are not loaded for any object when creating from an .obj file
[FIX] UI::ImageView: rendered content size is wrong if `ignoreSize` is true and `Scale9` is not enabled
[FIX] UI::Slider: when scale9 is enabled, the progress bar's rendering height is wrong
[FIX] UI:Scale9Sprite: some position information will be lost when toggling `Scale9` state
[FIX] UI::TextField: will get wrong event message if clicking `TextField` twice
[FIX] UI::WebView: base URL can not work
cocos2d-x-3.4rc1 Jan.15 2015
[NEW] C++: added CC_USE_CULLING macro to control if enable auto culling or not
[NEW] FileUtils::fullPathForFilename will return empty string when file can not be found

View File

@ -2923,7 +2923,6 @@
50FCEB9018C72017004AD434 /* WidgetReader.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WidgetReader.cpp; sourceTree = "<group>"; };
50FCEB9118C72017004AD434 /* WidgetReader.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetReader.h; sourceTree = "<group>"; };
50FCEB9218C72017004AD434 /* WidgetReaderProtocol.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WidgetReaderProtocol.h; sourceTree = "<group>"; };
5224EE741A64FEC900D447D8 /* ccShader_PositionColorPointsize.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_PositionColorPointsize.vert; sourceTree = "<group>"; };
52B47A1D1A53489B004E4C60 /* HttpClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HttpClient.cpp; sourceTree = "<group>"; };
52B47A291A5349A3004E4C60 /* HttpAsynConnection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpAsynConnection.h; sourceTree = "<group>"; };
52B47A2A1A5349A3004E4C60 /* HttpAsynConnection.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpAsynConnection.m; sourceTree = "<group>"; };
@ -2935,6 +2934,7 @@
5E9F61241A3FFE3D0038DE01 /* CCPlane.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CCPlane.cpp; sourceTree = "<group>"; };
5E9F61251A3FFE3D0038DE01 /* CCPlane.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CCPlane.h; sourceTree = "<group>"; };
A07A4D641783777C0073F6A7 /* libcocos2d iOS.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libcocos2d iOS.a"; sourceTree = BUILT_PRODUCTS_DIR; };
B20564AA1A6E5744001C1B6E /* ccShader_PositionColorTextureAsPointsize.vert */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.glsl; path = ccShader_PositionColorTextureAsPointsize.vert; sourceTree = "<group>"; };
B217703B1977ECB4009EE11B /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
B217703D1977ECC1009EE11B /* AudioToolbox.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AudioToolbox.framework; path = System/Library/Frameworks/AudioToolbox.framework; sourceTree = SDKROOT; };
B217703F1977ECE6009EE11B /* OpenGL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenGL.framework; path = System/Library/Frameworks/OpenGL.framework; sourceTree = SDKROOT; };
@ -4878,7 +4878,7 @@
5034CA5D191D591900CE6051 /* shaders */ = {
isa = PBXGroup;
children = (
5224EE741A64FEC900D447D8 /* ccShader_PositionColorPointsize.vert */,
B20564AA1A6E5744001C1B6E /* ccShader_PositionColorTextureAsPointsize.vert */,
B67C624319D4186F00F11FC6 /* ccShader_3D_ColorNormal.frag */,
B67C624419D4186F00F11FC6 /* ccShader_3D_ColorNormalTex.frag */,
B67C624519D4186F00F11FC6 /* ccShader_3D_PositionNormalTex.vert */,

View File

@ -79,7 +79,7 @@ public:
*/
virtual void stop();
//! called every frame with it's delta time. DON'T override unless you know what you are doing.
//! called every frame with it's delta time, dt in seconds. DON'T override unless you know what you are doing.
virtual void step(float dt);
/**
@ -202,6 +202,9 @@ public:
virtual Speed* reverse() const override;
virtual void startWithTarget(Node* target) override;
virtual void stop() override;
/**
* @param dt in seconds.
*/
virtual void step(float dt) override;
virtual bool isDone() const override;
@ -252,6 +255,9 @@ public:
//
virtual Follow* clone() const override;
virtual Follow* reverse() const override;
/**
* @param dt in seconds.
*/
virtual void step(float dt) override;
virtual bool isDone() const override;
virtual void stop() override;

View File

@ -144,6 +144,7 @@ class CC_DLL CardinalSplineTo : public ActionInterval
public:
/** creates an action with a Cardinal Spline array of points and tension
* @param duration in seconds
* @code
* when this function bound to js or lua,the input params are changed
* in js: var create(var t,var table)
@ -162,7 +163,10 @@ public:
*/
CardinalSplineTo();
/** initializes the action with a duration and an array of points */
/**
* initializes the action with a duration and an array of points
* @param duration in seconds
*/
bool initWithDuration(float duration, PointArray* points, float tension);
virtual void updatePosition(Vec2 &newPos);
@ -183,6 +187,10 @@ public:
virtual CardinalSplineTo *clone() const override;
virtual CardinalSplineTo* reverse() const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds.
*/
virtual void update(float time) override;
protected:
@ -233,6 +241,7 @@ class CC_DLL CatmullRomTo : public CardinalSplineTo
public:
/** creates an action with a Cardinal Spline array of points and tension
* @param dt in seconds
* @code
* when this function bound to js or lua,the input params are changed
* in js: var create(var dt,var table)
@ -241,7 +250,10 @@ public:
*/
static CatmullRomTo* create(float dt, PointArray* points);
/** initializes the action with a duration and an array of points */
/**
* initializes the action with a duration and an array of points
* @param dt in seconds
*/
bool initWithDuration(float dt, PointArray* points);
// Override
@ -258,6 +270,7 @@ class CC_DLL CatmullRomBy : public CardinalSplineBy
{
public:
/** creates an action with a Cardinal Spline array of points and tension
* @param dt in seconds
* @code
* when this function bound to js or lua,the input params are changed
* in js: var create(var dt,var table)

View File

@ -63,6 +63,9 @@ public:
virtual void startWithTarget(Node *target) override;
virtual void stop() override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -128,6 +131,9 @@ public:
static EaseIn* create(ActionInterval* action, float rate);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseIn* clone() const override;
virtual EaseIn* reverse() const override;
@ -151,6 +157,9 @@ public:
static EaseOut* create(ActionInterval* action, float rate);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseOut* clone() const override;
virtual EaseOut* reverse() const override;
@ -174,6 +183,9 @@ public:
static EaseInOut* create(ActionInterval* action, float rate);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseInOut* clone() const override;
virtual EaseInOut* reverse() const override;
@ -197,6 +209,9 @@ public:
static EaseExponentialIn* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseExponentialIn* clone() const override;
virtual ActionEase* reverse() const override;
@ -220,6 +235,9 @@ public:
static EaseExponentialOut* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseExponentialOut* clone() const override;
virtual ActionEase* reverse() const override;
@ -243,6 +261,9 @@ public:
static EaseExponentialInOut* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseExponentialInOut* clone() const override;
virtual EaseExponentialInOut* reverse() const override;
@ -266,6 +287,9 @@ public:
static EaseSineIn* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseSineIn* clone() const override;
virtual ActionEase* reverse() const override;
@ -289,6 +313,9 @@ public:
static EaseSineOut* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseSineOut* clone() const override;
virtual ActionEase* reverse() const override;
@ -312,6 +339,9 @@ public:
static EaseSineInOut* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseSineInOut* clone() const override;
virtual EaseSineInOut* reverse() const override;
@ -381,6 +411,9 @@ public:
static EaseElasticIn* create(ActionInterval *action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseElasticIn* clone() const override;
virtual EaseElastic* reverse() const override;
@ -407,6 +440,9 @@ public:
static EaseElasticOut* create(ActionInterval *action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseElasticOut* clone() const override;
virtual EaseElastic* reverse() const override;
@ -433,6 +469,9 @@ public:
static EaseElasticInOut* create(ActionInterval *action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseElasticInOut* clone() const override;
virtual EaseElasticInOut* reverse() const override;
@ -488,6 +527,9 @@ public:
static EaseBounceIn* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseBounceIn* clone() const override;
virtual EaseBounce* reverse() const override;
@ -513,6 +555,9 @@ public:
static EaseBounceOut* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseBounceOut* clone() const override;
virtual EaseBounce* reverse() const override;
@ -538,6 +583,9 @@ public:
static EaseBounceInOut* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseBounceInOut* clone() const override;
virtual EaseBounceInOut* reverse() const override;
@ -563,6 +611,9 @@ public:
static EaseBackIn* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseBackIn* clone() const override;
virtual ActionEase* reverse() const override;
@ -588,6 +639,9 @@ public:
static EaseBackOut* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseBackOut* clone() const override;
virtual ActionEase* reverse() const override;
@ -613,6 +667,9 @@ public:
static EaseBackInOut* create(ActionInterval* action);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseBackInOut* clone() const override;
virtual EaseBackInOut* reverse() const override;
@ -635,7 +692,10 @@ class CC_DLL EaseBezierAction : public ActionEase
public:
/** creates the action */
static EaseBezierAction* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseBezierAction* clone() const override;
virtual EaseBezierAction* reverse() const override;
@ -665,7 +725,10 @@ class CC_DLL EaseQuadraticActionIn : public ActionEase
public:
/** creates the action */
static EaseQuadraticActionIn* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseQuadraticActionIn* clone() const override;
virtual EaseQuadraticActionIn* reverse() const override;
@ -688,7 +751,10 @@ class CC_DLL EaseQuadraticActionOut : public ActionEase
public:
/** creates the action */
static EaseQuadraticActionOut* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseQuadraticActionOut* clone() const override;
virtual EaseQuadraticActionOut* reverse() const override;
@ -711,7 +777,10 @@ class CC_DLL EaseQuadraticActionInOut : public ActionEase
public:
/** creates the action */
static EaseQuadraticActionInOut* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseQuadraticActionInOut* clone() const override;
virtual EaseQuadraticActionInOut* reverse() const override;
@ -733,7 +802,10 @@ class CC_DLL EaseQuarticActionIn : public ActionEase
public:
/** creates the action */
static EaseQuarticActionIn* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseQuarticActionIn* clone() const override;
virtual EaseQuarticActionIn* reverse() const override;
@ -755,7 +827,10 @@ class CC_DLL EaseQuarticActionOut : public ActionEase
public:
/** creates the action */
static EaseQuarticActionOut* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseQuarticActionOut* clone() const override;
virtual EaseQuarticActionOut* reverse() const override;
@ -777,7 +852,10 @@ class CC_DLL EaseQuarticActionInOut : public ActionEase
public:
/** creates the action */
static EaseQuarticActionInOut* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseQuarticActionInOut* clone() const override;
virtual EaseQuarticActionInOut* reverse() const override;
@ -800,7 +878,10 @@ class CC_DLL EaseQuinticActionIn : public ActionEase
public:
/** creates the action */
static EaseQuinticActionIn* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseQuinticActionIn* clone() const override;
virtual EaseQuinticActionIn* reverse() const override;
@ -822,7 +903,10 @@ class CC_DLL EaseQuinticActionOut : public ActionEase
public:
/** creates the action */
static EaseQuinticActionOut* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseQuinticActionOut* clone() const override;
virtual EaseQuinticActionOut* reverse() const override;
@ -844,7 +928,10 @@ class CC_DLL EaseQuinticActionInOut : public ActionEase
public:
/** creates the action */
static EaseQuinticActionInOut* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseQuinticActionInOut* clone() const override;
virtual EaseQuinticActionInOut* reverse() const override;
@ -866,7 +953,10 @@ class CC_DLL EaseCircleActionIn : public ActionEase
public:
/** creates the action */
static EaseCircleActionIn* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseCircleActionIn* clone() const override;
virtual EaseCircleActionIn* reverse() const override;
@ -888,7 +978,10 @@ class CC_DLL EaseCircleActionOut : public ActionEase
public:
/** creates the action */
static EaseCircleActionOut* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseCircleActionOut* clone() const override;
virtual EaseCircleActionOut* reverse() const override;
@ -910,7 +1003,10 @@ class CC_DLL EaseCircleActionInOut:public ActionEase
public:
/** creates the action */
static EaseCircleActionInOut* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseCircleActionInOut* clone() const override;
virtual EaseCircleActionInOut* reverse() const override;
@ -932,7 +1028,10 @@ class CC_DLL EaseCubicActionIn:public ActionEase
public:
/** creates the action */
static EaseCubicActionIn* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseCubicActionIn* clone() const override;
virtual EaseCubicActionIn* reverse() const override;
@ -954,7 +1053,10 @@ class CC_DLL EaseCubicActionOut : public ActionEase
public:
/** creates the action */
static EaseCubicActionOut* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseCubicActionOut* clone() const override;
virtual EaseCubicActionOut* reverse() const override;
@ -976,7 +1078,10 @@ class CC_DLL EaseCubicActionInOut : public ActionEase
public:
/** creates the action */
static EaseCubicActionInOut* create(ActionInterval* action);
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual EaseCubicActionInOut* clone() const override;
virtual EaseCubicActionInOut* reverse() const override;

View File

@ -59,7 +59,10 @@ public:
CC_CONSTRUCTOR_ACCESS:
GridAction() {}
virtual ~GridAction() {}
/** initializes the action with size and duration */
/**
* initializes the action with size and duration
* @param duration in seconds
*/
bool initWithDuration(float duration, const Size& gridSize);
protected:
@ -186,6 +189,9 @@ public:
// Overrides
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual AccelDeccelAmplitude* clone() const override;
virtual AccelDeccelAmplitude* reverse() const override;
@ -219,6 +225,9 @@ public:
// Overrides
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual AccelAmplitude* clone() const override;
virtual AccelAmplitude* reverse() const override;
@ -251,6 +260,9 @@ public:
// overrides
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual DeccelAmplitude* clone() const override;
virtual DeccelAmplitude* reverse() const override;

View File

@ -56,6 +56,9 @@ public:
// Overrides
virtual Waves3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -83,6 +86,9 @@ public:
// Override
virtual FlipX3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -105,6 +111,9 @@ public:
static FlipY3D* create(float duration);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual FlipY3D* clone() const override;
@ -134,6 +143,9 @@ public:
// Overrides
virtual Lens3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -178,6 +190,9 @@ public:
// Override
virtual Ripple3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -214,7 +229,10 @@ CC_CONSTRUCTOR_ACCESS:
Shaky3D() {}
virtual ~Shaky3D() {}
/** initializes the action with a range, shake Z vertices, a grid and duration */
/**
* initializes the action with a range, shake Z vertices, a grid and duration
* @param duration in seconds
*/
bool initWithDuration(float duration, const Size& gridSize, int range, bool shakeZ);
protected:
@ -240,6 +258,9 @@ public:
// Overrides
virtual Liquid* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -273,6 +294,9 @@ public:
// Overrides
virtual Waves* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -314,6 +338,9 @@ public:
// Overrides
virtual Twirl* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:

View File

@ -61,7 +61,13 @@ public:
}
virtual bool isDone() const override;
/**
* @param dt in seconds
*/
virtual void step(float dt) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
};
@ -77,6 +83,9 @@ public:
//
// Overrides
//
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual ActionInstant* reverse() const override;
virtual Show* clone() const override;
@ -101,6 +110,9 @@ public:
//
// Overrides
//
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual ActionInstant* reverse() const override;
virtual Hide* clone() const override;
@ -124,6 +136,9 @@ public:
//
// Overrides
//
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual ToggleVisibility* reverse() const override;
virtual ToggleVisibility* clone() const override;
@ -148,6 +163,9 @@ public:
//
// Override
//
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual RemoveSelf* clone() const override;
virtual RemoveSelf* reverse() const override;
@ -179,6 +197,9 @@ public:
//
// Overrides
//
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual FlipX* reverse() const override;
virtual FlipX* clone() const override;
@ -210,6 +231,9 @@ public:
//
// Overrides
//
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual FlipY* reverse() const override;
virtual FlipY* clone() const override;
@ -240,6 +264,9 @@ public:
//
// Overrides
//
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual Place* reverse() const override;
virtual Place* clone() const override;
@ -302,6 +329,9 @@ public:
//
// Overrides
//
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual CallFunc* reverse() const override;
virtual CallFunc* clone() const override;

View File

@ -77,6 +77,9 @@ public:
// Overrides
//
virtual bool isDone(void) const override;
/**
* @param dt in seconds
*/
virtual void step(float dt) override;
virtual void startWithTarget(Node *target) override;
virtual ActionInterval* reverse() const override
@ -146,6 +149,9 @@ public:
virtual Sequence* reverse() const override;
virtual void startWithTarget(Node *target) override;
virtual void stop(void) override;
/**
* @param t in seconds
*/
virtual void update(float t) override;
CC_CONSTRUCTOR_ACCESS:
@ -195,6 +201,9 @@ public:
virtual Repeat* reverse() const override;
virtual void startWithTarget(Node *target) override;
virtual void stop(void) override;
/**
* @param dt in seconds
*/
virtual void update(float dt) override;
virtual bool isDone(void) const override;
@ -248,6 +257,9 @@ public:
virtual RepeatForever* clone() const override;
virtual RepeatForever* reverse(void) const override;
virtual void startWithTarget(Node* target) override;
/**
* @param dt in seconds
*/
virtual void step(float dt) override;
virtual bool isDone(void) const override;
@ -316,6 +328,9 @@ public:
virtual Spawn* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
virtual void stop(void) override;
/**
* @param dt in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -340,13 +355,25 @@ private:
class CC_DLL RotateTo : public ActionInterval
{
public:
/** creates the action with separate rotation angles */
/**
* creates the action with separate rotation angles
* @param duration in seconds
* @param dstAngleX in degreesCW
* @param dstAngleY in degreesCW
*/
static RotateTo* create(float duration, float dstAngleX, float dstAngleY);
/** creates the action */
/**
* creates the action
* @param duration in seconds
* @param dstAngle in degreesCW
*/
static RotateTo* create(float duration, float dstAngle);
/** creates the action with 3D rotation angles */
/**
* creates the action with 3D rotation angles
* @param duration in seconds
*/
static RotateTo* create(float duration, const Vec3& dstAngle3D);
//
@ -355,17 +382,32 @@ public:
virtual RotateTo* clone() const override;
virtual RotateTo* reverse() const override;
virtual void startWithTarget(Node *target) override;
/**
* @param dt in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
RotateTo();
virtual ~RotateTo() {}
/** initializes the action */
/**
* initializes the action
* @param duration in seconds
* @param dstAngleX in degreesCW
* @param dstAngleY in degreesCW
*/
bool initWithDuration(float duration, float dstAngleX, float dstAngleY);
/**
* initializes the action
* @param duration in seconds
*/
bool initWithDuration(float duration, const Vec3& dstAngle3D);
/** calculates the start and diff angles */
/**
* calculates the start and diff angles
* @param dstAngle in degreesCW
*/
void calculateAngles(float &startAngle, float &diffAngle, float dstAngle);
protected:
@ -383,10 +425,22 @@ private:
class CC_DLL RotateBy : public ActionInterval
{
public:
/** creates the action */
/**
* creates the action
* @param duration in seconds
* @param deltaAngle in degreesCW
*/
static RotateBy* create(float duration, float deltaAngle);
/** @warning The physics body contained in Node doesn't support rotate with different x and y angle. */
/**
* @param duration in seconds
* @param deltaAngleZ_X in degreesCW
* @param deltaAngleZ_Y in degreesCW
* @warning The physics body contained in Node doesn't support rotate with different x and y angle.
*/
static RotateBy* create(float duration, float deltaAngleZ_X, float deltaAngleZ_Y);
/**
* @param duration in seconds
*/
static RotateBy* create(float duration, const Vec3& deltaAngle3D);
//
@ -395,6 +449,9 @@ public:
virtual RotateBy* clone() const override;
virtual RotateBy* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -403,7 +460,11 @@ CC_CONSTRUCTOR_ACCESS:
/** initializes the action */
bool initWithDuration(float duration, float deltaAngle);
/** @warning The physics body contained in Node doesn't support rotate with different x and y angle. */
/**
* @warning The physics body contained in Node doesn't support rotate with different x and y angle.
* @param deltaAngleZ_X in degreesCW
* @param deltaAngleZ_Y in degreesCW
*/
bool initWithDuration(float duration, float deltaAngleZ_X, float deltaAngleZ_Y);
bool initWithDuration(float duration, const Vec3& deltaAngle3D);
@ -425,8 +486,15 @@ private:
class CC_DLL MoveBy : public ActionInterval
{
public:
/** creates the action */
/**
* creates the action
* @param duration in seconds
*/
static MoveBy* create(float duration, const Vec2& deltaPosition);
/**
* creates the action
* @param duration in seconds
*/
static MoveBy* create(float duration, const Vec3& deltaPosition);
//
@ -435,6 +503,9 @@ public:
virtual MoveBy* clone() const override;
virtual MoveBy* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -463,8 +534,15 @@ private:
class CC_DLL MoveTo : public MoveBy
{
public:
/** creates the action */
/**
* creates the action
* @param duration in seconds
*/
static MoveTo* create(float duration, const Vec2& position);
/**
* creates the action
* @param duration in seconds
*/
static MoveTo* create(float duration, const Vec3& position);
//
@ -477,8 +555,15 @@ CC_CONSTRUCTOR_ACCESS:
MoveTo() {}
virtual ~MoveTo() {}
/** initializes the action */
/**
* initializes the action
* @param duration in seconds
*/
bool initWithDuration(float duration, const Vec2& position);
/**
* initializes the action
* @param duration in seconds
*/
bool initWithDuration(float duration, const Vec3& position);
protected:
@ -494,7 +579,10 @@ private:
class CC_DLL SkewTo : public ActionInterval
{
public:
/** creates the action */
/**
* creates the action
* @param t in seconds
*/
static SkewTo* create(float t, float sx, float sy);
//
@ -503,12 +591,17 @@ public:
virtual SkewTo* clone() const override;
virtual SkewTo* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
SkewTo();
virtual ~SkewTo() {}
/**
* @param t in seconds
*/
bool initWithDuration(float t, float sx, float sy);
protected:
@ -531,7 +624,10 @@ private:
class CC_DLL SkewBy : public SkewTo
{
public:
/** creates the action */
/**
* creates the action
* @param t in seconds
*/
static SkewBy* create(float t, float deltaSkewX, float deltaSkewY);
//
@ -544,7 +640,9 @@ public:
CC_CONSTRUCTOR_ACCESS:
SkewBy() {}
virtual ~SkewBy() {}
/**
* @param t in seconds
*/
bool initWithDuration(float t, float sx, float sy);
private:
@ -556,7 +654,10 @@ private:
class CC_DLL JumpBy : public ActionInterval
{
public:
/** creates the action */
/**
* creates the action
* @param duration in seconds
*/
static JumpBy* create(float duration, const Vec2& position, float height, int jumps);
//
@ -565,13 +666,19 @@ public:
virtual JumpBy* clone() const override;
virtual JumpBy* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
JumpBy() {}
virtual ~JumpBy() {}
/** initializes the action */
/**
* initializes the action
* @param duration in seconds
*/
bool initWithDuration(float duration, const Vec2& position, float height, int jumps);
protected:
@ -590,7 +697,10 @@ private:
class CC_DLL JumpTo : public JumpBy
{
public:
/** creates the action */
/**
* creates the action
* @param duration in seconds
*/
static JumpTo* create(float duration, const Vec2& position, float height, int jumps);
//
@ -604,7 +714,10 @@ CC_CONSTRUCTOR_ACCESS:
JumpTo() {}
virtual ~JumpTo() {}
/** initializes the action */
/**
* initializes the action
* @param duration in seconds
*/
bool initWithDuration(float duration, const Vec2& position, float height, int jumps);
protected:
@ -631,6 +744,7 @@ class CC_DLL BezierBy : public ActionInterval
{
public:
/** creates the action with a duration and a bezier configuration
* @param t in seconds
* @code
* when this function bound to js or lua,the input params are changed
* in js: var create(var t,var table)
@ -645,13 +759,19 @@ public:
virtual BezierBy* clone() const override;
virtual BezierBy* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
BezierBy() {}
virtual ~BezierBy() {}
/** initializes the action with a duration and a bezier configuration */
/**
* initializes the action with a duration and a bezier configuration
* @param t in seconds
*/
bool initWithDuration(float t, const ccBezierConfig& c);
protected:
@ -670,6 +790,7 @@ class CC_DLL BezierTo : public BezierBy
{
public:
/** creates the action with a duration and a bezier configuration
* @param t in seconds
* @code
* when this function bound to js or lua,the input params are changed
* in js: var create(var t,var table)
@ -688,7 +809,9 @@ public:
CC_CONSTRUCTOR_ACCESS:
BezierTo() {}
virtual ~BezierTo() {}
/**
* @param t in seconds
*/
bool initWithDuration(float t, const ccBezierConfig &c);
protected:
@ -705,13 +828,22 @@ private:
class CC_DLL ScaleTo : public ActionInterval
{
public:
/** creates the action with the same scale factor for X and Y */
/**
* creates the action with the same scale factor for X and Y
* @param duration in seconds
*/
static ScaleTo* create(float duration, float s);
/** creates the action with and X factor and a Y factor */
/**
* creates the action with and X factor and a Y factor
* @param duration in seconds
*/
static ScaleTo* create(float duration, float sx, float sy);
/** creates the action with X Y Z factor */
/**
* creates the action with X Y Z factor
* @param duration in seconds
*/
static ScaleTo* create(float duration, float sx, float sy, float sz);
//
@ -720,17 +852,29 @@ public:
virtual ScaleTo* clone() const override;
virtual ScaleTo* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
ScaleTo() {}
virtual ~ScaleTo() {}
/** initializes the action with the same scale factor for X and Y */
/**
* initializes the action with the same scale factor for X and Y
* @param duration in seconds
*/
bool initWithDuration(float duration, float s);
/** initializes the action with and X factor and a Y factor */
/**
* initializes the action with and X factor and a Y factor
* @param duration in seconds
*/
bool initWithDuration(float duration, float sx, float sy);
/** initializes the action with X Y Z factor */
/**
* initializes the action with X Y Z factor
* @param duration in seconds
*/
bool initWithDuration(float duration, float sx, float sy, float sz);
protected:
@ -757,13 +901,22 @@ private:
class CC_DLL ScaleBy : public ScaleTo
{
public:
/** creates the action with the same scale factor for X and Y */
/**
* creates the action with the same scale factor for X and Y
* @param duration in seconds
*/
static ScaleBy* create(float duration, float s);
/** creates the action with and X factor and a Y factor */
/**
* creates the action with and X factor and a Y factor
* @param duration in seconds
*/
static ScaleBy* create(float duration, float sx, float sy);
/** creates the action with X Y Z factor */
/**
* creates the action with X Y Z factor
* @param duration in seconds
*/
static ScaleBy* create(float duration, float sx, float sy, float sz);
//
@ -786,7 +939,10 @@ private:
class CC_DLL Blink : public ActionInterval
{
public:
/** creates the action */
/**
* creates the action
* @param duration in seconds
*/
static Blink* create(float duration, int blinks);
//
@ -794,6 +950,9 @@ public:
//
virtual Blink* clone() const override;
virtual Blink* reverse() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual void startWithTarget(Node *target) override;
virtual void stop() override;
@ -802,7 +961,10 @@ CC_CONSTRUCTOR_ACCESS:
Blink() {}
virtual ~Blink() {}
/** initializes the action */
/**
* initializes the action
* @param duration in seconds
*/
bool initWithDuration(float duration, int blinks);
protected:
@ -820,7 +982,10 @@ private:
class CC_DLL FadeTo : public ActionInterval
{
public:
/** creates an action with duration and opacity */
/**
* creates an action with duration and opacity
* @param duration in seconds
*/
static FadeTo* create(float duration, GLubyte opacity);
//
@ -829,13 +994,19 @@ public:
virtual FadeTo* clone() const override;
virtual FadeTo* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
FadeTo() {}
virtual ~FadeTo() {}
/** initializes the action with duration and opacity */
/**
* initializes the action with duration and opacity
* @param duration in seconds
*/
bool initWithDuration(float duration, GLubyte opacity);
protected:
@ -853,7 +1024,10 @@ private:
class CC_DLL FadeIn : public FadeTo
{
public:
/** creates the action */
/**
* creates the action
* @param d in seconds
*/
static FadeIn* create(float d);
//
@ -880,7 +1054,10 @@ private:
class CC_DLL FadeOut : public FadeTo
{
public:
/** creates the action */
/**
* creates the action
* @param d in seconds
*/
static FadeOut* create(float d);
//
@ -906,8 +1083,15 @@ private:
class CC_DLL TintTo : public ActionInterval
{
public:
/** creates an action with duration and color */
/**
* creates an action with duration and color
* @param duration in seconds
*/
static TintTo* create(float duration, GLubyte red, GLubyte green, GLubyte blue);
/**
* creates an action with duration and color
* @param duration in seconds
*/
static TintTo* create(float duration, const Color3B& color);
//
@ -916,6 +1100,9 @@ public:
virtual TintTo* clone() const override;
virtual TintTo* reverse(void) const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -939,7 +1126,10 @@ private:
class CC_DLL TintBy : public ActionInterval
{
public:
/** creates an action with duration and color */
/**
* creates an action with duration and color
* @param duration in seconds
*/
static TintBy* create(float duration, GLshort deltaRed, GLshort deltaGreen, GLshort deltaBlue);
//
@ -948,6 +1138,9 @@ public:
virtual TintBy* clone() const override;
virtual TintBy* reverse() const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -975,12 +1168,18 @@ private:
class CC_DLL DelayTime : public ActionInterval
{
public:
/** creates the action */
/**
* creates the action
* @param d in seconds
*/
static DelayTime* create(float d);
//
// Overrides
//
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual DelayTime* reverse() const override;
virtual DelayTime* clone() const override;
@ -1013,6 +1212,9 @@ public:
virtual ReverseTime* clone() const override;
virtual void startWithTarget(Node *target) override;
virtual void stop(void) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -1050,6 +1252,9 @@ public:
virtual Animate* reverse() const override;
virtual void startWithTarget(Node *target) override;
virtual void stop(void) override;
/**
* @param t in seconds
*/
virtual void update(float t) override;
CC_CONSTRUCTOR_ACCESS:
@ -1094,6 +1299,9 @@ public:
virtual TargetedAction* reverse() const override;
virtual void startWithTarget(Node *target) override;
virtual void stop(void) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:

View File

@ -126,7 +126,9 @@ public:
/** Resume a set of targets (convenience function to reverse a pauseAllRunningActions call)
*/
void resumeTargets(const Vector<Node*>& targetsToResume);
/**
* @param dt in seconds
*/
void update(float dt);
protected:

View File

@ -53,6 +53,9 @@ public:
// Overrides
virtual PageTurn3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
};

View File

@ -42,7 +42,10 @@ NS_CC_BEGIN
class CC_DLL ProgressTo : public ActionInterval
{
public:
/** Creates and initializes with a duration and a percent */
/**
* Creates and initializes with a duration and a percent
* @param duration in seconds
*/
static ProgressTo* create(float duration, float percent);
//
@ -51,13 +54,19 @@ public:
virtual ProgressTo* clone() const override;
virtual ProgressTo* reverse() const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
ProgressTo() {}
virtual ~ProgressTo() {}
/** Initializes with a duration and a percent */
/**
* Initializes with a duration and a percent
* @param duration in seconds
*/
bool initWithDuration(float duration, float percent);
protected:
@ -75,7 +84,10 @@ private:
class CC_DLL ProgressFromTo : public ActionInterval
{
public:
/** Creates and initializes the action with a duration, a "from" percentage and a "to" percentage */
/**
* Creates and initializes the action with a duration, a "from" percentage and a "to" percentage
* @param duration in seconds
*/
static ProgressFromTo* create(float duration, float fromPercentage, float toPercentage);
//
@ -84,6 +96,9 @@ public:
virtual ProgressFromTo* clone() const override;
virtual ProgressFromTo* reverse() const override;
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:

View File

@ -39,18 +39,27 @@ NS_CC_BEGIN
class CC_DLL ShakyTiles3D : public TiledGrid3DAction
{
public:
/** creates the action with a range, whether or not to shake Z vertices, a grid size, and duration */
/**
* creates the action with a range, whether or not to shake Z vertices, a grid size, and duration
* @param duration in seconds
*/
static ShakyTiles3D* create(float duration, const Size& gridSize, int range, bool shakeZ);
// Override
virtual ShakyTiles3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
ShakyTiles3D() {}
virtual ~ShakyTiles3D() {}
/** initializes the action with a range, whether or not to shake Z vertices, a grid size, and duration */
/**
* initializes the action with a range, whether or not to shake Z vertices, a grid size, and duration
* @param duration in seconds
*/
bool initWithDuration(float duration, const Size& gridSize, int range, bool shakeZ);
protected:
@ -65,18 +74,25 @@ private:
class CC_DLL ShatteredTiles3D : public TiledGrid3DAction
{
public:
/** creates the action with a range, whether of not to shatter Z vertices, a grid size and duration */
/**
* creates the action with a range, whether of not to shatter Z vertices, a grid size and duration
* @param duration in seconds
*/
static ShatteredTiles3D* create(float duration, const Size& gridSize, int range, bool shatterZ);
// Override
virtual ShatteredTiles3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
ShatteredTiles3D() {}
virtual ~ShatteredTiles3D() {}
/** initializes the action with a range, whether or not to shatter Z vertices, a grid size and duration */
/**
* initializes the action with a range, whether or not to shatter Z vertices, a grid size and duration */
bool initWithDuration(float duration, const Size& gridSize, int range, bool shatterZ);
protected:
@ -95,7 +111,10 @@ struct Tile;
class CC_DLL ShuffleTiles : public TiledGrid3DAction
{
public:
/** creates the action with a random seed, the grid size and the duration */
/**
* creates the action with a random seed, the grid size and the duration
* @param duration in seconds
*/
static ShuffleTiles* create(float duration, const Size& gridSize, unsigned int seed);
void shuffle(unsigned int *array, unsigned int len);
@ -104,6 +123,9 @@ public:
// Overrides
virtual void startWithTarget(Node *target) override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual ShuffleTiles* clone() const override;
@ -111,7 +133,10 @@ CC_CONSTRUCTOR_ACCESS:
ShuffleTiles() {}
virtual ~ShuffleTiles();
/** initializes the action with a random seed, the grid size and the duration */
/**
* initializes the action with a random seed, the grid size and the duration
* @param duration in seconds
*/
bool initWithDuration(float duration, const Size& gridSize, unsigned int seed);
protected:
@ -130,7 +155,10 @@ private:
class CC_DLL FadeOutTRTiles : public TiledGrid3DAction
{
public:
/** creates the action with the grid size and the duration */
/**
* creates the action with the grid size and the duration
* @param duration in seconds
*/
static FadeOutTRTiles* create(float duration, const Size& gridSize);
virtual float testFunc(const Size& pos, float time);
@ -139,6 +167,9 @@ public:
virtual void transformTile(const Vec2& pos, float distance);
// Overrides
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual FadeOutTRTiles* clone() const override;
@ -156,7 +187,10 @@ private:
class CC_DLL FadeOutBLTiles : public FadeOutTRTiles
{
public:
/** creates the action with the grid size and the duration */
/**
* creates the action with the grid size and the duration
* @param duration in seconds
*/
static FadeOutBLTiles* create(float duration, const Size& gridSize);
// Overrides
@ -177,7 +211,10 @@ private:
class CC_DLL FadeOutUpTiles : public FadeOutTRTiles
{
public:
/** creates the action with the grid size and the duration */
/**
* creates the action with the grid size and the duration
* @param duration in seconds
*/
static FadeOutUpTiles* create(float duration, const Size& gridSize);
virtual void transformTile(const Vec2& pos, float distance);
@ -200,7 +237,10 @@ private:
class CC_DLL FadeOutDownTiles : public FadeOutUpTiles
{
public:
/** creates the action with the grid size and the duration */
/**
* creates the action with the grid size and the duration
* @param duration in seconds
*/
static FadeOutDownTiles* create(float duration, const Size& gridSize);
// Overrides
@ -221,9 +261,15 @@ private:
class CC_DLL TurnOffTiles : public TiledGrid3DAction
{
public:
/** creates the action with the grid size and the duration */
/**
* creates the action with the grid size and the duration
* @param duration in seconds
*/
static TurnOffTiles* create(float duration, const Size& gridSize);
/** creates the action with a random seed, the grid size and the duration */
/**
* creates the action with a random seed, the grid size and the duration
* @param duration in seconds
*/
static TurnOffTiles* create(float duration, const Size& gridSize, unsigned int seed);
void shuffle(unsigned int *array, unsigned int len);
@ -255,7 +301,10 @@ private:
class CC_DLL WavesTiles3D : public TiledGrid3DAction
{
public:
/** creates the action with a number of waves, the waves amplitude, the grid size and the duration */
/**
* creates the action with a number of waves, the waves amplitude, the grid size and the duration
* @param duration in seconds
*/
static WavesTiles3D* create(float duration, const Size& gridSize, unsigned int waves, float amplitude);
/** waves amplitude */
@ -268,6 +317,9 @@ public:
// Override
virtual WavesTiles3D* clone() const override;
/**
* @param duration in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -292,7 +344,10 @@ private:
class CC_DLL JumpTiles3D : public TiledGrid3DAction
{
public:
/** creates the action with the number of jumps, the sin amplitude, the grid size and the duration */
/**
* creates the action with the number of jumps, the sin amplitude, the grid size and the duration
* @param duration in seconds
*/
static JumpTiles3D* create(float duration, const Size& gridSize, unsigned int numberOfJumps, float amplitude);
/** amplitude of the sin*/
@ -305,6 +360,9 @@ public:
// Override
virtual JumpTiles3D* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
CC_CONSTRUCTOR_ACCESS:
@ -327,7 +385,10 @@ private:
class CC_DLL SplitRows : public TiledGrid3DAction
{
public :
/** creates the action with the number of rows to split and the duration */
/**
* creates the action with the number of rows to split and the duration
* @param duration in seconds
*/
static SplitRows* create(float duration, unsigned int rows);
// Overrides
@ -354,11 +415,17 @@ private:
class CC_DLL SplitCols : public TiledGrid3DAction
{
public:
/** creates the action with the number of columns to split and the duration */
/**
* creates the action with the number of columns to split and the duration
* @param duration in seconds
*/
static SplitCols* create(float duration, unsigned int cols);
// Overrides
virtual SplitCols* clone() const override;
/**
* @param time in seconds
*/
virtual void update(float time) override;
virtual void startWithTarget(Node *target) override;

View File

@ -69,17 +69,26 @@ public:
class CC_DLL ActionTween : public ActionInterval
{
public:
/** creates an initializes the action with the property name (key), and the from and to parameters. */
/**
* creates an initializes the action with the property name (key), and the from and to parameters.
* @param duration in seconds
*/
static ActionTween* create(float duration, const std::string& key, float from, float to);
// Overrides
void startWithTarget(Node *target) override;
/**
* @param dt in seconds
*/
void update(float dt) override;
ActionTween* reverse() const override;
ActionTween *clone() const override;
CC_CONSTRUCTOR_ACCESS:
/** initializes the action with the property name (key), and the from and to parameters. */
/**
* initializes the action with the property name (key), and the from and to parameters.
* @param duration in seconds
*/
bool initWithDuration(float duration, const std::string& key, float from, float to);
protected:

View File

@ -144,11 +144,11 @@ DrawNode::~DrawNode()
if (Configuration::getInstance()->supportsShareableVAO())
{
GL::bindVAO(0);
glDeleteVertexArrays(1, &_vao);
glDeleteVertexArrays(1, &_vaoGLLine);
glDeleteVertexArrays(1, &_vaoGLPoint);
GL::bindVAO(0);
_vao = 0;
_vao = _vaoGLLine = _vaoGLPoint = 0;
}
}
@ -185,7 +185,7 @@ void DrawNode::ensureCapacityGLPoint(int count)
if(_bufferCountGLPoint + count > _bufferCapacityGLPoint)
{
_bufferCapacityGLPoint += MAX(_bufferCapacityGLPoint, count);
_bufferGLPoint = (V2F_C4B_PF*)realloc(_bufferGLPoint, _bufferCapacityGLPoint*sizeof(V2F_C4B_PF));
_bufferGLPoint = (V2F_C4B_T2F*)realloc(_bufferGLPoint, _bufferCapacityGLPoint*sizeof(V2F_C4B_T2F));
}
}
@ -214,60 +214,66 @@ bool DrawNode::init()
{
glGenVertexArrays(1, &_vao);
GL::bindVAO(_vao);
}
glGenBuffers(1, &_vbo);
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)* _bufferCapacity, _buffer, GL_STREAM_DRAW);
// vertex
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices));
// color
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors));
// texcood
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords));
if (Configuration::getInstance()->supportsShareableVAO())
{
glGenBuffers(1, &_vbo);
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)* _bufferCapacity, _buffer, GL_STREAM_DRAW);
// vertex
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices));
// color
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors));
// texcood
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords));
glGenVertexArrays(1, &_vaoGLLine);
GL::bindVAO(_vaoGLLine);
}
glGenBuffers(1, &_vboGLLine);
glBindBuffer(GL_ARRAY_BUFFER, _vboGLLine);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacityGLLine, _bufferGLLine, GL_STREAM_DRAW);
// vertex
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices));
// color
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors));
// texcood
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords));
if (Configuration::getInstance()->supportsShareableVAO())
{
glGenBuffers(1, &_vboGLLine);
glBindBuffer(GL_ARRAY_BUFFER, _vboGLLine);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacityGLLine, _bufferGLLine, GL_STREAM_DRAW);
// vertex
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices));
// color
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors));
// texcood
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords));
glGenVertexArrays(1, &_vaoGLPoint);
GL::bindVAO(_vaoGLPoint);
}
glGenBuffers(1, &_vboGLPoint);
glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_PF)*_bufferCapacityGLPoint, _bufferGLPoint, GL_STREAM_DRAW);
// vertex
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_PF), (GLvoid *)offsetof(V2F_C4B_PF, vertices));
// color
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_PF), (GLvoid *)offsetof(V2F_C4B_PF, colors));
// pointsize
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POINTSIZE);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POINTSIZE, 1, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_PF), (GLvoid *)offsetof(V2F_C4B_PF, pointSize));
glBindBuffer(GL_ARRAY_BUFFER, 0);
if (Configuration::getInstance()->supportsShareableVAO())
{
glGenBuffers(1, &_vboGLPoint);
glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacityGLPoint, _bufferGLPoint, GL_STREAM_DRAW);
// vertex
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_POSITION);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices));
// color
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_COLOR);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors));
// Texture coord as pointsize
glEnableVertexAttribArray(GLProgram::VERTEX_ATTRIB_TEX_COORD);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords));
GL::bindVAO(0);
glBindBuffer(GL_ARRAY_BUFFER, 0);
}
else
{
glGenBuffers(1, &_vbo);
glBindBuffer(GL_ARRAY_BUFFER, _vbo);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)* _bufferCapacity, _buffer, GL_STREAM_DRAW);
glGenBuffers(1, &_vboGLLine);
glBindBuffer(GL_ARRAY_BUFFER, _vboGLLine);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacityGLLine, _bufferGLLine, GL_STREAM_DRAW);
glGenBuffers(1, &_vboGLPoint);
glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacityGLPoint, _bufferGLPoint, GL_STREAM_DRAW);
}
CHECK_GL_ERROR_DEBUG();
@ -348,6 +354,11 @@ void DrawNode::onDraw(const Mat4 &transform, uint32_t flags)
glDrawArrays(GL_TRIANGLES, 0, _bufferCount);
glBindBuffer(GL_ARRAY_BUFFER, 0);
if (Configuration::getInstance()->supportsShareableVAO())
{
GL::bindVAO(0);
}
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1, _bufferCount);
CHECK_GL_ERROR_DEBUG();
}
@ -381,6 +392,12 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags)
}
glLineWidth(2);
glDrawArrays(GL_LINES, 0, _bufferCountGLLine);
if (Configuration::getInstance()->supportsShareableVAO())
{
GL::bindVAO(0);
}
glBindBuffer(GL_ARRAY_BUFFER, 0);
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLLine);
@ -389,14 +406,14 @@ void DrawNode::onDrawGLLine(const Mat4 &transform, uint32_t flags)
void DrawNode::onDrawGLPoint(const Mat4 &transform, uint32_t flags)
{
auto glProgram = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_COLOR_POINTSIZE);
auto glProgram = GLProgramCache::getInstance()->getGLProgram(GLProgram::SHADER_NAME_POSITION_COLOR_TEXASPOINTSIZE);
glProgram->use();
glProgram->setUniformsForBuiltins(transform);
if (_dirtyGLPoint)
{
glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_PF)*_bufferCapacityGLPoint, _bufferGLPoint, GL_STREAM_DRAW);
glBufferData(GL_ARRAY_BUFFER, sizeof(V2F_C4B_T2F)*_bufferCapacityGLPoint, _bufferGLPoint, GL_STREAM_DRAW);
_dirtyGLPoint = false;
}
@ -408,13 +425,19 @@ void DrawNode::onDrawGLPoint(const Mat4 &transform, uint32_t flags)
else
{
glBindBuffer(GL_ARRAY_BUFFER, _vboGLPoint);
GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_COLOR);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_PF), (GLvoid *)offsetof(V2F_C4B_PF, vertices));
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_PF), (GLvoid *)offsetof(V2F_C4B_PF, colors));
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POINTSIZE, 1, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_PF), (GLvoid *)offsetof(V2F_C4B_PF, pointSize));
GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POS_COLOR_TEX);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, vertices));
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_UNSIGNED_BYTE, GL_TRUE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, colors));
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_TEX_COORD, 2, GL_FLOAT, GL_FALSE, sizeof(V2F_C4B_T2F), (GLvoid *)offsetof(V2F_C4B_T2F, texCoords));
}
glDrawArrays(GL_POINTS, 0, _bufferCountGLPoint);
if (Configuration::getInstance()->supportsShareableVAO())
{
GL::bindVAO(0);
}
glBindBuffer(GL_ARRAY_BUFFER, 0);
CC_INCREMENT_GL_DRAWN_BATCHES_AND_VERTICES(1,_bufferCountGLPoint);
@ -425,8 +448,8 @@ void DrawNode::drawPoint(const Vec2& position, const float pointSize, const Colo
{
ensureCapacityGLPoint(1);
V2F_C4B_PF *point = (V2F_C4B_PF*)(_bufferGLPoint + _bufferCountGLPoint);
V2F_C4B_PF a = {position, Color4B(color), pointSize};
V2F_C4B_T2F *point = (V2F_C4B_T2F*)(_bufferGLPoint + _bufferCountGLPoint);
V2F_C4B_T2F a = {position, Color4B(color), Tex2F(pointSize,0)};
*point = a;
_bufferCountGLPoint += 1;
@ -442,11 +465,11 @@ void DrawNode::drawPoints(const Vec2 *position, unsigned int numberOfPoints, con
{
ensureCapacityGLPoint(numberOfPoints);
V2F_C4B_PF *point = (V2F_C4B_PF*)(_bufferGLPoint + _bufferCountGLPoint);
V2F_C4B_T2F *point = (V2F_C4B_T2F*)(_bufferGLPoint + _bufferCountGLPoint);
for(unsigned int i=0; i < numberOfPoints; i++,point++)
{
V2F_C4B_PF a = {position[i], Color4B(color), pointSize};
V2F_C4B_T2F a = {position[i], Color4B(color), Tex2F(pointSize,0)};
*point = a;
}

View File

@ -154,7 +154,7 @@ protected:
int _bufferCapacityGLPoint;
GLsizei _bufferCountGLPoint;
V2F_C4B_PF *_bufferGLPoint;
V2F_C4B_T2F *_bufferGLPoint;
Color4F _pointColor;
int _pointSize;

View File

@ -154,7 +154,7 @@ void TMXLayer::draw(Renderer *renderer, const Mat4& transform, uint32_t flags)
_dirty = false;
}
if(_renderCommands.size() < _primitives.size())
if(_renderCommands.size() < static_cast<size_t>(_primitives.size()))
{
_renderCommands.resize(_primitives.size());
}

View File

@ -36,7 +36,8 @@ NS_CC_BEGIN
const int FontAtlas::CacheTextureWidth = 512;
const int FontAtlas::CacheTextureHeight = 512;
const char* FontAtlas::EVENT_PURGE_TEXTURES = "__cc_FontAtlasPurgeTextures";
const char* FontAtlas::CMD_PURGE_FONTATLAS = "__cc_PURGE_FONTATLAS";
const char* FontAtlas::CMD_RESET_FONTATLAS = "__cc_RESET_FONTATLAS";
FontAtlas::FontAtlas(Font &theFont)
: _font(&theFont)
@ -44,7 +45,6 @@ FontAtlas::FontAtlas(Font &theFont)
, _fontAscender(0)
, _rendererRecreatedListener(nullptr)
, _antialiasEnabled(true)
, _rendererRecreate(false)
{
_font->retain();
@ -122,25 +122,9 @@ void FontAtlas::purgeTexturesAtlas()
FontFreeType* fontTTf = dynamic_cast<FontFreeType*>(_font);
if (fontTTf && _atlasTextures.size() > 1)
{
for( auto &item: _atlasTextures)
{
if (item.first != 0)
{
item.second->release();
}
}
auto temp = _atlasTextures[0];
_atlasTextures.clear();
_atlasTextures[0] = temp;
_fontLetterDefinitions.clear();
memset(_currentPageData,0,_currentPageDataSize);
_currentPage = 0;
_currentPageOrigX = 0;
_currentPageOrigY = 0;
auto eventDispatcher = Director::getInstance()->getEventDispatcher();
eventDispatcher->dispatchCustomEvent(EVENT_PURGE_TEXTURES,this);
eventDispatcher->dispatchCustomEvent(CMD_PURGE_FONTATLAS,this);
eventDispatcher->dispatchCustomEvent(CMD_RESET_FONTATLAS,this);
}
}
@ -149,27 +133,9 @@ void FontAtlas::listenRendererRecreated(EventCustom *event)
FontFreeType* fontTTf = dynamic_cast<FontFreeType*>(_font);
if (fontTTf)
{
for( auto &item: _atlasTextures)
{
if (item.first != 0)
{
item.second->release();
}
}
auto temp = _atlasTextures[0];
_atlasTextures.clear();
_atlasTextures[0] = temp;
_fontLetterDefinitions.clear();
memset(_currentPageData,0,_currentPageDataSize);
_currentPage = 0;
_currentPageOrigX = 0;
_currentPageOrigY = 0;
_rendererRecreate = true;
auto eventDispatcher = Director::getInstance()->getEventDispatcher();
eventDispatcher->dispatchCustomEvent(EVENT_PURGE_TEXTURES,this);
_rendererRecreate = false;
eventDispatcher->dispatchCustomEvent(CMD_PURGE_FONTATLAS,this);
eventDispatcher->dispatchCustomEvent(CMD_RESET_FONTATLAS,this);
}
}
@ -309,25 +275,17 @@ bool FontAtlas::prepareLetterDefinitions(const std::u16string& utf16String)
if(existNewLetter)
{
if (_rendererRecreate)
unsigned char *data = nullptr;
if(pixelFormat == Texture2D::PixelFormat::AI88)
{
_atlasTextures[_currentPage]->initWithData(_currentPageData, _currentPageDataSize,
pixelFormat, CacheTextureWidth, CacheTextureHeight, Size(CacheTextureWidth,CacheTextureHeight) );
}
data = _currentPageData + CacheTextureWidth * (int)startY * 2;
}
else
{
unsigned char *data = nullptr;
if(pixelFormat == Texture2D::PixelFormat::AI88)
{
data = _currentPageData + CacheTextureWidth * (int)startY * 2;
}
else
{
data = _currentPageData + CacheTextureWidth * (int)startY;
}
_atlasTextures[_currentPage]->updateWithData(data, 0, startY,
CacheTextureWidth, _currentPageOrigY - startY + _commonLineHeight);
data = _currentPageData + CacheTextureWidth * (int)startY;
}
_atlasTextures[_currentPage]->updateWithData(data, 0, startY,
CacheTextureWidth, _currentPageOrigY - startY + _commonLineHeight);
}
return true;
}

View File

@ -61,7 +61,8 @@ class CC_DLL FontAtlas : public Ref
public:
static const int CacheTextureWidth;
static const int CacheTextureHeight;
static const char* EVENT_PURGE_TEXTURES;
static const char* CMD_PURGE_FONTATLAS;
static const char* CMD_RESET_FONTATLAS;
/**
* @js ctor
*/
@ -125,7 +126,6 @@ protected:
int _fontAscender;
EventListenerCustom* _rendererRecreatedListener;
bool _antialiasEnabled;
bool _rendererRecreate;
};

View File

@ -148,11 +148,11 @@ public:
private:
std::set<unsigned int>* parseConfigFile(const std::string& controlFile);
std::set<unsigned int>* parseBinaryConfigFile(unsigned char* pData, unsigned long size, const std::string& controlFile);
void parseCharacterDefinition(std::string line, BMFontDef *characterDefinition);
void parseInfoArguments(std::string line);
void parseCommonArguments(std::string line);
void parseImageFileName(std::string line, const std::string& fntFile);
void parseKerningEntry(std::string line);
void parseCharacterDefinition(const char* line, BMFontDef *characterDefinition);
void parseInfoArguments(const char* line);
void parseCommonArguments(const char* line);
void parseImageFileName(const char* line, const std::string& fntFile);
void parseKerningEntry(const char* line);
void purgeKerningDictionary();
void purgeFontDefDictionary();
};
@ -206,7 +206,7 @@ bool BMFontConfiguration::initWithFNTfile(const std::string& FNTfile)
_fontDefDictionary = nullptr;
_characterSet = this->parseConfigFile(FNTfile);
if (! _characterSet)
{
return false;
@ -271,48 +271,49 @@ void BMFontConfiguration::purgeFontDefDictionary()
}
std::set<unsigned int>* BMFontConfiguration::parseConfigFile(const std::string& controlFile)
{
std::string fullpath = FileUtils::getInstance()->fullPathForFilename(controlFile);
Data data = FileUtils::getInstance()->getDataFromFile(fullpath);
CCASSERT((!data.isNull() && data.getSize() > 0), "BMFontConfiguration::parseConfigFile | Open file error.");
{
Data data = FileUtils::getInstance()->getDataFromFile(controlFile);
CCASSERT((!data.isNull()), "BMFontConfiguration::parseConfigFile | Open file error.");
if (memcmp("BMF", data.getBytes(), 3) == 0) {
std::set<unsigned int>* ret = parseBinaryConfigFile(data.getBytes(), data.getSize(), controlFile);
return ret;
}
std::string contents((const char*)data.getBytes(), data.getSize());
std::set<unsigned int> *validCharsString = new std::set<unsigned int>();
if (contents.empty())
auto contents = (const char*)data.getBytes();
if (contents[0] == 0)
{
CCLOG("cocos2d: Error parsing FNTfile %s", controlFile.c_str());
return nullptr;
}
// parse spacing / padding
std::string line;
std::string strLeft(contents);
while (strLeft.length() > 0)
std::set<unsigned int> *validCharsString = new std::set<unsigned int>();
auto contentsLen = data.getSize();
char line[512];
auto next = strchr(contents, '\n');
auto base = contents;
int lineLength = 0;
int parseCount = 0;
while (next)
{
size_t pos = strLeft.find('\n');
lineLength = next - base;
memcpy(line, contents + parseCount, lineLength);
line[lineLength] = 0;
if (pos != std::string::npos)
parseCount += lineLength + 1;
if (parseCount < contentsLen)
{
// the data is more than a line.get one line
line = strLeft.substr(0, pos);
strLeft = strLeft.substr(pos + 1);
}
base = next + 1;
next = strchr(base, '\n');
}
else
{
// get the left data
line = strLeft;
strLeft.erase();
next = nullptr;
}
if(line.substr(0,strlen("info face")) == "info face")
if (memcmp(line, "info face", 9) == 0)
{
// FIXME: info parsing is incomplete
// Not needed for the Hiero editors, but needed for the AngelCode editor
@ -320,19 +321,19 @@ std::set<unsigned int>* BMFontConfiguration::parseConfigFile(const std::string&
this->parseInfoArguments(line);
}
// Check to see if the start of the line is something we are interested in
else if(line.substr(0,strlen("common lineHeight")) == "common lineHeight")
else if (memcmp(line, "common lineHeight", 17) == 0)
{
this->parseCommonArguments(line);
}
else if(line.substr(0,strlen("page id")) == "page id")
else if (memcmp(line, "page id", 7) == 0)
{
this->parseImageFileName(line, controlFile);
}
else if(line.substr(0,strlen("chars c")) == "chars c")
else if (memcmp(line, "chars c", 7) == 0)
{
// Ignore this line
}
else if(line.substr(0,strlen("char")) == "char")
else if (memcmp(line, "char", 4) == 0)
{
// Parse the current line and create a new CharDef
tFontDefHashElement* element = (tFontDefHashElement*)malloc( sizeof(*element) );
@ -347,7 +348,7 @@ std::set<unsigned int>* BMFontConfiguration::parseConfigFile(const std::string&
// {
// this->parseKerningCapacity(line);
// }
else if(line.substr(0,strlen("kerning first")) == "kerning first")
else if (memcmp(line, "kerning first", 13) == 0)
{
this->parseKerningEntry(line);
}
@ -514,7 +515,7 @@ std::set<unsigned int>* BMFontConfiguration::parseBinaryConfigFile(unsigned char
return validCharsString;
}
void BMFontConfiguration::parseImageFileName(std::string line, const std::string& fntFile)
void BMFontConfiguration::parseImageFileName(const char* line, const std::string& fntFile)
{
//////////////////////////////////////////////////////////////////////////
// line to parse:
@ -522,19 +523,16 @@ void BMFontConfiguration::parseImageFileName(std::string line, const std::string
//////////////////////////////////////////////////////////////////////////
// page ID. Sanity check
auto index = line.find('=')+1;
auto index2 = line.find(' ', index);
std::string value = line.substr(index, index2-index);
CCASSERT(atoi(value.c_str()) == 0, "LabelBMFont file could not be found");
int pageId;
sscanf(line, "page id=%d", &pageId);
CCASSERT(pageId == 0, "LabelBMFont file could not be found");
// file
index = line.find('"')+1;
index2 = line.find('"', index);
value = line.substr(index, index2-index);
_atlasName = FileUtils::getInstance()->fullPathFromRelativeFile(value.c_str(), fntFile);
char fileName[255];
sscanf(strchr(line,'"') + 1, "%[^\"]", fileName);
_atlasName = FileUtils::getInstance()->fullPathFromRelativeFile(fileName, fntFile);
}
void BMFontConfiguration::parseInfoArguments(std::string line)
void BMFontConfiguration::parseInfoArguments(const char* line)
{
//////////////////////////////////////////////////////////////////////////
// possible lines to parse:
@ -543,45 +541,42 @@ void BMFontConfiguration::parseInfoArguments(std::string line)
//////////////////////////////////////////////////////////////////////////
// padding
auto index = line.find("padding=");
auto index2 = line.find(' ', index);
std::string value = line.substr(index, index2-index);
sscanf(value.c_str(), "padding=%d,%d,%d,%d", &_padding.top, &_padding.right, &_padding.bottom, &_padding.left);
CCLOG("cocos2d: padding: %d,%d,%d,%d", _padding.left, _padding.top, _padding.right, _padding.bottom);
sscanf(strstr(line,"padding=") + 8, "%d,%d,%d,%d", &_padding.top, &_padding.right, &_padding.bottom, &_padding.left);
//CCLOG("cocos2d: padding: %d,%d,%d,%d", _padding.left, _padding.top, _padding.right, _padding.bottom);
}
void BMFontConfiguration::parseCommonArguments(std::string line)
void BMFontConfiguration::parseCommonArguments(const char* line)
{
//////////////////////////////////////////////////////////////////////////
// line to parse:
// common lineHeight=104 base=26 scaleW=1024 scaleH=512 pages=1 packed=0
//////////////////////////////////////////////////////////////////////////
// Height
auto index = line.find("lineHeight=");
auto index2 = line.find(' ', index);
std::string value = line.substr(index, index2-index);
sscanf(value.c_str(), "lineHeight=%d", &_commonHeight);
auto tmp = strstr(line, "lineHeight=") + 11;
sscanf(tmp, "%d", &_commonHeight);
// scaleW. sanity check
index = line.find("scaleW=") + strlen("scaleW=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
CCASSERT(atoi(value.c_str()) <= Configuration::getInstance()->getMaxTextureSize(), "CCLabelBMFont: page can't be larger than supported");
int value;
tmp = strstr(tmp, "scaleW=") + 7;
sscanf(tmp, "%d", &value);
int maxTextureSize = Configuration::getInstance()->getMaxTextureSize();
CCASSERT(value <= maxTextureSize, "CCLabelBMFont: page can't be larger than supported");
// scaleH. sanity check
index = line.find("scaleH=") + strlen("scaleH=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
CCASSERT(atoi(value.c_str()) <= Configuration::getInstance()->getMaxTextureSize(), "CCLabelBMFont: page can't be larger than supported");
tmp = strstr(tmp, "scaleH=") + 7;
sscanf(tmp, "%d", &value);
CCASSERT(value <= maxTextureSize, "CCLabelBMFont: page can't be larger than supported");
// pages. sanity check
index = line.find("pages=") + strlen("pages=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
CCASSERT(atoi(value.c_str()) == 1, "CCBitfontAtlas: only supports 1 page");
tmp = strstr(tmp, "pages=") + 6;
sscanf(tmp, "%d", &value);
CCASSERT(value == 1, "CCBitfontAtlas: only supports 1 page");
// packed (ignore) What does this mean ??
}
void BMFontConfiguration::parseCharacterDefinition(std::string line, BMFontDef *characterDefinition)
void BMFontConfiguration::parseCharacterDefinition(const char* line, BMFontDef *characterDefinition)
{
//////////////////////////////////////////////////////////////////////////
// line to parse:
@ -589,75 +584,48 @@ void BMFontConfiguration::parseCharacterDefinition(std::string line, BMFontDef *
//////////////////////////////////////////////////////////////////////////
// Character ID
auto index = line.find("id=");
auto index2 = line.find(' ', index);
std::string value = line.substr(index, index2-index);
sscanf(value.c_str(), "id=%u", &characterDefinition->charID);
auto tmp = strstr(line, "id=") + 3;
sscanf(tmp, "%u", &characterDefinition->charID);
// Character x
index = line.find("x=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
sscanf(value.c_str(), "x=%f", &characterDefinition->rect.origin.x);
tmp = strstr(tmp, "x=") + 2;
sscanf(tmp, "%f", &characterDefinition->rect.origin.x);
// Character y
index = line.find("y=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
sscanf(value.c_str(), "y=%f", &characterDefinition->rect.origin.y);
tmp = strstr(tmp, "y=") + 2;
sscanf(tmp, "%f", &characterDefinition->rect.origin.y);
// Character width
index = line.find("width=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
sscanf(value.c_str(), "width=%f", &characterDefinition->rect.size.width);
tmp = strstr(tmp, "width=") + 6;
sscanf(tmp, "%f", &characterDefinition->rect.size.width);
// Character height
index = line.find("height=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
sscanf(value.c_str(), "height=%f", &characterDefinition->rect.size.height);
tmp = strstr(tmp, "height=") + 7;
sscanf(tmp, "%f", &characterDefinition->rect.size.height);
// Character xoffset
index = line.find("xoffset=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
sscanf(value.c_str(), "xoffset=%hd", &characterDefinition->xOffset);
tmp = strstr(tmp, "xoffset=") + 8;
sscanf(tmp, "%hd", &characterDefinition->xOffset);
// Character yoffset
index = line.find("yoffset=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
sscanf(value.c_str(), "yoffset=%hd", &characterDefinition->yOffset);
tmp = strstr(tmp, "yoffset=") + 8;
sscanf(tmp, "%hd", &characterDefinition->yOffset);
// Character xadvance
index = line.find("xadvance=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
sscanf(value.c_str(), "xadvance=%hd", &characterDefinition->xAdvance);
tmp = strstr(tmp, "xadvance=") + 9;
sscanf(tmp, "%hd", &characterDefinition->xAdvance);
}
void BMFontConfiguration::parseKerningEntry(std::string line)
void BMFontConfiguration::parseKerningEntry(const char* line)
{
//////////////////////////////////////////////////////////////////////////
// line to parse:
// kerning first=121 second=44 amount=-7
//////////////////////////////////////////////////////////////////////////
// first
int first;
auto index = line.find("first=");
auto index2 = line.find(' ', index);
std::string value = line.substr(index, index2-index);
sscanf(value.c_str(), "first=%d", &first);
int first, second, amount;
auto tmp = strstr(line, "first=") + 6;
sscanf(tmp, "%d", &first);
// second
int second;
index = line.find("second=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
sscanf(value.c_str(), "second=%d", &second);
tmp = strstr(tmp, "second=") + 7;
sscanf(tmp, "%d", &second);
// amount
int amount;
index = line.find("amount=");
index2 = line.find(' ', index);
value = line.substr(index, index2-index);
sscanf(value.c_str(), "amount=%d", &amount);
tmp = strstr(tmp, "amount=") + 7;
sscanf(tmp, "%d", &amount);
tKerningHashElement *element = (tKerningHashElement *)calloc( sizeof( *element ), 1 );
element->amount = amount;

View File

@ -317,10 +317,10 @@ void Grid3D::beforeBlit()
{
if(_needDepthTestForBlit)
{
_oldDepthTestValue = glIsEnabled(GL_DEPTH_TEST);
_oldDepthTestValue = glIsEnabled(GL_DEPTH_TEST) != GL_FALSE;
GLboolean depthWriteMask;
glGetBooleanv(GL_DEPTH_WRITEMASK, &depthWriteMask);
_oldDepthWriteValue = depthWriteMask;
_oldDepthWriteValue = depthWriteMask != GL_FALSE;
CHECK_GL_ERROR_DEBUG();
glEnable(GL_DEPTH_TEST);
glDepthMask(true);

View File

@ -36,7 +36,6 @@
#include "base/CCEventListenerCustom.h"
#include "base/CCEventDispatcher.h"
#include "base/CCEventCustom.h"
#include "deprecated/CCString.h"
NS_CC_BEGIN
@ -245,10 +244,10 @@ Label::Label(FontAtlas *atlas /* = nullptr */, TextHAlignment hAlignment /* = Te
, _commonLineHeight(0.0f)
, _lineBreakWithoutSpaces(false)
, _horizontalKernings(nullptr)
, _maxLineWidth(0)
, _maxLineWidth(0.0f)
, _labelDimensions(Size::ZERO)
, _labelWidth(0)
, _labelHeight(0)
, _labelWidth(0.0f)
, _labelHeight(0.0f)
, _hAlignment(hAlignment)
, _vAlignment(vAlignment)
, _currNumLines(-1)
@ -263,24 +262,29 @@ Label::Label(FontAtlas *atlas /* = nullptr */, TextHAlignment hAlignment /* = Te
setAnchorPoint(Vec2::ANCHOR_MIDDLE);
reset();
auto purgeTextureListener = EventListenerCustom::create(FontAtlas::EVENT_PURGE_TEXTURES, [this](EventCustom* event){
auto purgeTextureListener = EventListenerCustom::create(FontAtlas::CMD_PURGE_FONTATLAS, [this](EventCustom* event){
if (_fontAtlas && _currentLabelType == LabelType::TTF && event->getUserData() == _fontAtlas)
{
Node::removeAllChildrenWithCleanup(true);
_batchNodes.clear();
_batchNodes.push_back(this);
if (_contentDirty)
if (_fontAtlas)
{
updateContent();
}
else
{
alignText();
FontAtlasCache::releaseFontAtlas(_fontAtlas);
}
}
});
_eventDispatcher->addEventListenerWithSceneGraphPriority(purgeTextureListener, this);
auto resetTextureListener = EventListenerCustom::create(FontAtlas::CMD_RESET_FONTATLAS, [this](EventCustom* event){
if (_fontAtlas && _currentLabelType == LabelType::TTF && event->getUserData() == _fontAtlas)
{
_fontAtlas = nullptr;
this->setTTFConfig(_fontConfig);
}
});
_eventDispatcher->addEventListenerWithSceneGraphPriority(resetTextureListener, this);
}
Label::~Label()
@ -496,7 +500,7 @@ void Label::setAlignment(TextHAlignment hAlignment,TextVAlignment vAlignment)
}
}
void Label::setMaxLineWidth(unsigned int maxLineWidth)
void Label::setMaxLineWidth(float maxLineWidth)
{
if (_labelWidth == 0 && _maxLineWidth != maxLineWidth)
{
@ -505,7 +509,7 @@ void Label::setMaxLineWidth(unsigned int maxLineWidth)
}
}
void Label::setDimensions(unsigned int width, unsigned int height)
void Label::setDimensions(float width, float height)
{
if (height != _labelHeight || width != _labelWidth)
{
@ -991,6 +995,7 @@ void Label::updateContent()
_fontDefinition._fontFillColor.r = _textColor.r;
_fontDefinition._fontFillColor.g = _textColor.g;
_fontDefinition._fontFillColor.b = _textColor.b;
_fontDefinition._fontAlpha = _textColor.a;
_fontDefinition._shadow._shadowEnabled = false;
@ -1001,6 +1006,7 @@ void Label::updateContent()
_fontDefinition._stroke._strokeColor.r = _effectColor.r;
_fontDefinition._stroke._strokeColor.g = _effectColor.g;
_fontDefinition._stroke._strokeColor.b = _effectColor.b;
_fontDefinition._stroke._strokeAlpha = _effectColor.a;
}
else
{

View File

@ -183,25 +183,25 @@ public:
* The label's max line width be used for force line breaks if the set value not equal zero.
* The label's width and max line width has not always to be equal.
*/
void setMaxLineWidth(unsigned int maxLineWidth);
unsigned int getMaxLineWidth() { return _maxLineWidth;}
void setMaxLineWidth(float maxLineWidth);
float getMaxLineWidth() { return _maxLineWidth; }
/** Sets the untransformed size of the label.
* The label's width be used for text align if the set value not equal zero.
* The label's max line width will be equal to the same value.
*/
void setWidth(unsigned int width) { setDimensions(width,_labelHeight);}
unsigned int getWidth() const { return _labelWidth; }
void setWidth(float width) { setDimensions(width,_labelHeight);}
float getWidth() const { return _labelWidth; }
/** Sets the untransformed size of the label.
* The label's height be used for text align if the set value not equal zero.
* The text will display of incomplete when the size of label not enough to support display all text.
*/
void setHeight(unsigned int height){ setDimensions(_labelWidth,height);}
unsigned int getHeight() const { return _labelHeight;}
void setHeight(float height){ setDimensions(_labelWidth, height); }
float getHeight() const { return _labelHeight; }
/** Sets the untransformed size of the label in a more efficient way. */
void setDimensions(unsigned int width,unsigned int height);
void setDimensions(float width, float height);
const Size& getDimensions() const{ return _labelDimensions;}
/** update content immediately.*/
@ -365,10 +365,10 @@ protected:
bool _lineBreakWithoutSpaces;
int * _horizontalKernings;
unsigned int _maxLineWidth;
Size _labelDimensions;
unsigned int _labelWidth;
unsigned int _labelHeight;
float _maxLineWidth;
Size _labelDimensions;
float _labelWidth;
float _labelHeight;
TextHAlignment _hAlignment;
TextVAlignment _vAlignment;

View File

@ -594,8 +594,9 @@ void LayerColor::onDraw(const Mat4& transform, uint32_t flags)
{
getGLProgram()->use();
getGLProgram()->setUniformsForBuiltins(transform);
GL::enableVertexAttribs( GL::VERTEX_ATTRIB_FLAG_POSITION | GL::VERTEX_ATTRIB_FLAG_COLOR );
//
// Attributes
//
@ -606,10 +607,11 @@ void LayerColor::onDraw(const Mat4& transform, uint32_t flags)
setGLBufferData(_squareColors, 4 * sizeof(Color4F), 1);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, 0);
#else
glBindBuffer(GL_ARRAY_BUFFER, 0);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_POSITION, 3, GL_FLOAT, GL_FALSE, 0, _noMVPVertices);
glVertexAttribPointer(GLProgram::VERTEX_ATTRIB_COLOR, 4, GL_FLOAT, GL_FALSE, 0, _squareColors);
#endif // EMSCRIPTEN
GL::blendFunc( _blendFunc.src, _blendFunc.dst );
glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

View File

@ -1280,7 +1280,7 @@ uint32_t Node::processParentFlags(const Mat4& parentTransform, uint32_t parentFl
bool Node::isVisitableByVisitingCamera() const
{
auto camera = Camera::getVisitingCamera();
bool visibleByCamera = camera ? (unsigned short)camera->getCameraFlag() & _cameraMask : true;
bool visibleByCamera = camera ? ((unsigned short)camera->getCameraFlag() & _cameraMask) != 0 : true;
return visibleByCamera;
}
@ -1695,48 +1695,53 @@ const Mat4& Node::getNodeToParentTransform() const
float x = _position.x;
float y = _position.y;
float z = _positionZ;
if (_ignoreAnchorPointForPosition)
{
x += _anchorPointInPoints.x;
y += _anchorPointInPoints.y;
}
bool needsSkewMatrix = ( _skewX || _skewY );
// Rotation values
// Change rotation code to handle X and Y
// If we skew with the exact same value for both x and y then we're simply just rotating
float cx = 1, sx = 0, cy = 1, sy = 0;
if (_rotationZ_X != _rotationZ_Y || (! needsSkewMatrix && !_anchorPointInPoints.equals(Vec2::ZERO)))
{
float radiansX = -CC_DEGREES_TO_RADIANS(_rotationZ_X);
float radiansY = -CC_DEGREES_TO_RADIANS(_rotationZ_Y);
cx = cosf(radiansX);
sx = sinf(radiansX);
cy = cosf(radiansY);
sy = sinf(radiansY);
}
Vec2 anchorPoint(_anchorPointInPoints.x * _scaleX, _anchorPointInPoints.y * _scaleY);
// optimization:
// inline anchor point calculation if skew is not needed
// Adjusted transform calculation for rotational skew
// caculate real position
if (! needsSkewMatrix && !_anchorPointInPoints.equals(Vec2::ZERO))
{
x += cy * -anchorPoint.x + -sx * -anchorPoint.y;
y += sy * -anchorPoint.x + cx * -anchorPoint.y;
x += -anchorPoint.x;
y += -anchorPoint.y;
}
// Build Transform Matrix
// Adjusted transform calculation for rotational skew
// Build Transform Matrix = translation * rotation * scale
Mat4 translation;
//move to anchor point first, then rotate
Mat4::createTranslation(x + anchorPoint.x, y + anchorPoint.y, z, &translation);
Mat4::createRotation(_rotationQuat, &_transform);
if (_rotationZ_X != _rotationZ_Y)
{
// Rotation values
// Change rotation code to handle X and Y
// If we skew with the exact same value for both x and y then we're simply just rotating
float radiansX = -CC_DEGREES_TO_RADIANS(_rotationZ_X);
float radiansY = -CC_DEGREES_TO_RADIANS(_rotationZ_Y);
float cx = cosf(radiansX);
float sx = sinf(radiansX);
float cy = cosf(radiansY);
float sy = sinf(radiansY);
float m0 = _transform.m[0], m1 = _transform.m[1], m4 = _transform.m[4], m5 = _transform.m[5], m8 = _transform.m[8], m9 = _transform.m[9];
_transform.m[0] = cy * m0 - sx * m1, _transform.m[4] = cy * m4 - sx * m5, _transform.m[8] = cy * m8 - sx * m9;
_transform.m[1] = sy * m0 + cx * m1, _transform.m[5] = sy * m4 + cx * m5, _transform.m[9] = sy * m8 + cx * m9;
}
_transform = translation * _transform;
//move by (-anchorPoint.x, -anchorPoint.y, 0) after rotation
_transform.translate(-anchorPoint.x, -anchorPoint.y, 0);
if (_scaleX != 1.f)
{
_transform.m[0] *= _scaleX, _transform.m[1] *= _scaleX, _transform.m[2] *= _scaleX;
@ -1749,7 +1754,6 @@ const Mat4& Node::getNodeToParentTransform() const
{
_transform.m[8] *= _scaleZ, _transform.m[9] *= _scaleZ, _transform.m[10] *= _scaleZ;
}
_transform.m[12] = x, _transform.m[13] = y, _transform.m[14] = z;
// FIXME:: Try to inline skew
// If skew is needed, apply skew and then anchor point
@ -1763,9 +1767,9 @@ const Mat4& Node::getNodeToParentTransform() const
0, 0, 0, 1
};
Mat4 skewMatrix(skewMatArray);
_transform = _transform * skewMatrix;
// adjust anchor point
if (!_anchorPointInPoints.equals(Vec2::ZERO))
{
@ -1775,15 +1779,15 @@ const Mat4& Node::getNodeToParentTransform() const
_transform.m[13] += _transform.m[1] * -_anchorPointInPoints.x + _transform.m[5] * -_anchorPointInPoints.y;
}
}
if (_useAdditionalTransform)
{
_transform = _transform * _additionalTransform;
}
_transformDirty = false;
}
return _transform;
}

View File

@ -235,10 +235,18 @@ void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist, const s
void SpriteFrameCache::addSpriteFramesWithFile(const std::string& plist)
{
CCASSERT(plist.size()>0, "plist filename should not be nullptr");
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist);
if (fullPath.size() == 0)
{
// return if plist file doesn't exist
CCLOG("cocos2d: SpriteFrameCache: can not find %s", plist.c_str());
return;
}
if (_loadedFileNames->find(plist) == _loadedFileNames->end())
{
std::string fullPath = FileUtils::getInstance()->fullPathForFilename(plist);
ValueMap dict = FileUtils::getInstance()->getValueMapFromFile(fullPath);
string texturePath("");

View File

@ -82,62 +82,212 @@ namespace tweenfunc {
//tween functions for CCActionEase
/**
* @param time in seconds.
*/
float CC_DLL easeIn(float time, float rate);
/**
* @param time in seconds.
*/
float CC_DLL easeOut(float time, float rate);
/**
* @param time in seconds.
*/
float CC_DLL easeInOut(float time, float rate);
/**
* @param time in seconds.
*/
float CC_DLL bezieratFunction( float a, float b, float c, float d, float t );
/**
* @param time in seconds.
*/
float CC_DLL quadraticIn(float time);
/**
* @param time in seconds.
*/
float CC_DLL quadraticOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL quadraticInOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL quadraticInOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL tweenTo(float time, TweenType type, float *easingParam);
/**
* @param time in seconds.
*/
float CC_DLL linear(float time);
/**
* @param time in seconds.
*/
float CC_DLL sineEaseIn(float time);
/**
* @param time in seconds.
*/
float CC_DLL sineEaseOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL sineEaseInOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL quadEaseIn(float time);
/**
* @param time in seconds.
*/
float CC_DLL quadEaseOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL quadEaseInOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL cubicEaseIn(float time);
/**
* @param time in seconds.
*/
float CC_DLL cubicEaseOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL cubicEaseInOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL quartEaseIn(float time);
/**
* @param time in seconds.
*/
float CC_DLL quartEaseOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL quartEaseInOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL quintEaseIn(float time);
/**
* @param time in seconds.
*/
float CC_DLL quintEaseOut(float time);
/**
@param time in seconds.
*/
float CC_DLL quintEaseInOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL expoEaseIn(float time);
/**
@param time in seconds.
*/
float CC_DLL expoEaseOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL expoEaseInOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL circEaseIn(float time);
/**
* @param time in seconds.
*/
float CC_DLL circEaseOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL circEaseInOut(float time);
/**
* @param time in seconds.
* @param period in seconds.
*/
float CC_DLL elasticEaseIn(float time, float period);
/**
* @param time in seconds.
* @param period in seconds.
*/
float CC_DLL elasticEaseOut(float time, float period);
/**
* @param time in seconds.
* @param period in seconds.
*/
float CC_DLL elasticEaseInOut(float time, float period);
/**
* @param time in seconds.
*/
float CC_DLL backEaseIn(float time);
/**
* @param time in seconds.
*/
float CC_DLL backEaseOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL backEaseInOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL bounceEaseIn(float time);
/**
* @param time in seconds.
*/
float CC_DLL bounceEaseOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL bounceEaseInOut(float time);
/**
* @param time in seconds.
*/
float CC_DLL customEase(float time, float *easingParam);
}

View File

@ -43,6 +43,7 @@ Animate3D* Animate3D::create(Animation3D* animation)
animate->autorelease();
animate->setDuration(animation->getDuration());
animate->setOriginInterval(animation->getDuration());
return animate;
}
@ -58,6 +59,7 @@ Animate3D* Animate3D::create(Animation3D* animation, float fromTime, float durat
animate->_start = fromTime / fullDuration;
animate->_last = duration / fullDuration;
animate->setDuration(duration);
animate->setOriginInterval(duration);
return animate;
}
@ -85,7 +87,7 @@ Animate3D* Animate3D::clone() const
copy->_last = _last;
copy->_playReverse = _playReverse;
copy->setDuration(animate->getDuration());
copy->setOriginInterval(animate->getOriginInterval());
return copy;
}
@ -160,7 +162,7 @@ void Animate3D::stop()
//! called every frame with it's delta time. DON'T override unless you know what you are doing.
void Animate3D::step(float dt)
{
ActionInterval::step(dt * _absSpeed);
ActionInterval::step(dt);
}
void Animate3D::update(float t)
@ -238,6 +240,7 @@ void Animate3D::setSpeed(float speed)
{
_absSpeed = fabsf(speed);
_playReverse = speed < 0;
_duration = _originInterval / _absSpeed;
}
void Animate3D::setWeight(float weight)
@ -246,6 +249,11 @@ void Animate3D::setWeight(float weight)
_weight = fabsf(weight);
}
void Animate3D::setOriginInterval(float interval)
{
_originInterval = interval;
}
Animate3D::Animate3D()
: _state(Animate3D::Animate3DState::Running)
, _animation(nullptr)
@ -256,6 +264,7 @@ Animate3D::Animate3D()
, _playReverse(false)
, _accTransTime(0.0f)
, _lastTime(0.0f)
, _originInterval(0.0f)
{
}

View File

@ -85,6 +85,10 @@ public:
float getWeight() const { return _weight; }
void setWeight(float weight);
/**get & set origin interval*/
void setOriginInterval(float interval);
float getOriginInterval() const {return _originInterval; }
/** animate transition time */
static float getTransitionTime() { return _transTime; }
@ -117,6 +121,7 @@ protected:
static float _transTime; //transition time from one animate3d to another
float _accTransTime; // acculate transition time
float _lastTime; // last t (0 - 1)
float _originInterval;// save origin interval time
std::unordered_map<Bone3D*, Animation3D::Curve*> _boneCurves; //weak ref
//sprite animates

View File

@ -207,8 +207,14 @@ bool Bundle3D::loadObj(MeshDatas& meshdatas, MaterialDatas& materialdatas, NodeD
materialdatas.resetData();
nodedatas.resetData();
std::string mtlPath = "";
if (mtl_basepath)
mtlPath = mtl_basepath;
else
mtlPath = fullPath.substr(0, fullPath.find_last_of("\\/") + 1).c_str();
ObjLoader::shapes_t shapes;
auto ret = ObjLoader::LoadObj(shapes, fullPath.c_str(), mtl_basepath);
auto ret = ObjLoader::LoadObj(shapes, fullPath.c_str(), mtlPath.c_str());
if (ret.empty())
{
//fill data
@ -1791,7 +1797,7 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton)
CCLOG("warning: Failed to read nodedata: uvMapping '%s'.", _path.c_str());
return nullptr;
}
for( int j = 0 ;j < uvMapping ; j++ )
for(int j = 0 ; j < uvMapping ; j++)
{
unsigned int textureIndexSize=0;
if (_binaryReader.read(&textureIndexSize, 4, 1) != 1)
@ -1799,7 +1805,7 @@ NodeData* Bundle3D::parseNodesRecursivelyBinary(bool& skeleton)
CCLOG("warning: Failed to read meshdata: attribCount '%s'.", _path.c_str());
return nullptr;
}
for(int k =0; k < textureIndexSize ; k++ )
for(unsigned int k = 0; k < textureIndexSize ; k++)
{
unsigned int index=0;
if (_binaryReader.read(&index, 4, 1) != 1)

View File

@ -41,7 +41,7 @@ public:
/**
* Constructor & Destructor.
*/
Frustum(): _initialized(false), _clipZ(true){}
Frustum(): _clipZ(true), _initialized(false) {}
~Frustum(){}
/**

View File

@ -161,7 +161,7 @@ static ssize_t updateVertex( std::map<vertex_index, ssize_t>& vertexCache, std::
return it->second;
}
assert(in_positions.size() > (3*i.v_idx+2));
assert(in_positions.size() > static_cast<size_t>(3*i.v_idx+2));
positions.push_back(in_positions[3*i.v_idx+0]);
positions.push_back(in_positions[3*i.v_idx+1]);

View File

@ -38,106 +38,167 @@ Ray::~Ray()
{
}
bool Ray::intersects(const AABB& aabb) const
bool Ray::intersects(const AABB& box, float* distance) const
{
Vec3 ptOnPlane;
Vec3 min = aabb._min;
Vec3 max = aabb._max;
const Vec3& origin = _origin;
const Vec3& dir = _direction;
float lowt = 0.0f;
float t;
bool hit = false;
Vec3 hitpoint;
const Vec3& min = box._min;
const Vec3& max = box._max;
const Vec3& rayorig = _origin;
const Vec3& raydir = _direction;
if (dir.x != 0.f)
// Check origin inside first
if (rayorig > min && rayorig < max)
return true;
// Check each face in turn, only check closest 3
// Min x
if (rayorig.x <= min.x && raydir.x > 0)
{
if (dir.x > 0)
t = (min.x - origin.x) / dir.x;
else
t = (max.x - origin.x) / dir.x;
if (t > 0.f)
t = (min.x - rayorig.x) / raydir.x;
if (t >= 0)
{
ptOnPlane = origin + t * dir;
if (min.y < ptOnPlane.y && ptOnPlane.y < max.y && min.z < ptOnPlane.z && ptOnPlane.z < max.z)
// Substitute t back into ray and check bounds and dist
hitpoint = rayorig + raydir * t;
if (hitpoint.y >= min.y && hitpoint.y <= max.y &&
hitpoint.z >= min.z && hitpoint.z <= max.z &&
(!hit || t < lowt))
{
return true;
hit = true;
lowt = t;
}
}
}
if (dir.y != 0.f)
// Max x
if (rayorig.x >= max.x && raydir.x < 0)
{
if (dir.y > 0)
t = (min.y - origin.y) / dir.y;
else
t = (max.y - origin.y) / dir.y;
if (t > 0.f)
t = (max.x - rayorig.x) / raydir.x;
if (t >= 0)
{
ptOnPlane = origin + t * dir;
if (min.z < ptOnPlane.z && ptOnPlane.z < max.z && min.x < ptOnPlane.x && ptOnPlane.x < max.x)
// Substitute t back into ray and check bounds and dist
hitpoint = rayorig + raydir * t;
if (hitpoint.y >= min.y && hitpoint.y <= max.y &&
hitpoint.z >= min.z && hitpoint.z <= max.z &&
(!hit || t < lowt))
{
return true;
hit = true;
lowt = t;
}
}
}
if (dir.z != 0.f)
{
if (dir.z > 0)
t = (min.z - origin.z) / dir.z;
else
t = (max.z - origin.z) / dir.z;
if (t > 0.f)
// Min y
if (rayorig.y <= min.y && raydir.y > 0)
{
t = (min.y - rayorig.y) / raydir.y;
if (t >= 0)
{
ptOnPlane = origin + t * dir;
// Substitute t back into ray and check bounds and dist
hitpoint = rayorig + raydir * t;
if (hitpoint.x >= min.x && hitpoint.x <= max.x &&
hitpoint.z >= min.z && hitpoint.z <= max.z &&
(!hit || t < lowt))
{
hit = true;
lowt = t;
}
}
}
// Max y
if (rayorig.y >= max.y && raydir.y < 0)
{
t = (max.y - rayorig.y) / raydir.y;
if
if (min.x < ptOnPlane.x && ptOnPlane.x < max.x && min.y < ptOnPlane.y && ptOnPlane.y < max.y)
(t >= 0)
{
// Substitute t back into ray and check bounds and dist
hitpoint = rayorig + raydir * t;
if (hitpoint.x >= min.x && hitpoint.x <= max.x &&
hitpoint.z >= min.z && hitpoint.z <= max.z &&
(!hit || t < lowt))
{
return true;
hit = true;
lowt = t;
}
}
}
// Min z
if (rayorig.z <= min.z && raydir.z > 0)
{
t = (min.z - rayorig.z) / raydir.z;
if (t >= 0)
{
// Substitute t back into ray and check bounds and dist
hitpoint = rayorig + raydir * t;
if (hitpoint.x >= min.x && hitpoint.x <= max.x &&
hitpoint.y >= min.y && hitpoint.y <= max.y &&
(!hit || t < lowt))
{
hit = true;
lowt = t;
}
}
}
// Max z
if (rayorig.z >= max.z && raydir.z < 0)
{
t = (max.z - rayorig.z) / raydir.z;
if (t >= 0)
{
// Substitute t back into ray and check bounds and dist
hitpoint = rayorig + raydir * t;
if (hitpoint.x >= min.x && hitpoint.x <= max.x &&
hitpoint.y >= min.y && hitpoint.y <= max.y &&
(!hit || t < lowt))
{
hit = true;
lowt = t;
}
}
}
return false;
if (distance)
*distance = lowt;
return hit;
}
bool Ray::intersects(const OBB& obb) const
bool Ray::intersects(const OBB& obb, float* distance) const
{
AABB aabb;
aabb._min = - obb._extents;
aabb._max = obb._extents;
Ray ray;
ray._direction = _direction;
ray._origin = _origin;
Mat4 mat = Mat4::IDENTITY;
mat.m[0] = obb._xAxis.x;
mat.m[1] = obb._xAxis.y;
mat.m[2] = obb._xAxis.z;
mat.m[4] = obb._yAxis.x;
mat.m[5] = obb._yAxis.y;
mat.m[6] = obb._yAxis.z;
mat.m[8] = obb._zAxis.x;
mat.m[9] = obb._zAxis.y;
mat.m[10] = obb._zAxis.z;
mat.m[12] = obb._center.x;
mat.m[13] = obb._center.y;
mat.m[14] = obb._center.z;
mat = mat.getInversed();
ray.transform(mat);
return ray.intersects(aabb);
return ray.intersects(aabb, distance);
}
float Ray::dist(const Plane& plane) const

View File

@ -59,14 +59,14 @@ public:
~Ray();
/**
* Check whether this ray intersects the specified bounding box.
* Check whether this ray intersects with the specified AABB.
*/
bool intersects(const AABB& aabb) const;
bool intersects(const AABB& aabb, float* distance = nullptr) const;
/**
* Check whether this ray intersects the specified obb.
* Check whether this ray intersects with the specified OBB.
*/
bool intersects(const OBB& obb) const;
bool intersects(const OBB& obb, float* distance = nullptr) const;
float dist(const Plane& plane) const;
Vec3 intersects(const Plane& plane) const;

View File

@ -275,7 +275,7 @@ ssize_t Skeleton3D::getBoneCount() const
//get bone
Bone3D* Skeleton3D::getBoneByIndex(unsigned int index) const
{
if (index < _bones.size())
if (index < static_cast<unsigned int>(_bones.size()))
return _bones.at(index);
return nullptr;

View File

@ -6,6 +6,12 @@ LOCAL_MODULE := cocos2dx_internal_static
LOCAL_MODULE_FILENAME := libcocos2dxinternal
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
MATHNEONFILE := math/MathUtil.cpp.neon
else
MATHNEONFILE := math/MathUtil.cpp
endif
LOCAL_SRC_FILES := \
cocos2d.cpp \
2d/CCAction.cpp \
@ -87,8 +93,8 @@ platform/CCImage.cpp \
math/CCAffineTransform.cpp \
math/CCGeometry.cpp \
math/CCVertex.cpp \
$(MATHNEONFILE) \
math/Mat4.cpp \
math/MathUtil.cpp \
math/Quaternion.cpp \
math/TransformUtils.cpp \
math/Vec2.cpp \
@ -233,10 +239,6 @@ LOCAL_CPPFLAGS := -Wno-deprecated-declarations -Wno-extern-c-compat
LOCAL_EXPORT_CFLAGS := -DUSE_FILE32API
LOCAL_EXPORT_CPPFLAGS := -Wno-deprecated-declarations -Wno-extern-c-compat
ifeq ($(TARGET_ARCH_ABI),armeabi-v7a)
LOCAL_ARM_NEON := true
endif
include $(BUILD_STATIC_LIBRARY)
#==============================================================

View File

@ -54,7 +54,7 @@ const float AudioEngine::TIME_UNKNOWN = -1.0f;
std::unordered_map<std::string,std::list<int>> AudioEngine::_audioPathIDMap;
//profileName,ProfileHelper
std::unordered_map<std::string, AudioEngine::ProfileHelper> AudioEngine::_audioPathProfileHelperMap;
int AudioEngine::_maxInstances = MAX_AUDIOINSTANCES;
unsigned int AudioEngine::_maxInstances = MAX_AUDIOINSTANCES;
AudioEngine::ProfileHelper* AudioEngine::_defaultProfileHelper = nullptr;
std::unordered_map<int, AudioEngine::AudioInfo> AudioEngine::_audioIDInfoMap;
AudioEngineImpl* AudioEngine::_audioEngineImpl = nullptr;

View File

@ -24,6 +24,7 @@
#if CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID
#include "AudioEngine-inl.h"
#include <unistd.h>
// for native asset manager
#include <sys/types.h>
#include <android/asset_manager.h>
@ -65,6 +66,7 @@ AudioPlayer::AudioPlayer()
, _duration(0.0f)
, _playOver(false)
, _loop(false)
, _assetFd(0)
{
}
@ -79,6 +81,11 @@ AudioPlayer::~AudioPlayer()
_fdPlayerVolume = nullptr;
_fdPlayerSeek = nullptr;
}
if(_assetFd > 0)
{
close(_assetFd);
_assetFd = 0;
}
}
bool AudioPlayer::init(SLEngineItf engineEngine, SLObjectItf outputMixObject,const std::string& fileFullPath, float volume, bool loop)
@ -110,15 +117,15 @@ bool AudioPlayer::init(SLEngineItf engineEngine, SLObjectItf outputMixObject,con
// open asset as file descriptor
off_t start, length;
int fd = AAsset_openFileDescriptor(asset, &start, &length);
if (fd <= 0){
_assetFd = AAsset_openFileDescriptor(asset, &start, &length);
if (_assetFd <= 0){
AAsset_close(asset);
break;
}
AAsset_close(asset);
// configure audio source
loc_fd = {SL_DATALOCATOR_ANDROIDFD, fd, start, length};
loc_fd = {SL_DATALOCATOR_ANDROIDFD, _assetFd, start, length};
audioSrc.pLocator = &loc_fd;
}

View File

@ -59,6 +59,7 @@ private:
float _duration;
int _audioID;
int _assetFd;
std::function<void (int, const std::string &)> _finishCallback;

View File

@ -262,7 +262,7 @@ protected:
//profileName,ProfileHelper
static std::unordered_map<std::string, ProfileHelper> _audioPathProfileHelperMap;
static int _maxInstances;
static unsigned int _maxInstances;
static ProfileHelper* _defaultProfileHelper;

View File

@ -202,10 +202,10 @@ static const char* inet_ntop(int af, const void* src, char* dst, int cnt)
}
#endif
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
static const int CCLOG_STRING_TAG = 1;
void SendLogToWindow(const char *log)
{
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
// Send data as a message
COPYDATASTRUCT myCDS;
myCDS.dwData = CCLOG_STRING_TAG;
@ -219,8 +219,12 @@ void SendLogToWindow(const char *log)
(WPARAM)(HWND)hwnd,
(LPARAM)(LPVOID)&myCDS);
}
#endif
}
#else
void SendLogToWindow(const char *log)
{
}
#endif
//
// Free functions to log

View File

@ -36,7 +36,7 @@
// The renderer[android:GLSurfaceView.Renderer WP8:Cocos2dRenderer] was recreated.
// This message is used for reloading resources before renderer is recreated on Android/WP8.
// This message is posted in cocos/platform/android/javaactivity.cpp and cocos\platform\wp8-xaml\cpp\Cocos2dRenderer.cpp.
#define EVENT_RENDERER_RECREATED "event_renderer_recreated"
#define EVENT_RENDERER_RECREATED "event_renderer_recreated"
// The application will come to background.
// This message is used for doing something before coming to background, such as save RenderTexture.

View File

@ -81,13 +81,13 @@ Ref::~Ref()
void Ref::retain()
{
CCASSERT(_referenceCount > 0, "reference count should greater than 0");
CCASSERT(_referenceCount > 0, "reference count should be greater than 0");
++_referenceCount;
}
void Ref::release()
{
CCASSERT(_referenceCount > 0, "reference count should greater than 0");
CCASSERT(_referenceCount > 0, "reference count should be greater than 0");
--_referenceCount;
if (_referenceCount == 0)

View File

@ -249,7 +249,7 @@ protected:
_allocated += _pageSize;
size_t aligned_size = AllocatorBase::nextPow2BlockSize(block_size);
uint8_t* block = (uint8_t*)p;
for (int i = 0; i < _pageSize; ++i, block += aligned_size)
for (unsigned int i = 0; i < _pageSize; ++i, block += aligned_size)
{
push_front(block);
}

View File

@ -44,7 +44,7 @@ public:
template<typename T>
static inline T random_int(T min, T max) {
std::uniform_int_distribution<> dist(min, max);
std::uniform_int_distribution<T> dist(min, max);
auto &mt = RandomHelper::getEngine();
return dist(mt);
}
@ -57,7 +57,7 @@ private:
*/
template<typename T>
inline T random(T min, T max) {
return RandomHelper::random_int(min, max);
return RandomHelper::random_int<T>(min, max);
}
template<>

View File

@ -451,12 +451,15 @@ public:
: _strokeEnabled(false)
, _strokeColor(Color3B::BLACK)
, _strokeSize(0)
, _strokeAlpha(255)
{}
// true if stroke enabled
bool _strokeEnabled;
// stroke color
Color3B _strokeColor;
// stroke alpha
GLubyte _strokeAlpha;
// stroke size
float _strokeSize;
@ -476,6 +479,7 @@ public:
, _vertAlignment(TextVAlignment::TOP)
, _dimensions(Size::ZERO)
, _fontFillColor(Color3B::WHITE)
, _fontAlpha(255)
{}
// font name
@ -490,6 +494,8 @@ public:
Size _dimensions;
// font color
Color3B _fontFillColor;
//font alpha
GLubyte _fontAlpha;
// font shadow
FontShadow _shadow;
// font stroke

View File

@ -55,6 +55,7 @@ static const char* Property_CColor = "CColor";
static const char* Property_FileData = "FileData";
static const char* Property_FrameEvent = "FrameEvent";
static const char* Property_Alpha = "Alpha";
static const char* Property_AnchorPoint = "AnchorPoint";
static const char* Property_ZOrder = "ZOrder";
static const char* Property_ActionValue = "ActionValue";
@ -533,6 +534,11 @@ Timeline* ActionTimelineCache::loadTimelineWithFlatBuffers(const flatbuffers::Ti
auto intFrame = frameFlatbuf->intFrame();
frame = loadAlphaFrameWithFlatBuffers(intFrame);
}
else if (property == Property_AnchorPoint)
{
auto scaleFrame = frameFlatbuf->scaleFrame();
frame = loadAnchorPointFrameWithFlatBuffers(scaleFrame);
}
else if (property == Property_ZOrder)
{
auto intFrame = frameFlatbuf->intFrame();
@ -560,14 +566,14 @@ Frame* ActionTimelineCache::loadVisibleFrameWithFlatBuffers(const flatbuffers::B
{
VisibleFrame* frame = VisibleFrame::create();
bool visible = flatbuffers->value();
bool visible = flatbuffers->value() != 0;
frame->setVisible(visible);
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween();
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
@ -584,7 +590,7 @@ Frame* ActionTimelineCache::loadPositionFrameWithFlatBuffers(const flatbuffers::
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween();
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
@ -602,7 +608,7 @@ Frame* ActionTimelineCache::loadScaleFrameWithFlatBuffers(const flatbuffers::Sca
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween();
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
@ -620,7 +626,7 @@ Frame* ActionTimelineCache::loadRotationSkewFrameWithFlatBuffers(const flatbuffe
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween();
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
@ -637,7 +643,7 @@ Frame* ActionTimelineCache::loadColorFrameWithFlatBuffers(const flatbuffers::Col
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween();
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
@ -694,7 +700,7 @@ Frame* ActionTimelineCache::loadTextureFrameWithFlatBuffers(const flatbuffers::T
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween();
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
@ -714,7 +720,7 @@ Frame* ActionTimelineCache::loadEventFrameWithFlatBuffers(const flatbuffers::Eve
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween();
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
@ -731,12 +737,29 @@ Frame* ActionTimelineCache::loadAlphaFrameWithFlatBuffers(const flatbuffers::Int
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween();
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
}
Frame* ActionTimelineCache::loadAnchorPointFrameWithFlatBuffers(const flatbuffers::ScaleFrame *flatbuffers)
{
AnchorPointFrame* frame = AnchorPointFrame::create();
auto f_scale = flatbuffers->scale();
Vec2 scale(f_scale->scaleX(), f_scale->scaleY());
frame->setAnchorPoint(scale);
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
}
Frame* ActionTimelineCache::loadZOrderFrameWithFlatBuffers(const flatbuffers::IntFrame *flatbuffers)
{
ZOrderFrame* frame = ZOrderFrame::create();
@ -748,7 +771,7 @@ Frame* ActionTimelineCache::loadZOrderFrameWithFlatBuffers(const flatbuffers::In
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween();
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
return frame;
@ -767,7 +790,7 @@ Frame* ActionTimelineCache::loadInnerActionFrameWithFlatBuffers(const flatbuffer
int frameIndex = flatbuffers->frameIndex();
frame->setFrameIndex(frameIndex);
bool tween = flatbuffers->tween();
bool tween = flatbuffers->tween() != 0;
frame->setTween(tween);
frame->setInnerActionType(innerActionType);

View File

@ -112,6 +112,7 @@ protected:
Frame* loadTextureFrameWithFlatBuffers (const flatbuffers::TextureFrame* flatbuffers);
Frame* loadEventFrameWithFlatBuffers (const flatbuffers::EventFrame* flatbuffers);
Frame* loadAlphaFrameWithFlatBuffers (const flatbuffers::IntFrame* flatbuffers);
Frame* loadAnchorPointFrameWithFlatBuffers (const flatbuffers::ScaleFrame* flatbuffers);
Frame* loadZOrderFrameWithFlatBuffers (const flatbuffers::IntFrame* flatbuffers);
Frame* loadInnerActionFrameWithFlatBuffers (const flatbuffers::InnerActionFrame* flatbuffers);

View File

@ -525,7 +525,7 @@ void InnerActionFrame::onEnter(Frame *nextFrame, int currentFrameIndex)
}
}
void InnerActionFrame::setStartFrameIndex(int frameIndex) throw()
void InnerActionFrame::setStartFrameIndex(int frameIndex)
{
if(_enterWithName)
{
@ -536,7 +536,7 @@ void InnerActionFrame::setStartFrameIndex(int frameIndex) throw()
}
void InnerActionFrame::setEndFrameIndex(int frameIndex) throw()
void InnerActionFrame::setEndFrameIndex(int frameIndex)
{
if(_enterWithName)
{
@ -546,7 +546,7 @@ void InnerActionFrame::setEndFrameIndex(int frameIndex) throw()
_endFrameIndex = frameIndex;
}
void InnerActionFrame::setAnimationName(const std::string& animationName) throw()
void InnerActionFrame::setAnimationName(const std::string& animationName)
{
if(!_enterWithName)
{

View File

@ -268,13 +268,13 @@ public:
inline void setEnterWithName(bool isEnterWithName) { _enterWithName = isEnterWithName;}
void setStartFrameIndex(int frameIndex) throw();
void setStartFrameIndex(int frameIndex);
inline int getStartFrameIndex() const { return _startFrameIndex; }
void setEndFrameIndex(int frameIndex) throw();
void setEndFrameIndex(int frameIndex);
inline int getEndFrameIndex() const { return _endFrameIndex; }
void setAnimationName(const std::string& animationNamed) throw();
void setAnimationName(const std::string& animationNamed);
inline void setSingleFrameIndex(int frameIndex) { _singleFrameIndex = frameIndex;}
inline int getSingleFrameIndex() const { return _singleFrameIndex;}

View File

@ -843,6 +843,7 @@ Node* CSLoader::nodeWithFlatBuffers(const flatbuffers::NodeTree *nodetree)
if (action)
{
node->runAction(action);
action->gotoFrameAndPause(0);
}
}
@ -1172,6 +1173,7 @@ Node* CSLoader::nodeWithFlatBuffersForSimulator(const flatbuffers::NodeTree *nod
if (action)
{
node->runAction(action);
action->gotoFrameAndPause(0);
}
}
}

View File

@ -176,29 +176,29 @@ MANUALLY_ALIGNED_STRUCT(4) CapInsets {
STRUCT_END(CapInsets, 16);
struct CSParseBinary : private flatbuffers::Table {
const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *textures() const { return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(4); }
const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *texturePngs() const { return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(6); }
const NodeTree *nodeTree() const { return GetPointer<const NodeTree *>(8); }
const NodeAction *action() const { return GetPointer<const NodeAction *>(10); }
const flatbuffers::Vector<flatbuffers::Offset<AnimationInfo>> *animationList() const { return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<AnimationInfo>> *>(12); }
const flatbuffers::String *version() const { return GetPointer<const flatbuffers::String *>(14); }
const flatbuffers::String *version() const { return GetPointer<const flatbuffers::String *>(4); }
const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *textures() const { return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(6); }
const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *texturePngs() const { return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>> *>(8); }
const NodeTree *nodeTree() const { return GetPointer<const NodeTree *>(10); }
const NodeAction *action() const { return GetPointer<const NodeAction *>(12); }
const flatbuffers::Vector<flatbuffers::Offset<AnimationInfo>> *animationList() const { return GetPointer<const flatbuffers::Vector<flatbuffers::Offset<AnimationInfo>> *>(14); }
bool Verify(flatbuffers::Verifier &verifier) const {
return VerifyTableStart(verifier) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* textures */) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 4 /* version */) &&
verifier.Verify(version()) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 6 /* textures */) &&
verifier.Verify(textures()) &&
verifier.VerifyVectorOfStrings(textures()) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 6 /* texturePngs */) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 8 /* texturePngs */) &&
verifier.Verify(texturePngs()) &&
verifier.VerifyVectorOfStrings(texturePngs()) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 8 /* nodeTree */) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 10 /* nodeTree */) &&
verifier.VerifyTable(nodeTree()) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 10 /* action */) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 12 /* action */) &&
verifier.VerifyTable(action()) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 12 /* animationList */) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 14 /* animationList */) &&
verifier.Verify(animationList()) &&
verifier.VerifyVectorOfTables(animationList()) &&
VerifyField<flatbuffers::uoffset_t>(verifier, 14 /* version */) &&
verifier.Verify(version()) &&
verifier.EndTable();
}
};
@ -206,12 +206,12 @@ struct CSParseBinary : private flatbuffers::Table {
struct CSParseBinaryBuilder {
flatbuffers::FlatBufferBuilder &fbb_;
flatbuffers::uoffset_t start_;
void add_textures(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> textures) { fbb_.AddOffset(4, textures); }
void add_texturePngs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> texturePngs) { fbb_.AddOffset(6, texturePngs); }
void add_nodeTree(flatbuffers::Offset<NodeTree> nodeTree) { fbb_.AddOffset(8, nodeTree); }
void add_action(flatbuffers::Offset<NodeAction> action) { fbb_.AddOffset(10, action); }
void add_animationList(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<AnimationInfo>>> animationList) { fbb_.AddOffset(12, animationList); }
void add_version(flatbuffers::Offset<flatbuffers::String> version) { fbb_.AddOffset(14, version); }
void add_version(flatbuffers::Offset<flatbuffers::String> version) { fbb_.AddOffset(4, version); }
void add_textures(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> textures) { fbb_.AddOffset(6, textures); }
void add_texturePngs(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> texturePngs) { fbb_.AddOffset(8, texturePngs); }
void add_nodeTree(flatbuffers::Offset<NodeTree> nodeTree) { fbb_.AddOffset(10, nodeTree); }
void add_action(flatbuffers::Offset<NodeAction> action) { fbb_.AddOffset(12, action); }
void add_animationList(flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<AnimationInfo>>> animationList) { fbb_.AddOffset(14, animationList); }
CSParseBinaryBuilder(flatbuffers::FlatBufferBuilder &_fbb) : fbb_(_fbb) { start_ = fbb_.StartTable(); }
CSParseBinaryBuilder &operator=(const CSParseBinaryBuilder &);
flatbuffers::Offset<CSParseBinary> Finish() {
@ -221,19 +221,19 @@ struct CSParseBinaryBuilder {
};
inline flatbuffers::Offset<CSParseBinary> CreateCSParseBinary(flatbuffers::FlatBufferBuilder &_fbb,
flatbuffers::Offset<flatbuffers::String> version = 0,
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> textures = 0,
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<flatbuffers::String>>> texturePngs = 0,
flatbuffers::Offset<NodeTree> nodeTree = 0,
flatbuffers::Offset<NodeAction> action = 0,
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<AnimationInfo>>> animationList = 0,
flatbuffers::Offset<flatbuffers::String> version = 0) {
flatbuffers::Offset<flatbuffers::Vector<flatbuffers::Offset<AnimationInfo>>> animationList = 0) {
CSParseBinaryBuilder builder_(_fbb);
builder_.add_version(version);
builder_.add_animationList(animationList);
builder_.add_action(action);
builder_.add_nodeTree(nodeTree);
builder_.add_texturePngs(texturePngs);
builder_.add_textures(textures);
builder_.add_version(version);
return builder_.Finish();
}

View File

@ -76,6 +76,7 @@ static const char* Property_CColor = "CColor";
static const char* Property_FileData = "FileData";
static const char* Property_FrameEvent = "FrameEvent";
static const char* Property_Alpha = "Alpha";
static const char* Property_AnchorPoint = "AnchorPoint";
static const char* Property_ZOrder = "ZOrder";
static const char* Property_ActionValue = "ActionValue";
@ -150,8 +151,7 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithXMLFile(const std::str
return ".csd file doesn not exists ";
}
ssize_t size;
std::string content =(char*)FileUtils::getInstance()->getFileData(inFullpath, "r", &size);
std::string content = FileUtils::getInstance()->getStringFromFile(inFullpath);
// xml parse
tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument();
@ -266,12 +266,12 @@ std::string FlatBuffersSerialize::serializeFlatBuffersWithXMLFile(const std::str
auto csparsebinary = CreateCSParseBinary(*_builder,
_builder->CreateString(_csdVersion),
_builder->CreateVector(_textures),
_builder->CreateVector(_texturePngs),
nodeTree,
aciton,
_builder->CreateVector(animationInfos),
_builder->CreateString(_csdVersion));
_builder->CreateVector(animationInfos));
_builder->Finish(csparsebinary);
_textures.clear();
@ -704,6 +704,13 @@ Offset<TimeLine> FlatBuffersSerialize::createTimeLine(const tinyxml2::XMLElement
0, // EventFrame
intFrame);
}
else if (property == Property_AnchorPoint)
{
auto scaleFrame = createScaleFrame(frameElement);
frame = CreateFrame(*_builder,
0, // PointFrame
scaleFrame);
}
else if (property == Property_ZOrder)
{
auto intFrame = createIntFrame(frameElement);
@ -1124,8 +1131,7 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato
// CCLOG(".csd file doesn not exists ");
}
ssize_t size;
std::string content =(char*)FileUtils::getInstance()->getFileData(inFullpath, "r", &size);
std::string content = FileUtils::getInstance()->getStringFromFile(inFullpath);
// xml parse
tinyxml2::XMLDocument* document = new tinyxml2::XMLDocument();
@ -1218,12 +1224,12 @@ FlatBufferBuilder* FlatBuffersSerialize::createFlatBuffersWithXMLFileForSimulato
}
auto csparsebinary = CreateCSParseBinary(*_builder,
_builder->CreateString(_csdVersion),
_builder->CreateVector(_textures),
_builder->CreateVector(_texturePngs),
nodeTree,
aciton,
_builder->CreateVector(animationInfos),
_builder->CreateString(_csdVersion));
_builder->CreateVector(animationInfos));
_builder->Finish(csparsebinary);
_textures.clear();

View File

@ -544,7 +544,7 @@ namespace cocostudio
Button* button = static_cast<Button*>(node);
auto options = (ButtonOptions*)buttonOptions;
bool scale9Enabled = options->scale9Enabled();
bool scale9Enabled = options->scale9Enabled() != 0;
button->setScale9Enabled(scale9Enabled);
bool normalFileExist = false;
@ -777,7 +777,7 @@ namespace cocostudio
}
}
bool displaystate = options->displaystate();
bool displaystate = options->displaystate() != 0;
button->setBright(displaystate);
button->setEnabled(displaystate);

View File

@ -753,10 +753,10 @@ namespace cocostudio
checkBox->addChild(label);
}
bool selectedstate = options->selectedState();
bool selectedstate = options->selectedState() != 0;
checkBox->setSelected(selectedstate);
bool displaystate = options->displaystate();
bool displaystate = options->displaystate() != 0;
checkBox->setBright(displaystate);
checkBox->setEnabled(displaystate);

View File

@ -181,11 +181,10 @@ namespace cocostudio
break;
}
bool loop = options->loop();
bool loop = options->loop() != 0;
audio->setLoop(loop);
audio->setName(options->name()->c_str());
audio->setLoop(options->loop());
return component;
}

View File

@ -24,6 +24,8 @@
#include "GameMapReader.h"
#include "2d/CCTMXXMLParser.h"
#include "cocostudio/CSParseBinary_generated.h"
#include "cocostudio/WidgetReader/NodeReader/NodeReader.h"
@ -159,6 +161,77 @@ namespace cocostudio
}
if (fileExist)
{
/* Whether tileset is valid. */
auto mapInfo = TMXMapInfo::create(path);
auto& layers = mapInfo->getLayers();
bool valid = false;
std::string layerName = "";
for (const auto &layerInfo : layers)
{
valid = false;
if (layerInfo->_visible)
{
Size size = layerInfo->_layerSize;
auto& tilesets = mapInfo->getTilesets();
if (tilesets.size()>0)
{
TMXTilesetInfo* tileset = nullptr;
for (auto iter = tilesets.crbegin(); iter != tilesets.crend(); ++iter)
{
tileset = *iter;
if (tileset)
{
for( int y=0; y < size.height; y++ )
{
for( int x=0; x < size.width; x++ )
{
int pos = static_cast<int>(x + size.width * y);
int gid = layerInfo->_tiles[ pos ];
if( gid != 0 )
{
if( (gid & kTMXFlippedMask) >= tileset->_firstGid )
{
valid = true;
break;
}
}
}
if (valid)
{
break;
}
}
}
}
}
if (!valid)
{
layerName = layerInfo->_name;
break;
}
}
else
{
valid = true;
}
}
if (!valid)
{
Node* node = Node::create();
setPropsWithFlatBuffers(node, (Table*)gameMapOptions);
auto label = Label::create();
label->setString(__String::createWithFormat("Some error of gid are in TMX Layer '%s'", layerName.c_str())->getCString());
node->setScale(1.0f);
node->addChild(label);
return node;
}
/**/
tmx = TMXTiledMap::create(path);
if (tmx)
{

View File

@ -355,7 +355,7 @@ namespace cocostudio
imageView->addChild(label);
}
bool scale9Enabled = options->scale9Enabled();
bool scale9Enabled = options->scale9Enabled() != 0;
imageView->setScale9Enabled(scale9Enabled);
auto widgetReader = WidgetReader::getInstance();

View File

@ -570,10 +570,10 @@ namespace cocostudio
Layout* panel = static_cast<Layout*>(node);
auto options = (PanelOptions*)layoutOptions;
bool clipEnabled = options->clipEnabled();
bool clipEnabled = options->clipEnabled() != 0;
panel->setClippingEnabled(clipEnabled);
bool backGroundScale9Enabled = options->backGroundScale9Enabled();
bool backGroundScale9Enabled = options->backGroundScale9Enabled() != 0;
panel->setBackGroundImageScale9Enabled(backGroundScale9Enabled);

View File

@ -398,10 +398,10 @@ namespace cocostudio
ListView* listView = static_cast<ListView*>(node);
auto options = (ListViewOptions*)listViewOptions;
bool clipEnabled = options->clipEnabled();
bool clipEnabled = options->clipEnabled() != 0;
listView->setClippingEnabled(clipEnabled);
bool backGroundScale9Enabled = options->backGroundScale9Enabled();
bool backGroundScale9Enabled = options->backGroundScale9Enabled() != 0;
listView->setBackGroundImageScale9Enabled(backGroundScale9Enabled);
@ -506,7 +506,7 @@ namespace cocostudio
listView->setInnerContainerSize(innerSize);
// int direction = options->direction();
// listView->setDirection((ScrollView::Direction)direction);
bool bounceEnabled = options->bounceEnabled();
bool bounceEnabled = options->bounceEnabled() != 0;
listView->setBounceEnabled(bounceEnabled);
// int gravityValue = options->gravity();

View File

@ -472,7 +472,7 @@ namespace cocostudio
int zorder = options->zOrder();
int tag = options->tag();
int actionTag = options->actionTag();
bool visible = options->visible();
bool visible = options->visible() != 0;
float w = options->size()->width();
float h = options->size()->height();
int alpha = options->alpha();
@ -521,16 +521,16 @@ namespace cocostudio
auto layoutComponent = ui::LayoutComponent::bindLayoutComponent(node);
bool positionXPercentEnabled = layoutComponentTable->positionXPercentEnabled();
bool positionYPercentEnabled = layoutComponentTable->positionYPercentEnabled();
bool positionXPercentEnabled = layoutComponentTable->positionXPercentEnabled() != 0;
bool positionYPercentEnabled = layoutComponentTable->positionYPercentEnabled() != 0;
float positionXPercent = layoutComponentTable->positionXPercent();
float positionYPercent = layoutComponentTable->positionYPercent();
bool sizeXPercentEnable = layoutComponentTable->sizeXPercentEnable();
bool sizeYPercentEnable = layoutComponentTable->sizeYPercentEnable();
bool sizeXPercentEnable = layoutComponentTable->sizeXPercentEnable() != 0;
bool sizeYPercentEnable = layoutComponentTable->sizeYPercentEnable() != 0;
float sizeXPercent = layoutComponentTable->sizeXPercent();
float sizeYPercent = layoutComponentTable->sizeYPercent();
bool stretchHorizontalEnabled = layoutComponentTable->stretchHorizontalEnabled();
bool stretchVerticalEnabled = layoutComponentTable->stretchVerticalEnabled();
bool stretchHorizontalEnabled = layoutComponentTable->stretchHorizontalEnabled() != 0;
bool stretchVerticalEnabled = layoutComponentTable->stretchVerticalEnabled() != 0;
std::string horizontalEdge = layoutComponentTable->horizontalEdge()->c_str();
std::string verticalEdge = layoutComponentTable->verticalEdge()->c_str();
float leftMargin = layoutComponentTable->leftMargin();

View File

@ -311,10 +311,10 @@ namespace cocostudio
PageView* pageView = static_cast<PageView*>(node);
auto options = (PageViewOptions*)pageViewOptions;
bool clipEnabled = options->clipEnabled();
bool clipEnabled = options->clipEnabled() != 0;
pageView->setClippingEnabled(clipEnabled);
bool backGroundScale9Enabled = options->backGroundScale9Enabled();
bool backGroundScale9Enabled = options->backGroundScale9Enabled() != 0;
pageView->setBackGroundImageScale9Enabled(backGroundScale9Enabled);

View File

@ -397,10 +397,10 @@ namespace cocostudio
ScrollView* scrollView = static_cast<ScrollView*>(node);
auto options = (ScrollViewOptions*)scrollViewOptions;
bool clipEnabled = options->clipEnabled();
bool clipEnabled = options->clipEnabled() != 0;
scrollView->setClippingEnabled(clipEnabled);
bool backGroundScale9Enabled = options->backGroundScale9Enabled();
bool backGroundScale9Enabled = options->backGroundScale9Enabled() != 0;
scrollView->setBackGroundImageScale9Enabled(backGroundScale9Enabled);
@ -505,7 +505,7 @@ namespace cocostudio
scrollView->setInnerContainerSize(innerSize);
int direction = options->direction();
scrollView->setDirection((ScrollView::Direction)direction);
bool bounceEnabled = options->bounceEnabled();
bool bounceEnabled = options->bounceEnabled() != 0;
scrollView->setBounceEnabled(bounceEnabled);

View File

@ -787,7 +787,7 @@ namespace cocostudio
slider->addChild(label);
}
bool displaystate = options->displaystate();
bool displaystate = options->displaystate() != 0;
slider->setBright(displaystate);
slider->setEnabled(displaystate);

View File

@ -224,8 +224,8 @@ namespace cocostudio
sprite->setColor(Color3B(red, green, blue));
}
bool flipX = nodeOptions->flipX();
bool flipY = nodeOptions->flipY();
bool flipX = nodeOptions->flipX() != 0;
bool flipY = nodeOptions->flipY() != 0;
if(flipX != false)
sprite->setFlippedX(flipX);

View File

@ -291,7 +291,7 @@ namespace cocostudio
std::string fontName = options->fontName()->c_str();
textField->setFontName(fontName);
bool maxLengthEnabled = options->maxLengthEnabled();
bool maxLengthEnabled = options->maxLengthEnabled() != 0;
textField->setMaxLengthEnabled(maxLengthEnabled);
if (maxLengthEnabled)
@ -299,7 +299,7 @@ namespace cocostudio
int maxLength = options->maxLength();
textField->setMaxLength(maxLength);
}
bool passwordEnabled = options->passwordEnabled();
bool passwordEnabled = options->passwordEnabled() != 0;
textField->setPasswordEnabled(passwordEnabled);
if (passwordEnabled)
{

View File

@ -292,7 +292,7 @@ namespace cocostudio
Text* label = static_cast<Text*>(node);
auto options = (TextOptions*)textOptions;
bool touchScaleEnabled = options->touchScaleEnable();
bool touchScaleEnabled = options->touchScaleEnable() != 0;
label->setTouchScaleChangeEnabled(touchScaleEnabled);
std::string text = options->text()->c_str();
@ -348,7 +348,7 @@ namespace cocostudio
label->setUnifySizeEnabled(false);
bool IsCustomSize = options->isCustomSize();
bool IsCustomSize = options->isCustomSize() != 0;
label->ignoreContentAdaptWithSize(!IsCustomSize);
auto widgetOptions = options->widgetOptions();

View File

@ -772,7 +772,7 @@ namespace cocostudio
widget->setAnchorPoint(Vec2::ZERO);
widget->setUnifySizeEnabled(true);
bool ignoreSize = options->ignoreSize();
bool ignoreSize = options->ignoreSize() != 0;
widget->ignoreContentAdaptWithSize(ignoreSize);
widget->setUnifySizeEnabled(false);
@ -788,7 +788,7 @@ namespace cocostudio
widget->setActionTag(actionTag);
widget->setUserObject(timeline::ActionTimelineData::create(actionTag));
bool touchEnabled = options->touchEnabled();
bool touchEnabled = options->touchEnabled() != 0;
widget->setTouchEnabled(touchEnabled);
std::string name = options->name()->c_str();
@ -807,7 +807,7 @@ namespace cocostudio
float rotationSkewY = options->rotationSkew()->rotationSkewY();
widget->setRotationSkewY(rotationSkewY);
bool visible = options->visible();
bool visible = options->visible() != 0;
widget->setVisible(visible);
int zOrder = options->zOrder();
@ -824,9 +824,9 @@ namespace cocostudio
Vec2 anchorPoint(f_anchorPoint->scaleX(), f_anchorPoint->scaleY());
widget->setAnchorPoint(anchorPoint);
bool flippedX = options->flipX();
bool flippedX = options->flipX() != 0;
widget->setFlippedX(flippedX);
bool flippedY = options->flipY();
bool flippedY = options->flipY() != 0;
widget->setFlippedY(flippedY);
std::string callbackType = options->callBackType()->c_str();
@ -844,16 +844,16 @@ namespace cocostudio
auto layoutComponent = ui::LayoutComponent::bindLayoutComponent(node);
bool positionXPercentEnabled = layoutComponentTable->positionXPercentEnabled();
bool positionYPercentEnabled = layoutComponentTable->positionYPercentEnabled();
bool positionXPercentEnabled = layoutComponentTable->positionXPercentEnabled() != 0;
bool positionYPercentEnabled = layoutComponentTable->positionYPercentEnabled() != 0;
float positionXPercent = layoutComponentTable->positionXPercent();
float positionYPercent = layoutComponentTable->positionYPercent();
bool sizeXPercentEnable = layoutComponentTable->sizeXPercentEnable();
bool sizeYPercentEnable = layoutComponentTable->sizeYPercentEnable();
bool sizeXPercentEnable = layoutComponentTable->sizeXPercentEnable() != 0;
bool sizeYPercentEnable = layoutComponentTable->sizeYPercentEnable() != 0;
float sizeXPercent = layoutComponentTable->sizeXPercent();
float sizeYPercent = layoutComponentTable->sizeYPercent();
bool stretchHorizontalEnabled = layoutComponentTable->stretchHorizontalEnabled();
bool stretchVerticalEnabled = layoutComponentTable->stretchVerticalEnabled();
bool stretchHorizontalEnabled = layoutComponentTable->stretchHorizontalEnabled() != 0;
bool stretchVerticalEnabled = layoutComponentTable->stretchVerticalEnabled() != 0;
std::string horizontalEdge = layoutComponentTable->horizontalEdge()->c_str();
std::string verticalEdge = layoutComponentTable->verticalEdge()->c_str();
float leftMargin = layoutComponentTable->leftMargin();

View File

@ -362,6 +362,13 @@ public:
*/
inline const Quaternion operator*(const Quaternion& q) const;
/**
* Calculates the quaternion product of this quaternion with the given vec3.
* @param v The vec3 to multiply.
* @return The vec3 product.
*/
inline Vec3 operator*(const Vec3& v) const;
/**
* Multiplies this quaternion with the given quaternion.
*

View File

@ -35,4 +35,17 @@ inline Quaternion& Quaternion::operator*=(const Quaternion& q)
return *this;
}
inline Vec3 Quaternion::operator*(const Vec3& v) const
{
Vec3 uv, uuv;
Vec3 qvec(x, y, z);
Vec3::cross(qvec, v, &uv);
Vec3::cross(qvec, uv, &uuv);
uv *= (2.0f * w);
uuv *= 2.0f;
return v + uv + uuv;
}
NS_CC_MATH_END

View File

@ -419,14 +419,25 @@ public:
*/
inline const Vec3 operator/(float s) const;
/**
* Determines if this vector is less than the given vector.
*
* @param v The vector to compare against.
*
* @return True if this vector is less than the given vector, false otherwise.
/** Returns true if the vector's scalar components are all greater
that the ones of the vector it is compared against.
*/
inline bool operator<(const Vec3& v) const;
inline bool operator < (const Vec3& rhs) const
{
if (x < rhs.x && y < rhs.y && z < rhs.z)
return true;
return false;
}
/** Returns true if the vector's scalar components are all smaller
that the ones of the vector it is compared against.
*/
inline bool operator >(const Vec3& rhs) const
{
if (x > rhs.x && y > rhs.y && z > rhs.z)
return true;
return false;
}
/**
* Determines if this vector is equal to the given vector.

View File

@ -74,19 +74,6 @@ inline const Vec3 Vec3::operator/(const float s) const
return Vec3(this->x / s, this->y / s, this->z / s);
}
inline bool Vec3::operator<(const Vec3& v) const
{
if (x == v.x)
{
if (y == v.y)
{
return z < v.z;
}
return y < v.y;
}
return x < v.x;
}
inline bool Vec3::operator==(const Vec3& v) const
{
return x==v.x && y==v.y && z==v.z;

View File

@ -68,11 +68,11 @@ PhysicsBody::PhysicsBody()
, _linearDamping(0.0f)
, _angularDamping(0.0f)
, _tag(0)
, _rotationOffset(0)
, _positionInitDirty(true)
, _recordedPosition(Vec2::ZERO)
, _rotationOffset(0)
, _recordedRotation(0.0f)
, _recordedAngle(0.0)
, _positionInitDirty(true)
{
}

View File

@ -40,9 +40,9 @@ PhysicsJoint::PhysicsJoint()
, _enable(false)
, _collisionEnable(true)
, _destoryMark(false)
, _initDirty(true)
, _tag(0)
, _maxForce(PHYSICS_INFINITY)
, _initDirty(true)
{
}

View File

@ -1103,7 +1103,7 @@ bool FileUtils::createDirectory(const std::string& path)
if ((GetFileAttributesA(path.c_str())) == INVALID_FILE_ATTRIBUTES)
{
subpath = "";
for (int i = 0; i < dirs.size(); ++i)
for (unsigned int i = 0; i < dirs.size(); ++i)
{
subpath += dirs[i];
if (!isDirectoryExist(subpath))

View File

@ -84,25 +84,11 @@ public:
int nWidth,
int nHeight,
Device::TextAlign eAlignMask,
const char * pFontName,
float fontSize,
float textTintR = 1.0,
float textTintG = 1.0,
float textTintB = 1.0,
bool shadow = false,
float shadowDeltaX = 0.0,
float shadowDeltaY = 0.0,
float shadowBlur = 0.0,
float shadowOpacity = 0.0,
bool stroke = false,
float strokeColorR = 0.0,
float strokeColorG = 0.0,
float strokeColorB = 0.0,
float strokeSize = 0.0 )
const FontDefinition& textDefinition )
{
JniMethodInfo methodInfo;
if (! JniHelper::getStaticMethodInfo(methodInfo, "org/cocos2dx/lib/Cocos2dxBitmap", "createTextBitmapShadowStroke",
"(Ljava/lang/String;Ljava/lang/String;IFFFIIIZFFFFZFFFF)Z"))
"(Ljava/lang/String;Ljava/lang/String;IIIIIIIIZFFFFZIIIIF)Z"))
{
CCLOG("%s %d: error to get methodInfo", __FILE__, __LINE__);
return false;
@ -110,7 +96,7 @@ public:
// Do a full lookup for the font path using FileUtils in case the given font name is a relative path to a font file asset,
// or the path has been mapped to a different location in the app package:
std::string fullPathOrFontName = FileUtils::getInstance()->fullPathForFilename(pFontName);
std::string fullPathOrFontName = FileUtils::getInstance()->fullPathForFilename(textDefinition._fontName);
// If the path name returned includes the 'assets' dir then that needs to be removed, because the android.content.Context
// requires this portion of the path to be omitted for assets inside the app package.
@ -128,22 +114,14 @@ public:
jstring jstrText = methodInfo.env->NewStringUTF(text);
jstring jstrFont = methodInfo.env->NewStringUTF(fullPathOrFontName.c_str());
if(!shadow)
{
shadowDeltaX = 0.0f;
shadowDeltaY = 0.0f;
shadowBlur = 0.0f;
shadowOpacity = 0.0f;
}
if (!stroke)
{
strokeColorR = 0.0f;
strokeColorG = 0.0f;
strokeColorB = 0.0f;
strokeSize = 0.0f;
}
if(!methodInfo.env->CallStaticBooleanMethod(methodInfo.classID, methodInfo.methodID, jstrText,
jstrFont, (int)fontSize, textTintR, textTintG, textTintB, eAlignMask, nWidth, nHeight, shadow, shadowDeltaX, -shadowDeltaY, shadowBlur, shadowOpacity, stroke, strokeColorR, strokeColorG, strokeColorB, strokeSize))
jstrFont, textDefinition._fontSize, textDefinition._fontFillColor.r, textDefinition._fontFillColor.g,
textDefinition._fontFillColor.b, textDefinition._fontAlpha,
eAlignMask, nWidth, nHeight,
textDefinition._shadow._shadowEnabled, textDefinition._shadow._shadowOffset.width, -textDefinition._shadow._shadowOffset.height,
textDefinition._shadow._shadowBlur, textDefinition._shadow._shadowOpacity,
textDefinition._stroke._strokeEnabled, textDefinition._stroke._strokeColor.r, textDefinition._stroke._strokeColor.g,
textDefinition._stroke._strokeColor.b, textDefinition._stroke._strokeAlpha, textDefinition._stroke._strokeSize))
{
return false;
}
@ -177,21 +155,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text
if(! dc.getBitmapFromJavaShadowStroke(text,
(int)textDefinition._dimensions.width,
(int)textDefinition._dimensions.height,
align, textDefinition._fontName.c_str(),
textDefinition._fontSize,
textDefinition._fontFillColor.r / 255.0f,
textDefinition._fontFillColor.g / 255.0f,
textDefinition._fontFillColor.b / 255.0f,
textDefinition._shadow._shadowEnabled,
textDefinition._shadow._shadowOffset.width,
textDefinition._shadow._shadowOffset.height,
textDefinition._shadow._shadowBlur,
textDefinition._shadow._shadowOpacity,
textDefinition._stroke._strokeEnabled,
textDefinition._stroke._strokeColor.r / 255.0f,
textDefinition._stroke._strokeColor.g / 255.0f,
textDefinition._stroke._strokeColor.b / 255.0f,
textDefinition._stroke._strokeSize )) { break;};
align, textDefinition )) { break;};
width = dc._width;
height = dc._height;

View File

@ -93,18 +93,18 @@ public class Cocos2dxBitmap {
final int fontSize, final int alignment, final int width,
final int height) {
createTextBitmapShadowStroke( string, fontName, fontSize, 1.0f, 1.0f, 1.0f, // text font and color
createTextBitmapShadowStroke( string, fontName, fontSize, 255, 255, 255, 255, // text font and color
alignment, width, height, // alignment and size
false, 0.0f, 0.0f, 0.0f, 0.0f, // no shadow
false, 1.0f, 1.0f, 1.0f, 1.0f); // no stroke
false, 255, 255, 255, 255, 0.0f); // no stroke
}
public static boolean createTextBitmapShadowStroke(String string, final String fontName, final int fontSize,
final float fontTintR, final float fontTintG, final float fontTintB,
final int alignment, final int width, final int height, final boolean shadow,
final float shadowDX, final float shadowDY, final float shadowBlur, final float shadowOpacity, final boolean stroke,
final float strokeR, final float strokeG, final float strokeB, final float strokeSize) {
public static boolean createTextBitmapShadowStroke(String string, final String fontName, int fontSize,
int fontTintR, int fontTintG, int fontTintB, int fontTintA,
int alignment, int width, int height,
boolean shadow, float shadowDX, float shadowDY, float shadowBlur, float shadowOpacity,
boolean stroke, int strokeR, int strokeG, int strokeB, int strokeA, float strokeSize) {
final int horizontalAlignment = alignment & 0x0F;
@ -126,7 +126,7 @@ public class Cocos2dxBitmap {
// set the paint color
paint.setARGB(255, (int)(255.0 * fontTintR), (int)(255.0 * fontTintG), (int)(255.0 * fontTintB));
paint.setARGB(fontTintA, fontTintR, fontTintG, fontTintB);
final TextProperty textProperty = Cocos2dxBitmap.computeTextProperty(string, width, height, paint);
final int bitmapTotalHeight = (height == 0 ? textProperty.mTotalHeight: height);
@ -158,7 +158,7 @@ public class Cocos2dxBitmap {
final Paint paintStroke = Cocos2dxBitmap.newPaint(fontName, fontSize, horizontalAlignment);
paintStroke.setStyle(Paint.Style.STROKE);
paintStroke.setStrokeWidth(strokeSize);
paintStroke.setARGB(255, (int) (strokeR * 255), (int) (strokeG * 255), (int) (strokeB * 255));
paintStroke.setARGB(strokeA, strokeR, strokeG, strokeB);
int x = 0;
int y = Cocos2dxBitmap.computeY(fontMetricsInt, height, textProperty.mTotalHeight, verticalAlignment);

View File

@ -54,7 +54,6 @@ public class Cocos2dxWebViewHelper {
onJsCallback(index, message);
}
@SuppressWarnings("unused")
public static int createWebView() {
final int index = viewTag;
sCocos2dxActivity.runOnUiThread(new Runnable() {
@ -72,7 +71,6 @@ public class Cocos2dxWebViewHelper {
return viewTag++;
}
@SuppressWarnings("unused")
public static void removeWebView(final int index) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
@ -86,7 +84,6 @@ public class Cocos2dxWebViewHelper {
});
}
@SuppressWarnings("unused")
public static void setVisible(final int index, final boolean visible) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
@ -99,7 +96,6 @@ public class Cocos2dxWebViewHelper {
});
}
@SuppressWarnings("unused")
public static void setWebViewRect(final int index, final int left, final int top, final int maxWidth, final int maxHeight) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
@ -112,7 +108,6 @@ public class Cocos2dxWebViewHelper {
});
}
@SuppressWarnings("unused")
public static void setJavascriptInterfaceScheme(final int index, final String scheme) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
@ -125,33 +120,30 @@ public class Cocos2dxWebViewHelper {
});
}
@SuppressWarnings("unused")
public static void loadData(final int index, final String data, final String mimeType, final String encoding, final String baseURL) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
Cocos2dxWebView webView = webViews.get(index);
if (webView != null) {
webView.loadDataWithBaseURL(baseURL, data, mimeType, encoding, null);
webView.loadDataWithBaseURL(baseURL, data, mimeType, encoding, null);
}
}
});
}
@SuppressWarnings("unused")
public static void loadHTMLString(final int index, final String htmlString, final String mimeType, final String encoding) {
public static void loadHTMLString(final int index, final String data, final String baseUrl) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
public void run() {
Cocos2dxWebView webView = webViews.get(index);
if (webView != null) {
webView.loadData(htmlString, mimeType, encoding);
webView.loadDataWithBaseURL(baseUrl, data, null, null, null);
}
}
});
}
@SuppressWarnings("unused")
public static void loadUrl(final int index, final String url) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
@ -164,7 +156,6 @@ public class Cocos2dxWebViewHelper {
});
}
@SuppressWarnings("unused")
public static void loadFile(final int index, final String filePath) {
if (CocosPlayClient.isEnabled() && !CocosPlayClient.isDemo()) {
CocosPlayClient.updateAssets(filePath);
@ -212,7 +203,6 @@ public class Cocos2dxWebViewHelper {
return task.get();
}
@SuppressWarnings("unused")
public static boolean canGoBack(final int index) {
Callable<Boolean> callable = new Callable<Boolean>() {
@Override
@ -230,7 +220,6 @@ public class Cocos2dxWebViewHelper {
}
}
@SuppressWarnings("unused")
public static boolean canGoForward(final int index) {
Callable<Boolean> callable = new Callable<Boolean>() {
@Override
@ -248,7 +237,6 @@ public class Cocos2dxWebViewHelper {
}
}
@SuppressWarnings("unused")
public static void goBack(final int index) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
@ -261,7 +249,6 @@ public class Cocos2dxWebViewHelper {
});
}
@SuppressWarnings("unused")
public static void goForward(final int index) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
@ -274,7 +261,6 @@ public class Cocos2dxWebViewHelper {
});
}
@SuppressWarnings("unused")
public static void evaluateJS(final int index, final String js) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override
@ -287,7 +273,6 @@ public class Cocos2dxWebViewHelper {
});
}
@SuppressWarnings("unused")
public static void setScalesPageToFit(final int index, final boolean scalesPageToFit) {
sCocos2dxActivity.runOnUiThread(new Runnable() {
@Override

View File

@ -192,10 +192,12 @@ typedef struct
float strokeColorR;
float strokeColorG;
float strokeColorB;
float strokeColorA;
float strokeSize;
float tintColorR;
float tintColorG;
float tintColorB;
float tintColorA;
unsigned char* data;
@ -355,7 +357,7 @@ static bool _initWithString(const char * text, cocos2d::Device::TextAlign align,
}
// text color
CGContextSetRGBFillColor(context, info->tintColorR, info->tintColorG, info->tintColorB, 1);
CGContextSetRGBFillColor(context, info->tintColorR, info->tintColorG, info->tintColorB, info->tintColorA);
// move Y rendering to the top of the image
CGContextTranslateCTM(context, 0.0f, (dim.height - shadowStrokePaddingY) );
CGContextScaleCTM(context, 1.0f, -1.0f); //NOTE: NSString draws in UIKit referential i.e. renders upside-down compared to CGBitmapContext referential
@ -402,12 +404,12 @@ static bool _initWithString(const char * text, cocos2d::Device::TextAlign align,
NSForegroundColorAttributeName:[UIColor colorWithRed:info->tintColorR
green:info->tintColorG
blue:info->tintColorB
alpha:1.0f],
alpha:info->tintColorA],
NSParagraphStyleAttributeName:paragraphStyle,
NSStrokeColorAttributeName: [UIColor colorWithRed:info->strokeColorR
green:info->strokeColorG
blue:info->strokeColorB
alpha:1.0f]
alpha:info->strokeColorA]
}
];
@ -415,7 +417,7 @@ static bool _initWithString(const char * text, cocos2d::Device::TextAlign align,
}
else
{
CGContextSetRGBStrokeColor(context, info->strokeColorR, info->strokeColorG, info->strokeColorB, 1);
CGContextSetRGBStrokeColor(context, info->strokeColorR, info->strokeColorG, info->strokeColorB, info->strokeColorA);
CGContextSetLineWidth(context, info->strokeSize);
//original code that was not working in iOS 7
@ -466,10 +468,12 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text
info.strokeColorR = textDefinition._stroke._strokeColor.r / 255.0f;
info.strokeColorG = textDefinition._stroke._strokeColor.g / 255.0f;
info.strokeColorB = textDefinition._stroke._strokeColor.b / 255.0f;
info.strokeColorB = textDefinition._stroke._strokeAlpha / 255.0f;
info.strokeSize = textDefinition._stroke._strokeSize;
info.tintColorR = textDefinition._fontFillColor.r / 255.0f;
info.tintColorG = textDefinition._fontFillColor.g / 255.0f;
info.tintColorB = textDefinition._fontFillColor.b / 255.0f;
info.tintColorA = textDefinition._fontAlpha / 255.0f;
if (! _initWithString(text, align, textDefinition._fontName.c_str(), textDefinition._fontSize, &info))
{

View File

@ -59,7 +59,7 @@ typedef struct
unsigned char* data;
} tImageInfo;
static bool _initWithString(const char * text, Device::TextAlign align, const char * fontName, int size, tImageInfo* info, const Color3B* strokeColor)
static bool _initWithString(const char * text, Device::TextAlign align, const char * fontName, int size, tImageInfo* info, const Color3B* fontColor, int fontAlpha)
{
bool ret = false;
@ -90,8 +90,8 @@ static bool _initWithString(const char * text, Device::TextAlign align, const ch
// color
NSColor* foregroundColor;
if (strokeColor) {
foregroundColor = [NSColor colorWithDeviceRed:strokeColor->r/255.0 green:strokeColor->g/255.0 blue:strokeColor->b/255.0 alpha:1];
if (fontColor) {
foregroundColor = [NSColor colorWithDeviceRed:fontColor->r/255.0 green:fontColor->g/255.0 blue:fontColor->b/255.0 alpha:fontAlpha/255.0];
} else {
foregroundColor = [NSColor whiteColor];
}
@ -132,9 +132,9 @@ static bool _initWithString(const char * text, Device::TextAlign align, const ch
lastBreakLocation = i + insertCount;
}
textSize = [lineBreak sizeWithAttributes:tokenAttributesDict];
if(info->height > 0 && textSize.height > info->height)
if(info->height > 0 && (int)textSize.height > info->height)
break;
if (textSize.width > info->width) {
if ((int)textSize.width > info->width) {
if(lastBreakLocation > 0) {
[lineBreak insertString:@"\r" atIndex:lastBreakLocation];
lastBreakLocation = 0;
@ -235,7 +235,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text
info.width = textDefinition._dimensions.width;
info.height = textDefinition._dimensions.height;
if (! _initWithString(text, align, textDefinition._fontName.c_str(), textDefinition._fontSize, &info, &textDefinition._fontFillColor)) //pStrokeColor))
if (! _initWithString(text, align, textDefinition._fontName.c_str(), textDefinition._fontSize, &info, &textDefinition._fontFillColor, textDefinition._fontAlpha))
{
break;
}

View File

@ -432,6 +432,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text
(LPBITMAPINFO)&bi, DIB_RGB_COLORS);
COLORREF textColor = (textDefinition._fontFillColor.b << 16 | textDefinition._fontFillColor.g << 8 | textDefinition._fontFillColor.r) & 0x00ffffff;
float alpha = textDefinition._fontAlpha / 255.0f;
COLORREF * pPixel = nullptr;
for (int y = 0; y < height; ++y)
{
@ -439,7 +440,7 @@ Data Device::getTextureDataForText(const char * text, const FontDefinition& text
for (int x = 0; x < width; ++x)
{
COLORREF& clr = *pPixel;
clr = (GetRValue(clr) << 24) | textColor;
clr = ((BYTE)(GetRValue(clr) * alpha) << 24) | textColor;
++pPixel;
}
}

View File

@ -36,13 +36,14 @@ using namespace Windows::Graphics::Display;
USING_NS_CC;
Cocos2dRenderer::Cocos2dRenderer(int width, int height, float dpi, CoreDispatcher^ dispatcher, Panel^ panel)
Cocos2dRenderer::Cocos2dRenderer(int width, int height, float dpi, DisplayOrientations orientation, CoreDispatcher^ dispatcher, Panel^ panel)
: m_app(nullptr)
, m_width(width)
, m_height(height)
, m_dpi(dpi)
, m_dispatcher(dispatcher)
, m_panel(panel)
, m_orientation(orientation)
{
m_app = new AppDelegate();
}
@ -62,7 +63,7 @@ void Cocos2dRenderer::Resume()
GLViewImpl* glview = GLViewImpl::create("Test Cpp");
glview->setDispatcher(m_dispatcher.Get());
glview->setPanel(m_panel.Get());
glview->Create(static_cast<float>(m_width), static_cast<float>(m_height), m_dpi, DisplayOrientations::Landscape);
glview->Create(static_cast<float>(m_width), static_cast<float>(m_height), m_dpi, m_orientation);
director->setOpenGLView(glview);
CCApplication::getInstance()->run();
}
@ -104,8 +105,14 @@ void Cocos2dRenderer::DeviceLost()
void Cocos2dRenderer::Draw(GLsizei width, GLsizei height, float dpi)
void Cocos2dRenderer::Draw(GLsizei width, GLsizei height, float dpi, DisplayOrientations orientation)
{
if (orientation != m_orientation)
{
m_orientation = orientation;
GLViewImpl::sharedOpenGLView()->UpdateOrientation(orientation);
}
if (width != m_width || height != m_height)
{
m_width = width;

View File

@ -29,9 +29,11 @@ namespace cocos2d
class Cocos2dRenderer
{
public:
Cocos2dRenderer( int width, int height, float dpi, Windows::UI::Core::CoreDispatcher^ dispathcer, Windows::UI::Xaml::Controls::Panel^ panel);
Cocos2dRenderer(int width, int height, float dpi,
Windows::Graphics::Display::DisplayOrientations orientation,
Windows::UI::Core::CoreDispatcher^ dispathcer, Windows::UI::Xaml::Controls::Panel^ panel);
~Cocos2dRenderer();
void Draw(GLsizei width, GLsizei height, float dpi);
void Draw(GLsizei width, GLsizei height, float dpi, Windows::Graphics::Display::DisplayOrientations orientation);
void QueuePointerEvent(PointerEventType type, Windows::UI::Core::PointerEventArgs^ args);
void QueueKeyBoardEvent(Cocos2dKeyEvent type, Windows::UI::Core::KeyEventArgs^ e);
void Pause();
@ -48,5 +50,6 @@ namespace cocos2d
AppDelegate* m_app;
Platform::Agile<Windows::UI::Core::CoreDispatcher> m_dispatcher;
Platform::Agile<Windows::UI::Xaml::Controls::Panel> m_panel;
Windows::Graphics::Display::DisplayOrientations m_orientation;
};
}

View File

@ -49,7 +49,8 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
mUseCustomRenderSurfaceSize(false),
m_coreInput(nullptr),
m_dpi(0.0f),
m_deviceLost(false)
m_deviceLost(false),
m_orientation(DisplayOrientations::Landscape)
{
InitializeComponent();
@ -61,6 +62,13 @@ OpenGLESPage::OpenGLESPage(OpenGLES* openGLES) :
swapChainPanel->SizeChanged +=
ref new Windows::UI::Xaml::SizeChangedEventHandler(this, &OpenGLESPage::OnSwapChainPanelSizeChanged);
DisplayInformation^ currentDisplayInformation = DisplayInformation::GetForCurrentView();
currentDisplayInformation->OrientationChanged +=
ref new TypedEventHandler<DisplayInformation^, Object^>(this, &OpenGLESPage::OnOrientationChanged);
m_orientation = currentDisplayInformation->CurrentOrientation;
this->Loaded +=
ref new Windows::UI::Xaml::RoutedEventHandler(this, &OpenGLESPage::OnPageLoaded);
@ -137,7 +145,11 @@ void OpenGLESPage::OnPointerReleased(Object^ sender, PointerEventArgs^ e)
}
}
void OpenGLESPage::OnOrientationChanged(DisplayInformation^ sender, Object^ args)
{
critical_section::scoped_lock lock(mSwapChainPanelSizeCriticalSection);
m_orientation = sender->CurrentOrientation;
}
void OpenGLESPage::OnVisibilityChanged(Windows::UI::Core::CoreWindow^ sender, Windows::UI::Core::VisibilityChangedEventArgs^ args)
{
@ -246,7 +258,7 @@ void OpenGLESPage::StartRenderLoop()
if (m_renderer.get() == nullptr)
{
m_renderer = std::make_shared<Cocos2dRenderer>(panelWidth, panelHeight, m_dpi, dispatcher, swapChainPanel);
m_renderer = std::make_shared<Cocos2dRenderer>(panelWidth, panelHeight, m_dpi, m_orientation, dispatcher, swapChainPanel);
}
if (m_deviceLost)
@ -263,7 +275,7 @@ void OpenGLESPage::StartRenderLoop()
while (action->Status == Windows::Foundation::AsyncStatus::Started && !m_deviceLost)
{
GetSwapChainPanelSize(&panelWidth, &panelHeight);
m_renderer.get()->Draw(panelWidth, panelHeight, m_dpi);
m_renderer.get()->Draw(panelWidth, panelHeight, m_dpi, m_orientation);
// The call to eglSwapBuffers might not be successful (i.e. due to Device Lost)
// If the call fails, then we must reinitialize EGL and the GL resources.

View File

@ -68,8 +68,11 @@ namespace cocos2d
void OnPointerMoved(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
void OnPointerReleased(Platform::Object^ sender, Windows::UI::Core::PointerEventArgs^ e);
void OnOrientationChanged(Windows::Graphics::Display::DisplayInformation^ sender, Platform::Object^ args);
float m_dpi;
bool m_deviceLost;
Windows::Graphics::Display::DisplayOrientations m_orientation;
};
}

View File

@ -120,7 +120,7 @@ void Device::setAccelerometerEnabled(bool isEnabled)
case DisplayOrientations::LandscapeFlipped:
acc.x = reading->AccelerationY;
acc.y = reading->AccelerationX;
acc.y = -reading->AccelerationX;
break;
default:
@ -148,8 +148,8 @@ void Device::setAccelerometerEnabled(bool isEnabled)
break;
case DisplayOrientations::LandscapeFlipped:
acc.x = -reading->AccelerationY;
acc.y = reading->AccelerationX;
acc.x = -reading->AccelerationX;
acc.y = -reading->AccelerationY;
break;
default:

View File

@ -89,6 +89,7 @@ unsigned char* CCFreeTypeFont::initWithString(const char * text, const FontDefin
m_fontFillColorR = textDefinition._fontFillColor.r;
m_fontFillColorG = textDefinition._fontFillColor.g;
m_fontFillColorB = textDefinition._fontFillColor.b;
m_fontFillColorA = textDefinition._fontAlpha;
#if 0
// check the cache for the font file buffer
@ -297,6 +298,7 @@ void CCFreeTypeFont::draw_bitmap(unsigned char* pBuffer, FT_Bitmap* bitmap, FT_
FT_Int i, j, p, q;
FT_Int x_max = x + bitmap->width;
FT_Int y_max = y + bitmap->rows;
float fontAlpha = m_fontFillColorA / 255.0f;
for (i = x, p = 0; i < x_max; i++, p++)
{
@ -313,7 +315,7 @@ void CCFreeTypeFont::draw_bitmap(unsigned char* pBuffer, FT_Bitmap* bitmap, FT_
pBuffer[index++] = m_fontFillColorR;
pBuffer[index++] = m_fontFillColorG;
pBuffer[index++] = m_fontFillColorB;
pBuffer[index++] = value;
pBuffer[index++] = value * fontAlpha;
}
}
}

View File

@ -132,6 +132,7 @@ private:
int m_fontFillColorR;
int m_fontFillColorG;
int m_fontFillColorB;
int m_fontFillColorA;
};
NS_CC_END

View File

@ -86,7 +86,7 @@ const unsigned char s_133478C5A874C1E6F59B418CE6C7C39F1AE0F873[] = {
120, 116, 117, 114, 101, 48, 0, 0,
0, 0, 1, 0, 0, 0, 248, 3,
0, 0, 4, 5, 0, 0, 0, 0,
0, 0, 210, 169, 0, 0, 0, 0,
0, 0, 217, 203, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 68, 88, 66, 67, 205, 227,
165, 164, 175, 20, 143, 214, 229, 157,
@ -456,7 +456,7 @@ const unsigned char s_13E33F532157A58EC77EDE3B3112560A89D272B2[] = {
116, 114, 105, 120, 0, 0, 0, 0,
0, 0, 0, 0, 204, 2, 0, 0,
164, 4, 0, 0, 0, 0, 0, 0,
210, 169, 0, 0, 0, 0, 0, 0,
217, 203, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
68, 88, 66, 67, 251, 171, 196, 153,
103, 104, 123, 148, 169, 33, 147, 252,
@ -800,7 +800,7 @@ const unsigned char s_1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE[] = {
116, 67, 111, 108, 111, 114, 0, 0,
0, 0, 3, 0, 0, 0, 208, 7,
0, 0, 4, 5, 0, 0, 0, 0,
0, 0, 210, 169, 0, 0, 0, 0,
0, 0, 217, 203, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 68, 88, 66, 67, 96, 232,
228, 187, 244, 35, 104, 223, 77, 10,
@ -1462,7 +1462,7 @@ const unsigned char s_2CF9793879165058483EFB4AD6FA9746ECD7DD2A[] = {
99, 111, 108, 111, 114, 0, 0, 0,
0, 16, 0, 0, 0, 236, 16, 0,
0, 124, 10, 0, 0, 0, 0, 0,
0, 210, 169, 0, 0, 0, 0, 0,
0, 217, 203, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 68, 88, 66, 67, 2, 25, 137,
206, 217, 191, 45, 93, 183, 145, 101,
@ -2344,326 +2344,325 @@ const unsigned char s_2CF9793879165058483EFB4AD6FA9746ECD7DD2A[] = {
171,
};
const unsigned char s_3B90B53AB54C964575CF2DA4BC9C86A594B6613E[] = {
const unsigned char s_502845049F68EB561266A6F565B06F642ADD3E53[] = {
166, 147, 0, 0, 142, 9, 2, 1,
0, 128, 0, 0, 82, 139, 0, 0,
10, 0, 0, 0, 97, 95, 112, 111,
115, 105, 116, 105, 111, 110, 2, 0,
115, 105, 116, 105, 111, 110, 1, 0,
0, 0, 82, 139, 0, 0, 7, 0,
0, 0, 97, 95, 99, 111, 108, 111,
114, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 255, 255, 255,
255, 0, 0, 0, 0, 0, 0, 0,
0, 255, 255, 255, 255, 0, 0, 0,
0, 0, 0, 0, 0, 255, 255, 255,
255, 0, 0, 0, 0, 0, 0, 0,
0, 255, 255, 255, 255, 0, 0, 0,
0, 0, 0, 0, 0, 255, 255, 255,
255, 0, 0, 0, 0, 0, 0, 0,
0, 255, 255, 255, 255, 0, 0, 0,
0, 0, 0, 0, 0, 255, 255, 255,
255, 6, 20, 0, 0, 11, 0, 0,
0, 97, 95, 112, 111, 105, 110, 116,
83, 105, 122, 101, 1, 0, 0, 0,
114, 0, 0, 0, 0, 80, 139, 0,
0, 10, 0, 0, 0, 97, 95, 116,
101, 120, 67, 111, 111, 114, 100, 2,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 255, 255, 255, 255, 0,
0, 0, 0, 0, 0, 0, 0, 255,
255, 255, 255, 0, 0, 0, 0, 0,
0, 0, 0, 255, 255, 255, 255, 0,
0, 0, 0, 0, 0, 0, 0, 255,
255, 255, 255, 0, 0, 0, 0, 0,
0, 0, 0, 255, 255, 255, 255, 0,
0, 0, 0, 0, 0, 0, 0, 255,
255, 255, 255, 0, 0, 0, 0, 0,
0, 0, 0, 255, 255, 255, 255, 0,
0, 0, 0, 0, 0, 0, 0, 255,
255, 255, 255, 0, 0, 0, 0, 0,
0, 0, 0, 255, 255, 255, 255, 0,
0, 0, 0, 0, 0, 0, 0, 255,
255, 255, 255, 0, 0, 0, 0, 0,
0, 0, 0, 255, 255, 255, 255, 0,
0, 0, 0, 0, 0, 0, 0, 255,
255, 255, 255, 0, 0, 0, 0, 0,
0, 0, 0, 255, 255, 255, 255, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1,
1, 0, 0, 0, 92, 139, 0, 0,
241, 141, 0, 0, 12, 0, 0, 0,
67, 67, 95, 77, 86, 80, 77, 97,
116, 114, 105, 120, 0, 0, 0, 0,
255, 255, 255, 255, 0, 0, 0, 0,
0, 0, 0, 0, 255, 255, 255, 255,
4, 0, 0, 0, 1, 0, 0, 0,
12, 0, 0, 0, 67, 67, 95, 77,
86, 80, 77, 97, 116, 114, 105, 120,
0, 0, 0, 0, 0, 0, 0, 0,
255, 255, 255, 255, 0, 0, 0, 0,
0, 0, 0, 0, 255, 255, 255, 255,
204, 2, 0, 0, 168, 4, 0, 0,
0, 0, 0, 0, 217, 203, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
255, 255, 255, 255, 0, 0, 0, 0,
0, 0, 0, 0, 255, 255, 255, 255,
0, 0, 0, 0, 68, 88, 66, 67,
251, 171, 196, 153, 103, 104, 123, 148,
169, 33, 147, 252, 223, 201, 186, 87,
1, 0, 0, 0, 204, 2, 0, 0,
6, 0, 0, 0, 56, 0, 0, 0,
168, 0, 0, 0, 72, 1, 0, 0,
196, 1, 0, 0, 28, 2, 0, 0,
80, 2, 0, 0, 65, 111, 110, 57,
104, 0, 0, 0, 104, 0, 0, 0,
0, 2, 255, 255, 68, 0, 0, 0,
36, 0, 0, 0, 0, 0, 36, 0,
0, 0, 36, 0, 0, 0, 36, 0,
0, 0, 36, 0, 0, 0, 36, 0,
1, 2, 255, 255, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0, 15, 176,
1, 0, 0, 2, 0, 8, 15, 128,
0, 0, 228, 176, 1, 0, 0, 2,
1, 8, 15, 128, 0, 0, 228, 176,
1, 0, 0, 2, 2, 8, 15, 128,
0, 0, 228, 176, 1, 0, 0, 2,
3, 8, 15, 128, 0, 0, 228, 176,
255, 255, 0, 0, 83, 72, 68, 82,
152, 0, 0, 0, 64, 0, 0, 0,
38, 0, 0, 0, 98, 16, 0, 3,
242, 16, 16, 0, 0, 0, 0, 0,
101, 0, 0, 3, 242, 32, 16, 0,
0, 0, 0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 1, 0, 0, 0,
101, 0, 0, 3, 242, 32, 16, 0,
2, 0, 0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 3, 0, 0, 0,
54, 0, 0, 5, 242, 32, 16, 0,
0, 0, 0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 54, 0, 0, 5,
242, 32, 16, 0, 1, 0, 0, 0,
70, 30, 16, 0, 0, 0, 0, 0,
54, 0, 0, 5, 242, 32, 16, 0,
2, 0, 0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 54, 0, 0, 5,
242, 32, 16, 0, 3, 0, 0, 0,
70, 30, 16, 0, 0, 0, 0, 0,
62, 0, 0, 1, 83, 84, 65, 84,
116, 0, 0, 0, 5, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
5, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
82, 68, 69, 70, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 28, 0, 0, 0,
0, 4, 255, 255, 0, 65, 0, 0,
28, 0, 0, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32, 40, 82,
41, 32, 72, 76, 83, 76, 32, 83,
104, 97, 100, 101, 114, 32, 67, 111,
109, 112, 105, 108, 101, 114, 32, 54,
46, 51, 46, 57, 54, 48, 48, 46,
49, 55, 52, 49, 53, 0, 171, 171,
73, 83, 71, 78, 44, 0, 0, 0,
1, 0, 0, 0, 8, 0, 0, 0,
32, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 15, 0, 0,
84, 69, 88, 67, 79, 79, 82, 68,
0, 171, 171, 171, 79, 83, 71, 78,
116, 0, 0, 0, 4, 0, 0, 0,
8, 0, 0, 0, 104, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 104, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0, 0, 0,
15, 0, 0, 0, 104, 0, 0, 0,
2, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0, 0, 0,
15, 0, 0, 0, 104, 0, 0, 0,
3, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 3, 0, 0, 0,
15, 0, 0, 0, 83, 86, 95, 84,
97, 114, 103, 101, 116, 0, 171, 171,
68, 88, 66, 67, 239, 235, 75, 231,
70, 132, 186, 178, 164, 139, 101, 82,
192, 188, 196, 194, 1, 0, 0, 0,
168, 4, 0, 0, 6, 0, 0, 0,
56, 0, 0, 0, 68, 1, 0, 0,
156, 2, 0, 0, 24, 3, 0, 0,
236, 3, 0, 0, 80, 4, 0, 0,
65, 111, 110, 57, 4, 1, 0, 0,
4, 1, 0, 0, 0, 2, 254, 255,
208, 0, 0, 0, 52, 0, 0, 0,
1, 0, 36, 0, 0, 0, 48, 0,
0, 0, 48, 0, 0, 0, 36, 0,
1, 0, 48, 0, 0, 0, 0, 0,
4, 0, 1, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 2, 254, 255,
81, 0, 0, 5, 5, 0, 15, 160,
0, 0, 0, 63, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
31, 0, 0, 2, 5, 0, 0, 128,
0, 0, 15, 144, 31, 0, 0, 2,
5, 0, 1, 128, 1, 0, 15, 144,
9, 0, 0, 3, 0, 0, 1, 128,
3, 0, 228, 160, 1, 0, 228, 144,
9, 0, 0, 3, 0, 0, 2, 128,
4, 0, 228, 160, 1, 0, 228, 144,
2, 0, 0, 3, 0, 0, 1, 128,
0, 0, 85, 128, 0, 0, 0, 128,
5, 0, 0, 3, 0, 0, 4, 192,
0, 0, 0, 128, 5, 0, 0, 160,
9, 0, 0, 3, 0, 0, 1, 128,
2, 0, 228, 160, 1, 0, 228, 144,
1, 0, 0, 2, 1, 0, 2, 128,
0, 0, 0, 129, 9, 0, 0, 3,
1, 0, 1, 128, 1, 0, 228, 160,
1, 0, 228, 144, 4, 0, 0, 4,
0, 0, 3, 192, 0, 0, 85, 128,
0, 0, 228, 160, 1, 0, 228, 128,
1, 0, 0, 2, 0, 0, 8, 192,
0, 0, 85, 128, 1, 0, 0, 2,
0, 0, 15, 224, 0, 0, 228, 144,
255, 255, 0, 0, 83, 72, 68, 82,
80, 1, 0, 0, 64, 0, 1, 0,
84, 0, 0, 0, 89, 0, 0, 4,
70, 142, 32, 0, 0, 0, 0, 0,
4, 0, 0, 0, 95, 0, 0, 3,
242, 16, 16, 0, 0, 0, 0, 0,
95, 0, 0, 3, 242, 16, 16, 0,
1, 0, 0, 0, 101, 0, 0, 3,
242, 32, 16, 0, 0, 0, 0, 0,
103, 0, 0, 4, 242, 32, 16, 0,
1, 0, 0, 0, 1, 0, 0, 0,
104, 0, 0, 2, 1, 0, 0, 0,
54, 0, 0, 5, 242, 32, 16, 0,
0, 0, 0, 0, 70, 30, 16, 0,
0, 0, 0, 0, 17, 0, 0, 8,
18, 0, 16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0, 0, 0,
1, 0, 0, 0, 70, 30, 16, 0,
1, 0, 0, 0, 54, 0, 0, 6,
34, 32, 16, 0, 1, 0, 0, 0,
10, 0, 16, 128, 65, 0, 0, 0,
0, 0, 0, 0, 17, 0, 0, 8,
18, 0, 16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0, 0, 0,
2, 0, 0, 0, 70, 30, 16, 0,
1, 0, 0, 0, 17, 0, 0, 8,
34, 0, 16, 0, 0, 0, 0, 0,
70, 142, 32, 0, 0, 0, 0, 0,
3, 0, 0, 0, 70, 30, 16, 0,
1, 0, 0, 0, 0, 0, 0, 7,
18, 0, 16, 0, 0, 0, 0, 0,
26, 0, 16, 0, 0, 0, 0, 0,
10, 0, 16, 0, 0, 0, 0, 0,
54, 0, 0, 5, 130, 32, 16, 0,
1, 0, 0, 0, 26, 0, 16, 0,
0, 0, 0, 0, 56, 0, 0, 7,
66, 32, 16, 0, 1, 0, 0, 0,
10, 0, 16, 0, 0, 0, 0, 0,
1, 64, 0, 0, 0, 0, 0, 63,
17, 0, 0, 8, 18, 32, 16, 0,
1, 0, 0, 0, 70, 142, 32, 0,
0, 0, 0, 0, 0, 0, 0, 0,
70, 30, 16, 0, 1, 0, 0, 0,
62, 0, 0, 1, 83, 84, 65, 84,
116, 0, 0, 0, 10, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 7, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
2, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
82, 68, 69, 70, 204, 0, 0, 0,
1, 0, 0, 0, 72, 0, 0, 0,
1, 0, 0, 0, 28, 0, 0, 0,
0, 4, 254, 255, 0, 65, 0, 0,
152, 0, 0, 0, 60, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 36, 71, 108, 111,
98, 97, 108, 115, 0, 171, 171, 171,
60, 0, 0, 0, 1, 0, 0, 0,
96, 0, 0, 0, 64, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
1, 1, 0, 0, 0, 92, 139, 0,
0, 241, 141, 0, 0, 12, 0, 0,
0, 67, 67, 95, 77, 86, 80, 77,
97, 116, 114, 105, 120, 0, 0, 0,
0, 255, 255, 255, 255, 0, 0, 0,
0, 4, 0, 0, 0, 1, 0, 0,
0, 12, 0, 0, 0, 67, 67, 95,
77, 86, 80, 77, 97, 116, 114, 105,
120, 0, 0, 0, 0, 0, 0, 0,
0, 204, 2, 0, 0, 168, 4, 0,
0, 0, 0, 0, 0, 210, 169, 0,
64, 0, 0, 0, 2, 0, 0, 0,
136, 0, 0, 0, 0, 0, 0, 0,
95, 67, 67, 95, 77, 86, 80, 77,
97, 116, 114, 105, 120, 0, 171, 171,
3, 0, 3, 0, 4, 0, 4, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 68, 88, 66,
67, 251, 171, 196, 153, 103, 104, 123,
148, 169, 33, 147, 252, 223, 201, 186,
87, 1, 0, 0, 0, 204, 2, 0,
0, 6, 0, 0, 0, 56, 0, 0,
0, 168, 0, 0, 0, 72, 1, 0,
0, 196, 1, 0, 0, 28, 2, 0,
0, 80, 2, 0, 0, 65, 111, 110,
57, 104, 0, 0, 0, 104, 0, 0,
0, 0, 2, 255, 255, 68, 0, 0,
0, 36, 0, 0, 0, 0, 0, 36,
0, 0, 0, 36, 0, 0, 0, 36,
0, 0, 0, 36, 0, 0, 0, 36,
0, 1, 2, 255, 255, 31, 0, 0,
2, 0, 0, 0, 128, 0, 0, 15,
176, 1, 0, 0, 2, 0, 8, 15,
128, 0, 0, 228, 176, 1, 0, 0,
2, 1, 8, 15, 128, 0, 0, 228,
176, 1, 0, 0, 2, 2, 8, 15,
128, 0, 0, 228, 176, 1, 0, 0,
2, 3, 8, 15, 128, 0, 0, 228,
176, 255, 255, 0, 0, 83, 72, 68,
82, 152, 0, 0, 0, 64, 0, 0,
0, 38, 0, 0, 0, 98, 16, 0,
3, 242, 16, 16, 0, 0, 0, 0,
0, 101, 0, 0, 3, 242, 32, 16,
0, 0, 0, 0, 0, 101, 0, 0,
3, 242, 32, 16, 0, 1, 0, 0,
0, 101, 0, 0, 3, 242, 32, 16,
0, 2, 0, 0, 0, 101, 0, 0,
3, 242, 32, 16, 0, 3, 0, 0,
0, 54, 0, 0, 5, 242, 32, 16,
0, 0, 0, 0, 0, 70, 30, 16,
0, 0, 0, 0, 0, 54, 0, 0,
5, 242, 32, 16, 0, 1, 0, 0,
0, 70, 30, 16, 0, 0, 0, 0,
0, 54, 0, 0, 5, 242, 32, 16,
0, 2, 0, 0, 0, 70, 30, 16,
0, 0, 0, 0, 0, 54, 0, 0,
5, 242, 32, 16, 0, 3, 0, 0,
0, 70, 30, 16, 0, 0, 0, 0,
0, 62, 0, 0, 1, 83, 84, 65,
84, 116, 0, 0, 0, 5, 0, 0,
77, 105, 99, 114, 111, 115, 111, 102,
116, 32, 40, 82, 41, 32, 72, 76,
83, 76, 32, 83, 104, 97, 100, 101,
114, 32, 67, 111, 109, 112, 105, 108,
101, 114, 32, 54, 46, 51, 46, 57,
54, 48, 48, 46, 49, 55, 52, 49,
53, 0, 171, 171, 73, 83, 71, 78,
92, 0, 0, 0, 3, 0, 0, 0,
8, 0, 0, 0, 80, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 5, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 4, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 82, 68, 69, 70, 80, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 28, 0, 0,
0, 0, 4, 255, 255, 0, 65, 0,
0, 28, 0, 0, 0, 77, 105, 99,
114, 111, 115, 111, 102, 116, 32, 40,
82, 41, 32, 72, 76, 83, 76, 32,
83, 104, 97, 100, 101, 114, 32, 67,
111, 109, 112, 105, 108, 101, 114, 32,
54, 46, 51, 46, 57, 54, 48, 48,
46, 49, 55, 52, 49, 53, 0, 171,
171, 73, 83, 71, 78, 44, 0, 0,
0, 1, 0, 0, 0, 8, 0, 0,
0, 32, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 3, 0, 0,
0, 0, 0, 0, 0, 15, 15, 0,
0, 84, 69, 88, 67, 79, 79, 82,
68, 0, 171, 171, 171, 79, 83, 71,
78, 116, 0, 0, 0, 4, 0, 0,
0, 8, 0, 0, 0, 104, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 3, 0, 0, 0, 0, 0, 0,
0, 15, 0, 0, 0, 104, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0,
0, 3, 0, 0, 0, 1, 0, 0,
0, 15, 0, 0, 0, 104, 0, 0,
0, 2, 0, 0, 0, 0, 0, 0,
0, 3, 0, 0, 0, 2, 0, 0,
0, 15, 0, 0, 0, 104, 0, 0,
0, 3, 0, 0, 0, 0, 0, 0,
0, 3, 0, 0, 0, 3, 0, 0,
0, 15, 0, 0, 0, 83, 86, 95,
84, 97, 114, 103, 101, 116, 0, 171,
171, 68, 88, 66, 67, 37, 104, 16,
63, 174, 212, 223, 93, 154, 196, 66,
107, 123, 58, 61, 130, 1, 0, 0,
0, 168, 4, 0, 0, 6, 0, 0,
0, 56, 0, 0, 0, 68, 1, 0,
0, 156, 2, 0, 0, 24, 3, 0,
0, 236, 3, 0, 0, 80, 4, 0,
0, 65, 111, 110, 57, 4, 1, 0,
0, 4, 1, 0, 0, 0, 2, 254,
255, 208, 0, 0, 0, 52, 0, 0,
0, 1, 0, 36, 0, 0, 0, 48,
0, 0, 0, 48, 0, 0, 0, 36,
0, 1, 0, 48, 0, 0, 0, 0,
0, 4, 0, 1, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 2, 254,
255, 81, 0, 0, 5, 5, 0, 15,
160, 0, 0, 0, 63, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 31, 0, 0, 2, 5, 0, 0,
128, 0, 0, 15, 144, 31, 0, 0,
2, 5, 0, 2, 128, 2, 0, 15,
144, 9, 0, 0, 3, 0, 0, 1,
128, 3, 0, 228, 160, 2, 0, 228,
144, 9, 0, 0, 3, 0, 0, 2,
128, 4, 0, 228, 160, 2, 0, 228,
144, 2, 0, 0, 3, 0, 0, 1,
128, 0, 0, 85, 128, 0, 0, 0,
128, 5, 0, 0, 3, 0, 0, 4,
192, 0, 0, 0, 128, 5, 0, 0,
160, 9, 0, 0, 3, 0, 0, 1,
128, 2, 0, 228, 160, 2, 0, 228,
144, 1, 0, 0, 2, 1, 0, 2,
128, 0, 0, 0, 129, 9, 0, 0,
3, 1, 0, 1, 128, 1, 0, 228,
160, 2, 0, 228, 144, 4, 0, 0,
4, 0, 0, 3, 192, 0, 0, 85,
128, 0, 0, 228, 160, 1, 0, 228,
128, 1, 0, 0, 2, 0, 0, 8,
192, 0, 0, 85, 128, 1, 0, 0,
2, 0, 0, 15, 224, 0, 0, 228,
144, 255, 255, 0, 0, 83, 72, 68,
82, 80, 1, 0, 0, 64, 0, 1,
0, 84, 0, 0, 0, 89, 0, 0,
4, 70, 142, 32, 0, 0, 0, 0,
0, 4, 0, 0, 0, 95, 0, 0,
3, 242, 16, 16, 0, 0, 0, 0,
0, 95, 0, 0, 3, 242, 16, 16,
0, 2, 0, 0, 0, 101, 0, 0,
3, 242, 32, 16, 0, 0, 0, 0,
0, 103, 0, 0, 4, 242, 32, 16,
0, 1, 0, 0, 0, 1, 0, 0,
0, 104, 0, 0, 2, 1, 0, 0,
0, 54, 0, 0, 5, 242, 32, 16,
0, 0, 0, 0, 0, 70, 30, 16,
0, 0, 0, 0, 0, 17, 0, 0,
8, 18, 0, 16, 0, 0, 0, 0,
0, 70, 142, 32, 0, 0, 0, 0,
0, 1, 0, 0, 0, 70, 30, 16,
0, 2, 0, 0, 0, 54, 0, 0,
6, 34, 32, 16, 0, 1, 0, 0,
0, 10, 0, 16, 128, 65, 0, 0,
0, 0, 0, 0, 0, 17, 0, 0,
8, 18, 0, 16, 0, 0, 0, 0,
0, 70, 142, 32, 0, 0, 0, 0,
0, 2, 0, 0, 0, 70, 30, 16,
0, 2, 0, 0, 0, 17, 0, 0,
8, 34, 0, 16, 0, 0, 0, 0,
0, 70, 142, 32, 0, 0, 0, 0,
0, 3, 0, 0, 0, 70, 30, 16,
0, 2, 0, 0, 0, 0, 0, 0,
7, 18, 0, 16, 0, 0, 0, 0,
0, 26, 0, 16, 0, 0, 0, 0,
0, 10, 0, 16, 0, 0, 0, 0,
0, 54, 0, 0, 5, 130, 32, 16,
0, 1, 0, 0, 0, 26, 0, 16,
0, 0, 0, 0, 0, 56, 0, 0,
7, 66, 32, 16, 0, 1, 0, 0,
0, 10, 0, 16, 0, 0, 0, 0,
0, 1, 64, 0, 0, 0, 0, 0,
63, 17, 0, 0, 8, 18, 32, 16,
0, 1, 0, 0, 0, 70, 142, 32,
0, 0, 0, 0, 0, 0, 0, 0,
0, 70, 30, 16, 0, 2, 0, 0,
0, 62, 0, 0, 1, 83, 84, 65,
84, 116, 0, 0, 0, 10, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0,
0, 4, 0, 0, 0, 7, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 2, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 82, 68, 69, 70, 204, 0, 0,
0, 1, 0, 0, 0, 72, 0, 0,
0, 1, 0, 0, 0, 28, 0, 0,
0, 0, 4, 254, 255, 0, 65, 0,
0, 152, 0, 0, 0, 60, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 0, 0,
0, 0, 0, 0, 0, 36, 71, 108,
111, 98, 97, 108, 115, 0, 171, 171,
171, 60, 0, 0, 0, 1, 0, 0,
0, 96, 0, 0, 0, 64, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 120, 0, 0, 0, 0, 0, 0,
0, 64, 0, 0, 0, 2, 0, 0,
0, 136, 0, 0, 0, 0, 0, 0,
0, 95, 67, 67, 95, 77, 86, 80,
77, 97, 116, 114, 105, 120, 0, 171,
171, 3, 0, 3, 0, 4, 0, 4,
0, 0, 0, 0, 0, 0, 0, 0,
0, 77, 105, 99, 114, 111, 115, 111,
102, 116, 32, 40, 82, 41, 32, 72,
76, 83, 76, 32, 83, 104, 97, 100,
101, 114, 32, 67, 111, 109, 112, 105,
108, 101, 114, 32, 54, 46, 51, 46,
57, 54, 48, 48, 46, 49, 55, 52,
49, 53, 0, 171, 171, 73, 83, 71,
78, 92, 0, 0, 0, 3, 0, 0,
0, 8, 0, 0, 0, 80, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 3, 0, 0, 0, 0, 0, 0,
0, 15, 15, 0, 0, 80, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0,
0, 3, 0, 0, 0, 1, 0, 0,
0, 1, 0, 0, 0, 80, 0, 0,
0, 2, 0, 0, 0, 0, 0, 0,
0, 3, 0, 0, 0, 2, 0, 0,
0, 15, 15, 0, 0, 84, 69, 88,
67, 79, 79, 82, 68, 0, 171, 171,
171, 79, 83, 71, 78, 80, 0, 0,
0, 2, 0, 0, 0, 8, 0, 0,
0, 56, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 3, 0, 0,
0, 0, 0, 0, 0, 15, 0, 0,
0, 65, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 3, 0, 0,
0, 1, 0, 0, 0, 15, 0, 0,
0, 84, 69, 88, 67, 79, 79, 82,
68, 0, 83, 86, 95, 80, 111, 115,
105, 116, 105, 111, 110, 0, 171, 171,
171,
3, 0, 0, 0, 0, 0, 0, 0,
15, 15, 0, 0, 80, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 1, 0, 0, 0,
15, 15, 0, 0, 80, 0, 0, 0,
2, 0, 0, 0, 0, 0, 0, 0,
3, 0, 0, 0, 2, 0, 0, 0,
3, 0, 0, 0, 84, 69, 88, 67,
79, 79, 82, 68, 0, 171, 171, 171,
79, 83, 71, 78, 80, 0, 0, 0,
2, 0, 0, 0, 8, 0, 0, 0,
56, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 15, 0, 0, 0,
65, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 3, 0, 0, 0,
1, 0, 0, 0, 15, 0, 0, 0,
84, 69, 88, 67, 79, 79, 82, 68,
0, 83, 86, 95, 80, 111, 115, 105,
116, 105, 111, 110, 0, 171, 171, 171,
};
const unsigned char s_53938AB67AD93ABA0DDB87F3C9889304284E011E[] = {
@ -2752,7 +2751,7 @@ const unsigned char s_53938AB67AD93ABA0DDB87F3C9889304284E011E[] = {
120, 116, 117, 114, 101, 48, 0, 0,
0, 0, 1, 0, 0, 0, 24, 4,
0, 0, 4, 5, 0, 0, 0, 0,
0, 0, 210, 169, 0, 0, 0, 0,
0, 0, 217, 203, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 68, 88, 66, 67, 33, 145,
46, 158, 198, 39, 68, 199, 78, 25,
@ -3126,7 +3125,7 @@ const unsigned char s_67837675F2BB48C0E926316F505FC1538228E0FA[] = {
86, 80, 77, 97, 116, 114, 105, 120,
0, 0, 0, 0, 0, 0, 0, 0,
16, 4, 0, 0, 48, 5, 0, 0,
0, 0, 0, 0, 210, 169, 0, 0,
0, 0, 0, 0, 217, 203, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 68, 88, 66, 67,
200, 75, 132, 243, 88, 73, 77, 96,
@ -4290,7 +4289,7 @@ const unsigned char s_77D0755E06AA7AF59FAA6B003CA2363EDEB25C4C[] = {
99, 111, 108, 111, 114, 0, 0, 0,
0, 17, 0, 0, 0, 236, 16, 0,
0, 232, 19, 0, 0, 0, 0, 0,
0, 210, 169, 0, 0, 0, 0, 0,
0, 217, 203, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 68, 88, 66, 67, 2, 25, 137,
206, 217, 191, 45, 93, 183, 145, 101,
@ -5567,7 +5566,7 @@ const unsigned char s_78250E25D1929D4A842050738140787BE42541C6[] = {
108, 112, 104, 97, 95, 118, 97, 108,
117, 101, 0, 0, 0, 0, 2, 0,
0, 0, 36, 5, 0, 0, 4, 5,
0, 0, 0, 0, 0, 0, 210, 169,
0, 0, 0, 0, 0, 0, 217, 203,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 68, 88,
66, 67, 240, 77, 46, 64, 69, 123,
@ -5982,7 +5981,7 @@ const unsigned char s_7B67DD242152D35ACC079265FAD9D03DC98182DE[] = {
67, 95, 84, 101, 120, 116, 117, 114,
101, 48, 0, 0, 0, 0, 1, 0,
0, 0, 248, 3, 0, 0, 0, 5,
0, 0, 0, 0, 0, 0, 210, 169,
0, 0, 0, 0, 0, 0, 217, 203,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 68, 88,
66, 67, 205, 227, 165, 164, 175, 20,
@ -6366,7 +6365,7 @@ const unsigned char s_7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D[] = {
99, 111, 108, 111, 114, 0, 0, 0,
0, 2, 0, 0, 0, 96, 4, 0,
0, 192, 4, 0, 0, 0, 0, 0,
0, 210, 169, 0, 0, 0, 0, 0,
0, 217, 203, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 68, 88, 66, 67, 157, 151, 165,
227, 12, 76, 8, 46, 192, 53, 98,
@ -6747,7 +6746,7 @@ const unsigned char s_7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C[] = {
117, 95, 99, 111, 108, 111, 114, 0,
0, 0, 0, 1, 0, 0, 0, 52,
3, 0, 0, 40, 4, 0, 0, 0,
0, 0, 0, 210, 169, 0, 0, 0,
0, 0, 0, 217, 203, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 68, 88, 66, 67, 107,
9, 43, 141, 43, 66, 57, 205, 237,
@ -7081,7 +7080,7 @@ const unsigned char s_847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5[] = {
111, 108, 111, 114, 0, 0, 0, 0,
2, 0, 0, 0, 240, 4, 0, 0,
4, 5, 0, 0, 0, 0, 0, 0,
210, 169, 0, 0, 0, 0, 0, 0,
217, 203, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
68, 88, 66, 67, 52, 12, 145, 212,
200, 167, 238, 40, 67, 241, 209, 24,
@ -7498,7 +7497,7 @@ const unsigned char s_92BE325B516F887D2C928EDE20ADF428DB01C038[] = {
95, 118, 97, 108, 117, 101, 0, 0,
0, 0, 2, 0, 0, 0, 36, 5,
0, 0, 0, 5, 0, 0, 0, 0,
0, 0, 210, 169, 0, 0, 0, 0,
0, 0, 217, 203, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 68, 88, 66, 67, 240, 77,
46, 64, 69, 123, 199, 8, 251, 116,
@ -8066,7 +8065,7 @@ const unsigned char s_93D31E1668075AE4941C53441D7A9D0DE8F76331[] = {
117, 95, 99, 111, 108, 111, 114, 0,
0, 0, 0, 15, 0, 0, 0, 200,
15, 0, 0, 216, 9, 0, 0, 0,
0, 0, 0, 210, 169, 0, 0, 0,
0, 0, 0, 217, 203, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 68, 88, 66, 67, 90,
212, 41, 73, 29, 78, 234, 182, 59,
@ -9599,7 +9598,7 @@ const unsigned char s_A130FCE93CA2E5D68468367D88D1D7BE357912E5[] = {
99, 111, 108, 111, 114, 0, 0, 0,
0, 3, 0, 0, 0, 96, 4, 0,
0, 192, 13, 0, 0, 0, 0, 0,
0, 210, 169, 0, 0, 0, 0, 0,
0, 217, 203, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 68, 88, 66, 67, 157, 151, 165,
227, 12, 76, 8, 46, 192, 53, 98,
@ -10276,7 +10275,7 @@ const unsigned char s_A2377A827972A5466DA8637681045D32DA8A817D[] = {
99, 111, 108, 111, 114, 0, 0, 0,
0, 2, 0, 0, 0, 96, 4, 0,
0, 144, 4, 0, 0, 0, 0, 0,
0, 210, 169, 0, 0, 0, 0, 0,
0, 217, 203, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 68, 88, 66, 67, 157, 151, 165,
227, 12, 76, 8, 46, 192, 53, 98,
@ -10661,7 +10660,7 @@ const unsigned char s_B5E27B4F3CF7236633255B28CBA530D6EE5CED86[] = {
111, 108, 111, 114, 0, 0, 0, 0,
2, 0, 0, 0, 240, 5, 0, 0,
4, 5, 0, 0, 0, 0, 0, 0,
210, 169, 0, 0, 0, 0, 0, 0,
217, 203, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
68, 88, 66, 67, 219, 130, 238, 9,
68, 170, 6, 56, 205, 123, 2, 41,
@ -11093,7 +11092,7 @@ const unsigned char s_E2C7CE1244DE9C76688EFA9463B2A130B6A08893[] = {
77, 97, 116, 114, 105, 120, 0, 0,
0, 0, 0, 0, 0, 0, 204, 2,
0, 0, 144, 4, 0, 0, 0, 0,
0, 0, 210, 169, 0, 0, 0, 0,
0, 0, 217, 203, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 68, 88, 66, 67, 251, 171,
196, 153, 103, 104, 123, 148, 169, 33,
@ -11423,8 +11422,8 @@ const unsigned char s_E2D56227712263272BD5218FEA117CD06180F81B[] = {
117, 95, 112, 111, 105, 110, 116, 83,
105, 122, 101, 0, 0, 0, 0, 2,
0, 0, 0, 204, 2, 0, 0, 208,
4, 0, 0, 0, 0, 0, 0, 210,
169, 0, 0, 0, 0, 0, 0, 0,
4, 0, 0, 0, 0, 0, 0, 217,
203, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 68,
88, 66, 67, 251, 171, 196, 153, 103,
104, 123, 148, 169, 33, 147, 252, 223,
@ -11774,7 +11773,7 @@ const unsigned char s_F46558C274182079784898CF4968CF431593D5E2[] = {
116, 67, 111, 108, 111, 114, 0, 0,
0, 0, 3, 0, 0, 0, 108, 6,
0, 0, 4, 5, 0, 0, 0, 0,
0, 0, 210, 169, 0, 0, 0, 0,
0, 0, 217, 203, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 68, 88, 66, 67, 216, 93,
95, 26, 224, 40, 133, 94, 49, 242,
@ -12230,7 +12229,7 @@ const unsigned char s_F6BA4519AF2653A53D57FB5D5508F0D8617105D6[] = {
101, 120, 116, 117, 114, 101, 48, 0,
0, 0, 0, 1, 0, 0, 0, 156,
3, 0, 0, 144, 4, 0, 0, 0,
0, 0, 0, 210, 169, 0, 0, 0,
0, 0, 0, 217, 203, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 68, 88, 66, 67, 104,
229, 40, 36, 199, 124, 225, 53, 60,
@ -12581,7 +12580,7 @@ const unsigned char s_FD391F5683B57320A7D2F98BFB3DE495DCF36DAD[] = {
67, 95, 84, 101, 120, 116, 117, 114,
101, 48, 0, 0, 0, 0, 1, 0,
0, 0, 4, 4, 0, 0, 164, 4,
0, 0, 0, 0, 0, 0, 210, 169,
0, 0, 0, 0, 0, 0, 217, 203,
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 68, 88,
66, 67, 194, 192, 156, 135, 173, 91,
@ -12864,6 +12863,6 @@ const unsigned char s_FD391F5683B57320A7D2F98BFB3DE495DCF36DAD[] = {
};
const int s_numPrograms = 23;
const int s_programLengths[] = {2990,2528,4102,8993,2537,3022,2996,16333,3358,2982,3073,2559,3300,3350,8475,10305,3025,3556,2502,2675,3746,2775,2902};
const unsigned char* s_programs[] = {s_133478C5A874C1E6F59B418CE6C7C39F1AE0F873,s_13E33F532157A58EC77EDE3B3112560A89D272B2,s_1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE,s_2CF9793879165058483EFB4AD6FA9746ECD7DD2A,s_3B90B53AB54C964575CF2DA4BC9C86A594B6613E,s_53938AB67AD93ABA0DDB87F3C9889304284E011E,s_67837675F2BB48C0E926316F505FC1538228E0FA,s_77D0755E06AA7AF59FAA6B003CA2363EDEB25C4C,s_78250E25D1929D4A842050738140787BE42541C6,s_7B67DD242152D35ACC079265FAD9D03DC98182DE,s_7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D,s_7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C,s_847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5,s_92BE325B516F887D2C928EDE20ADF428DB01C038,s_93D31E1668075AE4941C53441D7A9D0DE8F76331,s_A130FCE93CA2E5D68468367D88D1D7BE357912E5,s_A2377A827972A5466DA8637681045D32DA8A817D,s_B5E27B4F3CF7236633255B28CBA530D6EE5CED86,s_E2C7CE1244DE9C76688EFA9463B2A130B6A08893,s_E2D56227712263272BD5218FEA117CD06180F81B,s_F46558C274182079784898CF4968CF431593D5E2,s_F6BA4519AF2653A53D57FB5D5508F0D8617105D6,s_FD391F5683B57320A7D2F98BFB3DE495DCF36DAD};
const char* s_programKeys[] = {"133478C5A874C1E6F59B418CE6C7C39F1AE0F873","13E33F532157A58EC77EDE3B3112560A89D272B2","1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE","2CF9793879165058483EFB4AD6FA9746ECD7DD2A","3B90B53AB54C964575CF2DA4BC9C86A594B6613E","53938AB67AD93ABA0DDB87F3C9889304284E011E","67837675F2BB48C0E926316F505FC1538228E0FA","77D0755E06AA7AF59FAA6B003CA2363EDEB25C4C","78250E25D1929D4A842050738140787BE42541C6","7B67DD242152D35ACC079265FAD9D03DC98182DE","7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D","7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C","847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5","92BE325B516F887D2C928EDE20ADF428DB01C038","93D31E1668075AE4941C53441D7A9D0DE8F76331","A130FCE93CA2E5D68468367D88D1D7BE357912E5","A2377A827972A5466DA8637681045D32DA8A817D","B5E27B4F3CF7236633255B28CBA530D6EE5CED86","E2C7CE1244DE9C76688EFA9463B2A130B6A08893","E2D56227712263272BD5218FEA117CD06180F81B","F46558C274182079784898CF4968CF431593D5E2","F6BA4519AF2653A53D57FB5D5508F0D8617105D6","FD391F5683B57320A7D2F98BFB3DE495DCF36DAD"};
const int s_programLengths[] = {2990,2528,4102,8993,2536,3022,2996,16333,3358,2982,3073,2559,3300,3350,8475,10305,3025,3556,2502,2675,3746,2775,2902};
const unsigned char* s_programs[] = {s_133478C5A874C1E6F59B418CE6C7C39F1AE0F873,s_13E33F532157A58EC77EDE3B3112560A89D272B2,s_1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE,s_2CF9793879165058483EFB4AD6FA9746ECD7DD2A,s_502845049F68EB561266A6F565B06F642ADD3E53,s_53938AB67AD93ABA0DDB87F3C9889304284E011E,s_67837675F2BB48C0E926316F505FC1538228E0FA,s_77D0755E06AA7AF59FAA6B003CA2363EDEB25C4C,s_78250E25D1929D4A842050738140787BE42541C6,s_7B67DD242152D35ACC079265FAD9D03DC98182DE,s_7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D,s_7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C,s_847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5,s_92BE325B516F887D2C928EDE20ADF428DB01C038,s_93D31E1668075AE4941C53441D7A9D0DE8F76331,s_A130FCE93CA2E5D68468367D88D1D7BE357912E5,s_A2377A827972A5466DA8637681045D32DA8A817D,s_B5E27B4F3CF7236633255B28CBA530D6EE5CED86,s_E2C7CE1244DE9C76688EFA9463B2A130B6A08893,s_E2D56227712263272BD5218FEA117CD06180F81B,s_F46558C274182079784898CF4968CF431593D5E2,s_F6BA4519AF2653A53D57FB5D5508F0D8617105D6,s_FD391F5683B57320A7D2F98BFB3DE495DCF36DAD};
const char* s_programKeys[] = {"133478C5A874C1E6F59B418CE6C7C39F1AE0F873","13E33F532157A58EC77EDE3B3112560A89D272B2","1A69A7CC77C7C8FC62799B0513816EA41FBF3BFE","2CF9793879165058483EFB4AD6FA9746ECD7DD2A","502845049F68EB561266A6F565B06F642ADD3E53","53938AB67AD93ABA0DDB87F3C9889304284E011E","67837675F2BB48C0E926316F505FC1538228E0FA","77D0755E06AA7AF59FAA6B003CA2363EDEB25C4C","78250E25D1929D4A842050738140787BE42541C6","7B67DD242152D35ACC079265FAD9D03DC98182DE","7CE5EE84ACB6110F7FA29152ECE3344CB6D6620D","7E1EEF397305D0BC2DCDBA4F2DAFBCBA1534E45C","847DBFDDA6EC09C57E4ED43012AE2FB5CAC7D8D5","92BE325B516F887D2C928EDE20ADF428DB01C038","93D31E1668075AE4941C53441D7A9D0DE8F76331","A130FCE93CA2E5D68468367D88D1D7BE357912E5","A2377A827972A5466DA8637681045D32DA8A817D","B5E27B4F3CF7236633255B28CBA530D6EE5CED86","E2C7CE1244DE9C76688EFA9463B2A130B6A08893","E2D56227712263272BD5218FEA117CD06180F81B","F46558C274182079784898CF4968CF431593D5E2","F6BA4519AF2653A53D57FB5D5508F0D8617105D6","FD391F5683B57320A7D2F98BFB3DE495DCF36DAD"};

View File

@ -50,7 +50,7 @@ const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_COLOR_NO_MVP = "ShaderPositi
const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST = "ShaderPositionTextureColorAlphaTest";
const char* GLProgram::SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST_NO_MV = "ShaderPositionTextureColorAlphaTest_NoMV";
const char* GLProgram::SHADER_NAME_POSITION_COLOR = "ShaderPositionColor";
const char* GLProgram::SHADER_NAME_POSITION_COLOR_POINTSIZE = "ShaderPositionColorPointsize";
const char* GLProgram::SHADER_NAME_POSITION_COLOR_TEXASPOINTSIZE = "ShaderPositionColorTexAsPointsize";
const char* GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP = "ShaderPositionColor_noMVP";
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || defined(WP8_SHADER_COMPILER)
const char* GLProgram::SHADER_NAME_POSITION_COLOR_NO_MVP_GRAYSCALE = "ShaderPositionColor_noMVP_GrayScale";
@ -93,7 +93,6 @@ const char* GLProgram::UNIFORM_NAME_ALPHA_TEST_VALUE = "CC_alpha_value";
// Attribute names
const char* GLProgram::ATTRIBUTE_NAME_COLOR = "a_color";
const char* GLProgram::ATTRIBUTE_NAME_POSITION = "a_position";
const char* GLProgram::ATTRIBUTE_NAME_POINTSIZE = "a_pointSize";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD = "a_texCoord";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD1 = "a_texCoord1";
const char* GLProgram::ATTRIBUTE_NAME_TEX_COORD2 = "a_texCoord2";
@ -281,7 +280,6 @@ void GLProgram::bindPredefinedVertexAttribs()
} attribute_locations[] =
{
{GLProgram::ATTRIBUTE_NAME_POSITION, GLProgram::VERTEX_ATTRIB_POSITION},
{GLProgram::ATTRIBUTE_NAME_POINTSIZE, GLProgram::VERTEX_ATTRIB_POINTSIZE},
{GLProgram::ATTRIBUTE_NAME_COLOR, GLProgram::VERTEX_ATTRIB_COLOR},
{GLProgram::ATTRIBUTE_NAME_TEX_COORD, GLProgram::VERTEX_ATTRIB_TEX_COORD},
{GLProgram::ATTRIBUTE_NAME_TEX_COORD1, GLProgram::VERTEX_ATTRIB_TEX_COORD1},

View File

@ -89,7 +89,6 @@ public:
VERTEX_ATTRIB_NORMAL,
VERTEX_ATTRIB_BLEND_WEIGHT,
VERTEX_ATTRIB_BLEND_INDEX,
VERTEX_ATTRIB_POINTSIZE,
VERTEX_ATTRIB_MAX,
// backward compatibility
@ -120,7 +119,7 @@ public:
static const char* SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST;
static const char* SHADER_NAME_POSITION_TEXTURE_ALPHA_TEST_NO_MV;
static const char* SHADER_NAME_POSITION_COLOR;
static const char* SHADER_NAME_POSITION_COLOR_POINTSIZE;
static const char* SHADER_NAME_POSITION_COLOR_TEXASPOINTSIZE;
static const char* SHADER_NAME_POSITION_COLOR_NO_MVP;
#if CC_TARGET_PLATFORM == CC_PLATFORM_WP8 || defined(WP8_SHADER_COMPILER)
static const char* SHADER_NAME_POSITION_COLOR_NO_MVP_GRAYSCALE;
@ -164,7 +163,6 @@ public:
// Attribute names
static const char* ATTRIBUTE_NAME_COLOR;
static const char* ATTRIBUTE_NAME_POSITION;
static const char* ATTRIBUTE_NAME_POINTSIZE;
static const char* ATTRIBUTE_NAME_TEX_COORD;
static const char* ATTRIBUTE_NAME_TEX_COORD1;
static const char* ATTRIBUTE_NAME_TEX_COORD2;

View File

@ -44,7 +44,7 @@ enum {
kShaderType_PositionTextureColorAlphaTest,
kShaderType_PositionTextureColorAlphaTestNoMV,
kShaderType_PositionColor,
kShaderType_PositionColorPointsize,
kShaderType_PositionColorTextureAsPointsize,
kShaderType_PositionColor_noMVP,
kShaderType_PositionTexture,
kShaderType_PositionTexture_uColor,
@ -149,8 +149,8 @@ void GLProgramCache::loadDefaultGLPrograms()
// Position, Color, PointSize shader
p = new (std::nothrow) GLProgram();
loadDefaultGLProgram(p, kShaderType_PositionColorPointsize);
_programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_COLOR_POINTSIZE, p) );
loadDefaultGLProgram(p, kShaderType_PositionColorTextureAsPointsize);
_programs.insert( std::make_pair(GLProgram::SHADER_NAME_POSITION_COLOR_TEXASPOINTSIZE, p) );
//
// Position, Color shader no MVP
@ -275,9 +275,9 @@ void GLProgramCache::reloadDefaultGLPrograms()
loadDefaultGLProgram(p, kShaderType_PositionColor);
// Position, Color, PointSize shader
p = getGLProgram(GLProgram::SHADER_NAME_POSITION_COLOR_POINTSIZE);
p = getGLProgram(GLProgram::SHADER_NAME_POSITION_COLOR_TEXASPOINTSIZE);
p->reset();
loadDefaultGLProgram(p, kShaderType_PositionColorPointsize);
loadDefaultGLProgram(p, kShaderType_PositionColorTextureAsPointsize);
//
// Position, Color shader no MVP
@ -381,8 +381,8 @@ void GLProgramCache::loadDefaultGLProgram(GLProgram *p, int type)
case kShaderType_PositionColor:
p->initWithByteArrays(ccPositionColor_vert ,ccPositionColor_frag);
break;
case kShaderType_PositionColorPointsize:
p->initWithByteArrays(ccPositionColorPointsize_vert ,ccPositionColor_frag);
case kShaderType_PositionColorTextureAsPointsize:
p->initWithByteArrays(ccPositionColorTextureAsPointsize_vert ,ccPositionColor_frag);
break;
case kShaderType_PositionColor_noMVP:
p->initWithByteArrays(ccPositionTextureColor_noMVP_vert ,ccPositionColor_frag);

View File

@ -642,7 +642,9 @@ void TextureAtlas::drawNumberOfQuads(ssize_t numberOfQuads, ssize_t start)
#endif
glDrawElements(GL_TRIANGLES, (GLsizei) numberOfQuads*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(_indices[0])) );
GL::bindVAO(0);
#if CC_REBIND_INDICES_BUFFER
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
#endif

View File

@ -222,9 +222,11 @@ void enableVertexAttribs(uint32_t flags)
// hardcoded!
for(int i=0; i < MAX_ATTRIBUTES; i++) {
unsigned int bit = 1 << i;
bool enabled = flags & bit;
bool enabledBefore = s_attributeFlags & bit;
if(enabled != enabledBefore) {
//FIXME:Cache is disabled, try to enable cache as before
bool enabled = (flags & bit) != 0;
bool enabledBefore = (s_attributeFlags & bit) != 0;
if(enabled != enabledBefore)
{
if( enabled )
glEnableVertexAttribArray(i);
else

View File

@ -22,11 +22,11 @@
* THE SOFTWARE.
*/
const char* ccPositionColorPointsize_vert = STRINGIFY(
const char* ccPositionColorTextureAsPointsize_vert = STRINGIFY(
attribute vec4 a_position;
attribute vec4 a_color;
attribute float a_pointSize;
attribute vec2 a_texCoord;
\n#ifdef GL_ES\n
varying lowp vec4 v_fragmentColor;

View File

@ -22,11 +22,12 @@
* THE SOFTWARE.
*/
const char* ccPositionColorPointsize_vert = STRINGIFY(
const char* ccPositionColorTextureAsPointsize_vert = STRINGIFY(
attribute vec4 a_position;
attribute vec4 a_color;
attribute float a_pointSize;
attribute vec2 a_texCoord;
\n#ifdef GL_ES\n
varying lowp vec4 v_fragmentColor;
@ -37,7 +38,7 @@ varying vec4 v_fragmentColor;
void main()
{
gl_Position = CC_MVPMatrix * a_position;
gl_PointSize = a_pointSize;
gl_PointSize = a_texCoord.x;
v_fragmentColor = a_color;
}
);

View File

@ -43,10 +43,11 @@ NS_CC_BEGIN
#include "ccShader_PositionColor.vert"
//
#ifdef CC_NO_GL_POINTSIZE
#include "ccShader_PositionColorPointsize-no-gl_PointSize.vert"
#else
#include "ccShader_PositionColorPointsize.vert"
#include "ccShader_PositionColorTextureAsPointsize.vert"
#endif
//

View File

@ -42,7 +42,7 @@ extern CC_DLL const GLchar * ccPosition_uColor_vert;
extern CC_DLL const GLchar * ccPositionColor_frag;
extern CC_DLL const GLchar * ccPositionColor_vert;
extern CC_DLL const GLchar * ccPositionColorPointsize_vert;
extern CC_DLL const GLchar * ccPositionColorTextureAsPointsize_vert;
extern CC_DLL const GLchar * ccPositionTexture_frag;
extern CC_DLL const GLchar * ccPositionTexture_vert;

View File

@ -93,6 +93,7 @@ set(lua_bindings_manual_files
manual/cocosdenshion/lua_cocos2dx_cocosdenshion_manual.cpp
manual/cocostudio/CustomGUIReader.cpp
manual/cocostudio/lua_cocos2dx_coco_studio_manual.cpp
manual/cocostudio/lua-cocos-studio-conversions.cpp
manual/cocostudio/lua_cocos2dx_csloader_manual.cpp
manual/controller/lua_cocos2dx_controller_manual.cpp
manual/extension/lua_cocos2dx_extension_manual.cpp

Some files were not shown because too many files have changed in this diff Show More