Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
texturepaths.h
Go to the documentation of this file.
1// Luanti
2// SPDX-License-Identifier: LGPL-2.1-or-later
3// Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4
5#pragma once
6
7#include <string>
8#include <vector>
9
10// Texture paths get cached and this clears the Cache.
12
13// Find out the full path of an image by trying different filename extensions.
14// If failed, return "".
15std::string getImagePath(std::string_view path);
16
17/* Gets the path to a texture by first checking if the texture exists
18 * in texture_path and if not, using the data path.
19 *
20 * Checks all supported extensions by replacing the original extension.
21 *
22 * If not found, returns "".
23 *
24 * Utilizes a thread-safe cache.
25*/
26std::string getTexturePath(const std::string &filename, bool *is_base_pack = nullptr);
27
28// Returns all dictionaries found from the "texture_path" setting.
29std::vector<std::string> getTextureDirs();
std::vector< std::string > getTextureDirs()
Definition texturepaths.cpp:96
void clearTextureNameCache()
Definition texturepaths.cpp:16
std::string getTexturePath(const std::string &filename, bool *is_base_pack=nullptr)
Definition texturepaths.cpp:57
std::string getImagePath(std::string_view path)
Definition texturepaths.cpp:23