Commit Graph

4933 Commits

Author SHA1 Message Date
James Chen 23e80857fa [dispatcher] Defines TOUCH_PERF_DEBUG to enable setting touches in TouchEvent. 2013-09-15 17:49:09 +08:00
James Chen 499e8caf7a [dispatcher] Updating the declare of event listeners in Layer. Using more specified type. 2013-09-15 17:48:29 +08:00
James Chen d940e01bc1 [dispatcher] Supporting changing priority from fixed value to node or from node to fixed value. 2013-09-15 12:17:01 +08:00
James Chen 1b9658f5ad [dispatcher] Adding Node::dissociateEventListener method. 2013-09-15 12:14:48 +08:00
Keita Obo e0b13e8836 Disable log output on release build 2013-09-15 13:07:58 +09:00
James Chen 8102272b15 [dispatcher] Updating comments of EventDispatcher, renaming some functions and some performance improves when dispatching event. 2013-09-15 11:07:27 +08:00
Huabing.Xu 9440aa7a99 issue #2808: refractor setFrameZoomFactor() access, change init() parameter (linux windows version) 2013-09-14 22:48:14 +08:00
samuele3hu 85ca0136f0 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into Bridge 2013-09-14 19:53:08 +08:00
James Chen 997a5a36c1 [dispatcher] Renaming 'registerEventListenerXXX' to 'addEventListenerXXX'. 2013-09-14 09:02:49 +08:00
James Chen dd7bfd7b60 Merge branch 'develop' of git://github.com/cocos2d/cocos2d-x into new-event-dispatcher-rebase
Conflicts:
	cocos2dx/CCDirector.h
	cocos2dx/keyboard_dispatcher/CCKeyboardDispatcher.h
	cocos2dx/keypad_dispatcher/CCKeypadDelegate.h
	cocos2dx/keypad_dispatcher/CCKeypadDispatcher.h
	cocos2dx/layers_scenes_transitions_nodes/CCLayer.h
	cocos2dx/menu_nodes/CCMenu.h
	cocos2dx/platform/CCAccelerometerDelegate.h
	cocos2dx/platform/android/CCAccelerometer.h
	cocos2dx/platform/ios/CCAccelerometer.h
	cocos2dx/platform/mac/CCAccelerometer.h
	cocos2dx/platform/win32/CCAccelerometer.h
	cocos2dx/script_support/CCScriptSupport.h
	cocos2dx/touch_dispatcher/CCTouchDelegateProtocol.h
	cocos2dx/touch_dispatcher/CCTouchDispatcher.h
	cocos2dx/touch_dispatcher/CCTouchHandler.h
	extensions/CocoStudio/Components/CCInputDelegate.h
2013-09-13 19:06:09 +08:00
Huabing.Xu 0af0951c35 issue #2808: refractor setFrameZoomFactor() access, change init() parameter 2013-09-13 18:21:12 +08:00
Huabing.Xu 86306a842d issue #2808: 1. retina support 2. frameZoomFactor 2013-09-13 18:09:11 +08:00
James Chen 2fd655dc57 [dispatcher] Using cocos2d-x memory model instead of std::shared_ptr. It should be unified. 2013-09-13 18:00:56 +08:00
Huabing.Xu 5f1e5c505c issue #2808: when move window, set OpenGL viewport again 2013-09-13 17:11:35 +08:00
samuele3hu d8bd65b2e8 issue #2784:Add class constructor js-binding document 2013-09-13 16:46:31 +08:00
James Chen 40c410b78d file mode changed, cocos2d.h from 100755 -> 100644 2013-09-13 16:37:47 +08:00
James Chen 490c74fd99 Unneeded cast fix. 2013-09-13 16:37:19 +08:00
James Chen 1f0a883dbd [dispatcher] Checking whether the listener was registered. 2013-09-13 16:36:54 +08:00
James Chen 72c978f9fb [dispatcher] Adding clone method for listener class. 2013-09-13 16:36:25 +08:00
James Chen 838b059b45 [dispatcher] Adding (s|g)etCurrentTarget for Event. 2013-09-13 16:34:34 +08:00
samuele3hu 1d4d1f251c Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into doxygen
Conflicts:
	cocos2dx/label_nodes/CCLabel.h
2013-09-13 14:04:22 +08:00
samuele3hu 5ddd9ae23c issue #2784:Delete class destuctor js-binding and lua-binding document 2013-09-13 13:52:42 +08:00
minggo fd92708d16 Merge pull request #3588 from minggo/label-best-practice
fixed #2793:best practice of New Label
2013-09-12 22:29:56 -07:00
minggo c4cb2582cc fixed #2793:best practice of New Label 2013-09-13 11:46:46 +08:00
samuele3hu 3a334b7478 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into doxygen 2013-09-13 11:42:04 +08:00
samuele3hu a34ec99014 issue #2784:Add js-binding and lua-binding document 2013-09-13 11:41:20 +08:00
James Chen cb7d090992 [dispatcher] Updating CCDevice.cpp for linux. 2013-09-12 21:39:47 +08:00
James Chen 57b0a66bda [dispatcher] Removing Layer::setTouchPriority since it's not needed. 2013-09-12 21:11:47 +08:00
James Chen 1702cbd7b2 [dispatcher] Other platforms update. 2013-09-12 20:56:57 +08:00
James Chen dd57d6321b [dispatcher] Updating Makefile. 2013-09-12 20:51:44 +08:00
James Chen 6f37529236 [dispatcher] Adding 'Node::updateEventPriorityIndex' and making 'Node::addEventId(removeEventId)' method to be private. 2013-09-12 20:47:15 +08:00
James Chen 06bc92ff19 [dispatcher] Removing unused listeners after dispatching event. 2013-09-12 20:45:35 +08:00
James Chen fb12c90238 [dispatcher] Using temporary std::vector in handleTouchXXXX. 2013-09-12 20:43:09 +08:00
James Chen ea74c30895 [Dispatcher] Updating ios/CCDevice.mm. 2013-09-12 20:41:59 +08:00
James Chen 24c8438fa6 [Dispatcher] Updating Android.mk, and some refractor. 2013-09-12 17:31:37 +08:00
James Chen f6faf58f2e [Dispatcher] Updating Log message in CCAccelerationEventListener.cpp. 2013-09-12 16:03:30 +08:00
James Chen 891bcba459 [Dispatcher] Reverting Touch, it should be inherited from Object for JSB. 2013-09-12 16:01:49 +08:00
James Chen 1c7287dd59 [Dispatcher] Updating license of CCEventListener.cpp. 2013-09-12 16:01:14 +08:00
James Chen 6623879f6d [EventDispatcher] Refactoring Touch, Touch doesn't inherit from Object now. Using std::vector<Touch*> to dispatch event and a little performance improved. 2013-09-12 14:26:39 +08:00
James Chen 7071240e30 [EventDispatcher] Remove unused file(CCTouchDispatcher) reference in CCEGLView.mm. 2013-09-12 14:24:30 +08:00
Bruno Assarisse 636c3d1dfc TMX map polyline parse 2013-09-11 20:36:53 -03:00
Siim Kallas 4e1e69e873 Fixed compilation on VC12 (VS2013 RC), std::min and std::max require <algorithm> 2013-09-11 19:00:48 +03:00
James Chen b798535f14 [win32] Removing CCAccelerometer.cpp. 2013-09-11 22:31:17 +08:00
James Chen da1101beeb [Dispatcher] New event dispatcher, first commit. 2013-09-11 22:09:34 +08:00
samuele3hu 7c62509b02 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into Bridge 2013-09-11 09:50:31 +08:00
samuele3hu 29f0909714 issue #2768:Add LuaObjectBridge and LuaJavaBridge 2013-09-11 09:48:24 +08:00
boyu0 7bba5f1b01 issue #2771: Add method Scene::createWithPhysics() end Scene::initWithPhysics() 2013-09-10 17:38:47 +08:00
boyu0 bcab90ddc4 issue #2771: Change CC_USE_PHYSICS_ENGINE to CC_USE_PHYSICS. Add some implements. 2013-09-10 17:36:49 +08:00
boyu0 bd10d92460 issue #2771: Add macros to control use physics engine or not 2013-09-10 14:15:19 +08:00
chengstory 669de88e73 1. remove any unused functions. 2013-09-10 11:02:50 +08:00
boyu0 862a3bd6a4 issue #2771: Fix CI compile errors. 2013-09-10 10:06:51 +08:00
boyu0 0806c5fe15 issue #2771: Fix CI compile errors. 2013-09-09 17:13:59 +08:00
boyu0 6585fd2162 issue #2771: Fix CI compile errors. 2013-09-09 16:58:55 +08:00
boyu0 cb08f2baf2 issue #2771: Change _physicsBody from node to sprite. Reimplement Scene::addChild. Adjust some API. 2013-09-09 16:36:19 +08:00
minggo c5b113c35e Merge pull request #3554 from ricardoquesada/fileutils_perf_improvements
Fileutils perf improvements
2013-09-08 19:50:12 -07:00
boyu0 dce205f688 issue #2771: add new line to the end of line. 2013-09-09 10:40:31 +08:00
boyu0 a6f9533a94 issue #2771: add Node::_physicsBody to Node init list 2013-09-09 10:34:03 +08:00
boyu0 1d47737f45 issue #2771: add physics files and entries. 2013-09-09 10:29:02 +08:00
James Chen b8c82ae5a9 [develop] Warning fixes. 2013-09-08 11:26:38 +08:00
Ricardo Quesada 487f65af2e Replaces `Dictionary` with `std::unordered_map`
I did some performance tests, and `std::unordered_map` is more performant than `Dictionary`.

I need to do more tests, but so far, the results are good.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-09-06 22:55:11 -07:00
Ricardo Quesada 7d8261c722 Optimization + standardization in FileUtils
Since `FileUtils` was using `std::string` internally, it is more efficient to accept `const std::string &` as parameter than `char *` to avoid the creation of unneeded strings.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-09-06 22:54:08 -07:00
Ricardo Quesada 028deae846 Adds const in FileUtils
`const` was missing in some getters

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-09-06 22:52:55 -07:00
Ricardo Quesada 2d2e15d275 Key should start with '/' to gain performance
Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-09-06 22:51:47 -07:00
Ricardo Quesada 3a0e957e9e compatible with cocos2d c++ guidelines 2013-09-06 19:02:24 -07:00
Ricardo Quesada bf6750067f little optimization.
string is created when needed
2013-09-06 19:00:12 -07:00
Ricardo Quesada b2a81b5b86 Removes some Hungarion notation...
...and improves performance in FileUtils: String is not created
2013-09-06 18:46:33 -07:00
Ricardo Quesada ef622b23bd lazy alloc component container
faster and less memory
2013-09-06 16:00:24 -07:00
Ricardo Quesada b78382d5e5 Performance improvements in FileUtils / TextureCache
Added common "apple" platform to avoid duplicate files in FileUtils and other common files
Improves performance in fetching files.
2013-09-06 15:33:28 -07:00
minggo 249b4d79a3 Merge pull request #3503 from dabingnn/Iss2460-glfw-refractor
Iss2460 glfw refractor
2013-09-05 18:28:31 -07:00
samuele3hu 32d056df18 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into TableView 2013-09-04 14:03:21 +08:00
samuele3hu 6815e01f84 issue #2764:Add TableView lua binding and releated test sample 2013-09-04 14:02:22 +08:00
minggo 9dedb072e6 Merge pull request #3528 from natural-law/ForPlugin
Modify the method cocos_android_app_init()
2013-09-03 22:50:40 -07:00
Ricardo Quesada ee638b9c8b removes 'private' section from SpriteBatchNode 2013-09-02 16:56:14 -07:00
Ricardo Quesada 088a11ad0d Little performance improvements in SpriteBatchNode
_descendants: Array -> std::vector<Sprite*> since retain/release is no needed
Code is cleaner
Removes unused method (bug inherited from cocos2d-iphone)
Adds more doxygen strings
2013-09-02 16:44:25 -07:00
zhangbin b854c25103 Add parameter in method cocos_android_app_init() to initialize plugin. 2013-09-02 16:10:08 +08:00
Huabing.Xu bc5ae78423 issue #2460: change other sample projects to glfw version 2013-09-02 11:46:23 +08:00
minggo 54a5f1e870 Merge pull request #3516 from minggo/perf_addchild_test_fix
Perf addchild test fix
2013-09-01 08:12:24 -07:00
minggo 2c6665ac3b add missing head 2013-09-01 22:41:11 +08:00
Ricardo Quesada b697e2bc99 uses std::sort() by default 2013-08-31 15:37:35 -07:00
Ricardo Quesada d41fdea999 objectComparisonLess -> nodeComparisonLess
and unified it.
No need to have 3 different copies.
The only copy is in CCNode.cpp
2013-08-31 15:18:28 -07:00
Ricardo Quesada 1393fb356a SpriteBatchNode: follows C++ best practices
removes hungarian notation
uses `int` instead of `unsigned int`
Add more asserts
2013-08-31 10:38:10 -07:00
James Chen b7258abbe6 Merge pull request #3510 from samuele3hu/iss2433-lua-bindings-generator-new
Iss2433:Add deprecated class and enums and modify some project config and test samples
2013-08-31 03:52:41 -07:00
Ricardo Quesada 9ad1ab50fd compiles on ARM 2013-08-30 21:08:28 -07:00
Ricardo Quesada 09c0234821 Ooops, reverting optimization for C
still valid for Neon, but the current optimization is not valid for C.

Please, apply this patch otherwise cocos2d won't work correctly
on simulator, windows, linux, mac, etc...
2013-08-30 20:59:01 -07:00
samuele3hu 8f338cc209 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into iss2433-lua-bindings-generator-new
Conflicts:
	tools/tolua/cocos2dx.ini
2013-08-30 15:21:59 +08:00
samuele3hu f56c6f7087 issue #2433:Modify platform config and some test samples 2013-08-30 11:56:35 +08:00
Ricardo Quesada c599ecb260 revert back fps interval to 0.1s
Why was it set to 2 seconds?
2013-08-29 20:05:14 -07:00
Huabing.Xu b7d788a2f9 issue #2460: remove comment code 2013-08-29 13:48:58 +08:00
Huabing.Xu 99f88df8d2 issue #2460: optimize EGLView interface 2013-08-29 11:36:16 +08:00
Ricardo Quesada 530a0119ae `getNodeToParent()` returns a `const &`
This gives a little performance improvement.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-28 18:31:32 -07:00
Ricardo Quesada f4101d8b25 receives a `const &` instead of `const *`
If is more accurate since a `NULL` AffineTransform is not allowed.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-28 18:30:00 -07:00
Ricardo Quesada 57ce406bdb More reliable profiling.
clock is the first instruction to execute on `EndTimingBlock`

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-28 18:29:09 -07:00
Ricardo Quesada c4eb6c99ab kazmath: removes unneeded `memcpy`
gains about 5% in improvement

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-28 18:28:30 -07:00
Ricardo Quesada 85ed6d620b fixes some macro names
kActionInvalidTag -> Action::INVALID_TAG
kNodeTagInvalid -> Node::INVALID_TAG

and it is no longer a `#define` but an `int`

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-28 12:43:20 -07:00
Huabing.Xu d73b8e8b23 issue #2460: glfw windows keyboard input 2013-08-28 18:31:02 +08:00
James Chen 2578d15420 issue #2747: [Best C++ practice] Deprecating Sprite::displayFrame, adding Sprite::getDisplayFrame. 2013-08-28 18:17:05 +08:00
Huabing.Xu 1e4defb14d issue #2460: glfw linux keyboard input 2013-08-28 17:17:46 +08:00
James Chen 3ad8de9f15 Minor fix of 'Color4F(const Color3B& color3B)'. r(color3B.r) --> r(color3B.r/255.0f) 2013-08-28 17:15:35 +08:00
Huabing.Xu 4af0a418fe issue #2460: glfw mac keyboard input 2013-08-28 16:25:03 +08:00
Huabing.Xu e935481361 Merge branch 'develop' into Iss2460-glfw-refractor
Conflicts:
	cocos2d_libs.xcodeproj/project.pbxproj
	cocos2dx/platform/mac/CCEGLView.mm
	samples/Cpp/TestCpp/proj.linux/main.cpp
	samples/Cpp/TestCpp/proj.win32/main.cpp
2013-08-28 13:42:22 +08:00
Huabing.Xu 29746d513a issue #2640: glfw linux version 2013-08-28 12:00:06 +08:00
minggo 48444c864c Merge pull request #3484 from ledyba/develop
Override LayerMultiplex::init()
2013-08-27 19:08:39 -07:00
minggo 5834fc2f37 Merge pull request #3470 from boyu0/iss2494_Point_isSegmentIntersect_bug
closed #2494: Fix bug when two line is incident, the Point::isSegmentIntersect() may return wrong result
2013-08-26 23:27:00 -07:00
minggo faa94fd074 Merge pull request #3482 from minggo/release_unneeded_codes
Remove unneeded codes
2013-08-26 23:23:41 -07:00
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 62c578667b API compliant with cocos2d-x best practices
Uses `int` instead of `unsigned int` as described in the cocos2d-x best practices

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-26 18:07:40 -07:00
Ricardo Quesada b3b3583583 CCNode perf improvements
AffineTransforms uses a const global variable for the `IDENTITY`
`removeObject` only seeks the index once

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-26 18:04:51 -07:00
psi 9b352d5ff4 Merge remote-tracking branch 'parent/develop' into develop
merged from parent
2013-08-26 21:36:38 +09:00
psi 1beea771b4 type 2013-08-26 20:42:41 +09:00
psi f0620b0e85 add overrode init method for LayerMultiplex 2013-08-26 20:38:23 +09:00
James Chen 6501c9bffd Merge pull request #3479 from pyrasis/tizen_2.2
[Tizen] Update project files
2013-08-26 03:23:14 -07:00
minggo 61d82924be update Android.mk to remove deleted cpp files 2013-08-26 18:01:42 +08:00
minggo ec3fa59ae3 remove unneeded files 2013-08-26 17:40:25 +08:00
boyu0 1e452bf0bc closed #2494: add isLineOverlap, isLineParallel, isSegmentOverlap method to Point. 2013-08-26 13:45:45 +08:00
minggo c186ed6a7f Merge pull request #3447 from NatWeiss/patch-5
Fixes full paths on Android (cleaner)
2013-08-25 18:35:57 -07:00
Ricardo Quesada b6a90b81aa Adds missing include 2013-08-25 10:50:29 -07:00
Ricardo Quesada ea8eb601af Uses std::sort()
Uses std::sort() for inserting the nodes.

This code is not final, but preliminary results show that std::sort() is 60% faster

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-24 10:56:07 -07:00
Lee, Jae-Hong bbf9053788 [Tizen] Update project files.
- Update file list.
- change order of link files.
2013-08-25 02:22:50 +09:00
Ricardo Quesada 364288cf66 Adds "Sort all Children" perf test
Adds a new perf tests: "sortAllChildren"

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-23 13:14:57 -07:00
boyu0 9a3a03d6ef closed #2494: Fix some typo 2013-08-23 14:41:49 +08:00
boyu0 3f23a4a661 closed #2494: Fix bug when two line is incident, the Point::isSegmentIntersect() may return wrong result 2013-08-23 14:37:56 +08:00
minggo bbbfc82541 Merge pull request #3463 from ricardoquesada/perf_test_invocation
Adds 2 new performance tests
2013-08-22 20:26:54 -07:00
minggo b746bda738 Merge pull request #3461 from dumganhar/iss2650-remove-typeinfo
closed #2650: Remove ccTypeInfo since we could get the hash value from typeid(T).hash_code() if using c++11.
2013-08-22 20:26:25 -07:00
Ricardo Quesada 38bfadf7f3 Adds 2 new performance tests
Invocation with `for_each()` and using `arrayMakeObjectsPerformSelector`

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-22 18:21:52 -07:00
Ricardo Quesada c4735af1ef Adds more constants to Color
Adds more constants for Colors, in particular to `Color4B` and `Color4F`

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-22 17:19:07 -07:00
James Chen ca78d2d129 closed #2650: Remove ccTypeInfo since we could get the hash value from *typeid(T).hash_code()* if using c++11. 2013-08-22 18:16:50 +08:00
minggo ddb4219d24 Merge pull request #3457 from boyu0/iss2434_gen_android_mk
closed #2434: Add android_mk_generator.py to generate Android.mk
2013-08-22 03:05:11 -07:00
James Chen f02f72d980 Merge pull request #3456 from sbc100/fix_build
[NaCL] Add missing include of <sys/mount.h> [ci skip]
2013-08-22 00:39:16 -07:00
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 29d0bab0d3 fixes memory leak!
and double-autorelease on Dicts (on mac)
2013-08-21 21:12:32 -07:00
minggo d9da52ce86 Merge pull request #3454 from minggo/array-support-sort
Array can be use in stl::sort() when not using vector inside
2013-08-21 20:50:03 -07:00
boyu0 da566a3c16 issue #2434: add android_generator and generate cocos2dx, extensions and TestCpp's android.mk files
add PathUtils.py for python library.
2013-08-22 11:49:34 +08:00
Sam Clegg 7bd5025064 [NaCL] Add missing include of <sys/mount.h>
This was previously included by nacl_io.h but
upstrean changes in NaCl removed this.
2013-08-21 20:27:34 -07:00
Ricardo Quesada a3eb0a058e Merge branch 'develop' into dictionary_array_fixes
Conflicts:
	cocos2dx/platform/mac/CCFileUtilsMac.mm
	extensions/CCBReader/CCBAnimationManager.cpp
	extensions/CCBReader/CCBReader.cpp
	extensions/CCBReader/CCBSequenceProperty.cpp
	extensions/GUI/CCScrollView/CCScrollView.cpp
2013-08-21 20:27:19 -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
Ricardo Quesada 967eb4b08f Adds more asserts
The instance methods cannot be used if the instance was not `init()`

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-21 20:04:30 -07:00
Ricardo Quesada 4dc18029b7 Removed Iterator class
There is no need to implement `Array::Iterator`.
It is replaced by returning `end()` and `begin()`

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-21 20:03:45 -07:00
minggo 2de8963a0a fix warnings caused by deprecating some functions of Array 2013-08-22 10:45:47 +08:00
minggo 3476a843e2 Array can be use in stl::sort() when not using vector inside 2013-08-22 10:18:59 +08:00
James Chen 1ee7790f0e Initializing Array after it was constructed. 2013-08-22 10:15:47 +08:00
Huabing.Xu b2e167c6ea issue #2460: glfw mac version 2013-08-21 12:01:56 +08:00
Ricardo Quesada f9df7cf4e5 Uses high resolution clock for Profiling
and adds another average time.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-20 16:06:34 -07:00
Ricardo Quesada f7241ea533 Default capacity of Array is 10
plus better documentation

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-20 16:06:04 -07:00
Ricardo Quesada 4c99492589 Profiling: more useful information
Prints min,max, #calls

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-20 14:18:06 -07:00
Ricardo Quesada d96a504f3c cocos2d in lowercase
Cocos2d -> cocos2d

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-20 14:17:43 -07:00
Ricardo Quesada 4d6d2d0dfa Better default values for auto-release pool
150 is a reasonable number for auto-release pool.
By using 150, it prevents the unneeded re-alloc of the pool.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-20 14:17:26 -07:00
Ricardo Quesada 5225758c5c CCArray: performance improvements
CCArray:

- Iterator uses position for iterator. MUCH faster.
- Do not double init the array. performance improvements in memory.

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-08-20 14:16:43 -07:00
NatWeiss fb3d422f0c Fixes full paths on Android (cleaner)
If one adds a search resolutions order directory without a trailing slash, CCFileUtils::getFullPathForDirectoryAndFilename will fail on Android. For example it will return:

assets/sdBg1.png

Instead of the expected:

assets/sd/Bg1.png

This small commit fixes the function to add a slash if necessary, fixing the issue on Android.

Compared to the last pull request of this name, formatting matches the style of code around it and comments have been added.
2013-08-20 10:22:44 -07:00
Huabing.Xu c276cdf6ee issue #2460: glfw windows version: remove some unused function 2013-08-20 15:19:48 +08:00