Various bug fixes

This commit is contained in:
Jack Andersen 2016-08-31 13:08:09 -10:00
parent 955d043c9e
commit 129767134e
6 changed files with 18 additions and 7 deletions

View File

@ -16,6 +16,7 @@
namespace urde
{
static logvisor::Module Log("urde::CModelData");
CModelData::~CModelData() {}
@ -26,6 +27,8 @@ CModelData::CModelData(const CStaticRes& res)
: x0_particleScale(res.GetScale())
{
x1c_normalModel = g_SimplePool->GetObj({SBIG('CMDL'), res.GetId()});
if (!x1c_normalModel)
Log.report(logvisor::Fatal, "unable to find CMDL %08X", res.GetId());
}
CModelData::CModelData(const CAnimRes& res)

View File

@ -33,6 +33,7 @@ public:
ResId GetId() const { return x0_cmdlId; }
const zeus::CVector3f& GetScale() const { return x4_scale; }
operator bool() const { return x0_cmdlId != 0; }
};
class CAnimRes

View File

@ -3,6 +3,7 @@
namespace urde
{
static logvisor::Module Log("urde::CSkinnedModel");
CSkinnedModel::CSkinnedModel(TLockedToken<CModel> model,
TLockedToken<CSkinRules> skinRules,
@ -10,6 +11,12 @@ CSkinnedModel::CSkinnedModel(TLockedToken<CModel> model,
int shaderIdx)
: x4_model(model), x10_skinRules(skinRules), x1c_layoutInfo(layoutInfo)
{
if (!model)
Log.report(logvisor::Fatal, "bad model token provided to CSkinnedModel");
if (!skinRules)
Log.report(logvisor::Fatal, "bad skin token provided to CSkinnedModel");
if (!layoutInfo)
Log.report(logvisor::Fatal, "bad character layout token provided to CSkinnedModel");
m_modelInst = model->MakeNewInstance(shaderIdx);
}

View File

@ -60,10 +60,10 @@ void CTweaks::RegisterResourceTweaks()
#else
ProjectResourceFactoryMP1& factory = ProjectManager::g_SharedManager->resourceFactoryMP1();
std::unique_ptr<CInputStream> strm;
SObjectTag tag = *factory.GetResourceIdByName("GunRes");
SObjectTag tag = factory.ProjectResourceFactoryBase::TagFromPath(_S("MP1/Tweaks/GunRes.yaml"));
strm.reset(new CMemoryInStream(factory.LoadResourceSync(tag).release(), factory.ResourceSize(tag)));
g_tweakGunRes = new DataSpec::DNAMP1::CTweakGunRes(*strm);
tag = *factory.GetResourceIdByName("GunRes");
tag = factory.ProjectResourceFactoryBase::TagFromPath(_S("MP1/Tweaks/PlayerRes.yaml"));
strm.reset(new CMemoryInStream(factory.LoadResourceSync(tag).release(), factory.ResourceSize(tag)));
g_tweakPlayerRes = new DataSpec::DNAMP1::CTweakPlayerRes(*strm);
#endif

View File

@ -298,16 +298,16 @@ void CWorldTransManager::TouchModels()
x4_modelData->x1c_samusModelData.AnimationData()->SetAnimation(aData, false);
}
if (x4_modelData->x1c_samusModelData.IsNull())
if (!x4_modelData->x1c_samusModelData.IsNull())
x4_modelData->x1c_samusModelData.Touch(CModelData::EWhichModel::Normal, 0);
if (x4_modelData->xb4_platformModelData.IsNull())
if (!x4_modelData->xb4_platformModelData.IsNull())
x4_modelData->xb4_platformModelData.Touch(CModelData::EWhichModel::Normal, 0);
if (x4_modelData->x100_bgModelData.IsNull())
if (!x4_modelData->x100_bgModelData.IsNull())
x4_modelData->x100_bgModelData.Touch(CModelData::EWhichModel::Normal, 0);
if (x4_modelData->x68_beamModelData.IsNull())
if (!x4_modelData->x68_beamModelData.IsNull())
x4_modelData->x68_beamModelData.Touch(CModelData::EWhichModel::Normal, 0);
}

2
hecl

@ -1 +1 @@
Subproject commit ab1df60c348335f9e3637ef21ac5dc8c6f563ad9
Subproject commit 172d1de275d05f1fc8d69dac0c193d7c8bcc78cd