Commit Graph

143 Commits

Author SHA1 Message Date
James Chen a1c4c73c1c issue #2378: More setter/Getter, removing CC_PROPERTY_XXX macros. 2013-07-23 18:26:26 +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 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
Ricardo Quesada 5d499d351d Some more changes to make the code more c++ friendly:
- nodeToParentTransform -> getNodeToParentTransform() (the same for its friends)
   - Deprecates the old methods
   - adds 'consts' to those methods
- boundingBox() -> getBoundingBox()
   - the new one is const
   - Deprecates the old method.
- Adds overrides keywords in CCNodeRGBA and CCArmature
- AffineMatrix are mutables
2013-07-16 18:16:04 -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 34b60e99f1 Merge pull request #3140 from minggo/iss2393-mark_deprecated
Use Point, Rect and Size member functions instead of global functions
2013-07-12 08:59:27 -07:00
minggo 6abe6fce78 closed #2393: fix conflicts 2013-07-12 18:04:32 +08:00
James Chen 8d0888aa60 issue #2398: Trigger an assert when the default texture of Sprite was created unsuccessfully. 2013-07-12 16:36:19 +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
James Chen 7594136985 issue #2388: Updating comments for cc_2x2_white_image variable. 2013-07-10 11:57:35 +08:00
James Chen f6e0b6ca0b issue #2388: Checking whether the texture exists. 2013-07-10 10:07:45 +08:00
James Chen 87cec1622c closed #2388: Creating a default texture for CCSprite if setTexture(nullptr) is invoked. 2013-07-09 18:33:36 +08:00
James Chen e28cf8d258 issue #2129: Windows doesn't support 'initializer list', using constructor instead. 2013-07-07 21:08:14 +08:00
minggo 04465622b7 issue #2129:remove prefix of types in ccTypes.h 2013-07-05 16:49:22 +08:00
Ricardo Quesada 216c6eada5 Adds more const in getters
In Sprite and Texture2D
2013-07-03 17:44:41 -07:00
Ricardo Quesada adaa72fbb4 Adds const to getters
Many getters in cocos2d are not declared as const.
This patch adds const to many cocos2d properties, specially in CCNode and
subclasses
2013-07-03 17:22:15 -07:00
James Chen 3fa5c776b8 issue #2359: Using PositionColor shader when texture is NULL in Sprite.
TODO: PostionTextureColor shader should support empty texture.
2013-07-03 23:34:45 +08:00
James Chen 501afdd2e3 closed #2359: Sprite will become white block when using CCControlSwitch.
setShaderProgram should not be in Sprite::setTexture since setTexture is not related to shader.
2013-07-03 16:16:30 +08:00
James Chen 93b6328303 issue #2129: Removing CC prefix for cocos2dx module. 2013-06-20 14:13:12 +08:00
James Chen c0d44cb2e4 fixed #2129: Rename m_iVar to _var, remove CC prefixes. 2013-06-15 14:03:30 +08:00
James Chen 2fae3db792 Minor fix for CCSprite::draw(), checking whether texture is valid, if it's invalid, don't set the attribute for it. 2013-06-08 11:10:39 +08:00
James Chen 1a5e9f3717 Fixing a bug that display is wrong when setting setTexture(NULL) for CCSprite. 2013-06-06 15:02:57 +08:00
James Gregory 29cfe512a3 Remove debug print statement 2013-05-06 21:29:44 -07:00
James Gregory f386272486 Add method to CCNode class to allow uploading data to GPU. Call it from CCSprite. 2013-05-06 21:29:43 -07:00
James Gregory 872df86f84 Remove debug print statement 2013-05-06 20:59:48 -07:00
James Gregory d52aa420e8 Switch to slot-based GL buffer loading code for CCSprite. 2013-05-06 20:59:47 -07:00
James Gregory 089a47d937 Add method to CCNode class to allow uploading data to GPU. Call it from CCSprite. 2013-05-06 20:58:45 -07: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
minggo 94076a5b9c issue #1686:synchronize CCSprite.cpp 2013-02-27 15:30:49 +08:00
walzer c9c227873f Merge branch 'gles20' of https://github.com/cocos2d/cocos2d-x into gles20 2013-01-14 17:07:07 +08:00
walzer 1ab552b482 Add a sample doxygen sample in CCSprite.h and CCProtocol.h 2013-01-14 16:54:20 +08:00
James Chen 6733f786a5 fixed #1649: Reverted some invokings of function that returns const reference. 2013-01-14 16:06:18 +08:00
James Chen 6565fa92cc fixed #1649: Changed return type to const reference for member variable access. 2013-01-14 15:51:53 +08:00
minggo a75f8b7e7a fixed #1593:remove all deprecated methods expect CCBAnimationManager 2012-12-06 18:51:33 +08:00
James Chen ebd522e3fa issue #1564: Return a new object instead of 'const reference' for some get methods. 2012-11-20 16:34:55 +08:00
minggo a4a53df159 issue #1555:build ok on android 2012-11-16 14:23:14 +08:00
minggo a701eaecce issue #1555:update to v2.1 beta3 2012-11-14 18:05:15 +08:00
James Chen 833b5b1be8 Merge branch 'gles20' of https://github.com/mrmop/cocos2d-x into iss1557-marmalade
Conflicts:
	cocos2dx/base_nodes/CCNode.cpp
	cocos2dx/sprite_nodes/CCSprite.cpp
	samples/TestCpp/Classes/TouchesTest/Ball.cpp
	samples/TestCpp/Classes/VisibleRect.cpp
	samples/TestCpp/Classes/VisibleRect.h
2012-11-12 10:20:04 +08:00
James Chen 9f6d263c15 fixed #1531: The CCSprite::updateTransform() function needs to inherited from a base function on the CCNode. 2012-10-30 10:24:28 +08:00
Mat Hopwood 2b265929e2 Marmalade Sample data removed and merged changes
* Marmalade samples now use Resources folder, excess data removed
* Merged in James' changes
* CCNode::updateTransform() added
2012-10-25 21:40:37 +01:00
Mat Hopwood 24115675b0 Marmalade Cocos2d-x Main Repo Changes
These are changes to the main Cocos2d-x repo that Marmalade would like
to request for inclusion in the main repo
2012-10-19 16:38:58 +01:00
Donald Alan Morrison 4cbd993091 Minor English Spelling Corrections. A few grammar corrections. 2012-09-17 00:02:24 -07:00
YuLei 39b019b2cb [Mac] fix CC_ASSERT error
[Mac] add CC_DISABLE_ASSERT check

[cocos2d-x] CCSprite::createWithSpriteFrame() check pSpriteFrame
2012-09-04 11:16:59 +08:00
Rolando Abarca a114502929 removes OBJECT_TYPE thing 2012-08-27 08:43:38 -07:00
Rolando Abarca 4e640ecb35 uses new ADD_OBJECT_TYPE macro 2012-08-27 08:43:37 -07:00
minggo 2a9d29ba21 fixed #1440:convert offert point to pixel 2012-08-22 14:29:23 +08:00
Walzer cc3d850892 fixed #1416, add object orientated APIs for CCGeometry, replace "CCFloat" with "float" 2012-08-01 15:30:12 +08:00