@galacean/engine-core 1.3.7 → 1.3.9

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 CHANGED
@@ -18839,39 +18839,43 @@ var ObjectPool = /*#__PURE__*/ function() {
18839
18839
  return null;
18840
18840
  };
18841
18841
  _proto._freeArea = function _freeArea(area) {
18842
- var areas = this.vertexFreeAreas;
18843
- var areaLen = areas.length;
18844
- if (areaLen === 0) {
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 preArea = area;
18850
- var notMerge = true;
18851
- for(var i = 0; i < areaLen; ++i){
18852
- var curArea = areas[i];
18853
- var preStart = preArea.start, size = preArea.size;
18854
- var curStart = curArea.start;
18855
- var preEnd = preStart + size;
18856
- var curEnd = curStart + curArea.size;
18857
- if (preEnd < curStart) {
18858
- notMerge && areas.splice(i, 0, preArea);
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
  }();
@@ -20021,6 +20025,7 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
20021
20025
  */ SystemInfo._initialize = function _initialize() {
20022
20026
  {
20023
20027
  if (typeof navigator == "undefined") {
20028
+ SystemInfo._isBrowser = false;
20024
20029
  return;
20025
20030
  }
20026
20031
  var userAgent = navigator.userAgent;
@@ -20132,6 +20137,9 @@ var rePropName = RegExp(// Match anything that isn't a dot or bracket.
20132
20137
  (function() {
20133
20138
  /** The operating system is running on. */ SystemInfo.operatingSystem = "";
20134
20139
  })();
20140
+ (function() {
20141
+ /** @internal */ SystemInfo._isBrowser = true;
20142
+ })();
20135
20143
  (function() {
20136
20144
  /** Whether the system support SIMD. */ SystemInfo._simdSupported = null;
20137
20145
  })();