mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-06-09 06:18:05 -05:00
25 lines
521 B
C++
25 lines
521 B
C++
#include "loadedsound_actions.h"
|
|
|
|
#include <cstring>
|
|
|
|
using namespace IW5;
|
|
|
|
Actions_LoadedSound::Actions_LoadedSound(Zone* zone)
|
|
: AssetLoadingActions(zone)
|
|
{
|
|
}
|
|
|
|
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));
|
|
memcpy(sound->data, tempData, sound->info.data_len);
|
|
}
|
|
else
|
|
{
|
|
sound->data = nullptr;
|
|
}
|
|
}
|