isle/LEGO1/mxdssound.cpp

64 lines
1.1 KiB
C++
Raw Normal View History

#include "mxdssound.h"
2023-10-24 19:38:27 -04:00
#include "legoutil.h"
2023-08-16 13:15:59 -04:00
DECOMP_SIZE_ASSERT(MxDSSound, 0xc0)
// OFFSET: LEGO1 0x100c92c0
MxDSSound::MxDSSound()
{
2023-10-24 19:38:27 -04:00
this->m_volume = 0x4f;
this->SetType(MxDSType_Sound);
}
// OFFSET: LEGO1 0x100c9470
MxDSSound::~MxDSSound()
{
}
2023-08-16 13:15:59 -04:00
// OFFSET: LEGO1 0x100c94c0
2023-10-24 19:38:27 -04:00
void MxDSSound::CopyFrom(MxDSSound& p_dsSound)
2023-08-16 13:15:59 -04:00
{
2023-10-24 19:38:27 -04:00
this->SetType(p_dsSound.GetType());
this->m_volume = p_dsSound.m_volume;
2023-08-16 13:15:59 -04:00
}
// OFFSET: LEGO1 0x100c94e0
2023-10-24 19:38:27 -04:00
MxDSSound& MxDSSound::operator=(MxDSSound& p_dsSound)
2023-08-16 13:15:59 -04:00
{
2023-10-24 19:38:27 -04:00
if (this == &p_dsSound)
return *this;
2023-08-16 13:15:59 -04:00
2023-10-24 19:38:27 -04:00
MxDSMediaAction::operator=(p_dsSound);
this->CopyFrom(p_dsSound);
return *this;
2023-08-16 13:15:59 -04:00
}
// OFFSET: LEGO1 0x100c95d0
MxU32 MxDSSound::GetSizeOnDisk()
{
2023-10-24 19:38:27 -04:00
MxU32 totalSizeOnDisk = MxDSMediaAction::GetSizeOnDisk();
2023-08-16 13:15:59 -04:00
2023-10-24 19:38:27 -04:00
this->m_sizeOnDisk = sizeof(this->m_volume);
return totalSizeOnDisk + 4;
2023-08-16 13:15:59 -04:00
}
// OFFSET: LEGO1 0x100c95a0
2023-10-24 19:38:27 -04:00
void MxDSSound::Deserialize(char** p_source, MxS16 p_unk24)
2023-08-16 13:15:59 -04:00
{
2023-10-24 19:38:27 -04:00
MxDSMediaAction::Deserialize(p_source, p_unk24);
2023-08-16 13:15:59 -04:00
2023-10-24 19:38:27 -04:00
GetScalar(p_source, this->m_volume);
2023-08-16 13:15:59 -04:00
}
// OFFSET: LEGO1 0x100c9510
2023-10-24 19:38:27 -04:00
MxDSAction* MxDSSound::Clone()
2023-08-16 13:15:59 -04:00
{
2023-10-24 19:38:27 -04:00
MxDSSound* clone = new MxDSSound();
2023-08-16 13:15:59 -04:00
2023-10-24 19:38:27 -04:00
if (clone)
*clone = *this;
2023-08-16 13:15:59 -04:00
2023-10-24 19:38:27 -04:00
return clone;
}