Much Ado About Nullptr
The way BlastEd originally displayed selected tiles was, I felt, a waste of cycles. What would happen was this: for every mouse movement a vector would be initialized, created and populated with the indexed number of tiles within the square. It would then redraw all these tiles. A method that was fine for small selection boxes. And, for the Mega Drive entire tile maps aren't large. But, it's still poorly optimised. It calls a lot to the draw function. Plus, the mouse pointer isn't contiguous with the tile selection which can lead to artifacts.
The previously described method was simple but inelegant. I've since devised a strategy to lift some of the burden from the draw function. As always it's a tradeoff between computation and space. With this method I hope to mitigate some of the effort required to selected some tiles.
Bear in mind that the following is just an outline and that Vector is used to reference a dynamic array in C++, and Point is used to describe a co-ordinate (x/y.) Initially two points of an adjacent line are compared and sorted into ascending order so we have left-most and right-most points. All tiles within this collider are pushed back into the vector. The vector is then copied to draw. On each mouse drag the vector is recreated. However, it is then compared to the vector copied to draw and only the tiles that are in and out are marked for redraw.
UML is not available but Ibuprofen can be obtained from your local pharmacy.
Get BlastEd - Mega Drive/Genesis Graphics Tool
BlastEd - Mega Drive/Genesis Graphics Tool
Orthographic tile mapping software for the SEGA™ Mega Drive / Genesis
Status | Prototype |
Category | Tool |
Author | David Oberlin |
Tags | Mega Drive, Retro, Sega Genesis, Tilemap, Tileset |
More posts
- Xiyoubu - Mega Drive ModnessJan 11, 2023
- Coming soon...Dec 02, 2022
- Engineering, The FlowNov 06, 2022
- Getting On With It With David OberlinOct 14, 2022
- Let Me Start Over, AgainSep 27, 2022
- Slow, but steady.Sep 21, 2022
- Of A Sizeable ImprovementSep 12, 2022
- How to chooseSep 06, 2022
- Scope, scales and sizes.Aug 24, 2022
Leave a comment
Log in with itch.io to leave a comment.