mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-05 01:35:29 +01:00
Irrlicht: fix mipmaps regenerated multiple times
This commit is contained in:
@@ -186,11 +186,8 @@ public:
|
|||||||
You may want to call regenerateMipMapLevels() after this when you changed any data. */
|
You may want to call regenerateMipMapLevels() after this when you changed any data. */
|
||||||
virtual void unlock() = 0;
|
virtual void unlock() = 0;
|
||||||
|
|
||||||
//! Regenerates the mip map levels of the texture.
|
//! Regenerates the mip map levels of the texture. */
|
||||||
/** Required after modifying the texture, usually after calling unlock().
|
virtual void regenerateMipMapLevels() = 0;
|
||||||
\param layer It informs a texture about which cubemap or texture array layer
|
|
||||||
needs mipmap regeneration. */
|
|
||||||
virtual void regenerateMipMapLevels(u32 layer = 0) = 0;
|
|
||||||
|
|
||||||
//! Get original size of the texture.
|
//! Get original size of the texture.
|
||||||
/** The texture is usually scaled, if it was created with an unoptimal
|
/** The texture is usually scaled, if it was created with an unoptimal
|
||||||
|
|||||||
@@ -605,7 +605,7 @@ protected:
|
|||||||
|
|
||||||
void *lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel = 0, u32 layer = 0, E_TEXTURE_LOCK_FLAGS lockFlags = ETLF_FLIP_Y_UP_RTT) override { return 0; }
|
void *lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel = 0, u32 layer = 0, E_TEXTURE_LOCK_FLAGS lockFlags = ETLF_FLIP_Y_UP_RTT) override { return 0; }
|
||||||
void unlock() override {}
|
void unlock() override {}
|
||||||
void regenerateMipMapLevels(u32 layer = 0) override {}
|
void regenerateMipMapLevels() override {}
|
||||||
};
|
};
|
||||||
core::array<SSurface> Textures;
|
core::array<SSurface> Textures;
|
||||||
|
|
||||||
|
|||||||
@@ -115,8 +115,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (HasMipMaps) {
|
if (HasMipMaps) {
|
||||||
for (size_t i = 0; i < tmpImages->size(); ++i)
|
regenerateMipMapLevels();
|
||||||
regenerateMipMapLevels(i);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!KeepImage) {
|
if (!KeepImage) {
|
||||||
@@ -389,7 +388,7 @@ public:
|
|||||||
LockLayer = 0;
|
LockLayer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void regenerateMipMapLevels(u32 layer = 0) override
|
void regenerateMipMapLevels() override
|
||||||
{
|
{
|
||||||
if (!HasMipMaps || (Size.Width <= 1 && Size.Height <= 1))
|
if (!HasMipMaps || (Size.Width <= 1 && Size.Height <= 1))
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user