Luanti 5.16.0-dev
Loading...
Searching...
No Matches
texturepaths.cpp File Reference
#include "texturepaths.h"
#include "util/container.h"
#include "util/thread.h"
#include "settings.h"
#include "filesys.h"
#include "porting.h"
#include <vector>
Include dependency graph for texturepaths.cpp:

Functions

void clearTextureNameCache ()
std::string getImagePath (std::string_view path)
std::string getTexturePath (const std::string &filename, bool *is_base_pack)
std::vector< std::string > getTextureDirs ()

Variables

static MutexedMap< std::string, std::string > g_texturename_to_path_cache
static MutexedVariable< std::vector< std::string > > g_texturedirs_cache

Function Documentation

◆ clearTextureNameCache()

void clearTextureNameCache ( )

References g_texturedirs_cache, and g_texturename_to_path_cache.

Referenced by Game::Game(), and Game::~Game().

Here is the caller graph for this function:

◆ getImagePath()

std::string getImagePath ( std::string_view path)

References fs::PathExists(), and removeStringEnd().

Referenced by getTexturePath(), and ModApiMainMenu::l_get_games().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTextureDirs()

std::vector< std::string > getTextureDirs ( )

References g_settings, g_texturedirs_cache, and fs::GetRecursiveDirs().

Referenced by getTexturePath().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getTexturePath()

std::string getTexturePath ( const std::string & filename,
bool * is_base_pack )

References DIR_DELIM, g_texturename_to_path_cache, getImagePath(), getTextureDirs(), and porting::path_share.

Referenced by SourceImageCache::getOrLoad(), SourceImageCache::insert(), and TextureSource::isKnownSourceImage().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ g_texturedirs_cache

MutexedVariable<std::vector<std::string> > g_texturedirs_cache
static

◆ g_texturename_to_path_cache

MutexedMap<std::string, std::string> g_texturename_to_path_cache
static