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

Remove normal map leftovers (#15609)

leftovers from #10487 / ed22260822
This commit is contained in:
grorp 2024-12-31 19:28:57 +01:00 committed by GitHub
parent a4d2633ac6
commit f54d209bc8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 0 additions and 32 deletions

View file

@ -121,7 +121,6 @@ public:
// Shall be called from the main thread.
void rebuildImagesAndTextures();
video::ITexture* getNormalTexture(const std::string &name);
video::SColor getTextureAverageColor(const std::string &name);
private:
@ -488,27 +487,6 @@ void TextureSource::rebuildTexture(video::IVideoDriver *driver, TextureInfo &ti)
m_texture_trash.push_back(t_old);
}
video::ITexture* TextureSource::getNormalTexture(const std::string &name)
{
if (isKnownSourceImage("override_normal.png"))
return getTexture("override_normal.png");
std::string fname_base = name;
static const char *normal_ext = "_normal.png";
static const u32 normal_ext_size = strlen(normal_ext);
size_t pos = fname_base.find('.');
std::string fname_normal = fname_base.substr(0, pos) + normal_ext;
if (isKnownSourceImage(fname_normal)) {
// look for image extension and replace it
size_t i = 0;
while ((i = fname_base.find('.', i)) != std::string::npos) {
fname_base.replace(i, 4, normal_ext);
i += normal_ext_size;
}
return getTexture(fname_base);
}
return nullptr;
}
video::SColor TextureSource::getTextureAverageColor(const std::string &name)
{
video::IVideoDriver *driver = RenderingEngine::get_video_driver();