randomPoison / gunship-rs

An experimental game engine written in Rust.
MIT License
27 stars 3 forks source link

Hotloading Cancels Debug Pause #58

Closed randomPoison closed 8 years ago

randomPoison commented 8 years ago

Pressing the F9 key enables a "debug pause" in the engine which means that the main loop still runs (to process window messages and make sure the screen doesn't lock up) but game code doesn't run. When a hotload occurs (using the hotloading feature) the pause state is reset. The desired behavior is that the debug pause state carry over between hotloads (i.e. if the engine is paused and a hotload occurs then the engine should remain paused, and vice versa).

The code of interest is in the Clone impl for Engine in engine.rs. Engine::clone() is called when hotloading to make a new copy of the engine, so it is likely not copying the value of debug_pause from the old engine.

randomPoison commented 8 years ago

Hotloading is out of date, this will have to be revisited once the new hotloading system is implemented.