@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/miniprogram.js
CHANGED
|
@@ -18840,39 +18840,43 @@ var ObjectPool = /*#__PURE__*/ function() {
|
|
|
18840
18840
|
return null;
|
|
18841
18841
|
};
|
|
18842
18842
|
_proto._freeArea = function _freeArea(area) {
|
|
18843
|
-
var
|
|
18844
|
-
var
|
|
18845
|
-
|
|
18846
|
-
areas.push(area);
|
|
18847
|
-
return;
|
|
18848
|
-
}
|
|
18843
|
+
var start = area.start, size = area.size;
|
|
18844
|
+
var freeAreas = this.vertexFreeAreas;
|
|
18845
|
+
var end = start + size;
|
|
18849
18846
|
var pool = PrimitiveChunk.areaPool;
|
|
18850
|
-
var
|
|
18851
|
-
|
|
18852
|
-
|
|
18853
|
-
var
|
|
18854
|
-
|
|
18855
|
-
|
|
18856
|
-
|
|
18857
|
-
|
|
18858
|
-
if (
|
|
18859
|
-
|
|
18847
|
+
for(var i = 0, areaLen = freeAreas.length; i < areaLen; ++i){
|
|
18848
|
+
var curFreeArea = freeAreas[i];
|
|
18849
|
+
var curStart = curFreeArea.start;
|
|
18850
|
+
var curEnd = curStart + curFreeArea.size;
|
|
18851
|
+
if (end < curStart) {
|
|
18852
|
+
// The area to be freed is to the left of the current free area and is not connected
|
|
18853
|
+
freeAreas.splice(i, 0, area);
|
|
18854
|
+
return;
|
|
18855
|
+
} else if (end === curStart) {
|
|
18856
|
+
// The area to be freed is to the left of the current free area and is connected
|
|
18857
|
+
curFreeArea.start = start;
|
|
18858
|
+
curFreeArea.size += size;
|
|
18859
|
+
pool.return(area);
|
|
18860
|
+
return;
|
|
18861
|
+
} else if (start === curEnd) {
|
|
18862
|
+
// The area to be freed is to the right of the current free area and is connected
|
|
18863
|
+
curFreeArea.size += size;
|
|
18864
|
+
pool.return(area);
|
|
18865
|
+
var nextIndex = i + 1;
|
|
18866
|
+
if (nextIndex < areaLen) {
|
|
18867
|
+
var nextFreeArea = freeAreas[nextIndex];
|
|
18868
|
+
if (end === nextFreeArea.start) {
|
|
18869
|
+
// The cur free area after merge is to the left of the next free area and is connected
|
|
18870
|
+
curFreeArea.size += nextFreeArea.size;
|
|
18871
|
+
freeAreas.splice(nextIndex, 1);
|
|
18872
|
+
pool.return(nextFreeArea);
|
|
18873
|
+
}
|
|
18874
|
+
}
|
|
18860
18875
|
return;
|
|
18861
|
-
} else if (preEnd === curStart) {
|
|
18862
|
-
curArea.start = preStart;
|
|
18863
|
-
curArea.size += size;
|
|
18864
|
-
pool.return(preArea);
|
|
18865
|
-
preArea = curArea;
|
|
18866
|
-
notMerge = false;
|
|
18867
|
-
} else if (preStart === curEnd) {
|
|
18868
|
-
curArea.size += size;
|
|
18869
|
-
pool.return(preArea);
|
|
18870
|
-
preArea = curArea;
|
|
18871
|
-
notMerge = false;
|
|
18872
|
-
} else if (preStart > curEnd) {
|
|
18873
|
-
i + 1 === areaLen && areas.push(preArea);
|
|
18874
18876
|
}
|
|
18875
18877
|
}
|
|
18878
|
+
// The area to be freed is to the right of the last free area and is not connected or free areas is empty
|
|
18879
|
+
freeAreas.push(area);
|
|
18876
18880
|
};
|
|
18877
18881
|
return PrimitiveChunk;
|
|
18878
18882
|
}();
|
package/dist/module.js
CHANGED
|
@@ -18835,39 +18835,43 @@ var ObjectPool = /*#__PURE__*/ function() {
|
|
|
18835
18835
|
return null;
|
|
18836
18836
|
};
|
|
18837
18837
|
_proto._freeArea = function _freeArea(area) {
|
|
18838
|
-
var
|
|
18839
|
-
var
|
|
18840
|
-
|
|
18841
|
-
areas.push(area);
|
|
18842
|
-
return;
|
|
18843
|
-
}
|
|
18838
|
+
var start = area.start, size = area.size;
|
|
18839
|
+
var freeAreas = this.vertexFreeAreas;
|
|
18840
|
+
var end = start + size;
|
|
18844
18841
|
var pool = PrimitiveChunk.areaPool;
|
|
18845
|
-
var
|
|
18846
|
-
|
|
18847
|
-
|
|
18848
|
-
var
|
|
18849
|
-
|
|
18850
|
-
|
|
18851
|
-
|
|
18852
|
-
|
|
18853
|
-
if (
|
|
18854
|
-
|
|
18842
|
+
for(var i = 0, areaLen = freeAreas.length; i < areaLen; ++i){
|
|
18843
|
+
var curFreeArea = freeAreas[i];
|
|
18844
|
+
var curStart = curFreeArea.start;
|
|
18845
|
+
var curEnd = curStart + curFreeArea.size;
|
|
18846
|
+
if (end < curStart) {
|
|
18847
|
+
// The area to be freed is to the left of the current free area and is not connected
|
|
18848
|
+
freeAreas.splice(i, 0, area);
|
|
18849
|
+
return;
|
|
18850
|
+
} else if (end === curStart) {
|
|
18851
|
+
// The area to be freed is to the left of the current free area and is connected
|
|
18852
|
+
curFreeArea.start = start;
|
|
18853
|
+
curFreeArea.size += size;
|
|
18854
|
+
pool.return(area);
|
|
18855
|
+
return;
|
|
18856
|
+
} else if (start === curEnd) {
|
|
18857
|
+
// The area to be freed is to the right of the current free area and is connected
|
|
18858
|
+
curFreeArea.size += size;
|
|
18859
|
+
pool.return(area);
|
|
18860
|
+
var nextIndex = i + 1;
|
|
18861
|
+
if (nextIndex < areaLen) {
|
|
18862
|
+
var nextFreeArea = freeAreas[nextIndex];
|
|
18863
|
+
if (end === nextFreeArea.start) {
|
|
18864
|
+
// The cur free area after merge is to the left of the next free area and is connected
|
|
18865
|
+
curFreeArea.size += nextFreeArea.size;
|
|
18866
|
+
freeAreas.splice(nextIndex, 1);
|
|
18867
|
+
pool.return(nextFreeArea);
|
|
18868
|
+
}
|
|
18869
|
+
}
|
|
18855
18870
|
return;
|
|
18856
|
-
} else if (preEnd === curStart) {
|
|
18857
|
-
curArea.start = preStart;
|
|
18858
|
-
curArea.size += size;
|
|
18859
|
-
pool.return(preArea);
|
|
18860
|
-
preArea = curArea;
|
|
18861
|
-
notMerge = false;
|
|
18862
|
-
} else if (preStart === curEnd) {
|
|
18863
|
-
curArea.size += size;
|
|
18864
|
-
pool.return(preArea);
|
|
18865
|
-
preArea = curArea;
|
|
18866
|
-
notMerge = false;
|
|
18867
|
-
} else if (preStart > curEnd) {
|
|
18868
|
-
i + 1 === areaLen && areas.push(preArea);
|
|
18869
18871
|
}
|
|
18870
18872
|
}
|
|
18873
|
+
// The area to be freed is to the right of the last free area and is not connected or free areas is empty
|
|
18874
|
+
freeAreas.push(area);
|
|
18871
18875
|
};
|
|
18872
18876
|
return PrimitiveChunk;
|
|
18873
18877
|
}();
|