Sunday, July 26, 2015

FMod - Fast Tile Updates

While poking around making sure that Abiathar v2.8 was in good working order, I noticed that I had forgotten to apply the GDI+ optimizations to single-tile updates in TileRenderPlane. I copied the five lines of configuration from the full-render routine and now I think the placement of individual tiles is graphically updated faster. (It would probably be more apparent on a slower machine.) For the curious, those lines are:

' g is your Graphics instance
g.CompositingMode = Drawing2D.CompositingMode.SourceCopy
g.InterpolationMode = Drawing2D.InterpolationMode.Default
g.CompositingQuality = Drawing2D.CompositingQuality.HighSpeed
g.SmoothingMode = Drawing2D.SmoothingMode.None
g.PixelOffsetMode = Drawing2D.PixelOffsetMode.None

These are really only good if you're not stretching or scaling in DrawImage calls. If you are doing that with these settings, it's going to look super awful. But if you're just copying images, these are great.

No comments:

Post a Comment