1
0
mirror of https://github.com/tobspr/shapez.io.git synced 2024-10-27 20:34:29 +00:00

Improve overlay transition on low performance setups

This commit is contained in:
tobspr 2020-09-22 10:54:51 +02:00
parent fae67bb7b2
commit 607fd15a18

View File

@ -416,6 +416,11 @@ export class GameCore {
const desiredOverlayAlpha = this.root.camera.getIsMapOverlayActive() ? 1 : 0;
this.overlayAlpha = lerp(this.overlayAlpha, desiredOverlayAlpha, 0.25);
// On low performance, skip the fade
if (this.root.entityMgr.entities.length > 5000 || this.root.dynamicTickrate.averageFps < 50) {
this.overlayAlpha = desiredOverlayAlpha;
}
if (this.overlayAlpha < 0.99) {
// Background (grid, resources, etc)
root.map.drawBackground(params);