Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Miscellaneous optimizations in display::get_terrain_images()
* The vector of surfaces is now a class member variable instead of a local variable. This saves a memory allocation every time the function is called - which is worth it in this case, as the function is a major performance bottleneck. * The surfaces are now being moved instead of copied where possible. Turns out that freeing a SDL surface is fairly expensive in performance-critical code. * Pointers to ToDs are now cached, reducing the number of calls to get_time_of_day() from 37 to 7. In a stress-test in Aetheryn's Mod at 50 % zoom, the FPS I was getting on my PC (Intel Core i5-4430) increased from 16 to 23.
- Loading branch information
Showing
5 changed files
with
47 additions
and
21 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
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
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
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
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