Today I tied together all the infrastructural loose ends into a completed implementation of a clipboards palette for Abiathar. A view state - just like the ones for real levels - is maintained for each of the nine copied blocks. The clipboards palette form creates a level wrapper and a view state when a copied block is stored in a slot. The main renderer function now takes a plane filter function, which the clipboards palette uses to hide planes that the copied blocks do not contain. This avoids rendering an opaque background (of the background zero tile) when the copied block doesn't include the background plane. Since the palette form uses the main rendering function, hidden planes are also hidden in the palette. Likewise, tile properties and the find highlight are displayed if appropriate.
To select a clipboard slot for retrieving or storing, the user can click the image, click the label, or press the appropriate numeric key on the keyboard (probably the numeric keypad since the form is laid out to match that, but the normal numbers work too).
Various technical articles, IT-related tutorials, software information, and development journals
Monday, May 14, 2018
Sunday, May 13, 2018
FMod - Persistent saved clipboard
Yesterday I wrote the infrastructure needed for Abiathar to save and load chunks of tiles to/from project files. Today I used that to store the nine saved copied blocks when saving. The chunks of tiles are saved as the Base64 encoding of a simple binary format. Each plane has a byte of value zero or one indicating whether the plane is present in the copied block. If the plane is there, its width and height follow as 32-bit integers, then the tiles in the plane as 16-bit integers.
Saturday, May 12, 2018
FMod - Work on multiple clipboards
Today I implemented a good chunk of the multiple clipboard functionality. There is now a clipboards palette that can be called with Ctrl+Alt+Up to store or Ctrl+Alt+Down to retrieve. Clicking the spaces under each header indeed stores or retrieves the clipboard in that slot. The next order of business is to actually draw the copied blocks in the palette.
I also wrote some functions to serialize and deserialize chunks of tiles to/from text for purposes of stashing the copied blocks in the project file. This is mostly done but not quite hooked up yet.
As a really quick minor feature, the period key now selects the zero tile in all active planes. This is especially helpful for the foreground because if Assimilate Infoplane is off, the zero tile doesn't actually appear in the tileset. It's not hard to select the zero tile from a blank spot in the level, but if there are tons of foreground tiles everywhere for some reason, it'd be nice to have a guaranteed quick way of getting the zero tile.
I also wrote some functions to serialize and deserialize chunks of tiles to/from text for purposes of stashing the copied blocks in the project file. This is mostly done but not quite hooked up yet.
As a really quick minor feature, the period key now selects the zero tile in all active planes. This is especially helpful for the foreground because if Assimilate Infoplane is off, the zero tile doesn't actually appear in the tileset. It's not hard to select the zero tile from a blank spot in the level, but if there are tons of foreground tiles everywhere for some reason, it'd be nice to have a guaranteed quick way of getting the zero tile.
Wednesday, May 9, 2018
FMod - Further refactoring for temporary levels
The function that prepares a level's view state (whether or not the level is a real level or actually a copied block) is responsible for adding all the render planes to it. The planes that involve the infoplane receive a function that tells them whether to render a given tile ID; this is used to hide the hex composites corresponding to links when the visual link overlay is enabled. If the user copies something that happens to look like a link, though, it wouldn't be good to display a link in the rendering of the copied block because, when pasted, it wouldn't end up pointing to the spot it appears to. (Galaxy links use absolute coordinates.)
So I adjusted the "create level drawing surfaces" function to accept the dimensions of the level for purposes of link identification. The old "create drawing surfaces for a real level" function just supplies the real level's dimensions. I also added a Boolean to the constructor of the level wrapper class that indicates whether the "level" should be treated as just a temporary chunk of tiles.
So I adjusted the "create level drawing surfaces" function to accept the dimensions of the level for purposes of link identification. The old "create drawing surfaces for a real level" function just supplies the real level's dimensions. I also added a Boolean to the constructor of the level wrapper class that indicates whether the "level" should be treated as just a temporary chunk of tiles.
Monday, May 7, 2018
FMod - Refactoring for temporary levels
To implement multiple copied blocks in helpful way, Abiathar will need to be able to draw chunks of tiles that don't comprise a real level. To do that, I will need a way to manage level view states independently of level IDs. Today I did a bit of refactoring to make that possible. There is now a separate method to draw a given view state on a given surface, which is called by the main rendering function that historically assumed the current level is always the thing being drawn. A couple other little things, like the infoplane icon/link delimiter function needed to be adjusted as well.
Level wrappers now have a new Temporary property that will indicate whether they're just a temporary chunk of tiles instead of a full level. Tools should never see such wrappers, but render planes will.
Level wrappers now have a new Temporary property that will indicate whether they're just a temporary chunk of tiles instead of a full level. Tools should never see such wrappers, but render planes will.
Friday, May 4, 2018
If Android Studio shows nothing in Logcat, restart the emulator
I've noticed that sometimes Android Studio's Logcat window (where logged information from the attached or virtual device appears) stops updating with new log entries. Restarting and recompiling the app don't help; it just seems that Logcat gets stuck. Restarting the emulator solves the problem. I've observed this behavior with both the included Android Studio emulator and the Visual Studio Emulator for Android, but not with a real phone attached via USB.
Wednesday, May 2, 2018
If Android Studio can't resolve R, do a Clean Project
Occasionally Android Studio gets itself stuck in a state where it can't resolve R, the auto-generated class that stores all the IDs of the app's resources. (Sometimes it decides to stop resolving other important things too.) The solution is do force a full recompile using Build | Clean Project and Build | Rebuild Project.
Subscribe to:
Posts (Atom)
