|
1 | 1 | import AssociativeArray from '../Core/AssociativeArray.js';
|
2 | 2 | import Color from '../Core/Color.js';
|
| 3 | +import ColorGeometryInstanceAttribute from '../Core/ColorGeometryInstanceAttribute.js'; |
3 | 4 | import defined from '../Core/defined.js';
|
4 | 5 | import DistanceDisplayCondition from '../Core/DistanceDisplayCondition.js';
|
5 | 6 | import DistanceDisplayConditionGeometryInstanceAttribute from '../Core/DistanceDisplayConditionGeometryInstanceAttribute.js';
|
@@ -65,8 +66,6 @@ import Property from './Property.js';
|
65 | 66 | return false;
|
66 | 67 | };
|
67 | 68 |
|
68 |
| - var scratchArray = new Array(4); |
69 |
| - |
70 | 69 | Batch.prototype.update = function(time) {
|
71 | 70 | var isUpdated = true;
|
72 | 71 | var removedCount = 0;
|
@@ -135,12 +134,7 @@ import Property from './Property.js';
|
135 | 134 |
|
136 | 135 | if (!Color.equals(attributes._lastColor, fillColor)) {
|
137 | 136 | attributes._lastColor = Color.clone(fillColor, attributes._lastColor);
|
138 |
| - var color = this.color; |
139 |
| - var newColor = fillColor.toBytes(scratchArray); |
140 |
| - if (color[0] !== newColor[0] || color[1] !== newColor[1] || |
141 |
| - color[2] !== newColor[2] || color[3] !== newColor[3]) { |
142 |
| - this.itemsToRemove[removedCount++] = updater; |
143 |
| - } |
| 137 | + attributes.color = ColorGeometryInstanceAttribute.toValue(fillColor, attributes.color); |
144 | 138 | }
|
145 | 139 | }
|
146 | 140 |
|
@@ -241,9 +235,9 @@ import Property from './Property.js';
|
241 | 235 | StaticGroundGeometryColorBatch.prototype.add = function(time, updater) {
|
242 | 236 | var instance = updater.createFillGeometryInstance(time);
|
243 | 237 | var batches = this._batches;
|
244 |
| - // color and zIndex are batch breakers, so we'll use that for the key |
| 238 | + // zIndex is a batch breaker, so we'll use that for the key |
245 | 239 | var zIndex = Property.getValueOrDefault(updater.zIndex, 0);
|
246 |
| - var batchKey = new Uint32Array(instance.attributes.color.value.buffer)[0] + ':' + zIndex; |
| 240 | + var batchKey = zIndex; |
247 | 241 | var batch;
|
248 | 242 | if (batches.contains(batchKey)) {
|
249 | 243 | batch = batches.get(batchKey);
|
|
0 commit comments