diff --git a/es-app/src/views/gamelist/GridGameListView.h b/es-app/src/views/gamelist/GridGameListView.h index b89852271..2c2f50458 100644 --- a/es-app/src/views/gamelist/GridGameListView.h +++ b/es-app/src/views/gamelist/GridGameListView.h @@ -72,11 +72,9 @@ protected: private: void updateInfoPanel(); - const std::string getImagePath(FileData* file); void initMDLabels(); - void initMDValues(); ImageComponent mMarquee; diff --git a/es-core/src/components/BadgesComponent.cpp b/es-core/src/components/BadgesComponent.cpp index 7ef09ec25..9a28fa3c9 100644 --- a/es-core/src/components/BadgesComponent.cpp +++ b/es-core/src/components/BadgesComponent.cpp @@ -30,19 +30,19 @@ BadgesComponent::BadgesComponent(Window* window) mImageComponents = std::map(); ImageComponent mImageFavorite = ImageComponent(window); - mImageFavorite.setImage(mBadgeIcons[SLOT_FAVORITE], false, true, true); + mImageFavorite.setImage(mBadgeIcons[SLOT_FAVORITE], false, true); mImageComponents.insert({SLOT_FAVORITE, mImageFavorite}); ImageComponent mImageCompleted = ImageComponent(window); - mImageCompleted.setImage(mBadgeIcons[SLOT_COMPLETED], false, true, true); + mImageCompleted.setImage(mBadgeIcons[SLOT_COMPLETED], false, true); mImageComponents.insert({SLOT_COMPLETED, mImageCompleted}); ImageComponent mImageKids = ImageComponent(window); - mImageKids.setImage(mBadgeIcons[SLOT_KIDS], false, true, true); + mImageKids.setImage(mBadgeIcons[SLOT_KIDS], false, true); mImageComponents.insert({SLOT_KIDS, mImageKids}); ImageComponent mImageBroken = ImageComponent(window); - mImageBroken.setImage(mBadgeIcons[SLOT_BROKEN], false, true, true); + mImageBroken.setImage(mBadgeIcons[SLOT_BROKEN], false, true); mImageComponents.insert({SLOT_BROKEN, mImageBroken}); ImageComponent mImageAltEmu = ImageComponent(window); - mImageAltEmu.setImage(mBadgeIcons[SLOT_ALTERNATIVE_EMULATOR], false, true, true); + mImageAltEmu.setImage(mBadgeIcons[SLOT_ALTERNATIVE_EMULATOR], false, true); mImageComponents.insert({SLOT_ALTERNATIVE_EMULATOR, mImageAltEmu}); } @@ -99,7 +99,7 @@ void BadgesComponent::applyTheme(const std::shared_ptr& theme, if (properties & PATH && elem->has(slot) && mBadgeIcons[slot] != elem->get(slot)) { mBadgeIcons[slot] = elem->get(slot); - mImageComponents.find(slot)->second.setImage(mBadgeIcons[slot], false, true, true); + mImageComponents.find(slot)->second.setImage(mBadgeIcons[slot], false, true); imgChanged = true; } } diff --git a/es-core/src/components/ImageComponent.cpp b/es-core/src/components/ImageComponent.cpp index e3009b888..f6c2d2af2 100644 --- a/es-core/src/components/ImageComponent.cpp +++ b/es-core/src/components/ImageComponent.cpp @@ -138,7 +138,7 @@ void ImageComponent::resize() onSizeChanged(); } -void ImageComponent::setImage(std::string path, bool tile, bool linearMagnify, bool cacheImage) +void ImageComponent::setImage(std::string path, bool tile, bool linearMagnify) { // Always load bundled graphic resources statically, unless mForceLoad has been set. // This eliminates annoying texture pop-in problems that would otherwise occur. @@ -150,12 +150,11 @@ void ImageComponent::setImage(std::string path, bool tile, bool linearMagnify, b if (mDefaultPath.empty() || !ResourceManager::getInstance()->fileExists(mDefaultPath)) mTexture.reset(); else - mTexture = TextureResource::get(mDefaultPath, tile, mForceLoad, mDynamic, linearMagnify, - 1.0f, cacheImage); + mTexture = + TextureResource::get(mDefaultPath, tile, mForceLoad, mDynamic, linearMagnify); } else { - mTexture = - TextureResource::get(path, tile, mForceLoad, mDynamic, linearMagnify, 1.0f, cacheImage); + mTexture = TextureResource::get(path, tile, mForceLoad, mDynamic, linearMagnify); } resize(); diff --git a/es-core/src/components/ImageComponent.h b/es-core/src/components/ImageComponent.h index 60ba89cd9..159d65e3b 100644 --- a/es-core/src/components/ImageComponent.h +++ b/es-core/src/components/ImageComponent.h @@ -18,20 +18,15 @@ class ImageComponent : public GuiComponent { public: ImageComponent(Window* window, bool forceLoad = false, bool dynamic = true); - virtual ~ImageComponent() {}; + virtual ~ImageComponent() {} void setDefaultImage(std::string path) { mDefaultPath = path; } // Loads the image at the given filepath. Will tile if tile is true (retrieves texture // as tiling, creates vertices accordingly). - void setImage(std::string path, - bool tile = false, - bool linearMagnify = false, - bool cacheSVG = false); - + void setImage(std::string path, bool tile = false, bool linearMagnify = false); // Loads an image from memory. void setImage(const char* data, size_t length, bool tile = false); - // Use an already existing texture. void setImage(const std::shared_ptr& texture, bool resizeTexture = true); diff --git a/es-core/src/resources/TextureResource.cpp b/es-core/src/resources/TextureResource.cpp index 0b5272464..74e5d5bfe 100644 --- a/es-core/src/resources/TextureResource.cpp +++ b/es-core/src/resources/TextureResource.cpp @@ -148,8 +148,7 @@ std::shared_ptr TextureResource::get(const std::string& path, bool forceLoad, bool dynamic, bool linearMagnify, - float scaleDuringLoad, - bool cacheImage) + float scaleDuringLoad) { std::shared_ptr& rm = ResourceManager::getInstance(); @@ -177,7 +176,7 @@ std::shared_ptr TextureResource::get(const std::string& path, std::shared_ptr data = sTextureDataManager.get(tex.get()); // Is it an SVG? - if (key.first.substr(key.first.size() - 4, std::string::npos) != ".svg" || cacheImage) { + if (key.first.substr(key.first.size() - 4, std::string::npos) != ".svg") { // Probably not. Add it to our map. We don't add SVGs because 2 SVGs might be // rasterized at different sizes. sTextureMap[key] = std::weak_ptr(tex); diff --git a/es-core/src/resources/TextureResource.h b/es-core/src/resources/TextureResource.h index 39d096d6d..223d60fcc 100644 --- a/es-core/src/resources/TextureResource.h +++ b/es-core/src/resources/TextureResource.h @@ -30,9 +30,7 @@ public: bool forceLoad = false, bool dynamic = true, bool linearMagnify = false, - float scaleDuringLoad = 1.0f, - bool cacheImage = false); - + float scaleDuringLoad = 1.0f); void initFromPixels(const unsigned char* dataRGBA, size_t width, size_t height); virtual void initFromMemory(const char* data, size_t length); static void manualUnload(std::string path, bool tile);