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.

No comments:

Post a Comment