Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade WebGL Renderer with auto batching #900

Merged
merged 9 commits into from Jul 15, 2016
Merged

Conversation

pandamicro
Copy link
Contributor

Re: cocos-creator/fireball#2787

Changes proposed in this pull request:

  • Merge some important method in WebGL/Canvas render command: transform, visit, _syncStatus, updateStatus
  • Upgrade WebGL Renderer
  • Reorganize cc.Scale9Sprite data layout
  • Rewrite TMXLayer
  • Reduce basic type memory usage

Makes sure these boxes are checked before submitting your PR - thank you!

  • If your pull request has gone "stale", you should rebase your work on top of the latest version of the upstream branch.
  • If your commit history is full of small, unimportant commits (such as "fix pep8" or "update tests"), squash your commits down to a few, or one, discreet changesets before submitting a pull request.
  • To official teams:
    • Check that your javascript is following our style guide and end files with a newline
    • Document new code with comments in source code based on API Docs

@cocos-creator/engine-admins

cc.gl.blendFunc(this._blendFunc.src, this._blendFunc.dst);

var wt = this._worldTransform;
this._matrix.mat[0] = wt.a;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以把 this._matrix.mat 做个 local property, 下面调用次数还比较多

if (constructor) {
return findComponent(this, constructor);
if (typeOrClassName) {
var constructor = getConstructor(typeOrClassName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

输入为空的话,本来是会报错的,现在不报错了吗?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥要报错来阻断执行呢?有一些应用场景里面,可能只是尝试获取,获取不到就算了

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

只是报错,没有阻断。如果要尝试获取,传入参数更不应该是空。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

哦,是这样的,在 CCNodePool 里面,用户有可能初始化的时候不传递 component,那我在那边处理一下也可以

@pandamicro
Copy link
Contributor Author

Issues fixed, can be merged now

@@ -427,7 +403,7 @@ cc.LabelTTF._firsrEnglish = /^[a-zA-Z0-9ÄÖÜäöüßéèçàùêâîôû]/;

if (node._string.length === 0) {
locLabelCanvas.width = width;
locLabelCanvas.height = locContentSize.height || 1;
locLabelCanvas.height = height;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为什么要去掉 || 1

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里的 height 不是 ContentSize 了,是 texture height

}

var locIDs = this._cacheInstanceIds;
cc.arrayRemoveObject(locIDs, instanceID);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cc.arrayRemoveObject 已经被废弃了,现在是 cc.js.array.remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

估计是合并导致的

@pandamicro pandamicro merged commit a06a9b7 into cocos:master Jul 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants