2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-12-10 05:07:43 +00:00

RetroDataSpec: Make use of make_unique where applicable

Same behavior, but without a mildly wonky way of performing it.
This commit is contained in:
Lioncash
2020-03-31 12:50:26 -04:00
parent 53694481e5
commit 9ef2fbba5a
9 changed files with 82 additions and 77 deletions

View File

@@ -122,15 +122,15 @@ void ANIM::Enumerate<BigDNA::Read>(typename Read::StreamT& reader) {
atUint32 version = reader.readUint32Big();
switch (version) {
case 0:
m_anim.reset(new struct ANIM0);
m_anim = std::make_unique<ANIM0>();
m_anim->read(reader);
break;
case 2:
m_anim.reset(new struct ANIM2(false));
m_anim = std::make_unique<ANIM2>(false);
m_anim->read(reader);
break;
case 3:
m_anim.reset(new struct ANIM2(true));
m_anim = std::make_unique<ANIM2>(true);
m_anim->read(reader);
break;
default:
@@ -548,7 +548,7 @@ void ANIM::ANIM2::Enumerate<BigDNA::BinarySize>(size_t& __isz) {
ANIM::ANIM(const BlenderAction& act, const std::unordered_map<std::string, atInt32>& idMap,
const DNAANIM::RigInverter<CINF>& rig, bool pc) {
m_anim.reset(new struct ANIM2(pc));
m_anim = std::make_unique<ANIM2>(pc);
IANIM& newAnim = *m_anim;
newAnim.looping = act.looping;