Friday, July 31, 2015

FMod - Level Management Improvement

Today while processing a feature request for Abiathar (the ability to shuffle levels around, changing their IDs), I noticed a crash bug in the level copy feature. When overwriting existing levels, it always tried to remove that level's entry in the view state cache, but that resulted in a KeyNotFoundException if that level had not been visited yet. I added a check for LevelViewStates.ContainsKey and the crash was fixed.

I then went to implement that feature request. It was a bit tricky, but I got the Level | Properties feature to enable changing the level ID. When the level ID is changed to the ID of an existing level, an option is provided to swap, reordering the levels. The undoable action description (for the Time Machine) is even customized based on whether the level was moved, swapped, or simply reconfigured.

Thursday, July 30, 2015

This Site Uses Cookies

Apparently the European Union has a law that requires all sites to declare their use of cookies, a law which Blogger told me about by raising a little notification on the Overview tab of my blog control panel. I'm not sure what the consequences are if you don't obey that law, but in the interest of being a good Internet citizen, I'll comply:

This blog, for some reason, uses cookies, and it's out of my control. I'm fairly certain the cookies are only there to recognize if you're signed in with Google. Hopefully, Google isn't doing anything super privacy-violating with said cookies. If you aren't OK with cookies, I guess you should read my blog through a proxy, or disable cookies entirely. (Expect stuff to break if you choose the second option.)

Hooray for laws?

Wednesday, July 29, 2015

Visual Studio 2015 Compiler Produces Smaller Assemblies

A PCKF community member pointed out that the binaries for Abiathar v2.8 were smaller than those for v2.7.2, which led me to notice that Abiathar v2.8 was the smallest version by file size to date. I certainly added features and didn't remove anything major, so the only explanation I have is that the Visual Studio 2015 compiler creates smaller, better-packed assemblies than the compiler in Visual Studio 2013, which I switched away from between v2.7.2 and v2.8. Note that I have not switched to .NET 4.6 for build targeting (thanks in no small part to this bug); I'm still targeting .NET 4.0, so the downsize is a function of the compiler, not the framework. Neat!

Tuesday, July 28, 2015

FMod - Missed a Space

I remembered that I had completely forgotten to make sure the Time Machine displays tileinfo-related undoable actions correctly. I checked that today, and fortunately there were no major problems. The description of normal tileinfo tweaks was, however, missing a space between the tile ID and the word "properties". I fixed it in my local build, but didn't bother to push a whole update for it since it's such a small and unobtrusive thing. Even so, I should probably be sure to test more thoroughly in the future.

Monday, July 27, 2015

FMod - v2.8

A few weeks ago, somebody noted that placing the worldmap Keen sprite in levels doesn't do anything bad, it just makes the level work like another worldmap. So, I finally remembered to downgrade the Abiathar Level Inspector's problem alerts about map Keen in levels and level Keen on the map to warnings. Since some mods (Kube, for instance) make serious use of the ability to use map Keen in normal levels, I also added a switch called IgnoreWorldmap in the InfoplaneInspector section of the ADEPS file to turn off the warnings. I did make sure that the sprites that always cause a crash still produce a "problem" message even with IgnoreWorldmap, since it's a combination of those same fields that trigger it.

I released those changes and those from the past few weeks as Abiathar v2.8.

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.

Saturday, July 25, 2015

FMod - Improved Time Machine

Today I made some tweaks to the Time Machine feature. The normal TileUndo class now records which tool was active when it was instantiated and adds a "using tool" phrase to the end of its description. The word "tiles" is now singularized when there was only one tile modified. Clear History now requires confirmation before doing its work, which - naturally - cannot be undone. Finally, I made sure the Time Machine window can't be resized in a way that hides some of the buttons.

The improved Time Machine
Visual Studio 2015 bug: the dividing lines between methods and other important stuff don't extend to the right when the horizontal scroll bar is used in the code window.