Commit Graph

61 Commits

Author SHA1 Message Date
Ricardo Quesada 48ef1f24c3 fixes possible crash when using `SpriteFrameCache`
the returned dictionary was double-released. ouch.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-26 18:08:56 -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 058935aa8d Removes Hungarian notation
Removes Hungarian notation from the code.
2013-07-25 15:53:24 -07: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
minggo 6abe6fce78 closed #2393: fix conflicts 2013-07-12 18:04:32 +08:00
minggo 15096b0716 issue #2393:mark CCPointMake CCSizeMake CCRectMake as deprecated 2013-07-12 14:30:26 +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
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 6f3b22031f Using new API of getting full path for file name. 2013-01-25 20:51:52 +08:00
James Chen bc76cf09c4 Added filename lookup support for win32. 2013-01-18 21:54:48 +08:00
Donald Alan Morrison 4cbd993091 Minor English Spelling Corrections. A few grammar corrections. 2012-09-17 00:02:24 -07:00
minggo 90448ec7d0 issue #1269:fix some compiling error because of including error header files 2012-06-19 16:20:46 +08:00
James Chen 3a410c14a1 Merge branch 'gles20' of https://github.com/cocos2d/cocos2d-x into iss1324_create
Conflicts:
	cocos2dx/extensions/CCBReader/CCBReader_v2.cpp
	cocos2dx/extensions/CCControlExtension/CCScale9Sprite.cpp
	cocos2dx/label_nodes/CCLabelBMFont.cpp
	cocos2dx/menu_nodes/CCMenuItem.cpp
	cocos2dx/menu_nodes/CCMenuItem.h
	cocos2dx/misc_nodes/CCRenderTexture.h
	cocos2dx/tileMap_parallax_nodes/CCTileMapAtlas.cpp
	tests/tests/ExtensionsTest/CocosBuilderTest/HelloCocosBuilder.cpp
	tests/tests/LabelTest/LabelTest.cpp
2012-06-14 17:36:31 +08:00
James Chen 23574172ff issue #1324: Added create() for static member functions that new an autorelease object, updated cocoa folder. 2012-06-14 16:05:58 +08:00
Nicolas Gramlich e52d5ae223 CCSpriteFrameCache: Minor optimization. 2012-06-11 18:31:36 -07:00
Nicolas Gramlich 4378731418 Merge with gles20. 2012-06-11 10:43:07 -07:00
James Chen c9dc60b0f7 issue #1310: fixed a bug in CCSpriteFrameCache.cpp. Disable retina mode for tests project. 2012-06-08 17:58:21 +08:00
James Chen 76a560a474 issue #1310: Made CCFileUtils as a singleton. 2012-06-08 16:22:57 +08:00
James Chen c5cf23c859 issue #1310: First commit since sync to rc2. 2012-06-08 14:11:48 +08:00
James Chen edfb8c1f9c issue #1190: used std::string as key of CCDictionary. Updated CCString.pkg, CCArray.pkg, CCDictionary.pkg. 2012-04-26 11:39:49 +08:00
James Chen 230b8a386b issue #1176: Changed linebreak symbol to UNIX format ('\n'),replaced 'tab'
with four spaces. Also,
1. Used macro NS_CC_BEGIN instead of namespace cocos2d {, NS_CC_END instead
of }.
2. Removed some unused files.
3. Renamed the name of some folders, for example,
"test.android"-->"proj.android" .
2012-04-19 14:35:52 +08:00
James Chen d01f1277af optimize data struct. 2012-04-14 19:11:57 +08:00
James Chen 6ce06bd906 issue #1056: Remove CCMutableArray and CCMutableDictionary template, offer CCDictionary to improve the performance of dictionary by 60%, it means that CCDictionary can save about 2/3 time cost. 2012-03-20 15:04:53 +08:00
minggo f0d22ae504 issue #879: replase assert with CCAssert 2011-11-28 17:28:43 +08:00
minggo 5273819e83 offer a thread safe function to read contents of xml file, and the engine use it internal 2011-11-15 10:41:18 +08:00
minggo 09dc164fff issue #645: update to v1.0.1 2011-08-02 15:45:27 +08:00
natural-law 810cf3f8c3 fixed #591 2011-07-08 15:02:46 +08:00
natural-law 7d7f3a9241 fixed #562, Upgrade folder sprite_nodes to rc3. 2011-07-01 16:11:31 +08:00
natural-law b684cbdc6c fixed #522, CCSpriteFrameCache::addSpriteFramesWithFile(const char *pszPlist) will not crash any more if the parameter don't have '/'. 2011-06-30 17:50:28 +08:00
Marat Yakupov 14c43f4246 changed postfix increment of iterators to prefix increment 2011-06-21 09:30:03 +04:00
liswei 1591c7edc8 fixed #512 fix warnings in /Wall flag 2011-06-10 17:51:37 +08:00
minggo 7d52161804 fixed #441: Initialize pointer in contruction & detect pointer value in destruction 2011-04-01 16:06:53 +08:00
natural-law 87ea85a986 fixed #411,support .plist format generated by zwoptex in the last version. 2011-03-29 16:59:50 +08:00
natural-law 5f7357bf09 fixed #391,CCSpriteFrameCache support *.plist files with format value is not 0. 2011-03-29 11:56:14 +08:00
natural-law 55143e3b9e issue #391,implement functions:CCRectFromString, CCPointFromString and CCSizeFromString. 2011-03-24 10:38:08 +08:00
walzer 2b7a324c47 fix compilation error when COCOS2D_DEBUG = 2 2011-03-21 10:50:24 +08:00
walzer 81fa070125 fixed #418, add copyright of original authors, merge Bin's commit 2011-03-19 14:45:51 +08:00
minggo 47173778cc fixed #409: rename NSArray UIAlignment 2011-03-18 14:31:29 +08:00
minggo 7a331e1e14 issue #375: wophone compiled ok 2011-03-07 18:20:48 +08:00
minggo b5a99f90df issue #375: rename file names and object names 2011-03-07 17:11:57 +08:00
natural-law 0d2d746aec Fix bugs.Run tests in cocos2d-uphone successful. 2011-01-05 17:01:08 +08:00
minggo 4cd3e59e2b fixed #278 2010-12-27 10:26:56 +08:00
Walzer 820c2f0714 issue #211 cocos2d-x back to cocos2dx 2010-11-18 15:01:42 +00:00
Walzer b4328354af issue #211 cocos2dx -> cocos2d-x 2010-11-18 14:07:17 +00:00
Ming 12d6df9717 issue #154 2010-09-24 10:10:32 +00:00
natural-law ae1439812a issue #139
Debug
2010-09-13 06:12:50 +00:00