Commit Graph

277 Commits

Author SHA1 Message Date
Timothy Qiu d1e46940ab Documentation fix: use \p to reference a parameter
The orginal @param is meant to describe a parameter, resulting in a
strange doc output.
2013-07-26 12:04:03 +08:00
James Chen 387ea1899c issue #2404: Disabling warning of invoking deprecated methods in engine. Rename CCCallFuncND to __CCCallFuncND, and add deprecated typedef CCCallFuncND.
Only disable warning for CCActionInstant.cpp and CCMenuItem.cpp
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher
#pragma warning (push)
#pragma warning (disable: 4996)
#endif

#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher
#pragma warning (pop)
#endif
2013-07-25 15:05:56 +08:00
James Chen af3b8a0390 issue #2404: Rename CallFuncND/CallFuncO to CCCallFuncND/CCCallFuncO and mark them as deprecated classes. In v3.0, we could use CallFuncN instead. 2013-07-25 13:45:02 +08:00
James Chen 44a338f63c issue #2404: Re-add CallFuncND and CallFuncO and mark them as deprecated class. 2013-07-24 16:45:11 +08:00
Ricardo Quesada 1f37d4d00a More best practices fixes and other bug fixes
- Adds `CC_REQUIRES_NULL_TERMINATION` to methods that require a NULL at the end
- Removes more Hungarian notations in samples
- s/sprite/scene: fix from previous commit
- `CCLog` -> `log`
- `getLayerNamed` -> `getLayer`
- `getPropertyNamed` -> `getProperty`
- and other small fixes
2013-07-23 15:20:22 -07:00
James Chen 4110b95e96 issue #2378: inline function are in header files now. 2013-07-23 20:36:41 +08:00
James Chen f32f1dff33 Cast fix: GLbyte --> GLubyte. 2013-07-22 14:45:01 +08:00
Ricardo Quesada 89d210bdb3 CCAssert -> CCASSERT
and other best pracitces like:

capacity and "index" are ints and not unsigned int (google's recomendation).
 It is easier to detect underflow bugs like this

plus other minor improvements
2013-07-19 22:01:27 -07:00
Ricardo Quesada 1f0dac4ed0 Removes CC_PROPERTY / CC_SYNTHESIZE from some parts of the code
As agreed previously, CC_PROPERTY_XXX and CC_SYNTHESIZE_XXX should
not be used in the code.
This patch removes some of them. There are still many more to remove
2013-07-19 13:16:38 -07:00
Ricardo Quesada ba6ab126c6 More best practices fixes
- class order fixes
  - static methods (creators) at the beginning
  - then constructors / destructors
  - then init
- more `const` fixes
  - adds some const getters
  - some getters have 2 versions: `const` and no-const version
- renamed CocosDenshion::sharedEngine -> getInstance()
2013-07-18 16:30:19 -07:00
James Chen 7de69edad8 Merge pull request #3187 from dumganhar/ricardoquesada-more_best_practices_fixes
Merge https://github.com/cocos2d/cocos2d-x/pull/3183
2013-07-18 08:52:15 -07:00
minggo 208c1312f4 Merge pull request #3171 from samuele3hu/ScriptHandler
issue #2377:Modify some tolua_*_open functions place and Modify Websocket,OpenGL,ScrollView handlers operation
2013-07-18 02:48:37 -07:00
James Chen a425dd3dc0 Merge branch 'more_best_practices_fixes' of https://github.com/ricardoquesada/cocos2d-x into ricardoquesada-more_best_practices_fixes
Conflicts:
	cocos2dx/actions/CCActionTiledGrid.h
2013-07-18 15:46:14 +08:00
Ricardo Quesada 6e25301b43 more best practices fixes
- Adds more `const` in getters
- Overriden methods have the `override` keyword
- Reorganizes the structure of the class:
  # creators first, then constructor, destructors, init
  # then overridden methods
  # variables at the end
- removes Hungarian notation from parts of the code
2013-07-17 16:56:19 -07:00
James Chen f4edc7a922 closed #2413: Warning fixes for overload virtual functions. 2013-07-17 16:25:13 +08:00
samuele3hu c9f0f09dac issue #2377:Del CallFunc and CallFuncN handler operation and Modify LuaWebScoket linux config 2013-07-17 14:44:28 +08:00
Ricardo Quesada 9958e0d7f9 Adds more readability to the class internals.
Changes:
  - creator (static) methods, and singleton methods (static) are always at the top of the class
  - Constructors, destructros, and init methods comes next
  - Then the instance methods for the class
  - Then the overriden methods
  - and finally the ivars

Also, overriden methos have the "override" context keyword
2013-07-15 12:43:22 -07:00
minggo eada29ee40 issue #2404:created CCDprecated.h and move all global functions and variables into it 2013-07-15 16:14:26 +08:00
minggo 6abe6fce78 closed #2393: fix conflicts 2013-07-12 18:04:32 +08:00
minggo 58fe3c7563 closed #2393: fixed conflicts 2013-07-12 15:07:44 +08:00
minggo 5d9fea1416 issue #2393:mark PointZero RectZero and SizeZero as deprecated 2013-07-12 14:47:36 +08:00
minggo 15096b0716 issue #2393:mark CCPointMake CCSizeMake CCRectMake as deprecated 2013-07-12 14:30:26 +08:00
minggo bb758df0d0 issue #2393:mark ccp as deprecated 2013-07-12 14:11:55 +08:00
Ricardo Quesada cf262c28e2 getInstance() / destroyInstance() are used...
... instead of sharedXXX / purgeXXX.
They are more C++ friendly, and also easier to remember.

common files + Mac files + iOS files + tests/samples files were updated.

The old methods are deprecated now.
2013-07-11 15:24:23 -07:00
minggo c37af8fa77 issue #2393:mark functions in CCPointExtensions deprecated 2013-07-11 16:38:58 +08:00
James Chen a5470aaa45 Minor fix in BezierTo::initWithDuration and BezierTo::clone. 2013-07-11 15:41:05 +08:00
minggo 630937aa3d Merge pull request #3124 from dumganhar/rename-method
issue #2300: A fix of missing invoking 'initXXX' in clone method.(FadeOut, DelayTime).
2013-07-10 00:49:58 -07:00
James Chen d830bb5f96 'tile' --> 'getTile', 'orignalTile' --> 'getOrignalTile' 2013-07-10 14:17:42 +08:00
James Chen a6db6db334 issue #2300: A fix of missing invoking 'initXXX' in clone method.(FadeOut, DelayTime). 2013-07-10 14:16:42 +08:00
minggo 91fc0b2a45 Merge pull request #3114 from dumganhar/iss2388-default-texture
closed #2388: Creating a default texture for CCSprite if setTexture(nullptr) is invoked.
2013-07-09 21:03:20 -07:00
James Chen 86b6f26cee issue #2388: Fixing a bug in FadeIn::clone. 2013-07-10 11:58:07 +08:00
Éloi Rivard 05ae6f8518 Fixed some warnings 2013-07-09 16:33:21 +02:00
James Chen a517e68c59 closed #2379: Removing CCZone.h/.cpp. 2013-07-09 14:50:31 +08:00
James Chen 9b9fe67d25 issue #2387: Using static_cast instead of C style cast in iteration of CCArray. 2013-07-09 14:29:51 +08:00
James Chen 976d4ad11e Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into remove-copywithzone
Conflicts:
	cocos2dx/actions/CCActionInterval.cpp
	cocos2dx/cocoa/CCDictionary.cpp
	samples/Cpp/TestCpp/Classes/NodeTest/NodeTest.cpp
2013-07-09 09:48:41 +08:00
Ricardo Quesada 9fe9341646 From C++ best practices
Uses static_cast<> instead of C casting.
2013-07-08 14:38:14 -07:00
dumganhar b41dd9277d issue #2300: Warning fixes. 2013-07-08 23:12:11 +08:00
dumganhar 8f900d02b8 issue #2300: Removing all 'copyWithZone' pattern. 2013-07-08 23:05:47 +08:00
James Chen 37f9c4415a vertex --> getVertex, originalVertex --> getOriginVertex. 2013-07-08 15:12:06 +08:00
James Chen 1eacab0278 Merge branch 'iss2129-remove_prefix' of https://github.com/minggo/cocos2d-x into minggo-iss2129-remove_prefix 2013-07-08 10:51:07 +08:00
Ricardo Quesada c65b6f1417 Adds const to more getters
adds `const` to more getters.
2013-07-06 22:01:21 -07:00
minggo dfde41b932 issue #2129:fix conflicts 2013-07-05 17:32:50 +08:00
minggo 04465622b7 issue #2129:remove prefix of types in ccTypes.h 2013-07-05 16:49:22 +08:00
minggo 7e56bb57c8 Merge pull request #3076 from samuele3hu/execDev
issue #2244:Modify CallFunc event bug and modify a function name to createCCBreader
2013-07-05 01:32:06 -07:00
James Chen 268245635d issue #2373: Fixing a bug in CardinalSplineTo::clone function. this->_points needs to be cloned. 2013-07-05 15:08:52 +08:00
samuele3hu 9eb31df9f3 issue #2244:Replace the tab with space 2013-07-05 11:29:21 +08:00
samuele3hu 2aef49f251 issue #2244:Replace the tab with space 2013-07-05 11:24:28 +08:00
samuele3hu bb244edae6 issue #2244:Modify a function name to createCCBReader 2013-07-05 10:25:37 +08:00
samuele3hu b0e4757c24 issue #2244:Modify CallFunc event bug and modify a function name to createCCBreader 2013-07-04 17:54:02 +08:00
samuele3hu 570f2663f4 issue #2244:Modify ScriptData struct and functions related with sendEvent 2013-07-04 15:44:42 +08:00