summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-29 14:30:51 +0100
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2024-01-29 14:30:51 +0100
commitaf0dc52db16a0e1a0d11fcba45e21dfbbedfce5c (patch)
tree09ea59c7984803154df5728ed829ecbbc6dade3b
parent59ee2d9dc81b2ed89f073b1541fc8d8c4f1f28f8 (diff)
downloadmana-client-af0dc52db16a0e1a0d11fcba45e21dfbbedfce5c.tar.gz
mana-client-af0dc52db16a0e1a0d11fcba45e21dfbbedfce5c.tar.bz2
mana-client-af0dc52db16a0e1a0d11fcba45e21dfbbedfce5c.tar.xz
mana-client-af0dc52db16a0e1a0d11fcba45e21dfbbedfce5c.zip
Removed remnants of alpha cache in ResourceManager
Continuation of 2c51c98625b225cecfb9628c30d62d4e30f7e3e1, which had already removed most of the alpha cache in Image.
-rw-r--r--src/gui/gui.cpp3
-rw-r--r--src/resources/resourcemanager.cpp22
-rw-r--r--src/resources/resourcemanager.h13
3 files changed, 0 insertions, 38 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index e0487d95..fd8f38ea 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -176,9 +176,6 @@ Gui::~Gui()
void Gui::logic()
{
- ResourceManager *resman = ResourceManager::getInstance();
- resman->clearScheduled();
-
// Fade out mouse cursor after extended inactivity
if (mMouseInactivityTimer < 100 * 15)
{
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index a810a11e..71d9ca1c 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -536,25 +536,3 @@ std::vector<std::string> ResourceManager::loadTextFile(
free(fileContents);
return lines;
}
-
-SDL_Surface *ResourceManager::loadSDLSurface(const std::string &filename)
-{
- SDL_Surface *surface = nullptr;
- if (SDL_RWops *rw = PHYSFSRWOPS_openRead(filename.c_str()))
- surface = IMG_Load_RW(rw, 1);
- return surface;
-}
-
-void ResourceManager::scheduleDelete(SDL_Surface* surface)
-{
- mDeletedSurfaces.insert(surface);
-}
-
-void ResourceManager::clearScheduled()
-{
- for (auto mDeletedSurface : mDeletedSurfaces)
- {
- SDL_FreeSurface(mDeletedSurface);
- }
- mDeletedSurfaces.clear();
-}
diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h
index a087082d..9a427ba0 100644
--- a/src/resources/resourcemanager.h
+++ b/src/resources/resourcemanager.h
@@ -26,7 +26,6 @@
#include <map>
#include <string>
#include <vector>
-#include <set>
class Image;
class ImageSet;
@@ -35,7 +34,6 @@ class Resource;
class SoundEffect;
class SpriteDef;
-struct SDL_Surface;
struct SDL_RWops;
/**
@@ -208,16 +206,6 @@ class ResourceManager
std::vector<std::string> loadTextFile(const std::string &fileName);
/**
- * Loads the given filename as an SDL surface. The returned surface is
- * expected to be freed by the caller using SDL_FreeSurface.
- */
- SDL_Surface *loadSDLSurface(const std::string &filename);
-
- void scheduleDelete(SDL_Surface* surface);
-
- void clearScheduled();
-
- /**
* Returns an instance of the class, creating one if it does not
* already exist.
*/
@@ -251,7 +239,6 @@ class ResourceManager
static ResourceManager *instance;
using Resources = std::map<std::string, Resource *>;
using ResourceIterator = Resources::iterator;
- std::set<SDL_Surface*> mDeletedSurfaces;
Resources mResources;
Resources mOrphanedResources;
time_t mOldestOrphan;