Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Display: work on refactoring the main drawing system
Previously, every visible hex was iterated over and every element in that hex draw. This was inefficient for two reasons: First, it meant the performance footprint for many operations like unit drawing was O(n²), since the list of elements had to be checked for every single hex. Second, it meant the renderer had to switch active textures many more times than necessary. My new system involved drawing every element of a specific type at once - ie, all background terrains at once, all units, all items, etc. This reduces lookup time from O(n²) to O(n) and results in a noticeable performance increase. It also reduces the number of times the renderer needs to switch active textures, since bulk draws such as the map grid overlay are now done all at once while that specific texture is active. There are still some layering issues and missing elements that need to be sorted, especially in game_display.
- Loading branch information
Showing
6 changed files
with
378 additions
and
183 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.