File tree Expand file tree Collapse file tree 2 files changed +38
-10
lines changed
extensions/cocostudio/armature Expand file tree Collapse file tree 2 files changed +38
-10
lines changed Original file line number Diff line number Diff line change 163
163
currentStack . top = this . _stackMatrix ;
164
164
165
165
node . sortAllChildren ( ) ;
166
- cc . renderer . pushRenderCommand ( this ) ;
166
+
167
+ var renderer = cc . renderer ,
168
+ children = node . _children , child ,
169
+ i , len = children . length ;
170
+
171
+ for ( i = 0 ; i < len ; i ++ ) {
172
+ child = children [ i ] ;
173
+ if ( child . _localZOrder < 0 ) {
174
+ if ( isNaN ( child . _customZ ) ) {
175
+ child . _vertexZ = renderer . assignedZ ;
176
+ renderer . assignedZ += renderer . assignedZStep ;
177
+ }
178
+ }
179
+ else {
180
+ break ;
181
+ }
182
+ }
183
+
184
+ if ( isNaN ( node . _customZ ) ) {
185
+ node . _vertexZ = renderer . assignedZ ;
186
+ renderer . assignedZ += renderer . assignedZStep ;
187
+ }
188
+ renderer . pushRenderCommand ( this ) ;
189
+
190
+ for ( ; i < len ; i ++ ) {
191
+ child = children [ i ] ;
192
+ if ( isNaN ( child . _customZ ) ) {
193
+ child . _vertexZ = renderer . assignedZ ;
194
+ renderer . assignedZ += renderer . assignedZStep ;
195
+ }
196
+ }
167
197
168
198
this . _dirtyFlag = 0 ;
169
199
currentStack . top = currentStack . stack . pop ( ) ;
Original file line number Diff line number Diff line change 45
45
var node = this . _node ;
46
46
var locQuad = this . _quad ;
47
47
var vertices = this . _vertices ;
48
- // If it is not visible, or one of its ancestors is not visible, then do nothing:
49
- if ( ! node . _visible )
50
- locQuad . br . vertices = locQuad . tl . vertices = locQuad . tr . vertices = locQuad . bl . vertices = { x : 0 , y : 0 , z : 0 } ;
51
- else if ( this . _buffer ) {
48
+
49
+ if ( this . _buffer ) {
52
50
//
53
51
// calculate the Quad based on the Affine Matrix
54
52
//
86
84
if ( node . textureAtlas ) {
87
85
node . textureAtlas . updateQuad ( locQuad , node . textureAtlas . getTotalQuads ( ) ) ;
88
86
}
89
-
90
- this . _quadDirty = true ;
91
- this . _savedDirtyFlag = true ;
92
- this . _bufferDirty = true ;
93
- this . _buffer . setDirty ( ) ;
87
+
88
+ // Need manually buffer data because it's invoked during rendering
89
+ cc . _renderContext . bindBuffer ( gl . ARRAY_BUFFER , this . _buffer . vertexBuffer ) ;
90
+ cc . _renderContext . bufferSubData ( gl . ARRAY_BUFFER , this . _bufferOffset , this . _float32View ) ;
91
+ cc . _renderContext . bindBuffer ( gl . ARRAY_BUFFER , null ) ;
94
92
}
95
93
} ;
96
94
} ) ( ) ;
You can’t perform that action at this time.
0 commit comments