Skip to content

Commit

Permalink
Deprecate .bmp format
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Oct 27, 2023
1 parent 2f16227 commit 03ba937
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion doc/lua_api.md
Expand Up @@ -265,7 +265,7 @@ the clients (see [Translations]). Accepted characters for names are:

Accepted formats are:

images: .png, .jpg, .bmp, .tga
images: .png, .jpg, .tga, (deprecated:) .bmp
sounds: .ogg vorbis
models: .x, .b3d, .obj

Expand Down
7 changes: 7 additions & 0 deletions src/server.cpp
Expand Up @@ -2557,6 +2557,13 @@ 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.c_str(), filedata.length());

Expand Down

0 comments on commit 03ba937

Please sign in to comment.