mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-10 23:08:05 -05:00
chore: update all usages of memory manager allocation
This commit is contained in:
@ -19,6 +19,6 @@ void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image)
|
||||
{
|
||||
const size_t loadDefSize = offsetof(IW3::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->AllocRaw(loadDefSize));
|
||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ void Actions_LoadedSound::SetSoundData(MssSound* sound) const
|
||||
{
|
||||
if (sound->info.data_len > 0)
|
||||
{
|
||||
char* tempData = sound->data;
|
||||
sound->data = static_cast<char*>(m_zone->GetMemory()->Alloc(sound->info.data_len));
|
||||
const auto* tempData = sound->data;
|
||||
sound->data = m_zone->GetMemory()->Alloc<char>(sound->info.data_len);
|
||||
memcpy(sound->data, tempData, sound->info.data_len);
|
||||
}
|
||||
else
|
||||
|
@ -19,6 +19,6 @@ void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image)
|
||||
{
|
||||
const size_t loadDefSize = offsetof(IW4::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->AllocRaw(loadDefSize));
|
||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ void Actions_LoadedSound::SetSoundData(MssSound* sound) const
|
||||
{
|
||||
if (sound->info.data_len > 0)
|
||||
{
|
||||
char* tempData = sound->data;
|
||||
sound->data = static_cast<char*>(m_zone->GetMemory()->Alloc(sound->info.data_len));
|
||||
const auto* tempData = sound->data;
|
||||
sound->data = m_zone->GetMemory()->Alloc<char>(sound->info.data_len);
|
||||
memcpy(sound->data, tempData, sound->info.data_len);
|
||||
}
|
||||
else
|
||||
|
@ -10,8 +10,8 @@ Actions_clipMap_t::Actions_clipMap_t(Zone* zone)
|
||||
{
|
||||
}
|
||||
|
||||
void Actions_clipMap_t::ReallocClipInfo(ClipInfo* clipInfo, clipMap_t* clipMap) const
|
||||
void Actions_clipMap_t::ReallocClipInfo(const ClipInfo* clipInfo, clipMap_t* clipMap) const
|
||||
{
|
||||
clipMap->pInfo = static_cast<ClipInfo*>(m_zone->GetMemory()->Alloc(sizeof(ClipInfo)));
|
||||
clipMap->pInfo = m_zone->GetMemory()->Alloc<ClipInfo>();
|
||||
memcpy(clipMap->pInfo, clipInfo, sizeof(ClipInfo));
|
||||
}
|
||||
|
@ -10,6 +10,6 @@ namespace IW5
|
||||
public:
|
||||
explicit Actions_clipMap_t(Zone* zone);
|
||||
|
||||
void ReallocClipInfo(ClipInfo* clipInfo, clipMap_t* clipMap) const;
|
||||
void ReallocClipInfo(const ClipInfo* clipInfo, clipMap_t* clipMap) const;
|
||||
};
|
||||
} // namespace IW5
|
||||
|
@ -19,6 +19,6 @@ void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image)
|
||||
{
|
||||
const size_t loadDefSize = offsetof(IW5::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->AllocRaw(loadDefSize));
|
||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ void Actions_LoadedSound::SetSoundData(MssSound* sound) const
|
||||
if (sound->info.data_len > 0)
|
||||
{
|
||||
char* tempData = sound->data;
|
||||
sound->data = static_cast<char*>(m_zone->GetMemory()->Alloc(sound->info.data_len));
|
||||
sound->data = m_zone->GetMemory()->Alloc<char>(sound->info.data_len);
|
||||
memcpy(sound->data, tempData, sound->info.data_len);
|
||||
}
|
||||
else
|
||||
|
@ -19,6 +19,6 @@ void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image)
|
||||
{
|
||||
const size_t loadDefSize = offsetof(GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->AllocRaw(loadDefSize));
|
||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||
}
|
||||
|
@ -19,6 +19,6 @@ void Actions_GfxImage::LoadImageData(GfxImageLoadDef* loadDef, GfxImage* image)
|
||||
{
|
||||
const size_t loadDefSize = offsetof(T6::GfxImageLoadDef, data) + loadDef->resourceSize;
|
||||
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->Alloc(loadDefSize));
|
||||
image->texture.loadDef = static_cast<GfxImageLoadDef*>(m_zone->GetMemory()->AllocRaw(loadDefSize));
|
||||
memcpy(image->texture.loadDef, loadDef, loadDefSize);
|
||||
}
|
||||
|
Reference in New Issue
Block a user