File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,12 +40,14 @@ var Mesh = new Class({
4040 throw new Error ( 'Phaser: Vertex count must match UV count' ) ;
4141 }
4242
43- if ( colors . length > 0 && colors . length < ( ( vertices . length / 2 ) | 0 ) )
43+ var verticesUB = ( vertices . length / 2 ) | 0 ;
44+
45+ if ( colors . length > 0 && colors . length < verticesUB )
4446 {
4547 throw new Error ( 'Phaser: Color count must match Vertex count' ) ;
4648 }
4749
48- if ( alphas . length > 0 && alphas . length < ( ( vertices . length / 2 ) | 0 ) )
50+ if ( alphas . length > 0 && alphas . length < verticesUB )
4951 {
5052 throw new Error ( 'Phaser: Alpha count must match Vertex count' ) ;
5153 }
@@ -54,15 +56,15 @@ var Mesh = new Class({
5456
5557 if ( colors . length === 0 )
5658 {
57- for ( i = 0 ; i < ( vertices . length / 2 ) | 0 ; ++ i )
59+ for ( i = 0 ; i < verticesUB ; ++ i )
5860 {
5961 colors [ i ] = 0xFFFFFF ;
6062 }
6163 }
6264
6365 if ( alphas . length === 0 )
6466 {
65- for ( i = 0 ; i < ( vertices . length / 2 ) | 0 ; ++ i )
67+ for ( i = 0 ; i < verticesUB ; ++ i )
6668 {
6769 alphas [ i ] = 1.0 ;
6870 }
You can’t perform that action at this time.
0 commit comments