mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Get rid of 'builtins' file since its useless and causes performance issues
This commit is contained in:
@@ -5,7 +5,6 @@ import { T } from "../../../translations";
|
||||
import { createLogger } from "../../../core/logging";
|
||||
import { StaticMapEntityComponent } from "../../components/static_map_entity";
|
||||
import { Vector } from "../../../core/vector";
|
||||
import { Math_max, Math_min, Math_floor } from "../../../core/builtins";
|
||||
import { makeOffscreenBuffer } from "../../../core/buffer_utils";
|
||||
import { DrawParameters } from "../../../core/draw_parameters";
|
||||
import { Rectangle } from "../../../core/rectangle";
|
||||
@@ -43,11 +42,11 @@ export class HUDScreenshotExporter extends BaseHUDPart {
|
||||
const maxTile = new Vector(0, 0);
|
||||
for (let i = 0; i < staticEntities.length; ++i) {
|
||||
const bounds = staticEntities[i].components.StaticMapEntity.getTileSpaceBounds();
|
||||
minTile.x = Math_min(minTile.x, bounds.x);
|
||||
minTile.y = Math_min(minTile.y, bounds.y);
|
||||
minTile.x = Math.min(minTile.x, bounds.x);
|
||||
minTile.y = Math.min(minTile.y, bounds.y);
|
||||
|
||||
maxTile.x = Math_max(maxTile.x, bounds.x + bounds.w);
|
||||
maxTile.y = Math_max(maxTile.y, bounds.y + bounds.h);
|
||||
maxTile.x = Math.max(maxTile.x, bounds.x + bounds.w);
|
||||
maxTile.y = Math.max(maxTile.y, bounds.y + bounds.h);
|
||||
}
|
||||
|
||||
const minChunk = minTile.divideScalar(globalConfig.mapChunkSize).floor();
|
||||
@@ -57,10 +56,10 @@ export class HUDScreenshotExporter extends BaseHUDPart {
|
||||
logger.log("Dimensions:", dimensions);
|
||||
|
||||
let chunkSizePixels = 128;
|
||||
const maxDimensions = Math_max(dimensions.x, dimensions.y);
|
||||
const maxDimensions = Math.max(dimensions.x, dimensions.y);
|
||||
|
||||
if (maxDimensions > 128) {
|
||||
chunkSizePixels = Math_max(1, Math_floor(128 * (128 / maxDimensions)));
|
||||
chunkSizePixels = Math.max(1, Math.floor(128 * (128 / maxDimensions)));
|
||||
}
|
||||
logger.log("ChunkSizePixels:", chunkSizePixels);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user