Commit Graph

6732 Commits

Author SHA1 Message Date
unknown adb68ddbb6 Enable Windows XP support in Visual Studio 2012 Update 1.
Not tested with Visual Studio 2010, not sure will it work with PlatformToolset v110_xp.
2012-12-19 19:28:25 +01:00
unknown fdd67d37c9 Missing subproject 2012-12-18 23:01:22 +01:00
James Chen e8c0844dd5 fixed #1617: Some improvements for JS Bindings.
1) Changed cc.REPEAT_FOREVER = - 1 to cc.REPEAT_FOREVER = 0xffffffff
[Reason]: If cc.REPEAT_FOREVER = -1, it will be a very big double value after converting it to double by JS_ValueToNumber on android.
Then cast it to unsigned int, the value will be 0. The schedule will not be able to work.
I don't know why this occurs only on android.
[Solution]: Instead of passing -1 to it, I assign it with max value of unsigned int in c++.

2) Added two helper function, cc.ArrayGetIndexOfObject and cc.ArrayContainsObject.

3) Added JSScheduleWrapper::removeTargetForNativeNode to avoid memory leaks.

4) Improvments for JSTouchDelegate. Added four functions as follows:
// Set the touch delegate to map by using the key (pJSObj).
static void setDelegateForJSObject(JSObject* pJSObj, JSTouchDelegate* pDelegate);

// Get the touch delegate by the key (pJSObj).
static JSTouchDelegate* getDelegateForJSObject(JSObject* pJSObj);

// Remove the delegate by the key (pJSObj).
static void removeDelegateForJSObject(JSObject* pJSObj);

void unregisterTouchDelegate();
And exported cc.unregisterTouchDelegate(); to js.
Fix a memory leak for JSTouchDelegate by making it as an autorelease object.

5) Don't add js callback function to the reserved slot of object.
[Reason]: The target object may execute more than one schedule.
Therefore, previous js callback function will be replaced
by the current one. For example:

this.scheduleOnce(function() { temporary function 1 }, 0.5);
this.scheduleOnce(function() { temporary function 2 }, 0.5);

In this case, the temporary function 1 will be removed from reserved slot 0.
And temporary function 2 will be set to reserved slot 0 of this object.
If gc is triggered before the JSScheduleWrapper::scheduleFunc is invoked,
crash will happen. You could simply reproduce it by adding jsc.garbageCollect(); after scheduleOnce.
[Solution] Because one schedule corresponds to one JSScheduleWrapper, we root
the js callback function in JSScheduleWrapper::setJSCallbackFunc and unroot it
at the destructor of JSScheduleWrapper.
2012-12-18 11:56:44 +08:00
James Chen c2e1cf2d51 Merge pull request #1763 from CocosRobot/updategeneratedsubmodule_1355729180
cocos2dxmatoMac-mini : updating submodule reference to latest autogenerated bindings
2012-12-16 23:40:28 -08:00
CocosRobot 13b04e3ee4 cocos2dxmatoMac-mini : updating submodule reference to latest autogenerated bindings 2012-12-17 15:26:28 +08:00
minggo e9c7db5a36 Merge pull request #1761 from dualface/fix_ccnode_scheduleupdate_lua
[lua] remove current schedule before register new script schedule
2012-12-16 17:26:59 -08:00
minggo 325db7e4f5 Merge pull request #1760 from dualface/fix_android_compile_warning
fix android compile warning
2012-12-16 17:26:19 -08:00
dualface c3f900d36c [lua] remove current schedule before register new script schedule 2012-12-14 18:06:21 +08:00
dualface 98ea80329e fix android compile warning 2012-12-14 18:01:54 +08:00
James Chen 5b23475451 Merge pull request #1759 from dumganhar/gles20
fixed #1614: DrawNodeTest crashes on JSB.
2012-12-13 18:33:26 -08:00
James Chen 254e3838d5 Updated the submodule reference of cocos2d-js-tests to the latest version. 2012-12-14 10:32:06 +08:00
James Chen e7328cf3ba fixed #1614: DrawNodeTest crashes on JSB. 2012-12-14 10:31:31 +08:00
tiantian dc49561357 Fix crash for call runAnimation() in CCBAnimationManagerDelegate::completedAnimationSequenceNamed; Set mRunningSequence to NULL before any runAnimation() call; 2012-12-13 13:21:58 +08:00
James Chen b872909152 Merge pull request #1756 from dumganhar/gles20
Added cc.DrawNode.extend.
2012-12-12 05:51:53 -08:00
Nicolas Gramlich 9537389949 Added cc.DrawNode.extend. 2012-12-12 21:49:29 +08:00
James Chen e706cdb207 Merge pull request #1754 from dualface/fix_compile_error_for_ios_mac_cpp11
fixed #1612: Compilation errors occur when using c++11 compiler for ios/mac.
2012-12-10 02:20:52 -08:00
dualface d6a84e0d16 fix compile error for ios/mac c++11 2012-12-10 18:10:41 +08:00
James Chen 38a1e52bed Update AUTHORS 2012-12-10 17:31:27 +08:00
James Chen 597a6f181d Merge pull request #1752 from dumganhar/linux-lua
fixed #1611: Adding lua support for linux platform
2012-12-10 01:29:15 -08:00
James Chen 190e6c1de5 Merge branch 'linux-lua' of https://github.com/dumganhar/cocos2d-x into lua-linux
Conflicts:
	scripting/lua/cocos2dx_support/LuaCocos2d.cpp
2012-12-10 17:25:23 +08:00
minggo 9d793f0def Merge pull request #1751 from minggo/iss1610_labelttf
fixed #1610:skip only white character
2012-12-10 01:19:27 -08:00
minggo e15c0a33ae fixed #1610:skip only white character 2012-12-10 17:18:20 +08:00
James Chen fdd1479ca9 Merge pull request #1747 from dualface/lua_update
Updated something for luabinding:
1) fix invalid export, e.g. va_list
2) fix CCSequence export 
3) Updated LuaCocos2d.cpp.
2012-12-10 01:11:11 -08:00
James Chen 15251626b0 Merge pull request #1748 from guanqun/fix-doxygen
fix the doxygen output of CCAtlasNode
2012-12-10 01:01:21 -08:00
dualface f815cdc423 merge gles20 2012-12-10 17:00:16 +08:00
James Chen 0adc070146 Merge pull request #1749 from guanqun/fix-reorder
fix the reorder warning of class CCCallFunc
2012-12-10 00:59:00 -08:00
dualface d9abb15b9a Merge branch 'gles20' of git://github.com/cocos2d/cocos2d-x into gles20 2012-12-10 16:56:42 +08:00
James Chen 6cca9b6548 Merge pull request #1750 from dumganhar/iss1608-lua-scheduleUpdateWithPriority
fixed #1608: Adding CCNode::scheduleUpdateWithPriorityLua() for LuaBinding.
2012-12-10 00:54:16 -08:00
James Chen 65d81b0de7 fixed #1608: Updated tools/tolua++/CCAction.pkg. 2012-12-10 16:50:02 +08:00
James Chen fcead8ba34 Merge branch 'lua_add_CCNode_scheduleUpdateScriptHandlerWithPriority' of https://github.com/dualface/cocos2d-x into lua-schedule-improvement 2012-12-10 16:36:46 +08:00
minggo 0f58987ad1 Merge pull request #1740 from rtissera/gles20
[android] Cocos2dxHelper/CCFileUtils JNI fixes and improvements
2012-12-10 00:33:11 -08:00
dualface f08b9c4573 performance fix 2012-12-10 16:31:57 +08:00
dualface 268aa45d2c rename CCNode:scheduleUpdateScriptHandlerWithPriority() to CCNode::scheduleUpdateWhitPriorityLua()
remove unused functions
2012-12-10 16:09:23 +08:00
Lu Guanqun b2c13cba9d fix the reorder warning of class CCCallFunc
../actions/CCActionInstant.h: In constructor 'cocos2d::CCCallFunc::CCCallFunc()':
../actions/CCActionInstant.h:240:25: warning: 'cocos2d::CCCallFunc::<anonymous union>::m_pCallFunc' will be initialized after [-Wreorder]
../actions/CCActionInstant.h:236:6: warning:   'int cocos2d::CCCallFunc::m_nScriptHandler' [-Wreorder]
../actions/CCActionInstant.h:188:5: warning:   when initialized here [-Wreorder]
2012-12-10 16:07:19 +08:00
Lu Guanqun 497ae7c33f fix the reorder warning of class CCCallFunc
../actions/CCActionInstant.h: In constructor 'cocos2d::CCCallFunc::CCCallFunc()':
../actions/CCActionInstant.h:240:25: warning: 'cocos2d::CCCallFunc::<anonymous union>::m_pCallFunc' will be initialized after [-Wreorder]
../actions/CCActionInstant.h:236:6: warning:   'int cocos2d::CCCallFunc::m_nScriptHandler' [-Wreorder]
../actions/CCActionInstant.h:188:5: warning:   when initialized here [-Wreorder]
2012-12-10 16:05:17 +08:00
Lu Guanqun 64772d09b0 fix the doxygen output of CCAtlasNode 2012-12-10 15:31:26 +08:00
minggo 0c00f7cb70 Merge pull request #1746 from dumganhar/gles20
fixed #1606: Return CCSequence pointer for CCSequence::create.
2012-12-09 22:30:27 -08:00
dualface 77d4da6e22 [lua] remove va_list 2012-12-10 14:28:26 +08:00
James Chen fc16cd8d01 Merge branch 'gles20' of https://github.com/cocos2d/cocos2d-x into gles20 2012-12-10 14:21:18 +08:00
dualface b6e605b9ae [lua] fix CCSequence export 2012-12-10 14:19:18 +08:00
James Chen 21f88534cf fixed #1606: Updated some invocations of CCSequence for TestCpp project. 2012-12-10 14:12:56 +08:00
James Chen 839288671e fixed #1606: Override update function for ExtraAction. 2012-12-10 14:11:42 +08:00
minggo 62e49387e5 Merge pull request #1745 from minggo/iss1580_lost_focus
fixed #1580:request focus after keyboard closed
2012-12-09 22:11:05 -08:00
dualface 4ca6cf8c7a [lua] update LuaCocos2d.cpp 2012-12-10 14:09:00 +08:00
minggo 71f61596e9 fixed #1580:request focus after keyboard closed 2012-12-10 14:08:01 +08:00
dualface 0662ceac9d [lua] update export 2012-12-10 14:07:24 +08:00
dualface 86f6473270 [lua] fix invalid export 2012-12-10 14:04:56 +08:00
dualface 121706172f Merge branch 'gles20' of git://github.com/cocos2d/cocos2d-x into gles20 2012-12-10 14:02:15 +08:00
dualface d854f68c63 [scripting] add CCNode::scheduleUpdateScriptHandlerWithPriority() 2012-12-10 13:51:37 +08:00
dualface c8753f72ef [scripting] add CCNode::scheduleUpdateScriptHandlerWithPriority() 2012-12-10 13:48:27 +08:00