From 2b8bc3fd8ac5c5a07f33432761b0f758437d77b6 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Sun, 2 May 2021 15:06:38 -0700 Subject: [PATCH] Minor corrections, and fix memorycard corruption --- Runtime/Collision/CGameCollision.cpp | 28 +++++++++++++++++----------- Runtime/MP1/CMemoryCardDriver.cpp | 3 ++- extern/kabufuda | 2 +- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/Runtime/Collision/CGameCollision.cpp b/Runtime/Collision/CGameCollision.cpp index 512e3e625..577084fad 100644 --- a/Runtime/Collision/CGameCollision.cpp +++ b/Runtime/Collision/CGameCollision.cpp @@ -18,7 +18,9 @@ #include "TCastTo.hpp" // Generated file, do not modify include path namespace metaforce { - +namespace { +static constexpr bool skPlayerUsesNewColliderLogic = true; +} static float CollisionImpulseFiniteVsInfinite(float mass, float velNormDot, float restitution) { return mass * -(1.f + restitution) * velNormDot; } @@ -60,13 +62,16 @@ void CGameCollision::MovePlayer(CStateManager& mgr, CPhysicsActor& actor, float const rstl::reserved_vector* colliderList) { actor.SetAngularEnabled(true); actor.AddMotionState(actor.PredictAngularMotion(dt)); - if (actor.IsUseStandardCollider()) { - MoveAndCollide(mgr, actor, dt, CBallFilter(actor), colliderList); - } else { - if (actor.GetMaterialList().HasMaterial(EMaterialTypes::GroundCollider)) - CGroundMovement::MoveGroundCollider_New(mgr, actor, dt, colliderList); - else + if (!actor.IsUseStandardCollider()) { + if (!actor.GetMaterialList().HasMaterial(EMaterialTypes::GroundCollider)) { MoveAndCollide(mgr, actor, dt, CBallFilter(actor), colliderList); + } else if (skPlayerUsesNewColliderLogic) { + CGroundMovement::MoveGroundCollider_New(mgr, actor, dt, colliderList); + } else { + CGroundMovement::MoveGroundCollider(mgr, actor, dt, colliderList); + } + } else { + MoveAndCollide(mgr, actor, dt, CBallFilter(actor), colliderList); } actor.SetAngularEnabled(false); } @@ -722,13 +727,14 @@ bool CGameCollision::DetectDynamicCollisionMoving(const CCollisionPrimitive& pri return ret; } -bool CGameCollision::DetectCollision(const CStateManager& mgr, const CCollisionPrimitive& prim, const zeus::CTransform& xf, - const CMaterialFilter& filter, const rstl::reserved_vector& nearList, - TUniqueId& idOut, CCollisionInfoList& infoOut) { +bool CGameCollision::DetectCollision(const CStateManager& mgr, const CCollisionPrimitive& prim, + const zeus::CTransform& xf, const CMaterialFilter& filter, + const rstl::reserved_vector& nearList, TUniqueId& idOut, + CCollisionInfoList& infoOut) { bool ret = false; CMaterialList exclude = filter.ExcludeList(); if (!exclude.HasMaterial(EMaterialTypes::Occluder) && DetectStaticCollision(mgr, prim, xf, filter, infoOut)) { - ret = true; + ret = true; } TUniqueId tmpId = kInvalidUniqueId; diff --git a/Runtime/MP1/CMemoryCardDriver.cpp b/Runtime/MP1/CMemoryCardDriver.cpp index a1d14bb7c..d132609b8 100644 --- a/Runtime/MP1/CMemoryCardDriver.cpp +++ b/Runtime/MP1/CMemoryCardDriver.cpp @@ -32,8 +32,9 @@ ECardResult CMemoryCardDriver::SFileInfo::StartRead() { ECardResult CMemoryCardDriver::SFileInfo::TryFileRead() { ECardResult res = CMemoryCardSys::GetResultCode(GetFileCardPort()); - if (res == ECardResult::READY) + if (res == ECardResult::READY) { res = FileRead(); + } return res; } diff --git a/extern/kabufuda b/extern/kabufuda index 106bb02fb..1111fb483 160000 --- a/extern/kabufuda +++ b/extern/kabufuda @@ -1 +1 @@ -Subproject commit 106bb02fbf6e482af2621f9b5e3ea099fcf1d53a +Subproject commit 1111fb48397534f86c61db3b681cbcfef583f019