Commit Graph

86 Commits

Author SHA1 Message Date
Ricardo Quesada d78304599d Cache working OK.
Performance increased in 20% for static objects.
2014-02-28 16:10:48 -08:00
Ricardo Quesada eb66ddd931 visit and draw improved.
`visit()` and `draw()` are improved.
they both receive:
 - `Renderer`
 - `kmMat4` for transformation
 - `bool` whether or not the transform changed from the previous frame

Although `draw` and `visit` are not using the 3 new parameters,
they will start using it in the coming days (or weeks, or months).

Those parameters are needed for:
 - `Renderer` shouldn't be a singleton. There should be one renderer per Director. There could be more than one renderer
 - we should get rid of `kmGLXXX` functions since nodoby knows what is happening. the `kmMat4` is for that.
 - whenever possible, we should try to optimize the multiplications. the `dirty` flag is for that.

We need those changes, so, it is better to change the API now, and not right after v3.0-final is released.
2014-02-27 21:43:54 -08:00
James Chen 2b2979551e Merge pull request #5460 from boyu0/iss4118_physical_performance_improve
issue #4118: Physical performance improve.
2014-02-26 11:37:13 +08:00
Ricardo Quesada 18c3a8dd02 little fixes for sprite 2014-02-24 15:18:07 -08:00
Huabing.Xu f20d487ade closed #3818: fix CC_SPRITE_DEBUG_DRAW feature 2014-02-24 20:02:48 +08:00
boyu0 a4cc0edb4a issue #4118: refactor physics update 2014-02-24 16:17:42 +08:00
Dhilan007 b54607bfc9 only using std::max for window. 2014-02-24 11:54:58 +08:00
Dhilan007 d6cd2eb05f fix compiling error cause by using 'fmaxf'. 2014-02-24 11:38:03 +08:00
Ricardo Quesada f77b92f1d7 performance improvements in culling 2014-02-23 02:02:28 -08:00
Ricardo Quesada 04460750b8 culling working for both 2d and 3d projections 2014-02-23 01:09:52 -08:00
Ricardo Quesada fe1160cd8c changes in API to support 3D 2014-02-22 19:16:42 -08:00
Ricardo Quesada f37c606c4e removes unsued function
keeps the code cleaner
2014-02-22 17:55:03 -08:00
Ricardo Quesada 8ca746af17 Implements AABB culling for sprites 2014-02-22 17:47:56 -08:00
Ricardo Quesada 68143d3093 re-add missing assert 2014-02-09 19:39:56 -08:00
Ricardo Quesada 9a53f5a9f5 Testing a new TMX renderer
faster
2014-02-04 17:59:21 -08:00
James Chen 9f793f8a9b Warning fixes: 1) getZOrder —> getLocalZOrder. 2) long —> int 2014-01-20 15:03:30 +08:00
Ricardo Quesada 5fcbf42356 GlobalZOrder is used for render priority...
...and not vertexZ

Node::setGlobalZOrder() is used to change that.

Node::setZOrder() -> Node::setLocalZOrder();
2014-01-18 11:38:06 -08:00
Ricardo Quesada 8931d968c0 Renderer uses a float as a key
Instead of using a 64-bit int key with viewport, opaque and depth,
it only uses a 32-bit float with only the depth.
Saves time in:
 - No need to convert the 32-bit float into 24-bit int
 - keys are shorter
2014-01-17 16:08:29 -08:00
Ricardo Quesada d0dbf34319 removes "include "cocos2d.h" from cocos2d files 2014-01-16 21:35:58 -08:00
Ricardo Quesada 9b490a9124 Sprite: removed _hasChildren
_hasChildren has been replaced with !_children.empty()
2014-01-15 18:37:07 -08:00
walzer 64af0de648 update copyrights for 2014, in cocos/2d/ folder 2014-01-07 11:25:07 +08:00
minggo 0e9b43248c Merge pull request #4728 from dabingnn/develop_removeCommandPool
Develop remove command pool
2013-12-29 21:53:12 -08:00
Huabing.Xu 268f2fcc21 adjust comment codes 2013-12-27 13:52:44 +08:00
walzer c5e95618d9 fixed #3517, make CC_USE_PHYSICS can be switch off, and bring Scene::update(float), Scene::addChild(...) out of CC_USE_PHYSICS segment 2013-12-26 23:55:05 +08:00
boyu0 2fb0179293 change QuadCommand variable to class member. 2013-12-26 16:36:03 +08:00
Huabing.Xu 963d637198 use raw new instead of generateCommand 2013-12-26 14:45:44 +08:00
Huabing.Xu c3247c800f merge feature function from NewSprite into Sprite 2013-12-23 21:06:37 +08:00
James Chen ed93f90ccc Removes unneeded ‘override’ codes, uses `using Node::addChild;` to prevent compiler warnings. 2013-12-23 16:58:26 +08:00
Ricardo Quesada f5d0d1ce43 batched children work as expected
Fixed order in the multi matrix.
2013-12-19 16:33:47 -08:00
boyu0 ef54ed3c15 Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into HEAD
Conflicts:
	cocos/2d/CCLabel.cpp
	cocos/2d/CCLabel.h
	cocos/2d/CCLabelBMFont.cpp
	cocos/2d/CCLabelBMFont.h
	cocos/2d/CCLayer.cpp
	cocos/2d/CCLayer.h
	cocos/2d/CCNode.cpp
	extensions/GUI/CCControlExtension/CCControl.cpp
	extensions/GUI/CCControlExtension/CCControlButton.cpp
	extensions/GUI/CCControlExtension/CCScale9Sprite.cpp
	tools/tojs/cocos2dx.ini
2013-12-19 17:05:59 +08:00
Ricardo Quesada d138925aa0 Merge branch 'develop' into node_fixes 2013-12-18 18:33:56 -08:00
Ricardo Quesada b9a64725ab iterator in Sprite fixes
And replaces some std::for_each() with for() to prevent another object in the stack.
2013-12-18 18:33:04 -08:00
boyu0 c6cc77e75b Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into edit_hungarian_notation 2013-12-19 09:45:21 +08:00
Ricardo Quesada 7616edd9f3 Improves SpriteTest
Improves SpriteTest.
It is easier to see if Sprite works as SpriteBatchNode (and vice-versa).

Needed for the new renderer.

Also adds `const` to title() and subtitle()
2013-12-18 13:52:10 -08:00
boyu0 082c3d274a Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into edit_hungarian_notation 2013-12-18 18:05:30 +08:00
boyu0 e07c4ffec1 Change NULL to nullptr, edit hungarian notation. 2013-12-18 17:47:20 +08:00
James Chen 7719c692b8 More warning fixes. 2013-12-18 16:03:07 +08:00
Ricardo Quesada 33c4f891a0 Adds 'CC' to renderer files 2013-12-17 18:41:09 -08:00
Ricardo Quesada d6be81b7a8 The Renderer is not a singleton
In order to access, you have to get it from the Director

`Director::getInstance()->getRenderer()`
2013-12-17 17:50:17 -08:00
James Chen d16fa07661 Removes Vector<T>::forEach, please use std::for_each instead. The same as Vector<T>::sort. 2013-12-17 17:45:29 +08:00
Ricardo Quesada 3838268fd0 Merge branch 'develop' into newRenderer 2013-12-14 19:28:01 -08:00
boyu0 defae416f3 Merge branch 'develop' of git://github.com/cocos2d/cocos2d-x into bug3162_opacity_incorrect 2013-12-13 18:09:39 +08:00
James Chen bb5ef615dd Merge branch 'develop' of git://github.com/cocos2d/cocos2d-x into pr4479
Conflicts:
	cocos/2d/CCSpriteBatchNode.h
2013-12-13 16:44:22 +08:00
boyu0 d4c8fb0be6 Merge branch 'develop' of git://github.com/cocos2d/cocos2d-x into bug3162_opacity_incorrect 2013-12-13 10:47:52 +08:00
Ricardo Quesada 61cc365d9e Merge branch 'develop' into newRenderer
Conflicts:
	cocos/2d/CCGLProgram.h
	cocos/2d/CCLabelTTF.h
2013-12-12 14:41:42 -08:00
Ricardo Quesada a8c317bd83 getDescription() works as expected
renames `description` to `getDescription`. Adds `virtual`  to it.
Adds `getDescription` to missing nodes.
2013-12-12 14:30:22 -08:00
minggo 1e9c763b40 use ssize_t for index and capacity 2013-12-12 14:48:26 +08:00
boyu0 7cbce905bf issue #3162: delete duplicate functions. 2013-12-11 16:12:14 +08:00
Ricardo Quesada 0222c6544e Migration to Mat4x4
Armature not migrated yet

Signed-off-by: Ricardo Quesada <ricardoquesada@gmail.com>
2013-12-09 17:32:51 -08:00
Ricardo Quesada 73b1e3bb9e Merge branch 'develop' into newRenderer
Conflicts:
	cocos/2d/CCLabelAtlas.cpp
	cocos/2d/CCSprite.cpp
2013-12-06 09:37:08 -08:00