mirror of
https://github.com/tobspr/shapez.io.git
synced 2026-03-02 03:39:21 +00:00
Improve map overlay rendering and raise zoom limit
This commit is contained in:
@@ -95,15 +95,18 @@ export class BufferMaintainer {
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param {string} key
|
||||
* @param {string} subKey
|
||||
* @param {function(HTMLCanvasElement, CanvasRenderingContext2D, number, number, number, object?) : void} redrawMethod
|
||||
* @param {object=} additionalParams
|
||||
* @param {object} param0
|
||||
* @param {string} param0.key
|
||||
* @param {string} param0.subKey
|
||||
* @param {number} param0.w
|
||||
* @param {number} param0.h
|
||||
* @param {number} param0.dpi
|
||||
* @param {function(HTMLCanvasElement, CanvasRenderingContext2D, number, number, number, object?) : void} param0.redrawMethod
|
||||
* @param {object=} param0.additionalParams
|
||||
* @returns {HTMLCanvasElement}
|
||||
*
|
||||
*/
|
||||
getForKey(key, subKey, w, h, dpi, redrawMethod, additionalParams) {
|
||||
getForKey({ key, subKey, w, h, dpi, redrawMethod, additionalParams }) {
|
||||
// First, create parent key
|
||||
let parent = this.cache.get(key);
|
||||
if (!parent) {
|
||||
|
||||
@@ -34,6 +34,7 @@ export const globalConfig = {
|
||||
assetsDpi: 192 / 32,
|
||||
assetsSharpness: 1.2,
|
||||
shapesSharpness: 1.4,
|
||||
mapChunkSharpness: 1.0,
|
||||
|
||||
// Production analytics
|
||||
statisticsGraphDpi: 2.5,
|
||||
@@ -45,8 +46,7 @@ export const globalConfig = {
|
||||
|
||||
// Map
|
||||
mapChunkSize: 16,
|
||||
mapChunkPrerenderMinZoom: -1,
|
||||
mapChunkOverviewMinZoom: 0.7,
|
||||
mapChunkOverviewMinZoom: 0.9,
|
||||
|
||||
// Belt speeds
|
||||
// NOTICE: Update webpack.production.config too!
|
||||
@@ -113,14 +113,12 @@ globalConfig.minerSpeedItemsPerSecond = globalConfig.beltSpeedItemsPerSecond / 5
|
||||
// Dynamic calculations
|
||||
if (globalConfig.debug.disableMapOverview) {
|
||||
globalConfig.mapChunkOverviewMinZoom = 0;
|
||||
globalConfig.mapChunkPrerenderMinZoom = 0;
|
||||
}
|
||||
|
||||
// Stuff for making the trailer
|
||||
if (G_IS_DEV && globalConfig.debug.renderForTrailer) {
|
||||
globalConfig.debug.framePausesBetweenTicks = 32;
|
||||
// globalConfig.mapChunkOverviewMinZoom = 0.0;
|
||||
// globalConfig.mapChunkPrerenderMinZoom = globalConfig.mapChunkOverviewMinZoom;
|
||||
// globalConfig.debug.instantBelts = true;
|
||||
// globalConfig.debug.instantProcessors = true;
|
||||
// globalConfig.debug.instantMiners = true;
|
||||
|
||||
@@ -15,8 +15,8 @@ export function getDeviceDPI() {
|
||||
* @returns {number} Smoothed dpi
|
||||
*/
|
||||
export function smoothenDpi(dpi) {
|
||||
if (dpi < 0.05) {
|
||||
return 0.05;
|
||||
if (dpi < 0.02) {
|
||||
return 0.02;
|
||||
} else if (dpi < 0.1) {
|
||||
return round2Digits(dpi);
|
||||
} else if (dpi < 1) {
|
||||
|
||||
Reference in New Issue
Block a user