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

macOS decal rendering support

This commit is contained in:
Jack Andersen
2018-03-16 17:41:01 -10:00
parent 08569104c2
commit 7100ed437f
22 changed files with 1613 additions and 105 deletions

View File

@@ -182,6 +182,32 @@ CCollisionResponseData::CCollisionResponseData(CInputStream& in, CSimplePool* re
const rstl::optional_object<TLockedToken<CGenDescription>>&
CCollisionResponseData::GetParticleDescription(EWeaponCollisionResponseTypes type) const
{
if (x0_generators[u32(type)])
return x0_generators[u32(type)];
bool foundType = false;
if (ResponseTypeIsEnemyNormal(type))
{
type = EWeaponCollisionResponseTypes::EnemyNormal;
foundType = true;
}
else if (ResponseTypeIsEnemySpecial(type))
{
type = EWeaponCollisionResponseTypes::EnemySpecial;
foundType = true;
}
else if (ResponseTypeIsEnemyShielded(type))
{
type = EWeaponCollisionResponseTypes::EnemyShielded;
foundType = true;
}
if (foundType && !x0_generators[u32(type)])
type = EWeaponCollisionResponseTypes::EnemyNormal;
if (!x0_generators[u32(type)] && type != EWeaponCollisionResponseTypes::None)
type = EWeaponCollisionResponseTypes::Default;
return x0_generators[u32(type)];
}
@@ -210,9 +236,8 @@ s32 CCollisionResponseData::GetSoundEffectId(EWeaponCollisionResponseTypes type)
EWeaponCollisionResponseTypes CCollisionResponseData::GetWorldCollisionResponseType(s32 id)
{
if (id < 0 || id >= s32(EWeaponCollisionResponseTypes::Unknown32))
if (id < 0 || id >= 32)
return EWeaponCollisionResponseTypes::Default;
return skWorldMaterialTable[id];
}