partey_workadventure/front/src/Phaser/Menu
David Négrier 0c5e5ef578 Skip "render" if nothing changed on screen
For each requested animation frame (RAF) in Phaser, Phaser calls the "update" method, then the "render" method of each scenes.
The "render" method takes some time (and energy) to perform the rendering.

The fact is we probably don't need to call "render" if nothing changed on the screen (which happens most of the frames in a typical WorkAdventure game).

This commit is therefore overloading the "Game" class of Phaser to add a "dirty" flag.

Scenes can now add a "isDirty()" method. If all displayed scenes are pristine (not dirty), Phaser will skip rendering the frame altogether.

This saves "a lot" of energy, resulting in laptops that are not overheating when using WorkAdventure \o/
2021-05-06 15:36:45 +02:00
..
HelpCameraSettingsScene.ts FIX: help camera settings popup now only show up once 2021-03-24 15:59:18 +01:00
MenuScene.ts Skip "render" if nothing changed on screen 2021-05-06 15:36:45 +02:00
ReportMenu.ts HotFix style WorkAdventure 2021-04-12 18:17:04 +02:00