mirror of
https://github.com/tobspr/shapez.io.git
synced 2025-06-13 13:04:03 +00:00
Improve overlay transition on low performance setups
This commit is contained in:
parent
fae67bb7b2
commit
607fd15a18
@ -416,6 +416,11 @@ export class GameCore {
|
|||||||
const desiredOverlayAlpha = this.root.camera.getIsMapOverlayActive() ? 1 : 0;
|
const desiredOverlayAlpha = this.root.camera.getIsMapOverlayActive() ? 1 : 0;
|
||||||
this.overlayAlpha = lerp(this.overlayAlpha, desiredOverlayAlpha, 0.25);
|
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) {
|
if (this.overlayAlpha < 0.99) {
|
||||||
// Background (grid, resources, etc)
|
// Background (grid, resources, etc)
|
||||||
root.map.drawBackground(params);
|
root.map.drawBackground(params);
|
||||||
|
Loading…
Reference in New Issue
Block a user