2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-08 22:27:43 +00:00

New code style refactor

This commit is contained in:
Jack Andersen
2018-12-07 19:30:43 -10:00
parent 41ae32be31
commit 636c82a568
1451 changed files with 171430 additions and 203303 deletions

View File

@@ -1,40 +1,33 @@
#include "CAudioGroupSet.hpp"
namespace urde
{
namespace urde {
amuse::AudioGroupData CAudioGroupSet::LoadData()
{
athena::io::MemoryReader r(m_buffer.get(), INT32_MAX);
x10_baseName = r.readString();
x20_name = r.readString();
amuse::AudioGroupData CAudioGroupSet::LoadData() {
athena::io::MemoryReader r(m_buffer.get(), INT32_MAX);
x10_baseName = r.readString();
x20_name = r.readString();
u8* buf = m_buffer.get() + r.position();
uint32_t poolLen = hecl::SBig(*reinterpret_cast<uint32_t*>(buf));
unsigned char* pool = buf + 4;
buf += poolLen + 4;
uint32_t projLen = hecl::SBig(*reinterpret_cast<uint32_t*>(buf));
unsigned char* proj = buf + 4;
buf += projLen + 4;
uint32_t sampLen = hecl::SBig(*reinterpret_cast<uint32_t*>(buf));
unsigned char* samp = buf + 4;
buf += sampLen + 4;
uint32_t sdirLen = hecl::SBig(*reinterpret_cast<uint32_t*>(buf));
unsigned char* sdir = buf + 4;
u8* buf = m_buffer.get() + r.position();
uint32_t poolLen = hecl::SBig(*reinterpret_cast<uint32_t*>(buf));
unsigned char* pool = buf + 4;
buf += poolLen + 4;
uint32_t projLen = hecl::SBig(*reinterpret_cast<uint32_t*>(buf));
unsigned char* proj = buf + 4;
buf += projLen + 4;
uint32_t sampLen = hecl::SBig(*reinterpret_cast<uint32_t*>(buf));
unsigned char* samp = buf + 4;
buf += sampLen + 4;
uint32_t sdirLen = hecl::SBig(*reinterpret_cast<uint32_t*>(buf));
unsigned char* sdir = buf + 4;
return {proj, projLen, pool, poolLen, sdir, sdirLen, samp, sampLen, amuse::GCNDataTag{}};
return {proj, projLen, pool, poolLen, sdir, sdirLen, samp, sampLen, amuse::GCNDataTag{}};
}
CAudioGroupSet::CAudioGroupSet(std::unique_ptr<u8[]>&& in)
: m_buffer(std::move(in)), m_data(LoadData())
{}
CAudioGroupSet::CAudioGroupSet(std::unique_ptr<u8[]>&& in) : m_buffer(std::move(in)), m_data(LoadData()) {}
CFactoryFnReturn FAudioGroupSetDataFactory(const urde::SObjectTag& tag,
std::unique_ptr<u8[]>&& in, u32 len,
const urde::CVParamTransfer& vparms,
CObjectReference* selfRef)
{
return TToken<CAudioGroupSet>::GetIObjObjectFor(std::make_unique<CAudioGroupSet>(std::move(in)));
CFactoryFnReturn FAudioGroupSetDataFactory(const urde::SObjectTag& tag, std::unique_ptr<u8[]>&& in, u32 len,
const urde::CVParamTransfer& vparms, CObjectReference* selfRef) {
return TToken<CAudioGroupSet>::GetIObjObjectFor(std::make_unique<CAudioGroupSet>(std::move(in)));
}
}
} // namespace urde