Commit Graph

325 Commits

Author SHA1 Message Date
dumganhar 8f900d02b8 issue #2300: Removing all 'copyWithZone' pattern. 2013-07-08 23:05:47 +08:00
Xuejie Xiao a1fbee0bdf Merge remote-tracking branch 'upstream/develop' into add-namespace-to-macro
Conflicts:
	cocos2dx/cocoa/CCObject.h
2013-07-04 13:59:36 +08:00
Xuejie Xiao 3401c909d8 Add namespace prefix to selector macros 2013-07-04 13:35:11 +08:00
James Chen 331c688f6f Merge pull request #3063 from dumganhar/DarraghCoy-selector_cast_safety
Merge PR#3058:  Adding extra safety to selector casting macros
2013-07-03 01:09:09 -07:00
minggo 2f88109a96 Merge pull request #3055 from DarraghCoy/add_rect_union_with_rect
Add Rect::unionWithRect
2013-07-03 00:42:55 -07:00
minggo f089e62e8f closed #2361:fix a crsash caused by Set::removeAllObjects 2013-07-03 15:26:58 +08:00
James Chen 661a934e82 Merge branch 'selector_cast_safety' of https://github.com/DarraghCoy/cocos2d-x into DarraghCoy-selector_cast_safety 2013-07-03 14:06:53 +08:00
Darragh Coy abbbc3191e Add extra safety to selector casting macros
Use static_cast<> instead of C-Style casts in the callfunc0_selector() etc. series of macros as this will allow the compiler to perform more stringent error checking and catch out cases where incompatible function signatures are being casted. This helps prevent very subtle and difficult to track down bugs where the signature of the function being casted is not what Cocos2dx expect - which can cause strange things to happen and corrupt the current stack frame.
2013-07-02 14:36:09 -07:00
Darragh Coy e6270e64de Bugfixes to the Set class.
1: If adding an object to the container then only retain the object again provided it's not already been added. The underlying std::set does not support duplicate entries. (see: www.cocos2d-x.org/boards/6/topics/10876)
2: When removing an object only CC_SAFE_RELEASE it if it was actually contained in the set. (see: http://www.cocos2d-x.org/boards/6/topics/10876)
3: Fix a bug in 'removeAllObjects' where the underlying std::set container was not being cleared. (see: https://github.com/cocos2d/cocos2d-x/issues/2283)
2013-07-02 14:24:14 -07:00
Darragh Coy da58f035c5 Add CCRect::unionWithRect
Add a new CCRect utility function called 'unionWithRect' which computes the minimum rectangle that contains the current rectangle and another given rectangle, similar to to the following .NET function: http://msdn.microsoft.com/en-us/library/ms521839.aspx
2013-07-02 11:39:49 -07:00
folecr ee5f319a77 Fix include path 2013-06-24 17:29:24 -07:00
James Chen 93b6328303 issue #2129: Removing CC prefix for cocos2dx module. 2013-06-20 14:13:12 +08:00
Ricardo Quesada 159ef1ec68 clone() doesn't use copy constructor
... and other bug fixes
2013-06-18 15:06:53 -07:00
James Chen c0d44cb2e4 fixed #2129: Rename m_iVar to _var, remove CC prefixes. 2013-06-15 14:03:30 +08:00
James Chen 1cfca9bc60 Updating property in CCDictionary. 2013-06-15 13:42:05 +08:00
James Chen e56c63b03d Merge pull request #2884 from ricardoquesada/actions_clone_pattern
issue #2289: Actions with clone() pattern 1/3
2013-06-13 23:19:04 -07:00
Ricardo Quesada 8a6d33a212 Adds CC prefix to CALLBACK()
Now it is called: CC_CALLBACK()
2013-06-13 20:36:43 -07:00
Ricardo Quesada 98190a21c0 Actions with clone() pattern 1/3
This is the 1st patch of 3.

1)
Removes the copyWithZone() patterns.
Adds the clone() pattern instead (which is more C++ friendly)
Adds also "const" to getters.
2013-06-13 17:25:14 -07:00
Ricardo Quesada 83b43ab93e Adds CALLBACK_0, CALLBACK_1 and CALLBACK_2
Handy macros for callbacks.
Instead of:
	std::bind(func_ptr, instnace, std::placeholder::_1)
you use:
	CALLBACK_1(func_ptr, instance)

And also removes more warnings from the tests
2013-06-11 16:30:05 -07:00
James Chen 8cfe969137 Fixing compilation errors for win32. 2013-06-07 14:31:15 +08:00
Jaroslaw Lewandowski 3f7c506638 Ability to save/retrieve CCData into/from CCUserDefault 2013-05-29 01:06:41 +01:00
Ricardo Quesada 836a61cd3e CCConfiguration extension (rewritten)
rewritten to prevent conflicts while rebasing
2013-05-22 13:00:34 -07:00
James Chen e21926edb8 fixed #1644: Passing NULL parameter to ccdictionary_to_jsval will cause crash. 2013-05-22 11:56:47 +08:00
James Chen cbafaf67a6 fixed #2142: Adding CCDataVisitor and Implementing CCPrettyPrinter, iOS port is ok. 2013-05-10 15:07:05 +08:00
minggo 1166a02e13 resolve conflict for #2505 2013-05-07 14:31:00 +08:00
minggo 90b8dfd383 Merge pull request #2504 from wagaf-d/ccpchanges
Move ccpX functions to CCPoint methods and operators
2013-05-06 23:22:21 -07:00
minggo ea5d7bc5ad Merge pull request #2361 from tiantian20007/dictStuff
Implement CCDictionary::writeToFile();
2013-05-06 23:17:11 -07:00
Adrien Béraud 16d2b5a957 Assert that the user does not divide by 0 in CCPoint and CCSize 2013-05-07 14:58:43 +10:00
Adrien Béraud ca4c2edc29 Clarify CCPoint::rotate & unrotate documentation 2013-05-07 14:36:17 +10:00
James Gregory 92e4c76f20 Move GL server-side buffer code into a separate class and use multiple inheritance to deploy only to classes that need it. 2013-05-06 21:29:44 -07:00
James Gregory fa77e6ede2 Switch to using GL_DYNAMIC_DRAW. 2013-05-06 21:29:44 -07:00
James Gregory 36fc2ecf99 Get CCGrid to work. 2013-05-06 21:29:43 -07:00
James Gregory 9ae67ff78a Move GL server-side buffer code into a separate class and use multiple inheritance to deploy only to classes that need it. 2013-05-06 21:25:47 -07:00
James Gregory ff1e0aefa0 Switch to using GL_DYNAMIC_DRAW. 2013-05-06 21:25:47 -07:00
James Gregory 235b80e7f8 Get CCGrid to work. 2013-05-06 21:22:34 -07:00
James Gregory 062a5eefd8 Move GL server-side buffer code into a separate class and use multiple inheritance to deploy only to classes that need it. 2013-05-06 21:13:21 -07:00
James Gregory 6c828bbe4f Switch to using GL_DYNAMIC_DRAW. 2013-05-06 21:13:21 -07:00
James Gregory 809b77d632 Get CCGrid to work. 2013-05-06 21:08:28 -07:00
James Gregory 5bac7b52ac Move GL server-side buffer code into a separate class and use multiple inheritance to deploy only to classes that need it. 2013-05-06 20:59:48 -07:00
James Gregory a9c8d99a4c Switch to using GL_DYNAMIC_DRAW. 2013-05-06 20:59:48 -07:00
James Gregory 9500448f87 Get CCGrid to work. 2013-05-06 20:58:46 -07:00
minggo 80dfd4d493 Merge pull request #2407 from sergey-shambir/attribute_format
Added __attribute__(__format__()) for CCLog and CCString
2013-05-06 20:06:52 -07:00
Adrien Béraud 6a5559da7f Check for 0 length in CCPoint::normalize() 2013-05-07 03:15:28 +10:00
Adrien Béraud f71798a35b Check for 0 length in CCPoint::normalize() 2013-05-07 02:59:38 +10:00
Adrien Béraud 49474f5194 documentation 2013-05-07 02:53:13 +10:00
Adrien Béraud 3661e34695 Bug fix: width and height reversed in CCSize operators 2013-05-05 19:51:44 +10:00
Adrien Béraud 637cc1a9ed CCPoint::getDistance() implemented, CCPoint::length() renamed to getLength(), bug fixes 2013-05-05 02:58:46 +10:00
savdalion 5f549dd011 Added const modifier for classes CCArray, CCObject - fine code! 2013-05-04 15:05:06 +03:00
Adrien Béraud b9fe35901a Moved most CCPointExtension functions to CCPoint OO-equivalents 2013-05-04 17:18:22 +10:00
Adrien Béraud b34dc25346 Cleaner constructors and overloads for CCSize; Cross-assignement and conversion constructors between CCPoint and CCSize. 2013-05-03 13:24:52 +10:00
Adrien Béraud b627cd4674 overloading operators +-*/ in CCPoint 2013-05-02 15:13:03 +10:00
Adrien Béraud 9fb0081add direct constructor for CCPoint 2013-05-02 14:59:50 +10:00
Sergey Shambir 3ae98978d4 Added CC_FORMAT_PRINTF to CCString
Added for CCString::initWithFormat() and CCString::createWithFormat().
Fixed warnings.
2013-04-19 14:00:16 +04:00
James Chen d37a43e100 Merge pull request #2398 from lgb/float_comparison_issue
fixed #1935: Float comparison must not use "==" in the equal function of CCPoint and CCSize, we should compare float number by using epsilon and absolute difference.
2013-04-18 19:44:17 -07:00
Oleg Baluk 271f90e744 compare using epsilon and absolute difference 2013-04-18 02:16:49 +04:00
James Chen 84b4c5ac2b fixed #2051: Comment update, int ~> intptr_t. 2013-04-14 16:05:54 +08:00
James Chen ea78ee9bb7 fixed #2051: TestCpp/ExtensionsTest/CocosbuilderTest crashes under x86_64 target. 2013-04-14 16:00:50 +08:00
James Chen 2757962748 Merge branch 'master' of https://github.com/billy1380/cocos2d-x into billy1380-master 2013-04-14 14:49:02 +08:00
tianTian 96359950cf Implement CCDictionary::writeToFile();
Use NSDictionay to do the job for iOS and Mac, and using tinyxml2 for other platform;
2013-04-13 16:55:24 +08:00
billy1380 493d1d90ed fixed a bug that was causing x86_64 tests to crash while loading
ccbuilder files
2013-04-12 14:37:28 +01:00
hkrishna 38cb350d39 Problem with initWithObjects of CCArray
A new unused array was created instead of using the instance on which
the method was called
2013-04-09 00:08:41 +05:30
Darragh Coy 55dd6a6129 Add CCSet::create() to create, autorelease and return a new empty set. 2013-03-13 10:58:24 -07:00
James Chen ae1c64573e Merge pull request #2046 from rohankuruvilla/eclipse
fixed #1827: Eclipse Project import - Documentation Added and Tested.
2013-03-12 01:36:17 -07:00
Rohan Kuruvilla 7149f0598d Adding missing eclipse project files 2013-03-07 12:13:50 -08:00
Sam Clegg 38878b084b Fix all compiler warnings produced by gcc.
This allows the linux and NaCl builds (and perhaps others)
to be compiles with -Wall and -Werror, and it makes the build
output much less noisy.
2013-03-05 17:01:00 -08:00
James Chen ae0b973cf1 issue #1687: Moving the global function( ccFileUtils_dictionaryWithContentsOfFileThreadSafe, ccFileUtils_arrayWithContentsOfFileThreadSafe) to the CCFileUtils class.
)
2013-02-01 18:48:44 +08:00
minggo fbcb33eefd make CCRect accept width<0 and height<0 2013-01-29 14:03:03 +08:00
James Chen 375666fd6c fixed #1468: Exported CCPoint, CCSize and CCRect. 2013-01-15 18:59:35 +08:00
James Chen 5d7cc39edd issue #1650: Inline function needs to be implemented in header file on Android platform. 2013-01-15 18:15:14 +08:00
James Chen 547f95d761 issue #1650: Made the destructor of CCDictElement as public method. 2013-01-15 17:20:04 +08:00
James Chen c3d697a0f8 issue #1650: Adding detailed doxgen comments for CCDictionary. 2013-01-15 17:09:25 +08:00
minggo 984b304ec5 issue #1468:change CCPoint CCSize CCRect from class to struct 2013-01-14 14:45:16 +08:00
Tomoaki Shimizu 1293c8a6c2 added licence 2012-12-29 11:32:27 +09:00
Tomoaki Shimizu b4edd167af The variable name was changed.The check of pRet was added. 2012-12-28 12:24:28 +09:00
Tomoaki Shimizu 87146d82e1 Added CCFloat, CCDouble and CCBool 2012-12-27 23:15:13 +09:00
James Chen 0d90fea7b3 Merge branch 'myFeature' of https://github.com/tks2shimizu/cocos2d-x into iss1602-rand-ccdictionary
Conflicts:
	cocos2dx/cocoa/CCDictionary.cpp
	cocos2dx/cocoa/CCDictionary.h
2012-12-07 10:40:32 +08:00
Tomoaki Shimizu e680e5f0f2 Add randomObject to CCDictionary
Although CCArray has randomObject(), CCDictionary does not have it.
So CCDictionary should have randomObject().
2012-12-06 23:56:49 +09:00
minggo a75f8b7e7a fixed #1593:remove all deprecated methods expect CCBAnimationManager 2012-12-06 18:51:33 +08:00
Andres Pagliano 97efff6e46 Removed unnescessary header 2012-11-30 11:30:45 -03:00
Andres Pagliano 8adb3eb6eb Refactoring in CCSet 2012-11-30 11:23:44 -03:00
Gonzalo Buteler 43cc383346 Implementation of removeAllObjects() methods in CCSet 2012-11-30 10:44:09 -03:00
James Chen d7ebd681ec fix a warning in CCRenderTexture. 2012-11-26 22:11:56 +08:00
James Chen 965540ecec issue #1486: fix a warning in CCAutoreleasePool.cpp. 2012-10-12 16:03:53 +08:00
James Chen be236155e9 Fix a typo. 2012-10-08 14:58:24 +08:00
James Chen f6c34e23e6 Adding some comments for CCDictionary::objectForKey method. 2012-10-08 14:55:46 +08:00
James Chen 6d29e63294 fixed #1494: Change the value of CCObject::m_uAutoreleaseCount in CCAutoreleasePool class. 2012-10-08 14:05:03 +08:00
James Chen 54b4c690d1 fixed #1494: Missing removing auto-release object from AutoReleasePool if invoking 'autorelease' method more times. 2012-10-08 13:41:48 +08:00
walzer 0cca568ffe fixed #1492, assert if user add an CCObject* into CCAutoreleasePool twice. 2012-09-28 18:22:00 +08:00
Byung Choi 2ed9119d4f fixed pointer to int casting warnings and errors, based on stdint 2012-09-22 03:02:29 +09:00
Donald Alan Morrison 4cbd993091 Minor English Spelling Corrections. A few grammar corrections. 2012-09-17 00:02:24 -07:00
Walzer f475bcf102 CCString::stringWithContentsOfFile should call CCString::createWithContentsOfFile, but not CCString::create 2012-09-16 16:21:42 +08:00
James Chen 7d8b261ced fixed #1477: Abstracts Lua and JS binding protocol, some bugs fixes in lua-binding, adding custom menu on win32 and mac for switching resolutions. 2012-09-11 14:02:33 +08:00
James Chen 9ba5a1bfef issue #1454: Removed COCOS2D_JAVASCRIPT macro. 2012-08-31 21:23:23 +08:00
minggo 860d3eff4b issue #1454: make js binding work together with lua binding and native codes 2012-08-31 17:55:45 +08:00
Rohan Kuruvilla 8d7516a0ef Test project for cocos2d-x js. 2012-08-27 10:07:31 -07:00
Rolando Abarca a114502929 removes OBJECT_TYPE thing 2012-08-27 08:43:38 -07:00
Rolando Abarca 42ce395f05 uses proxy instead of Get/SetPrivate 2012-08-27 08:43:38 -07:00
Rohan Kuruvilla 0e9ba1173a Callbacks 2012-08-27 08:43:37 -07:00
Rolando Abarca 4e640ecb35 uses new ADD_OBJECT_TYPE macro 2012-08-27 08:43:37 -07:00
Rolando Abarca 701f5e9dfc roots & unroots jsobject 2012-08-27 08:43:37 -07:00