Commit Graph

23 Commits

Author SHA1 Message Date
Ricardo Quesada a0ab8fcdf3 onDraw() updated
`onDraw()` receives `const kmMat4 &transform` and `bool
transformUpdated`.

`CC_NODE_DRAW_SETUP()` is no longer used in our code.
`_modelViewTransform` is only used as a cache.
2014-03-05 15:49:08 -08:00
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
Ricardo Quesada 82700339c0 Adds a way to print the renderer vertices 2014-02-07 19:37:44 -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
James Chen 2133c0e566 Merge commit 'refs/pull/3938/head' of git://github.com/cocos2d/cocos2d-x into drawnode
Conflicts:
	cocos/2d/CCDrawNode.h
2014-01-09 17:03:08 +08:00
walzer 64af0de648 update copyrights for 2014, in cocos/2d/ folder 2014-01-07 11:25:07 +08:00
James Chen cf006df9ff closed #2865: Deprecates CCNotificationCenter, uses EventDispatcher instead. 2013-12-31 10:54:37 +08:00
boyu0 6bc0a7066f change CustomCommand variable to class member. 2013-12-26 21:19:12 +08:00
boyu0 f878864794 Specialize GroupCommand and CustomCommand, change generateCommand to new. 2013-12-26 15:41:47 +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 903844c7bd Removes unneeded files
New functionality is merged into the 'official' classes
2013-12-18 11:44:45 -08:00
boyu0 e07c4ffec1 Change NULL to nullptr, edit hungarian notation. 2013-12-18 17:47:20 +08:00
minggo b67d567a79 replace long with int or ssize_t 2013-12-05 17:22:22 +08:00
James Chen 424431690a Fixing warning generated by VS2012. 2013-11-20 10:39:30 +08:00
bmanGH 2687ee8915 put '{' in a new line to follow cocos2d-x coding style 2013-11-13 14:52:16 +08:00
bmanGH 683ce1692d Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into feature/configuration_VAO_runtime
Conflicts:
	cocos2dx/CCConfiguration.cpp
	cocos2dx/draw_nodes/CCDrawNode.cpp
	cocos2dx/particle_nodes/CCParticleSystemQuad.cpp
	cocos2dx/platform/android/CCEGLView.cpp
	cocos2dx/platform/ios/EAGLView.mm
	cocos2dx/textures/CCTextureAtlas.cpp
	cocos2dx/textures/CCTextureAtlas.h
2013-11-12 20:18:04 +08:00
Ricardo Quesada ddb0111392 continue replacing `const char*` with `const std::string&`
This patch includes:

* Continue replacing `const char*` with `const std::string&`  where it makes sense.
* It also removes some Hungarian notation from the code.
* It fixes some indentation issues in part of the code
* It replaces `int` or `unsigned int` with `long` where it makes sense.
2013-11-06 17:05:13 -08:00
minggo 95acb1b9e3 issue #2905: helloworld build ok on android 2013-10-14 14:01:00 +08:00
PickleMan 01ebb2ac29 Added triangle, quad bezier, cubic bezier drawing to DrawNode 2013-10-13 23:41:55 -04:00
minggo 49d7bbd600 issue #2905: remove sub folders except platform 2013-10-12 15:41:45 +08:00