@galacean/engine-core 1.3.7 → 1.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.js +33 -29
- package/dist/main.js.map +1 -1
- package/dist/miniprogram.js +33 -29
- package/dist/module.js +33 -29
- package/dist/module.js.map +1 -1
- package/package.json +3 -3
package/dist/main.js
CHANGED
|
@@ -18839,39 +18839,43 @@ var ObjectPool = /*#__PURE__*/ function() {
|
|
|
18839
18839
|
return null;
|
|
18840
18840
|
};
|
|
18841
18841
|
_proto._freeArea = function _freeArea(area) {
|
|
18842
|
-
var
|
|
18843
|
-
var
|
|
18844
|
-
|
|
18845
|
-
areas.push(area);
|
|
18846
|
-
return;
|
|
18847
|
-
}
|
|
18842
|
+
var start = area.start, size = area.size;
|
|
18843
|
+
var freeAreas = this.vertexFreeAreas;
|
|
18844
|
+
var end = start + size;
|
|
18848
18845
|
var pool = PrimitiveChunk.areaPool;
|
|
18849
|
-
var
|
|
18850
|
-
|
|
18851
|
-
|
|
18852
|
-
var
|
|
18853
|
-
|
|
18854
|
-
|
|
18855
|
-
|
|
18856
|
-
|
|
18857
|
-
if (
|
|
18858
|
-
|
|
18846
|
+
for(var i = 0, areaLen = freeAreas.length; i < areaLen; ++i){
|
|
18847
|
+
var curFreeArea = freeAreas[i];
|
|
18848
|
+
var curStart = curFreeArea.start;
|
|
18849
|
+
var curEnd = curStart + curFreeArea.size;
|
|
18850
|
+
if (end < curStart) {
|
|
18851
|
+
// The area to be freed is to the left of the current free area and is not connected
|
|
18852
|
+
freeAreas.splice(i, 0, area);
|
|
18853
|
+
return;
|
|
18854
|
+
} else if (end === curStart) {
|
|
18855
|
+
// The area to be freed is to the left of the current free area and is connected
|
|
18856
|
+
curFreeArea.start = start;
|
|
18857
|
+
curFreeArea.size += size;
|
|
18858
|
+
pool.return(area);
|
|
18859
|
+
return;
|
|
18860
|
+
} else if (start === curEnd) {
|
|
18861
|
+
// The area to be freed is to the right of the current free area and is connected
|
|
18862
|
+
curFreeArea.size += size;
|
|
18863
|
+
pool.return(area);
|
|
18864
|
+
var nextIndex = i + 1;
|
|
18865
|
+
if (nextIndex < areaLen) {
|
|
18866
|
+
var nextFreeArea = freeAreas[nextIndex];
|
|
18867
|
+
if (end === nextFreeArea.start) {
|
|
18868
|
+
// The cur free area after merge is to the left of the next free area and is connected
|
|
18869
|
+
curFreeArea.size += nextFreeArea.size;
|
|
18870
|
+
freeAreas.splice(nextIndex, 1);
|
|
18871
|
+
pool.return(nextFreeArea);
|
|
18872
|
+
}
|
|
18873
|
+
}
|
|
18859
18874
|
return;
|
|
18860
|
-
} else if (preEnd === curStart) {
|
|
18861
|
-
curArea.start = preStart;
|
|
18862
|
-
curArea.size += size;
|
|
18863
|
-
pool.return(preArea);
|
|
18864
|
-
preArea = curArea;
|
|
18865
|
-
notMerge = false;
|
|
18866
|
-
} else if (preStart === curEnd) {
|
|
18867
|
-
curArea.size += size;
|
|
18868
|
-
pool.return(preArea);
|
|
18869
|
-
preArea = curArea;
|
|
18870
|
-
notMerge = false;
|
|
18871
|
-
} else if (preStart > curEnd) {
|
|
18872
|
-
i + 1 === areaLen && areas.push(preArea);
|
|
18873
18875
|
}
|
|
18874
18876
|
}
|
|
18877
|
+
// The area to be freed is to the right of the last free area and is not connected or free areas is empty
|
|
18878
|
+
freeAreas.push(area);
|
|
18875
18879
|
};
|
|
18876
18880
|
return PrimitiveChunk;
|
|
18877
18881
|
}();
|