1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Remove BMP image support (#15434)

Co-authored-by: Lars Mueller <appgurulars@gmx.de>
This commit is contained in:
sfan5 2024-11-15 12:21:30 +01:00 committed by GitHub
parent 46f0baff09
commit 11837d4623
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 6 additions and 713 deletions

View file

@ -765,7 +765,7 @@ bool Client::loadMedia(const std::string &data, const std::string &filename,
std::string name;
const char *image_ext[] = {
".png", ".jpg", ".bmp", ".tga",
".png", ".jpg", ".tga",
NULL
};
name = removeStringEnd(filename, image_ext);

View file

@ -22,10 +22,8 @@ void clearTextureNameCache()
// If failed, return "".
std::string getImagePath(std::string_view path)
{
// A NULL-ended list of possible image extensions
// (In newer C++ versions a fixed size array and ranges::subrange could be used
// or just modernise removeStringEnd.)
static const char *extensions[] = {".png", ".jpg", ".bmp", ".tga", nullptr};
// possible image extensions
static const char *extensions[] = {".png", ".jpg", ".tga", nullptr};
// Remove present extension
std::string_view stripped_path = removeStringEnd(path, extensions);

View file

@ -2521,7 +2521,7 @@ bool Server::addMediaFile(const std::string &filename,
}
// If name is not in a supported format, ignore it
const char *supported_ext[] = {
".png", ".jpg", ".bmp", ".tga",
".png", ".jpg", ".tga",
".ogg",
".x", ".b3d", ".obj", ".gltf", ".glb",
// Translation file formats
@ -2547,13 +2547,6 @@ bool Server::addMediaFile(const std::string &filename,
return false;
}
const char *deprecated_ext[] = { ".bmp", nullptr };
if (!removeStringEnd(filename, deprecated_ext).empty())
{
warningstream << "Media file \"" << filename << "\" is using a"
" deprecated format and will stop working in the future." << std::endl;
}
SHA1 sha1;
sha1.addBytes(filedata);