Fix linux build

This commit is contained in:
Phillip Stephens 2017-07-15 07:13:36 -07:00
parent e23a61876e
commit 70951275db
3 changed files with 6 additions and 8 deletions

View File

@ -19,7 +19,7 @@ void CDependencyGroup::ReadFromStream(CInputStream& in)
CFactoryFnReturn FDependencyGroupFactory(const SObjectTag& /*tag*/, CInputStream& in, const CVParamTransfer& /*param*/, CFactoryFnReturn FDependencyGroupFactory(const SObjectTag& /*tag*/, CInputStream& in, const CVParamTransfer& /*param*/,
CObjectReference* selfRef) CObjectReference* selfRef)
{ {
return TToken<CDependencyGroup>::GetIObjObjectFor(std::unique_ptr<CDependencyGroup>(new CDependencyGroup(in))); return TToken<CDependencyGroup>::GetIObjObjectFor(std::make_unique<CDependencyGroup>(in));
} }
} }

View File

@ -125,8 +125,8 @@ CCharacterFactory::CreateCharacter(int charIdx, bool loop,
({FourCC(drawInsts << 16), charInfo.GetModelId()}, charParm); ({FourCC(drawInsts << 16), charInfo.GetModelId()}, charParm);
rstl::optional_object<TToken<CMorphableSkinnedModel>> iceModel; rstl::optional_object<TToken<CMorphableSkinnedModel>> iceModel;
if (charInfo.GetIceModelId() != 0xffffffff && if (charInfo.GetIceModelId() != kInvalidResId &&
charInfo.GetIceSkinRulesId() != 0xffffffff) charInfo.GetIceSkinRulesId() != kInvalidResId)
iceModel.emplace(const_cast<CCharacterFactory*>(this)->x70_cacheResPool.GetObj iceModel.emplace(const_cast<CCharacterFactory*>(this)->x70_cacheResPool.GetObj
({FourCC((drawInsts << 16) | 1), charInfo.GetIceModelId()}, charParm)); ({FourCC((drawInsts << 16) | 1), charInfo.GetIceModelId()}, charParm));
@ -144,7 +144,7 @@ ResId CCharacterFactory::GetEventResourceIdForAnimResourceId(ResId id) const
return id == elem.first; return id == elem.first;
}); });
if (search == x58_animResources.cend()) if (search == x58_animResources.cend())
return -1; return kInvalidResId;
return search->second; return search->second;
} }
@ -162,10 +162,7 @@ bool CCharacterFactory::HasAdditiveInfo(u32 idx) const
{ {
auto search = rstl::binary_find(x40_additiveInfo.cbegin(), x40_additiveInfo.cend(), idx, auto search = rstl::binary_find(x40_additiveInfo.cbegin(), x40_additiveInfo.cend(), idx,
[](const auto& anim) { return anim.first; }); [](const auto& anim) { return anim.first; });
return search != x40_additiveInfo.cend();
if (search == x40_additiveInfo.cend())
return false;
return true;
} }
std::vector<CCharacterInfo> std::vector<CCharacterInfo>

View File

@ -2,6 +2,7 @@
#define __RSTL_HPP__ #define __RSTL_HPP__
#include <vector> #include <vector>
#include <algorithm>
#include <stdlib.h> #include <stdlib.h>
#include "optional.hpp" #include "optional.hpp"