Friday, August 1, 2014

FMod - Less Obtrusive Graphics Reload

Gridlock on IRC today requested that the Reload Graphics function receive two adjustments, both of which turned out to be somewhat tricky. First, he wanted it to preserve the plane states and position in the level, which is very understandable. I ended up adding an "after reload" flag to InitializeGraphics that suppresses the, well, initialization of the plane states and selected tiles. The reloading function itself now saves the X and Y offsets inside the level view state and restores them after the InitializeGraphics call.

Then, he noted that, while reloading, the "Abiathar" logo/image appears instead of the level, which makes it hard to compare different versions of graphics because it's interrupted by a big splash screen. I did a whole lot of messing around and eventually settled on using the Windows API to send a "stop repainting" message to the form before doing the reload. For some reason, the level would simply vanish while the graphics reloaded, which was strange because I couldn't find a call that re-rendered anything. So, the issue is now solved, and even falls back on the old behavior if that API call is unavailable (i.e. it's running on Linux).

In other news, I have placed a moratorium on new features until the v2.0 update, and the documentation update has been completed. After a little more testing and feedback, Abiathar v2.0 will be released on August 3.

No comments:

Post a Comment