1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +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

@ -20,7 +20,10 @@ CImage::CImage(ECOLOR_FORMAT format, const core::dimension2d<u32> &size, void *d
IImage(format, size, deleteMemory)
{
if (ownForeignMemory) {
Data = (u8 *)data;
_IRR_DEBUG_BREAK_IF(!data)
Data = reinterpret_cast<u8*>(data);
if (reinterpret_cast<uintptr_t>(data) % sizeof(u32) != 0)
os::Printer::log("CImage created with foreign memory that's not aligned", ELL_WARNING);
} else {
const u32 dataSize = getDataSizeFromFormat(Format, Size.Width, Size.Height);
const u32 allocSize = align_next(dataSize, 16);