Minor corrections, and fix memorycard corruption

This commit is contained in:
Phillip Stephens 2021-05-02 15:06:38 -07:00
parent 6ad0e5cb37
commit 2b8bc3fd8a
Signed by: Antidote
GPG Key ID: F8BEE4C83DACA60D
3 changed files with 20 additions and 13 deletions

View File

@ -18,7 +18,9 @@
#include "TCastTo.hpp" // Generated file, do not modify include path #include "TCastTo.hpp" // Generated file, do not modify include path
namespace metaforce { namespace metaforce {
namespace {
static constexpr bool skPlayerUsesNewColliderLogic = true;
}
static float CollisionImpulseFiniteVsInfinite(float mass, float velNormDot, float restitution) { static float CollisionImpulseFiniteVsInfinite(float mass, float velNormDot, float restitution) {
return mass * -(1.f + restitution) * velNormDot; return mass * -(1.f + restitution) * velNormDot;
} }
@ -60,12 +62,15 @@ void CGameCollision::MovePlayer(CStateManager& mgr, CPhysicsActor& actor, float
const rstl::reserved_vector<TUniqueId, 1024>* colliderList) { const rstl::reserved_vector<TUniqueId, 1024>* colliderList) {
actor.SetAngularEnabled(true); actor.SetAngularEnabled(true);
actor.AddMotionState(actor.PredictAngularMotion(dt)); actor.AddMotionState(actor.PredictAngularMotion(dt));
if (actor.IsUseStandardCollider()) { if (!actor.IsUseStandardCollider()) {
if (!actor.GetMaterialList().HasMaterial(EMaterialTypes::GroundCollider)) {
MoveAndCollide(mgr, actor, dt, CBallFilter(actor), colliderList); MoveAndCollide(mgr, actor, dt, CBallFilter(actor), colliderList);
} else { } else if (skPlayerUsesNewColliderLogic) {
if (actor.GetMaterialList().HasMaterial(EMaterialTypes::GroundCollider))
CGroundMovement::MoveGroundCollider_New(mgr, actor, dt, colliderList); CGroundMovement::MoveGroundCollider_New(mgr, actor, dt, colliderList);
else } else {
CGroundMovement::MoveGroundCollider(mgr, actor, dt, colliderList);
}
} else {
MoveAndCollide(mgr, actor, dt, CBallFilter(actor), colliderList); MoveAndCollide(mgr, actor, dt, CBallFilter(actor), colliderList);
} }
actor.SetAngularEnabled(false); actor.SetAngularEnabled(false);
@ -722,9 +727,10 @@ bool CGameCollision::DetectDynamicCollisionMoving(const CCollisionPrimitive& pri
return ret; return ret;
} }
bool CGameCollision::DetectCollision(const CStateManager& mgr, const CCollisionPrimitive& prim, const zeus::CTransform& xf, bool CGameCollision::DetectCollision(const CStateManager& mgr, const CCollisionPrimitive& prim,
const CMaterialFilter& filter, const rstl::reserved_vector<TUniqueId, 1024>& nearList, const zeus::CTransform& xf, const CMaterialFilter& filter,
TUniqueId& idOut, CCollisionInfoList& infoOut) { const rstl::reserved_vector<TUniqueId, 1024>& nearList, TUniqueId& idOut,
CCollisionInfoList& infoOut) {
bool ret = false; bool ret = false;
CMaterialList exclude = filter.ExcludeList(); CMaterialList exclude = filter.ExcludeList();
if (!exclude.HasMaterial(EMaterialTypes::Occluder) && DetectStaticCollision(mgr, prim, xf, filter, infoOut)) { if (!exclude.HasMaterial(EMaterialTypes::Occluder) && DetectStaticCollision(mgr, prim, xf, filter, infoOut)) {

View File

@ -32,8 +32,9 @@ ECardResult CMemoryCardDriver::SFileInfo::StartRead() {
ECardResult CMemoryCardDriver::SFileInfo::TryFileRead() { ECardResult CMemoryCardDriver::SFileInfo::TryFileRead() {
ECardResult res = CMemoryCardSys::GetResultCode(GetFileCardPort()); ECardResult res = CMemoryCardSys::GetResultCode(GetFileCardPort());
if (res == ECardResult::READY) if (res == ECardResult::READY) {
res = FileRead(); res = FileRead();
}
return res; return res;
} }

2
extern/kabufuda vendored

@ -1 +1 @@
Subproject commit 106bb02fbf6e482af2621f9b5e3ea099fcf1d53a Subproject commit 1111fb48397534f86c61db3b681cbcfef583f019