Merge branch 'develop' into ios_mac_one_project

This commit is contained in:
Ricardo Quesada 2013-07-03 11:39:00 -07:00
commit 77dbe995d4
21 changed files with 185 additions and 63 deletions

View File

@ -45,6 +45,9 @@ Developers:
DarraghCoy DarraghCoy
Fix a potential crash SimpleAudioEngineOpenSL::playEffect Fix a potential crash SimpleAudioEngineOpenSL::playEffect
Fix some bugs with Set class
Add ccDrawSolidCircle
Add Rect::unionWithRect
silverscania silverscania
Pass correct parameter to glPixelStorei when creating a texture Pass correct parameter to glPixelStorei when creating a texture
@ -434,6 +437,7 @@ Developers:
Fix for broken of ccArrayGetIndexOfObject after merging this commit(076f38c). Fix for broken of ccArrayGetIndexOfObject after merging this commit(076f38c).
Explicitly initialising CCAcceleration structure. Explicitly initialising CCAcceleration structure.
Add support to save/retrieve CCData into/from CCUserDefault. Add support to save/retrieve CCData into/from CCUserDefault.
Text Shadows fix
MarcelBloemendaal MarcelBloemendaal
Adding secureTextEntry property to CCTextFieldTTF. Adding secureTextEntry property to CCTextFieldTTF.

View File

@ -271,4 +271,44 @@ bool Rect::intersectsRect(const Rect& rect) const
rect.getMaxY() < getMinY()); rect.getMaxY() < getMinY());
} }
Rect Rect::unionWithRect(const Rect & rect) const
{
float thisLeftX = origin.x;
float thisRightX = origin.x + size.width;
float thisTopY = origin.y + size.height;
float thisBottomY = origin.y;
if (thisRightX < thisLeftX)
{
std::swap(thisRightX, thisLeftX); // This rect has negative width
}
if (thisTopY < thisBottomY)
{
std::swap(thisTopY, thisBottomY); // This rect has negative height
}
float otherLeftX = rect.origin.x;
float otherRightX = rect.origin.x + rect.size.width;
float otherTopY = rect.origin.y + rect.size.height;
float otherBottomY = rect.origin.y;
if (otherRightX < otherLeftX)
{
std::swap(otherRightX, otherLeftX); // Other rect has negative width
}
if (otherTopY < otherBottomY)
{
std::swap(otherTopY, otherBottomY); // Other rect has negative height
}
float combinedLeftX = std::min(thisLeftX, otherLeftX);
float combinedRightX = std::max(thisRightX, otherRightX);
float combinedTopY = std::max(thisTopY, otherTopY);
float combinedBottomY = std::min(thisBottomY, otherBottomY);
return Rect(combinedLeftX, combinedBottomY, combinedRightX - combinedLeftX, combinedTopY - combinedBottomY);
}
NS_CC_END NS_CC_END

View File

@ -245,6 +245,7 @@ public:
bool equals(const Rect& rect) const; bool equals(const Rect& rect) const;
bool containsPoint(const Point& point) const; bool containsPoint(const Point& point) const;
bool intersectsRect(const Rect& rect) const; bool intersectsRect(const Rect& rect) const;
Rect unionWithRect(const Rect & rect) const;
}; };

View File

@ -100,14 +100,14 @@ typedef void (Object::*SEL_MenuHandler)(Object*);
typedef void (Object::*SEL_EventHandler)(Event*); typedef void (Object::*SEL_EventHandler)(Event*);
typedef int (Object::*SEL_Compare)(Object*); typedef int (Object::*SEL_Compare)(Object*);
#define schedule_selector(_SELECTOR) (SEL_SCHEDULE)(&_SELECTOR) #define schedule_selector(_SELECTOR) static_cast<SEL_SCHEDULE>(&_SELECTOR)
#define callfunc_selector(_SELECTOR) (SEL_CallFunc)(&_SELECTOR) #define callfunc_selector(_SELECTOR) static_cast<SEL_CallFunc>(&_SELECTOR)
#define callfuncN_selector(_SELECTOR) (SEL_CallFuncN)(&_SELECTOR) #define callfuncN_selector(_SELECTOR) static_cast<SEL_CallFuncN>(&_SELECTOR)
#define callfuncND_selector(_SELECTOR) (SEL_CallFuncND)(&_SELECTOR) #define callfuncND_selector(_SELECTOR) static_cast<SEL_CallFuncND>(&_SELECTOR)
#define callfuncO_selector(_SELECTOR) (SEL_CallFuncO)(&_SELECTOR) #define callfuncO_selector(_SELECTOR) static_cast<SEL_CallFuncO>(&_SELECTOR)
#define menu_selector(_SELECTOR) (SEL_MenuHandler)(&_SELECTOR) #define menu_selector(_SELECTOR) static_cast<SEL_MenuHandler>(&_SELECTOR)
#define event_selector(_SELECTOR) (SEL_EventHandler)(&_SELECTOR) #define event_selector(_SELECTOR) static_cast<SEL_EventHandler>(&_SELECTOR)
#define compare_selector(_SELECTOR) (SEL_Compare)(&_SELECTOR) #define compare_selector(_SELECTOR) static_cast<SEL_Compare>(&_SELECTOR)
// new callbacks based on C++11 // new callbacks based on C++11
#define CC_CALLBACK_0(__selector__,__target__, ...) std::bind(&__selector__,__target__, ##__VA_ARGS__) #define CC_CALLBACK_0(__selector__,__target__, ...) std::bind(&__selector__,__target__, ##__VA_ARGS__)

View File

@ -92,27 +92,37 @@ int Set::count(void)
void Set::addObject(Object *pObject) void Set::addObject(Object *pObject)
{ {
if (_set->count(pObject) == 0)
{
CC_SAFE_RETAIN(pObject); CC_SAFE_RETAIN(pObject);
_set->insert(pObject); _set->insert(pObject);
}
} }
void Set::removeObject(Object *pObject) void Set::removeObject(Object *pObject)
{ {
_set->erase(pObject); if (_set->erase(pObject) > 0)
{
CC_SAFE_RELEASE(pObject); CC_SAFE_RELEASE(pObject);
}
} }
void Set::removeAllObjects() void Set::removeAllObjects()
{ {
SetIterator it; SetIterator it = _set->begin();
for (it = _set->begin(); it != _set->end(); ++it) SetIterator tmp;
while (it != _set->end())
{ {
if (! (*it)) if (!(*it))
{ {
break; break;
} }
(*it)->release(); tmp = it;
++tmp;
_set->erase(it);
it = tmp;
} }
} }

View File

@ -383,6 +383,52 @@ void CC_DLL ccDrawCircle( const Point& center, float radius, float angle, unsign
ccDrawCircle(center, radius, angle, segments, drawLineToCenter, 1.0f, 1.0f); ccDrawCircle(center, radius, angle, segments, drawLineToCenter, 1.0f, 1.0f);
} }
void ccDrawSolidCircle( const Point& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY)
{
lazy_init();
const float coef = 2.0f * (float)M_PI/segments;
GLfloat *vertices = (GLfloat*)calloc( sizeof(GLfloat)*2*(segments+2), 1);
if( ! vertices )
return;
for(unsigned int i = 0;i <= segments; i++) {
float rads = i*coef;
GLfloat j = radius * cosf(rads + angle) * scaleX + center.x;
GLfloat k = radius * sinf(rads + angle) * scaleY + center.y;
vertices[i*2] = j;
vertices[i*2+1] = k;
}
vertices[(segments+1)*2] = center.x;
vertices[(segments+1)*2+1] = center.y;
s_pShader->use();
s_pShader->setUniformsForBuiltins();
s_pShader->setUniformLocationWith4fv(s_nColorLocation, (GLfloat*) &s_tColor.r, 1);
ccGLEnableVertexAttribs( kVertexAttribFlag_Position );
#ifdef EMSCRIPTEN
setGLBufferData(vertices, sizeof(GLfloat)*2*(segments+2));
glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, 0);
#else
glVertexAttribPointer(kVertexAttrib_Position, 2, GL_FLOAT, GL_FALSE, 0, vertices);
#endif // EMSCRIPTEN
glDrawArrays(GL_TRIANGLE_FAN, 0, (GLsizei) segments+1);
free( vertices );
CC_INCREMENT_GL_DRAWS(1);
}
void CC_DLL ccDrawSolidCircle( const Point& center, float radius, float angle, unsigned int segments)
{
ccDrawSolidCircle(center, radius, angle, segments, 1.0f, 1.0f);
}
void ccDrawQuadBezier(const Point& origin, const Point& control, const Point& destination, unsigned int segments) void ccDrawQuadBezier(const Point& origin, const Point& control, const Point& destination, unsigned int segments)
{ {
lazy_init(); lazy_init();

View File

@ -113,6 +113,10 @@ void CC_DLL ccDrawSolidPoly( const Point *poli, unsigned int numberOfPoints, ccC
void CC_DLL ccDrawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY); void CC_DLL ccDrawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter, float scaleX, float scaleY);
void CC_DLL ccDrawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter); void CC_DLL ccDrawCircle( const Point& center, float radius, float angle, unsigned int segments, bool drawLineToCenter);
/** draws a solid circle given the center, radius and number of segments. */
void CC_DLL ccDrawSolidCircle( const Point& center, float radius, float angle, unsigned int segments, float scaleX, float scaleY);
void CC_DLL ccDrawSolidCircle( const Point& center, float radius, float angle, unsigned int segments);
/** draws a quad bezier path /** draws a quad bezier path
@warning This function could be pretty slow. Use it only for debugging purposes. @warning This function could be pretty slow. Use it only for debugging purposes.
@since v0.8 @since v0.8

View File

@ -65,7 +65,7 @@ MotionStreak::~MotionStreak()
CC_SAFE_FREE(_texCoords); CC_SAFE_FREE(_texCoords);
} }
MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, ccColor3B color, const char* path) MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const ccColor3B& color, const char* path)
{ {
MotionStreak *pRet = new MotionStreak(); MotionStreak *pRet = new MotionStreak();
if (pRet && pRet->initWithFade(fade, minSeg, stroke, color, path)) if (pRet && pRet->initWithFade(fade, minSeg, stroke, color, path))
@ -78,7 +78,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, ccCol
return NULL; return NULL;
} }
MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, ccColor3B color, Texture2D* texture) MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, const ccColor3B& color, Texture2D* texture)
{ {
MotionStreak *pRet = new MotionStreak(); MotionStreak *pRet = new MotionStreak();
if (pRet && pRet->initWithFade(fade, minSeg, stroke, color, texture)) if (pRet && pRet->initWithFade(fade, minSeg, stroke, color, texture))
@ -91,7 +91,7 @@ MotionStreak* MotionStreak::create(float fade, float minSeg, float stroke, ccCol
return NULL; return NULL;
} }
bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, ccColor3B color, const char* path) bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const ccColor3B& color, const char* path)
{ {
CCAssert(path != NULL, "Invalid filename"); CCAssert(path != NULL, "Invalid filename");
@ -99,7 +99,7 @@ bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, ccColor3
return initWithFade(fade, minSeg, stroke, color, texture); return initWithFade(fade, minSeg, stroke, color, texture);
} }
bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, ccColor3B color, Texture2D* texture) bool MotionStreak::initWithFade(float fade, float minSeg, float stroke, const ccColor3B& color, Texture2D* texture)
{ {
Node::setPosition(PointZero); Node::setPosition(PointZero);
setAnchorPoint(PointZero); setAnchorPoint(PointZero);
@ -143,7 +143,7 @@ void MotionStreak::setPosition(const Point& position)
_positionR = position; _positionR = position;
} }
void MotionStreak::tintWithColor(ccColor3B colors) void MotionStreak::tintWithColor(const ccColor3B& colors)
{ {
setColor(colors); setColor(colors);

View File

@ -53,17 +53,17 @@ public:
virtual ~MotionStreak(); virtual ~MotionStreak();
/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */ /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture filename */
static MotionStreak* create(float fade, float minSeg, float stroke, ccColor3B color, const char* path); static MotionStreak* create(float fade, float minSeg, float stroke, const ccColor3B& color, const char* path);
/** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture */ /** creates and initializes a motion streak with fade in seconds, minimum segments, stroke's width, color, texture */
static MotionStreak* create(float fade, float minSeg, float stroke, ccColor3B color, Texture2D* texture); static MotionStreak* create(float fade, float minSeg, float stroke, const ccColor3B& color, Texture2D* texture);
/** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture filename */ /** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture filename */
bool initWithFade(float fade, float minSeg, float stroke, ccColor3B color, const char* path); bool initWithFade(float fade, float minSeg, float stroke, const ccColor3B& color, const char* path);
/** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture */ /** initializes a motion streak with fade in seconds, minimum segments, stroke's width, color and texture */
bool initWithFade(float fade, float minSeg, float stroke, ccColor3B color, Texture2D* texture); bool initWithFade(float fade, float minSeg, float stroke, const ccColor3B& color, Texture2D* texture);
/** color used for the tint */ /** color used for the tint */
void tintWithColor(ccColor3B colors); void tintWithColor(const ccColor3B& colors);
/** Remove all living segments of the ribbon */ /** Remove all living segments of the ribbon */
void reset(); void reset();

View File

@ -128,7 +128,7 @@ public class Cocos2dxBitmap {
if ( shadow ) { if ( shadow ) {
int shadowColor = 0xff7d7d7d; int shadowColor = 0x54000000;
paint.setShadowLayer(shadowBlur, shadowDX, shadowDY, shadowColor); paint.setShadowLayer(shadowBlur, shadowDX, shadowDY, shadowColor);
bitmapPaddingX = Math.abs(shadowDX); bitmapPaddingX = Math.abs(shadowDX);

View File

@ -365,10 +365,14 @@ static bool _initWithString(const char * pText, cocos2d::Image::ETextAlign eAlig
textOrigingY = startH - shadowStrokePaddingY; textOrigingY = startH - shadowStrokePaddingY;
} }
CGRect rect = CGRectMake(textOriginX, textOrigingY, textWidth, textHeight);
CGContextBeginTransparencyLayerWithRect(context, rect, NULL);
// actually draw the text in the context // actually draw the text in the context
// XXX: ios7 casting // XXX: ios7 casting
[str drawInRect:CGRectMake(textOriginX, textOrigingY, textWidth, textHeight) withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:(NSTextAlignment)align]; [str drawInRect: rect withFont:font lineBreakMode:NSLineBreakByWordWrapping alignment:(NSTextAlignment)align];
CGContextEndTransparencyLayer(context);
// pop the context // pop the context
UIGraphicsPopContext(); UIGraphicsPopContext();

View File

@ -182,6 +182,9 @@ bool Sprite::initWithTexture(Texture2D *pTexture, const Rect& rect, bool rotated
_quad.tl.colors = tmpColor; _quad.tl.colors = tmpColor;
_quad.tr.colors = tmpColor; _quad.tr.colors = tmpColor;
// shader program
setShaderProgram(ShaderCache::sharedShaderCache()->programForKey(kShader_PositionTextureColor));
// update texture (calls updateBlendFunc) // update texture (calls updateBlendFunc)
setTexture(pTexture); setTexture(pTexture);
setTextureRect(rect, rotated, rect.size); setTextureRect(rect, rotated, rect.size);
@ -547,17 +550,22 @@ void Sprite::draw(void)
CCAssert(!_batchNode, "If Sprite is being rendered by SpriteBatchNode, Sprite#draw SHOULD NOT be called"); CCAssert(!_batchNode, "If Sprite is being rendered by SpriteBatchNode, Sprite#draw SHOULD NOT be called");
CC_NODE_DRAW_SETUP();
ccGLBlendFunc( _blendFunc.src, _blendFunc.dst ); ccGLBlendFunc( _blendFunc.src, _blendFunc.dst );
if (_texture != NULL) if (_texture != NULL)
{ {
CC_NODE_DRAW_SETUP();
ccGLBindTexture2D( _texture->getName() ); ccGLBindTexture2D( _texture->getName() );
ccGLEnableVertexAttribs( kVertexAttribFlag_PosColorTex ); ccGLEnableVertexAttribs( kVertexAttribFlag_PosColorTex );
} }
else else
{ {
// If the texture is invalid, uses the PositionColor shader instead.
// TODO: PostionTextureColor shader should support empty texture. In that way, we could get rid of next three lines.
GLProgram* prog = ShaderCache::sharedShaderCache()->programForKey(kShader_PositionColor);
prog->use();
prog->setUniformsForBuiltins();
ccGLBindTexture2D(0); ccGLBindTexture2D(0);
ccGLEnableVertexAttribs( kVertexAttribFlag_Position | kVertexAttribFlag_Color ); ccGLEnableVertexAttribs( kVertexAttribFlag_Position | kVertexAttribFlag_Color );
} }
@ -1082,16 +1090,6 @@ void Sprite::setTexture(Texture2D *texture)
// accept texture==nil as argument // accept texture==nil as argument
CCAssert( !texture || dynamic_cast<Texture2D*>(texture), "setTexture expects a Texture2D. Invalid argument"); CCAssert( !texture || dynamic_cast<Texture2D*>(texture), "setTexture expects a Texture2D. Invalid argument");
// shader program
if (texture)
{
setShaderProgram(ShaderCache::sharedShaderCache()->programForKey(kShader_PositionTextureColor));
}
else
{
setShaderProgram(ShaderCache::sharedShaderCache()->programForKey(kShader_PositionColor));
}
if (!_batchNode && _texture != texture) if (!_batchNode && _texture != texture)
{ {
CC_SAFE_RETAIN(texture); CC_SAFE_RETAIN(texture);

View File

@ -226,7 +226,11 @@ void TMXLayer::parseInternalProperties()
GLint alphaValueLocation = glGetUniformLocation(getShaderProgram()->getProgram(), kUniformAlphaTestValue); GLint alphaValueLocation = glGetUniformLocation(getShaderProgram()->getProgram(), kUniformAlphaTestValue);
// NOTE: alpha test shader is hard-coded to use the equivalent of a glAlphaFunc(GL_GREATER) comparison // NOTE: alpha test shader is hard-coded to use the equivalent of a glAlphaFunc(GL_GREATER) comparison
// use shader program to set uniform
getShaderProgram()->use();
getShaderProgram()->setUniformLocationWith1f(alphaValueLocation, alphaFuncValue); getShaderProgram()->setUniformLocationWith1f(alphaValueLocation, alphaFuncValue);
CHECK_GL_ERROR_DEBUG();
} }
else else
{ {

View File

@ -172,6 +172,13 @@ void DrawPrimitivesTest::draw()
CHECK_GL_ERROR_DEBUG(); CHECK_GL_ERROR_DEBUG();
// draw a pink solid circle with 50 segments
glLineWidth(2);
ccDrawColor4B(255, 0, 255, 255);
ccDrawSolidCircle( VisibleRect::center() + ccp(140,0), 40, CC_DEGREES_TO_RADIANS(90), 50, 1.0f, 1.0f);
CHECK_GL_ERROR_DEBUG();
// open yellow poly // open yellow poly
ccDrawColor4B(255, 255, 0, 255); ccDrawColor4B(255, 255, 0, 255);
glLineWidth(10); glLineWidth(10);

@ -1 +1 @@
Subproject commit 38374930ae707c70611ad1fcb3a5af91d50d72d0 Subproject commit e4b1b15b70075dee1f20afff4741eb0be88b0a8b

View File

@ -10,6 +10,7 @@
15A3D5631682F20C002FB0C5 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4621682F14C002FB0C5 /* main.js */; }; 15A3D5631682F20C002FB0C5 /* main.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4621682F14C002FB0C5 /* main.js */; };
15A3D5651682F20C002FB0C5 /* tests_resources-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */; }; 15A3D5651682F20C002FB0C5 /* tests_resources-jsb.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */; };
15A3D5681682F20C002FB0C5 /* tests-main.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4741682F14C002FB0C5 /* tests-main.js */; }; 15A3D5681682F20C002FB0C5 /* tests-main.js in Resources */ = {isa = PBXBuildFile; fileRef = 15A3D4741682F14C002FB0C5 /* tests-main.js */; };
1A42C7A81782CEA100F738F6 /* MotionStreakTest in Resources */ = {isa = PBXBuildFile; fileRef = 1A42C7A71782CEA100F738F6 /* MotionStreakTest */; };
1A4C3F1317784B6000EDFB3B /* libchipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */; }; 1A4C3F1317784B6000EDFB3B /* libchipmunk.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */; };
1A4C3F1417784B6000EDFB3B /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */; }; 1A4C3F1417784B6000EDFB3B /* libcocos2dx.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */; };
1A4C3F1517784B6000EDFB3B /* libCocosDenshion.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */; }; 1A4C3F1517784B6000EDFB3B /* libCocosDenshion.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */; };
@ -117,6 +118,7 @@
15A3D4621682F14C002FB0C5 /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = ../../Shared/tests/main.js; sourceTree = "<group>"; }; 15A3D4621682F14C002FB0C5 /* main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = main.js; path = ../../Shared/tests/main.js; sourceTree = "<group>"; };
15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "tests_resources-jsb.js"; path = "../../Shared/tests/tests_resources-jsb.js"; sourceTree = "<group>"; }; 15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "tests_resources-jsb.js"; path = "../../Shared/tests/tests_resources-jsb.js"; sourceTree = "<group>"; };
15A3D4741682F14C002FB0C5 /* tests-main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "tests-main.js"; path = "../../Shared/tests/tests-main.js"; sourceTree = "<group>"; }; 15A3D4741682F14C002FB0C5 /* tests-main.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; name = "tests-main.js"; path = "../../Shared/tests/tests-main.js"; sourceTree = "<group>"; };
1A42C7A71782CEA100F738F6 /* MotionStreakTest */ = {isa = PBXFileReference; lastKnownFileType = folder; name = MotionStreakTest; path = ../../Shared/tests/MotionStreakTest; sourceTree = "<group>"; };
1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libchipmunk.a; sourceTree = BUILT_PRODUCTS_DIR; }; 1A4C3F0E17784B6000EDFB3B /* libchipmunk.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libchipmunk.a; sourceTree = BUILT_PRODUCTS_DIR; };
1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libcocos2dx.a; sourceTree = BUILT_PRODUCTS_DIR; }; 1A4C3F0F17784B6000EDFB3B /* libcocos2dx.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libcocos2dx.a; sourceTree = BUILT_PRODUCTS_DIR; };
1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libCocosDenshion.a; sourceTree = BUILT_PRODUCTS_DIR; }; 1A4C3F1017784B6000EDFB3B /* libCocosDenshion.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libCocosDenshion.a; sourceTree = BUILT_PRODUCTS_DIR; };
@ -333,14 +335,13 @@
D401B5FC16FB169100F2529D /* js_src_raw */ = { D401B5FC16FB169100F2529D /* js_src_raw */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
A22656EE1743DCBB00598A2C /* ClippingNodeTest */,
A218F7DB1743D97E00F65883 /* XHRTest */,
1AA51A7816F708FA000FDF05 /* ActionManagerTest */, 1AA51A7816F708FA000FDF05 /* ActionManagerTest */,
1AA51A7916F708FA000FDF05 /* ActionsTest */, 1AA51A7916F708FA000FDF05 /* ActionsTest */,
1AA51A7A16F708FA000FDF05 /* BaseTestLayer */, 1AA51A7A16F708FA000FDF05 /* BaseTestLayer */,
1AA51A7B16F708FA000FDF05 /* Box2dTest */, 1AA51A7B16F708FA000FDF05 /* Box2dTest */,
1AA51A7C16F708FA000FDF05 /* ChipmunkTest */, 1AA51A7C16F708FA000FDF05 /* ChipmunkTest */,
1AA51A7D16F708FA000FDF05 /* ClickAndMoveTest */, 1AA51A7D16F708FA000FDF05 /* ClickAndMoveTest */,
A22656EE1743DCBB00598A2C /* ClippingNodeTest */,
1AA51A7E16F708FA000FDF05 /* CocosDenshionTest */, 1AA51A7E16F708FA000FDF05 /* CocosDenshionTest */,
1AA51A7F16F708FA000FDF05 /* CocosNodeTest */, 1AA51A7F16F708FA000FDF05 /* CocosNodeTest */,
1AA51A8016F708FA000FDF05 /* CurrentLanguageTest */, 1AA51A8016F708FA000FDF05 /* CurrentLanguageTest */,
@ -355,7 +356,9 @@
1AA51A8816F708FA000FDF05 /* IntervalTest */, 1AA51A8816F708FA000FDF05 /* IntervalTest */,
1AA51A8916F708FA000FDF05 /* LabelTest */, 1AA51A8916F708FA000FDF05 /* LabelTest */,
1AA51A8A16F708FA000FDF05 /* LayerTest */, 1AA51A8A16F708FA000FDF05 /* LayerTest */,
15A3D4621682F14C002FB0C5 /* main.js */,
1AA51A8B16F708FA000FDF05 /* MenuTest */, 1AA51A8B16F708FA000FDF05 /* MenuTest */,
1A42C7A71782CEA100F738F6 /* MotionStreakTest */,
1AA51A8C16F708FA000FDF05 /* OpenGLTest */, 1AA51A8C16F708FA000FDF05 /* OpenGLTest */,
1AA51A8D16F708FA000FDF05 /* ParallaxTest */, 1AA51A8D16F708FA000FDF05 /* ParallaxTest */,
1AA51A8E16F708FA000FDF05 /* ParticleTest */, 1AA51A8E16F708FA000FDF05 /* ParticleTest */,
@ -368,16 +371,16 @@
1AA51A9616F708FA000FDF05 /* SchedulerTest */, 1AA51A9616F708FA000FDF05 /* SchedulerTest */,
1AA51A9716F708FA000FDF05 /* SpriteTest */, 1AA51A9716F708FA000FDF05 /* SpriteTest */,
1AA51A9816F708FA000FDF05 /* SysTest */, 1AA51A9816F708FA000FDF05 /* SysTest */,
D401B6DE16FC071100F2529D /* tests-boot-jsb.js */,
15A3D4741682F14C002FB0C5 /* tests-main.js */,
15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */,
1AA51A9916F708FA000FDF05 /* TextInputTest */, 1AA51A9916F708FA000FDF05 /* TextInputTest */,
1AA51A9A16F708FA000FDF05 /* TextureCacheTest */, 1AA51A9A16F708FA000FDF05 /* TextureCacheTest */,
1AA51A9B16F708FA000FDF05 /* TileMapTest */, 1AA51A9B16F708FA000FDF05 /* TileMapTest */,
1AA51A9C16F708FA000FDF05 /* TouchesTest */, 1AA51A9C16F708FA000FDF05 /* TouchesTest */,
1AA51A9D16F708FA000FDF05 /* TransitionsTest */, 1AA51A9D16F708FA000FDF05 /* TransitionsTest */,
1AA51A9E16F708FA000FDF05 /* UnitTest */, 1AA51A9E16F708FA000FDF05 /* UnitTest */,
15A3D4621682F14C002FB0C5 /* main.js */, A218F7DB1743D97E00F65883 /* XHRTest */,
D401B6DE16FC071100F2529D /* tests-boot-jsb.js */,
15A3D4741682F14C002FB0C5 /* tests-main.js */,
15A3D4711682F14C002FB0C5 /* tests_resources-jsb.js */,
); );
name = js_src_raw; name = js_src_raw;
sourceTree = "<group>"; sourceTree = "<group>";
@ -549,6 +552,7 @@
1A80332C1728F1FB00240CC3 /* res in Resources */, 1A80332C1728F1FB00240CC3 /* res in Resources */,
A218F7DC1743D97E00F65883 /* XHRTest in Resources */, A218F7DC1743D97E00F65883 /* XHRTest in Resources */,
A22656EF1743DCBB00598A2C /* ClippingNodeTest in Resources */, A22656EF1743DCBB00598A2C /* ClippingNodeTest in Resources */,
1A42C7A81782CEA100F738F6 /* MotionStreakTest in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };

View File

@ -1 +1 @@
b30514e90b5ed9a70853c63f20e9204052679459 2fe7237c56cf52c3ca577e33fc39aa5c9e2469ba

View File

@ -101,9 +101,9 @@ public:
const jsval& getJSCallbackThis() const; const jsval& getJSCallbackThis() const;
const jsval& getJSExtraData() const; const jsval& getJSExtraData() const;
protected: protected:
jsval jsCallback; jsval _jsCallback;
jsval jsThisObj; jsval _jsThisObj;
jsval extraData; jsval _extraData;
}; };
@ -112,13 +112,13 @@ public:
JSCCBAnimationWrapper() {} JSCCBAnimationWrapper() {}
virtual ~JSCCBAnimationWrapper() {} virtual ~JSCCBAnimationWrapper() {}
void animationCompleteCallback() const { void animationCompleteCallback() {
JSContext *cx = ScriptingCore::getInstance()->getGlobalContext(); JSContext *cx = ScriptingCore::getInstance()->getGlobalContext();
jsval retval = JSVAL_NULL; jsval retval = JSVAL_NULL;
if(!JSVAL_IS_VOID(jsCallback) && !JSVAL_IS_VOID(jsThisObj)) { if(!JSVAL_IS_VOID(_jsCallback) && !JSVAL_IS_VOID(_jsThisObj)) {
JS_CallFunctionValue(cx, JSVAL_TO_OBJECT(jsThisObj), jsCallback, 0, NULL, &retval); JS_CallFunctionValue(cx, JSVAL_TO_OBJECT(_jsThisObj), _jsCallback, 0, NULL, &retval);
} }
} }
@ -135,7 +135,7 @@ public:
static void setTargetForNativeNode(Node *pNode, JSCallFuncWrapper *target); static void setTargetForNativeNode(Node *pNode, JSCallFuncWrapper *target);
static Array * getTargetForNativeNode(Node *pNode); static Array * getTargetForNativeNode(Node *pNode);
void callbackFunc(Node *node) const; void callbackFunc(Node *node);
}; };
@ -162,7 +162,7 @@ public:
void pause(); void pause();
void scheduleFunc(float dt) const; void scheduleFunc(float dt);
virtual void update(float dt); virtual void update(float dt);
Object* getTarget(); Object* getTarget();

@ -1 +1 @@
Subproject commit 1aef083d3959574072f234cd31c5a53ac52b58a9 Subproject commit 5df9199315b9e9972da23e478808a2e9152e9980

@ -1 +1 @@
Subproject commit 6a45a0770c4e6075f20d5049c88e3cb5f8aa83eb Subproject commit b09d920cdb2523ba7ee1a5ee4419fe11f1bc5e7b

View File

@ -26,7 +26,7 @@ headers = %(cocosdir)s/cocos2dx/include/cocos2d.h %(cocosdir)s/CocosDenshion/inc
# what classes to produce code for. You can use regular expressions here. When testing the regular # what classes to produce code for. You can use regular expressions here. When testing the regular
# expression, it will be enclosed in "^$", like this: "^Menu*$". # expression, it will be enclosed in "^$", like this: "^Menu*$".
classes = Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Data SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode classes = Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.* Rotate.* Blink.* Tint.* Sequence Repeat.* Fade.* Ease.* Scale.* Transition.* Spawn Animat.* Flip.* Delay.* Skew.* Jump.* Place.* Show.* Progress.* PointArray ToggleVisibility.* Hide Particle.* Label.* Atlas.* TextureCache.* Texture2D Cardinal.* CatmullRom.* ParallaxNode TileMap.* TMX.* CallFunc RenderTexture GridAction Grid3DAction GridBase$ .+Grid Shaky3D Waves3D FlipX3D FlipY3D Speed ActionManager Set Data SimpleAudioEngine Scheduler Timer Orbit.* Follow.* Bezier.* CardinalSpline.* Camera.* DrawNode .*3D$ Liquid$ Waves$ ShuffleTiles$ TurnOffTiles$ Split.* Twirl$ FileUtils$ GLProgram ShaderCache Application ClippingNode MotionStreak
# what should we skip? in the format ClassName::[function function] # what should we skip? in the format ClassName::[function function]
# ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also
@ -35,17 +35,17 @@ classes = Sprite.* Scene Node.* Director Layer.* Menu.* Touch .*Action.* Move.*
# will apply to all class names. This is a convenience wildcard to be able to skip similar named # will apply to all class names. This is a convenience wildcard to be able to skip similar named
# functions from all classes. # functions from all classes.
skip = Node::[convertToWindowSpace ^setPosition$ getGrid setGLServerState description getUserObject .*UserData getGLServerState .*schedule], skip = Node::[^setPosition$ getGrid setGLServerState description getUserObject .*UserData getGLServerState .*schedule],
Sprite::[getQuad displayFrame getBlendFunc ^setPosition$ setBlendFunc setSpriteBatchNode getSpriteBatchNode], Sprite::[getQuad displayFrame getBlendFunc ^setPosition$ setBlendFunc setSpriteBatchNode getSpriteBatchNode],
SpriteBatchNode::[getBlendFunc setBlendFunc], SpriteBatchNode::[getBlendFunc setBlendFunc],
MotionStreak::[getBlendFunc setBlendFunc], MotionStreak::[getBlendFunc setBlendFunc draw update],
AtlasNode::[getBlendFunc setBlendFunc], AtlasNode::[getBlendFunc setBlendFunc],
ParticleBatchNode::[getBlendFunc setBlendFunc], ParticleBatchNode::[getBlendFunc setBlendFunc],
LayerColor::[getBlendFunc setBlendFunc], LayerColor::[getBlendFunc setBlendFunc],
ParticleSystem::[getBlendFunc setBlendFunc], ParticleSystem::[getBlendFunc setBlendFunc],
DrawNode::[getBlendFunc setBlendFunc drawPolygon], DrawNode::[getBlendFunc setBlendFunc drawPolygon],
Director::[getAccelerometer (g|s)et.*Dispatcher getOpenGLView getProjection getClassTypeInfo], Director::[getAccelerometer (g|s)et.*Dispatcher getOpenGLView getProjection getClassTypeInfo],
Layer.*::[didAccelerate (g|s)etBlendFunc], Layer.*::[didAccelerate (g|s)etBlendFunc keyPressed keyReleased unregisterScriptKeypadHandler],
Menu.*::[.*Target getSubItems create initWithItems alignItemsInRows alignItemsInColumns], Menu.*::[.*Target getSubItems create initWithItems alignItemsInRows alignItemsInColumns],
MenuItem.*::[create setCallback initWithCallback], MenuItem.*::[create setCallback initWithCallback],
Copying::[*], Copying::[*],