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

V2.0 skeleton optimize #3537

Merged
merged 13 commits into from Dec 3, 2018
Merged

Conversation

sunnylanwanjun
Copy link
Contributor

@sunnylanwanjun sunnylanwanjun commented Nov 20, 2018

@@ -73,6 +73,15 @@ var game = {
*/
EVENT_SHOW: "game_on_show",

/**
* Event triggered when game restart
Copy link
Contributor

Choose a reason for hiding this comment

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

加个 !#en

@@ -240,7 +238,6 @@ let ArmatureDisplay = cc.Class({
type: DefaultAnimsEnum,
visible: true,
editorOnly: true,
animatable: false,
Copy link
Contributor

Choose a reason for hiding this comment

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

这些属性好像不能暴露在动画编辑器里,因为是私有变量

// it will just use the _material,won't clone it.
// So if invoke getMaterial,it only return _material,if you want to change all materials,
// you can change materials directly.
this._materials = {};
Copy link
Contributor

Choose a reason for hiding this comment

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

不太明白 _materials 在哪用到的?

Copy link
Contributor

Choose a reason for hiding this comment

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

之前不是在 assembler 里面定义成 _sharedMaterials 吗,和在放到这里有什么区别吗
render component 的 _materials 在 2.2 材质系统会被使用到,而且是数组的形式,可能和你这里的使用会有冲突

Copy link
Contributor Author

Choose a reason for hiding this comment

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

之前用_shareMaterials 共享材质会导致一些问题,当skeleton reload的时候,需要重新去刷新_shareMaterials,否则里面存的贴图对象会失效,具体可以看看以下反馈
#3477
https://forum.cocos.com/t/mask-spine/68844/3
所以把材质列表存储skeleton组件身上就可以比较合理的解决这些问题了。

至于名字的冲突,那就要修改了。

}
},

ctor () {
Copy link
Contributor

Choose a reason for hiding this comment

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

ctor 为空就不用定义了哈

@@ -32,25 +32,29 @@ var vfmt3D = new gfx.VertexFormat([
{ name: gfx.ATTR_COLOR, type: gfx.ATTR_TYPE_UINT8, num: 4, normalize: true },
]);
vfmt3D.name = 'vfmt3D';
gfx.VertexFormat.XYZ_UV_Color = vfmt3D;
Copy link
Contributor

Choose a reason for hiding this comment

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

不要放到 gfx.VertexFormat 里吧,而且没看到有使用呢?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

这个在jsb adapter中用到了,因为spine 和 dragonbones 需要使用自定义的顶点和索引缓冲,所以需要导出gfx.VertexFormat 中的顶点格式定义到jsb adapter 中使用,由于@panda 在native-renderer中也需要在jsb adapter中用到这些顶点格式,所以和他的保持一至了。

@pandamicro pandamicro merged commit 767e56d into cocos:v2.0-release Dec 3, 2018
pandamicro pushed a commit that referenced this pull request Dec 5, 2018
* export vfmt for jsb adapter

* fix some bug drabonebones 2.0

* remove useless code

* Export StencilManager to jsb adapter

* Support dragonbones bin load

* remove dragonbones and spine lib file when compile jsb

* rename materials to materialCache

* add blank line

* Add premultipliedAlpha property in dragonbones

* Remove unuse child node which is created by old code.

* Change copyright time
xianyinchen added a commit to xianyinchen/engine that referenced this pull request Dec 5, 2018
…into v2.1-release

* 'v2.1-release' of https://github.com/cocos-creator/engine: (133 commits)
  refine image type check (cocos#3591)
  modify preloadScene API params (cocos#3583)
  V2.0 skeleton optimize (cocos#3537)
  update alignWithScree in Canvas for fireball/issues/8281 (cocos#3186) (cocos#3585)
  add platform differ on baiduGame, vivoGame and oppoGame (cocos#3582)
  add stopAnimation/startAnimation to game pasue/resume (cocos#3584)
  Fix failed to update particle system _renderSpriteFrame (cocos#3577)
  fixed bar-filled (cocos#3581)
  refine buffer view check (cocos#3578)
  fixed texture image check in wechat game platform (cocos#3576)
  upgrade del to 3.0 (cocos#3572)
  Fix rendering residue for transparent images on Chrome69. (cocos#3357) (cocos#3573)
  add system font to richtext (cocos#3570)
  fix outline enable and disable invaild / rm label updateRenderData CC_EDITOR (cocos#3567)
  optimize children (cocos#3552)
  fixed bar-filled (cocos#3566)
  RichText support node color settings (cocos#3560)
  improve rotateTo/rotateBy (cocos#3565)
  improve rotateTo/rotateBy (cocos#3563)
  fix outline enable and disable is invaild bug (cocos#3564)
  ...
@flashria
Copy link

这个版本什么时候合并到发布版?

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

5 participants