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:
parent
7689f1f0fd
commit
03affa1bbb
15 changed files with 29 additions and 98 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue