2024-10-28 15:57:39 +01:00
|
|
|
// Luanti
|
|
|
|
// SPDX-License-Identifier: LGPL-2.1-or-later
|
|
|
|
// Copyright (C) 2010-2013 celeron55, Perttu Ahola <celeron55@gmail.com>
|
2024-02-27 10:56:22 +01:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
// Texture paths get cached and this clears the Cache.
|
|
|
|
void clearTextureNameCache();
|
|
|
|
|
|
|
|
// Find out the full path of an image by trying different filename extensions.
|
|
|
|
// If failed, return "".
|
2024-02-27 19:03:46 +01:00
|
|
|
std::string getImagePath(std::string_view path);
|
2024-02-27 10:56:22 +01:00
|
|
|
|
|
|
|
/* Gets the path to a texture by first checking if the texture exists
|
|
|
|
* in texture_path and if not, using the data path.
|
|
|
|
*
|
|
|
|
* Checks all supported extensions by replacing the original extension.
|
|
|
|
*
|
|
|
|
* If not found, returns "".
|
|
|
|
*
|
|
|
|
* Utilizes a thread-safe cache.
|
|
|
|
*/
|
|
|
|
std::string getTexturePath(const std::string &filename, bool *is_base_pack = nullptr);
|
|
|
|
|
|
|
|
// Returns all dictionaries found from the "texture_path" setting.
|
|
|
|
std::vector<std::string> getTextureDirs();
|