chore: update all usages of memory manager allocation

This commit is contained in:
Jan
2024-04-22 21:21:31 +02:00
parent 0845cccd12
commit a3acba8bc0
51 changed files with 149 additions and 211 deletions

View File

@ -99,7 +99,7 @@ bool AssetLoaderGfxImage::LoadFromRaw(
for (auto mipLevel = 0; mipLevel < mipCount; mipLevel++)
dataSize += texture->GetSizeOfMipLevel(mipLevel) * faceCount;
auto* loadDef = static_cast<GfxImageLoadDef*>(zone->GetMemory()->Alloc(offsetof(GfxImageLoadDef, data) + dataSize));
auto* loadDef = static_cast<GfxImageLoadDef*>(zone->GetMemory()->AllocRaw(offsetof(GfxImageLoadDef, data) + dataSize));
image->texture.loadDef = loadDef;
loadDef->levelCount = static_cast<char>(mipCount);
loadDef->flags = 0;

View File

@ -31,7 +31,7 @@ bool AssetLoaderRawFile::LoadFromRaw(
rawFile->name = memory->Dup(assetName.c_str());
rawFile->len = static_cast<int>(file.m_length);
auto* fileBuffer = static_cast<char*>(memory->Alloc(static_cast<size_t>(file.m_length + 1)));
auto* fileBuffer = memory->Alloc<char>(static_cast<size_t>(file.m_length + 1));
file.m_stream->read(fileBuffer, file.m_length);
if (file.m_stream->gcount() != file.m_length)
return false;