1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-26 18:21:04 +00:00

Some minor code cleanups

This commit is contained in:
sfan5 2025-03-31 18:01:51 +02:00
parent 7689f1f0fd
commit 03affa1bbb
15 changed files with 29 additions and 98 deletions

View file

@ -897,6 +897,8 @@ video::IImage* CGUITTFont::createTextureFromChar(const char32_t& ch)
// Acquire a read-only lock of the corresponding page texture.
void* ptr = tex->lock(video::ETLM_READ_ONLY);
if (!ptr)
return nullptr;
video::ECOLOR_FORMAT format = tex->getColorFormat();
core::dimension2du tex_size = tex->getOriginalSize();

View file

@ -200,9 +200,13 @@ namespace gui
//! Updates the texture atlas with new glyphs.
void updateTexture()
{
if (!dirty) return;
if (!dirty)
return;
void* ptr = texture->lock();
if (!ptr)
return;
video::ECOLOR_FORMAT format = texture->getColorFormat();
core::dimension2du size = texture->getOriginalSize();
video::IImage* pageholder = driver->createImageFromData(format, size, ptr, true, false);