Commit Graph

71 Commits

Author SHA1 Message Date
Ricardo Quesada d7590affda Merge branch 'develop' into dictionary_array_fixes
Conflicts:
	cocos2dx/cocoa/CCArray.cpp
	cocos2dx/cocoa/CCArray.h
	cocos2dx/label_nodes/CCLabel.cpp
	extensions/CCArmature/datas/CCDatas.cpp
	extensions/CCArmature/display/CCDisplayManager.cpp
2013-08-21 21:27:44 -07:00
Ricardo Quesada 2e221ee6cc Array & Dictionary fixes
In many places `Dictionary` and `Array` are not being initialized. In fact `Dictionary` doesn't  have the `init()` method creating potential leaks.
Also in objects like `Armature` and the new `LabelTTF`, the `Array` object is not being used a pointer. So it doesn't use the 2 phase initialization, creating potential leaks.

This patch fixes all those issues.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-21 20:12:09 -07:00
Ricardo Quesada 4104cdc20e Better destructors logs
Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-21 20:08:51 -07:00
minggo 2de8963a0a fix warnings caused by deprecating some functions of Array 2013-08-22 10:45:47 +08:00
Ricardo Quesada 511ec1cc5d Compiles with improved CCArray
Compiles both with std::vector or ccCArray
2013-08-19 17:09:28 -07:00
Timothy Qiu 5ad5cfed7a Yet another documentation fix.
Modified mismatching parameters doc caused by refactoring.
Added the missing doc of some parameters.
Removed Hungarian notation from parts of the code.
2013-08-01 21:40:13 +08:00
Timothy Qiu 5ed8deb9a6 Fixed more documentation errors.
Modified mismatching parameters doc caused by refactoring.
Added the missing doc of some parameters.
Fixed incorrect use of doxygen tags.
Removed Hungarian notation from parts of the code.
Replaced 1 tab character with 4 spaces.
2013-08-01 20:55:43 +08:00
boyu0 afde1e57b2 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into 2345 and fix the per premultipied tag 2013-07-30 11:10:05 +08:00
James Chen 343c98af13 Fixing warnings of the order of member variables and fixing errors for tizen projects. 2013-07-29 14:07:57 +08:00
boyu0 304d636deb Closed #2345 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into 2345 2013-07-29 11:40:18 +08:00
boyu0 cecfc13bc4 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into 2345 2013-07-27 22:06:30 +08:00
James Chen 6c2e6e8cb0 Merge pull request #3253 from metalbass/patch-3
Added virtual destructors to some interfaces to fix issue 3095
2013-07-26 05:47:35 -07:00
James Chen 7839f769f2 Merge pull request #3265 from dumganhar/constants_fixes
Merge PR https://github.com/cocos2d/cocos2d-x/pull/3261 and updating bindings-generator. It supports 'enum class' type now.
2013-07-25 23:21:29 -07:00
James Chen d882fc3ef0 Merge pull request #3263 from 2youyouo2/Fix_3.0
Fix armature supper fast
2013-07-25 19:58:22 -07:00
2youyou2 7c4460f9e0 Fix armature supper fast 2013-07-26 10:19:19 +08:00
Ricardo Quesada 8bf24f0475 ccGLXXX -> GL::xxx
Adds GL namespace. Deprecates the `ccGLFunctionName` functions. New functions are `GL::functionName`

Also, converts the class `DrawPrimitives` into a namespace
2013-07-25 18:42:53 -07:00
Ricardo Quesada 191aaebe2a More const fixes
`Menu::STATE_XXX` -> `Menu::State::XXX`
Removes more Hungarian notation
Removes Configuration::Type <- I added it a few months ago, and it was not being used. It is safe to remove it
2013-07-25 17:47:42 -07:00
Ricardo Quesada 16d0b43181 Constant fixes
Director::PROJECTION_2D, 3D,... -> Director::Projection::_2D, _3D, ...
Label::TEXT_ALIGNMENT_... -> Label::HAlignment::...
Label::TEXT_VERTICAL_ALIGNMENT_... -> Label::VAlignment::...
Texture2D::PIXEL_FORMAT_... -> Texture2D::PixelFormat::...
BlendFunc::BLEND_FUNC_DISABLE -> BlendFunc::DISABLE

Also adds more constant for BlendFunc
2013-07-25 13:36:19 -07:00
boyu0 a2b611d8c3 Refactor Image and Texture2D, combine TexturePVR to Image and Texture2D, and delete TexturePVR 2013-07-25 21:35:00 +08:00
minggo 77afae124b issue #2430:move Texture2D enum into class 2013-07-25 19:52:44 +08:00
metalbass 2982a42fbf Fixed typo. virutal -> virtual 2013-07-25 13:03:40 +02:00
metalbass c7329e9301 Added virtual destructors to some interfaces to fix issue 3095 2013-07-25 12:54:51 +02:00
minggo acdd1cfe9d issue #2430:move GLProgram enum into class 2013-07-25 17:48:22 +08:00
minggo 658bffbb69 issue #2430:use upper letter for enum item in ccGLStateCache.h 2013-07-25 15:04:13 +08:00
James Chen 762b987ae7 issue #2404: [Extensions] Updating the file for deprecated methods. 2013-07-24 18:00:40 +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 b58d18e20a More unsinged int -> int in some places where it could be difficult to find underflow bugs. And some warnings fix. 2013-07-22 14:28:19 +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
boyu0 76e05ee802 Merge https://github.com/cocos2d/cocos2d-x into 2345 2013-07-18 17:47:43 +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
boyu0 70140bb4cb refactor CCImage and CCTexture2D 2013-07-17 17:12:04 +08: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 6abe6fce78 closed #2393: fix conflicts 2013-07-12 18:04:32 +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 596c4c3cf2 issue #2387: Using static_cast instead of C style cast while iterating CCDictionary. 2013-07-09 14:40:43 +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
Ricardo Quesada 9fe9341646 From C++ best practices
Uses static_cast<> instead of C casting.
2013-07-08 14:38:14 -07: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 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 f1eaabb09f issue #2322: Fixing a warning in extensions/CCArmature/utils/CCDataReaderHelper.cpp. 2013-06-23 17:23:14 +08:00
Sam Clegg 3686e8245f [NaCl] Fix sigslot.h compilation on NaCl ARM 2013-06-20 10:54:11 -07:00
James Chen cb67ed0227 issue #2129: Removing CC prefix for extension module. 2013-06-20 14:15:53 +08:00
James Chen 78a5dff06d issue #2129: Resetting the namespace of armature to 'cocos2d::extension::armature'. 2013-06-20 12:59:32 +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 cbcc2022cf [Extension] RENDER_H --> CC_ARMATURE_GLES_RENDER_H 2013-06-10 14:17:16 +08:00
James Chen a14df8d28d issue #2271: Fixing some memory leaks. 2013-06-10 11:43:43 +08:00