Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overhaul map memory cache for tiles. #36392

Merged

Conversation

kevingranade
Copy link
Member

Summary

SUMMARY: None

Purpose of change

Fixes #36367
The cache in front of map memory never worked correctly, but due to another error that was fixed in #36338 this error was hidden. Essentially tiles, unlike curses, draws one map element at a time, and the cache for map memory was therefore being invoked multiple times. As a result of the cache being fixed, the first map element drawn would "win" instead of the final rendered tile being stored.

Describe the solution

Refrain from toggling the cache in the individual draw methods and instead only toggle it once all of the draw methods have been invoked.

Describe alternatives you've considered

In #36381 the whole map memory system is being overhauled, but I don't want to do something so invasive before 0.E.

Testing

Wander around and observe that furniture, vehicle parts and traps are drawn in map memory in addition to terrain.

@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Map Memory Performance issues, weird behavior, improvements to map memory feature labels Dec 24, 2019
@ZhilkinSerg ZhilkinSerg merged commit 62c50b3 into CleverRaven:master Dec 24, 2019
@kevingranade kevingranade deleted the overhaul-tiles-map-memory branch June 28, 2020 21:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Mechanics: Map Memory Performance issues, weird behavior, improvements to map memory feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Map memory that should be visible is invisible
2 participants