Commit Graph

4776 Commits

Author SHA1 Message Date
Siim Kallas 4e1e69e873 Fixed compilation on VC12 (VS2013 RC), std::min and std::max require <algorithm> 2013-09-11 19:00:48 +03:00
chengstory 669de88e73 1. remove any unused functions. 2013-09-10 11:02:50 +08:00
minggo c5b113c35e Merge pull request #3554 from ricardoquesada/fileutils_perf_improvements
Fileutils perf improvements
2013-09-08 19:50:12 -07: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