mirror of
https://github.com/RetroDECK/ES-DE.git
synced 2025-01-17 22:55:38 +00:00
The badge overlay images are now retained in the texture cache.
This commit is contained in:
parent
b3148a7f74
commit
a58153f08d
|
@ -137,6 +137,9 @@ void BadgeComponent::setBadges(const std::vector<BadgeInfo>& badges)
|
||||||
|
|
||||||
if (it2 != sGameControllers.cend()) {
|
if (it2 != sGameControllers.cend()) {
|
||||||
it->overlayImage.setImage((*it2).fileName);
|
it->overlayImage.setImage((*it2).fileName);
|
||||||
|
// This is done to keep the texture cache entry from expiring.
|
||||||
|
mOverlayMap[it2->shortName] =
|
||||||
|
std::make_unique<ImageComponent>(it->overlayImage);
|
||||||
}
|
}
|
||||||
else if (badge.gameController != "")
|
else if (badge.gameController != "")
|
||||||
it->overlayImage.setImage(sGameControllers.back().fileName);
|
it->overlayImage.setImage(sGameControllers.back().fileName);
|
||||||
|
|
|
@ -54,6 +54,9 @@ public:
|
||||||
private:
|
private:
|
||||||
static inline std::vector<GameControllers> sGameControllers;
|
static inline std::vector<GameControllers> sGameControllers;
|
||||||
|
|
||||||
|
// Used to keep the overlay texture cache entries from expiring.
|
||||||
|
std::map<std::string, std::unique_ptr<ImageComponent>> mOverlayMap;
|
||||||
|
|
||||||
std::vector<FlexboxComponent::FlexboxItem> mFlexboxItems;
|
std::vector<FlexboxComponent::FlexboxItem> mFlexboxItems;
|
||||||
FlexboxComponent mFlexboxComponent;
|
FlexboxComponent mFlexboxComponent;
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ public:
|
||||||
ImageComponent baseImage;
|
ImageComponent baseImage;
|
||||||
|
|
||||||
// Optional overlay image that can be sized and positioned relative to the base image.
|
// Optional overlay image that can be sized and positioned relative to the base image.
|
||||||
ImageComponent overlayImage {false, false};
|
ImageComponent overlayImage;
|
||||||
glm::vec2 overlayPosition {0.5f, 0.5f};
|
glm::vec2 overlayPosition {0.5f, 0.5f};
|
||||||
float overlaySize {0.5f};
|
float overlaySize {0.5f};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue