Add new icon cache, for caching small images.

It doesn't try to insert or fetch missing things itself, re-fetching is up to the caller.

This will be required for handling the many achievement icons.

Saving/loading the cache to a single file on disk is implemented but not
hooked up yet. It works without it, though of course will have to
re-fetch things on the next startup.
This commit is contained in:
Henrik Rydgård 2023-06-18 12:10:52 +02:00
parent 9f88dbd656
commit 2bee5b64e4
6 changed files with 51 additions and 13 deletions

View file

@ -6,6 +6,7 @@
#include "Common/UI/UI.h"
#include "Common/UI/View.h"
#include "Common/UI/ViewGroup.h"
#include "Common/UI/IconCache.h"
#include "Common/Log.h"
#include "Common/TimeUtil.h"
@ -130,6 +131,7 @@ void ScreenManager::axis(const AxisInput &axis) {
void ScreenManager::deviceLost() {
for (auto &iter : stack_)
iter.screen->deviceLost();
g_iconCache.ClearTextures();
}
void ScreenManager::deviceRestored() {