phaserjs / phaser-ce

Phaser CE is a fun, free and fast 2D game framework for making HTML5 games for desktop and mobile web browsers, supporting Canvas and WebGL rendering.
http://phaser.io
MIT License
1.34k stars 491 forks source link

Bugfix: Texture smoothing #636

Closed ndee85 closed 5 years ago

ndee85 commented 5 years ago

only mark texture as dirty when scaleMode differs from previous value

This PR (choose one or more, ✏️ delete others)

Please include a summary in Change Log: Unreleased and thank yourself.

Describe the changes below: Commit 7ea0dd2 a fix for #432 but marks texture always as dirty. Even if the smoothed value doesn't change at all. This fix now checks if the previous value actually differs to current. If it does, it marks the texture as dirty. This fixes some performance regressions for our framework that the commit introduced.

samme commented 5 years ago

Can you change to !== ?

ndee85 commented 5 years ago

@samme of course. Just applied the change.