It keeps rendered text so that we won't have to render it again - rendering is expensive, especially for complex stuff like the help windows. And some text images are reused a lot, e.g. the census and statistics strings.
* what is the cachek poliy (e.g. when will object be removed?)
Just like with the main image cache and the animation cache, objects are never removed. I guess we could have a flush function if the memory consumption should get too big and that could be called at strategic points, e.g. when switching between fullscreen menu and game.
* why do you use an (additional) std::unique_ptr if the make already makes this unique?
I don't know what you mean. Are you misreading make_pair as make_unique here?
* if its not small it deserverves some presizing.
You mean as is already done in texture_cache_(new TextureCache(kTextureCacheSize))?
I have also added comments to your in-line comments.
Thanks for taking on this review :)
* explian what this actually maps
It keeps rendered text so that we won't have to render it again - rendering is expensive, especially for complex stuff like the help windows. And some text images are reused a lot, e.g. the census and statistics strings.
* what is the cachek poliy (e.g. when will object be removed?)
Just like with the main image cache and the animation cache, objects are never removed. I guess we could have a flush function if the memory consumption should get too big and that could be called at strategic points, e.g. when switching between fullscreen menu and game.
* why do you use an (additional) std::unique_ptr if the make already makes this unique?
I don't know what you mean. Are you misreading make_pair as make_unique here?
* if its not small it deserverves some presizing.
You mean as is already done in texture_cache_(new TextureCache( kTextureCacheSi ze))?
I have also added comments to your in-line comments.