Thursday, March 19, 2015

FMod - Ephemeral Rendering?

I had an idea that could possibly decrease the memory footprint of Abiathar.

Currently, every rendering "plane" is persisted as a bitmap in the level's view state. There are currently eight (!) planes for each level: background, foreground, non-link infoplane, linkable infoplane, links, tile properties, selection rectangle, and paste preview. Those last two seem a bit wasteful to keep around all the time, especially since they can be rendered so easily.

I'm seriously considering implementing a different type of render plane that doesn't keep its contents in a bitmap. Rather, when it is instructed to render its contents, it will receive a Graphics object and draw directly on it. In fact, this might be even faster because GDI won't have to BitBlt an entire bitmap - one plane is literally just a rectangle and the other is a small smattering of tiles. Paste preview could be optimized by just storing the image of the blot and rendering it in the appropriate place rather than putting it on a mostly-empty bitmap and then blending that.

I'll call this mechanism "ephemeral rendering planes."

No comments:

Post a Comment