diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-03-14 13:56:57 +0100 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2025-03-17 13:47:42 +0100 |
commit | 4d8a5ed01560cde4e2c3caa819cb165dc7ac3df6 (patch) | |
tree | 4dc68e5c517e05ae0c1c89477bced774bdb67016 /src | |
parent | 2a8355942f7e4127ac911588c9893b4d6c5a82f8 (diff) | |
download | mana-4d8a5ed01560cde4e2c3caa819cb165dc7ac3df6.tar.gz mana-4d8a5ed01560cde4e2c3caa819cb165dc7ac3df6.tar.bz2 mana-4d8a5ed01560cde4e2c3caa819cb165dc7ac3df6.tar.xz mana-4d8a5ed01560cde4e2c3caa819cb165dc7ac3df6.zip |
Don't call static ResourceManager methods through instance
Diffstat (limited to 'src')
-rw-r--r-- | src/client.cpp | 17 | ||||
-rw-r--r-- | src/gui/gui.cpp | 8 |
2 files changed, 10 insertions, 15 deletions
diff --git a/src/client.cpp b/src/client.cpp index df8f1e23..6017bbdc 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -220,8 +220,6 @@ Client::Client(const Options &options): SDL_SetHint(SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH, "1"); - ResourceManager *resman = ResourceManager::getInstance(); - if (!FS::setWriteDir(mLocalDataDir)) { logger->error(strprintf("%s couldn't be set as write directory! " @@ -233,9 +231,8 @@ Client::Client(const Options &options): #else mPackageDir = PKG_DATADIR "data"; #endif - resman->addToSearchPath(mPackageDir, false); - - resman->addToSearchPath("data", false); + ResourceManager::addToSearchPath(mPackageDir, false); + ResourceManager::addToSearchPath("data", false); // Add branding/data to PhysFS search path if (!options.brandingPath.empty()) @@ -251,15 +248,15 @@ Client::Client(const Options &options): int loc = path.find_last_of('/'); #endif if (loc > 0) - resman->addToSearchPath(path.substr(0, loc + 1) + "data", false); + ResourceManager::addToSearchPath(path.substr(0, loc + 1) + "data", false); } // Add the main data directories to our PhysicsFS search path if (!options.dataPath.empty()) - resman->addToSearchPath(options.dataPath, false); + ResourceManager::addToSearchPath(options.dataPath, false); // Add the local data directory to PhysicsFS search path - resman->addToSearchPath(mLocalDataDir, false); + ResourceManager::addToSearchPath(mLocalDataDir, false); bool useOpenGL = !mOptions.noOpenGL && config.opengl; @@ -287,7 +284,7 @@ Client::Client(const Options &options): #else iconFile += ".png"; #endif - iconFile = resman->getPath(iconFile); + iconFile = ResourceManager::getPath(iconFile); logger->log("Loading icon from file: %s", iconFile.c_str()); #ifdef _WIN32 static SDL_SysWMinfo pInfo; @@ -667,7 +664,7 @@ int Client::exec() if (mOptions.dataPath.empty()) { // Add customdata directory - ResourceManager::getInstance()->searchAndAddArchives( + ResourceManager::searchAndAddArchives( "customdata/", "zip", false); diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp index 90f12672..f9a36472 100644 --- a/src/gui/gui.cpp +++ b/src/gui/gui.cpp @@ -80,12 +80,10 @@ Gui::Gui(Graphics *graphics, const std::string &themePath) Window::setWindowContainer(guiTop); setTop(guiTop); - ResourceManager *resman = ResourceManager::getInstance(); - // Set global font const int fontSize = config.fontSize; std::string fontFile = branding.getValue("font", "fonts/dejavusans.ttf"); - std::string path = resman->getPath(fontFile); + std::string path = ResourceManager::getPath(fontFile); // Initialize the font scale before creating the fonts TrueTypeFont::updateFontScale(graphics->getScale()); @@ -103,7 +101,7 @@ Gui::Gui(Graphics *graphics, const std::string &themePath) // Set bold font fontFile = branding.getValue("boldFont", "fonts/dejavusans-bold.ttf"); - path = resman->getPath(fontFile); + path = ResourceManager::getPath(fontFile); try { boldFont = new TrueTypeFont(path, fontSize); @@ -116,7 +114,7 @@ Gui::Gui(Graphics *graphics, const std::string &themePath) // Set mono font fontFile = branding.getValue("monoFont", "fonts/dejavusans-mono.ttf"); - path = resman->getPath(fontFile); + path = ResourceManager::getPath(fontFile); try { monoFont = new TrueTypeFont(path, fontSize); |