From 1c44f8d1bc8c0b45745087aa2f8c0e0a55be4c8a Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 18 Dec 2017 17:05:50 -1000 Subject: [PATCH] Various movement and HUD bug fixes --- CMakeLists.txt | 9 ++++++++- Runtime/CPlayerState.cpp | 2 +- Runtime/CStateManager.cpp | 13 +++++++++---- Runtime/CStateManager.hpp | 1 + Runtime/Camera/CBallCamera.cpp | 2 +- Runtime/Camera/CBallCamera.hpp | 4 ++-- Runtime/Camera/CGameCamera.cpp | 2 +- Runtime/Character/CActorLights.cpp | 6 +++--- Runtime/Character/CActorLights.hpp | 2 +- Runtime/Character/CGroundMovement.cpp | 8 ++++---- Runtime/Collision/CMaterialList.hpp | 4 ++-- Runtime/Collision/CMetroidAreaCollider.cpp | 5 +++++ Runtime/Graphics/CModelBoo.cpp | 2 +- Runtime/GuiSys/CGuiFrame.cpp | 8 ++++---- Runtime/MP1/CMFGame.cpp | 4 ++++ Runtime/MP1/CSamusHud.cpp | 16 ++++++++++------ Runtime/MP1/CSamusHud.hpp | 1 - Runtime/MkCastTo.py | 3 +-- Runtime/World/CEffect.cpp | 2 +- Runtime/World/CFishCloud.cpp | 2 +- Runtime/World/CMorphBall.cpp | 8 ++++---- Runtime/World/CPlayer.cpp | 8 ++------ Runtime/World/CScriptAiJumpPoint.cpp | 2 +- Runtime/World/CScriptCameraHint.cpp | 2 +- Runtime/World/CScriptCameraWaypoint.cpp | 2 +- Runtime/World/CScriptCoverPoint.cpp | 2 +- Runtime/World/CScriptDebugCameraWaypoint.cpp | 2 +- Runtime/World/CScriptPlatform.cpp | 2 +- Runtime/World/CScriptPlayerHint.cpp | 2 +- Runtime/World/CScriptSound.cpp | 2 +- .../World/CScriptSpiderBallAttractionSurface.cpp | 2 +- Runtime/World/CScriptSpiderBallWaypoint.cpp | 2 +- Runtime/World/CScriptTargetingPoint.cpp | 2 +- Runtime/World/CScriptTrigger.cpp | 6 ++++-- Runtime/World/CScriptVisorFlare.cpp | 2 +- hecl | 2 +- specter | 2 +- 37 files changed, 84 insertions(+), 62 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 03179062b..3aacf683a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,12 @@ cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17 -cmake_policy(SET CMP0054 NEW) + +if(APPLE AND NOT CMAKE_OSX_SYSROOT) + # If the Xcode SDK is lagging behind system version, CMake needs this done first + execute_process(COMMAND xcrun --show-sdk-path + OUTPUT_VARIABLE CMAKE_OSX_SYSROOT + OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() + project(urde) set(CMAKE_CXX_STANDARD 17) diff --git a/Runtime/CPlayerState.cpp b/Runtime/CPlayerState.cpp index 365061dc6..b9f3abe93 100644 --- a/Runtime/CPlayerState.cpp +++ b/Runtime/CPlayerState.cpp @@ -410,7 +410,7 @@ void CPlayerState::InitializePowerUp(CPlayerState::EItemType type, u32 capacity) return; CPowerUp& pup = x24_powerups[(u32)type]; - pup.x0_amount = zeus::clamp(u32(0), pup.x4_capacity + capacity, PowerUpMaxValues[u32(type)]); + pup.x4_capacity = zeus::clamp(u32(0), pup.x4_capacity + capacity, PowerUpMaxValues[u32(type)]); pup.x0_amount = std::min(pup.x0_amount, pup.x4_capacity); if (type >= EItemType::PowerSuit && type <= EItemType::PhazonSuit) { diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 52d832329..1c63551c2 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -437,6 +437,8 @@ void CStateManager::SetActorAreaId(CActor& actor, TAreaId aid) area->GetAreaObjects()->RemoveObject(actor.GetUniqueId()); } + actor.x4_areaId = aid; + if (aid == kInvalidAreaId) return; CGameArea* area = x850_world->GetArea(aid); @@ -1825,6 +1827,13 @@ void CStateManager::ProcessInput(const CFinalInput& input) x870_cameraManager->ProcessInput(input, *this); } +void CStateManager::UpdateGraphicsTiming(float dt) +{ + xf14_curTimeMod900 += dt; + if (xf14_curTimeMod900 > 900.f) + xf14_curTimeMod900 -= 900.f; +} + void CStateManager::Update(float dt) { CElementGen::SetGlobalSeed(x8d8_updateFrameIdx); @@ -1832,10 +1841,6 @@ void CStateManager::Update(float dt) CDecal::SetGlobalSeed(x8d8_updateFrameIdx); CProjectileWeapon::SetGlobalSeed(x8d8_updateFrameIdx); - xf14_curTimeMod900 += dt; - if (xf14_curTimeMod900 > 900.f) - xf14_curTimeMod900 -= 900.f; - xf08_pauseHudMessage = {}; CScriptEffect::ResetParticleCounts(); diff --git a/Runtime/CStateManager.hpp b/Runtime/CStateManager.hpp index 2c3bf02d8..f6c4cbd11 100644 --- a/Runtime/CStateManager.hpp +++ b/Runtime/CStateManager.hpp @@ -329,6 +329,7 @@ public: void SetGameState(EGameState state); EGameState GetGameState() const { return x904_gameState; } void ProcessInput(const CFinalInput& input); + void UpdateGraphicsTiming(float dt); void Update(float dt); void UpdateGameState(); void UpdateHintState(float dt); diff --git a/Runtime/Camera/CBallCamera.cpp b/Runtime/Camera/CBallCamera.cpp index 8a56f6f35..1d86e6085 100644 --- a/Runtime/Camera/CBallCamera.cpp +++ b/Runtime/Camera/CBallCamera.cpp @@ -606,7 +606,7 @@ void CBallCamera::CheckFailsafe(float dt, CStateManager& mgr) else { x18c_31_clearLOS = true; - x350_obscuringMaterial = CMaterialList(EMaterialTypes::Unknown); + x350_obscuringMaterial = CMaterialList(EMaterialTypes::NoStepLogic); } if (!x18c_31_clearLOS) diff --git a/Runtime/Camera/CBallCamera.hpp b/Runtime/Camera/CBallCamera.hpp index 00debe500..313d55494 100644 --- a/Runtime/Camera/CBallCamera.hpp +++ b/Runtime/Camera/CBallCamera.hpp @@ -149,7 +149,7 @@ private: float x330_clearColliderThreshold = 0.2f; zeus::CAABox x334_collidersAABB = zeus::CAABox::skNullBox; float x34c_obscuredTime = 0.f; - CMaterialList x350_obscuringMaterial = {EMaterialTypes::Unknown}; + CMaterialList x350_obscuringMaterial = {EMaterialTypes::NoStepLogic}; float x358_unobscureMag = 0.f; zeus::CVector3f x35c_splineIntermediatePos; TUniqueId x368_obscuringObjectId = kInvalidUniqueId; @@ -158,7 +158,7 @@ private: float x374_splineCtrl = 0.f; float x378_splineCtrlRange; CCameraSpline x37c_camSpline; - CMaterialList x3c8_collisionExcludeList = {EMaterialTypes::Unknown}; + CMaterialList x3c8_collisionExcludeList = {EMaterialTypes::NoStepLogic}; bool x3d0_24_camBehindFloorOrWall : 1; float x3d4_elevInterpTimer = 0.f; float x3d8_elevInterpStart = 0.f; diff --git a/Runtime/Camera/CGameCamera.cpp b/Runtime/Camera/CGameCamera.cpp index e1d73d8c7..f2b6c1222 100644 --- a/Runtime/Camera/CGameCamera.cpp +++ b/Runtime/Camera/CGameCamera.cpp @@ -9,7 +9,7 @@ namespace urde CGameCamera::CGameCamera(TUniqueId uid, bool active, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, float fovy, float znear, float zfar, float aspect, TUniqueId watchedId, bool disableInput, u32 controllerIdx) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId) , xe8_watchedObject(watchedId) , x12c_(xf) diff --git a/Runtime/Character/CActorLights.cpp b/Runtime/Character/CActorLights.cpp index af41f6e0c..2f302a3e9 100644 --- a/Runtime/Character/CActorLights.cpp +++ b/Runtime/Character/CActorLights.cpp @@ -317,7 +317,7 @@ bool CActorLights::BuildAreaLightList(const CStateManager& mgr, const CGameArea& std::sort(valList.begin(), valList.end(), [](const SLightValue& a, const SLightValue& b) { - return a.x10_colorMag >= b.x10_colorMag; + return a.x10_colorMag > b.x10_colorMag; }); if (x298_27_findShadowLight) @@ -333,12 +333,12 @@ bool CActorLights::BuildAreaLightList(const CStateManager& mgr, const CGameArea& } /* Ambient color for overflow area lights */ - zeus::CColor overflowAmbColor; + zeus::CColor overflowAmbColor = zeus::CColor::skClear; /* Averaged light for overflow area lights */ CLight overflowLight = CLight::BuildCustom(zeus::CVector3f::skZero, zeus::CVector3f::skZero, zeus::CColor::skBlack, 0.f, 0.f, 0.f, 0.f, 0.f, 0.f); - zeus::CColor overflowLightColor; + zeus::CColor overflowLightColor = zeus::CColor::skClear; float overflowMag = 0.f; /* Max significant lights */ diff --git a/Runtime/Character/CActorLights.hpp b/Runtime/Character/CActorLights.hpp index f3401de91..d503de2fb 100644 --- a/Runtime/Character/CActorLights.hpp +++ b/Runtime/Character/CActorLights.hpp @@ -18,7 +18,7 @@ class CActorLights static s32 sFrameSchedulerCount; std::vector x0_areaLights; std::vector x144_dynamicLights; - zeus::CColor x288_ambientColor; + zeus::CColor x288_ambientColor = zeus::CColor::skBlack; TAreaId x294_aid = kInvalidAreaId; union diff --git a/Runtime/Character/CGroundMovement.cpp b/Runtime/Character/CGroundMovement.cpp index 65a636f6c..48a8dc722 100644 --- a/Runtime/Character/CGroundMovement.cpp +++ b/Runtime/Character/CGroundMovement.cpp @@ -398,7 +398,7 @@ void CGroundMovement::MoveGroundCollider_New(CStateManager& mgr, CPhysicsActor& float stepUp = player.GetStepUpHeight(); bool doStepDown = true; - CMaterialList material(EMaterialTypes::Unknown); + CMaterialList material(EMaterialTypes::NoStepLogic); SMoveObjectResult result; if (!startingJump) @@ -437,7 +437,8 @@ void CGroundMovement::MoveGroundCollider_New(CStateManager& mgr, CPhysicsActor& CMaterialList material2 = MoveObjectAnalytical(mgr, actor, dt, useNearList, cache, opts, result); CPhysicsState physStatePost = actor.GetPhysicsState(); - if (material2.XOR({EMaterialTypes::Unknown})) + /* NoStepLogic must be the only set material bit to bypass step logic */ + if (material2.XOR({EMaterialTypes::NoStepLogic})) { SMovementOptions optsCopy = opts; zeus::CVector3f postToPre = physStatePre.GetTranslation() - physStatePost.GetTranslation(); @@ -802,11 +803,10 @@ CMaterialList CGroundMovement::MoveObjectAnalytical(CStateManager& mgr, CPhysics { if (actor.x15c_force.canBeNormalized()) { + zeus::CVector3f prevForce = actor.x15c_force; actor.x15c_force = CGroundMovement::CollisionDamping(actor.x15c_force, actor.x15c_force.normalized(), collisionNorm, 0.f, 1.f); - if (actor.x15c_force.z < -1000000.f) - printf(""); } if (actor.x150_momentum.canBeNormalized()) { diff --git a/Runtime/Collision/CMaterialList.hpp b/Runtime/Collision/CMaterialList.hpp index 81ae2bb6b..2d30bacac 100644 --- a/Runtime/Collision/CMaterialList.hpp +++ b/Runtime/Collision/CMaterialList.hpp @@ -7,7 +7,7 @@ namespace urde { enum class EMaterialTypes { - Unknown = 0, + NoStepLogic = 0, Stone = 1, Metal = 2, Grass = 3, @@ -27,7 +27,7 @@ enum class EMaterialTypes Sand = 17, ProjectilePassthrough = 18, Solid = 19, - Twenty = 20, + NoPlatformCollision = 20, CameraPassthrough = 21, Wood = 22, Organic = 23, diff --git a/Runtime/Collision/CMetroidAreaCollider.cpp b/Runtime/Collision/CMetroidAreaCollider.cpp index 645626438..05268adf9 100644 --- a/Runtime/Collision/CMetroidAreaCollider.cpp +++ b/Runtime/Collision/CMetroidAreaCollider.cpp @@ -664,6 +664,11 @@ bool CMetroidAreaCollider::MovingAABoxCollisionCheck_BoxVertexTri(const CCollisi { pointOut = float(d) * dir + point; normalOut = surf.GetNormal(); + if (normalOut.z > 100.f) + { + printf(""); + normalOut = surf.GetNormal(); + } ret = true; } } diff --git a/Runtime/Graphics/CModelBoo.cpp b/Runtime/Graphics/CModelBoo.cpp index f179fd787..aa8b6f1d5 100644 --- a/Runtime/Graphics/CModelBoo.cpp +++ b/Runtime/Graphics/CModelBoo.cpp @@ -177,7 +177,7 @@ CBooModel::CBooModel(TToken& token, CModel* parent, std::vectorm_data.matIdx; const MaterialSet::Material& matData = GetMaterialByIndex(matId); - if (matData.flags.depthSorting()) + if (matData.flags.depthSorting() || matData.heclIr.m_doAlpha) { it->m_next = x3c_firstSortedSurface; x3c_firstSortedSurface = &*it; diff --git a/Runtime/GuiSys/CGuiFrame.cpp b/Runtime/GuiSys/CGuiFrame.cpp index 2ce9c8722..d04ed6d9d 100644 --- a/Runtime/GuiSys/CGuiFrame.cpp +++ b/Runtime/GuiSys/CGuiFrame.cpp @@ -71,13 +71,13 @@ void CGuiFrame::EnableLights(u32 lights, CBooModel& model) const } if ((lights & (1 << idx)) != 0) { - const zeus::CColor& geomCol = light->GetGeometryColor(); - if (geomCol.r || geomCol.g || geomCol.b) - { + //const zeus::CColor& geomCol = light->GetGeometryColor(); + //if (geomCol.r || geomCol.g || geomCol.b) + //{ //CGraphics::LoadLight(lightId, light->BuildLight()); lightsOut.push_back(light->BuildLight()); CGraphics::EnableLight(lightId); - } + //} // accumulate ambient color ambColor += light->GetAmbientLightColor(); } diff --git a/Runtime/MP1/CMFGame.cpp b/Runtime/MP1/CMFGame.cpp index 723d485a6..6993aad89 100644 --- a/Runtime/MP1/CMFGame.cpp +++ b/Runtime/MP1/CMFGame.cpp @@ -33,6 +33,10 @@ CIOWin::EMessageReturn CMFGame::OnMessage(const CArchitectureMessage& msg, CArch bool wasInitialized = x2a_24_initialized; x2a_24_initialized = true; float dt = MakeMsg::GetParmTimerTick(msg).x4_parm; + + /* URDE addition: this is continuously updated for animated UVs even when game paused */ + x14_stateManager->UpdateGraphicsTiming(dt); + switch (x1c_flowState) { case EGameFlowState::CinematicSkip: diff --git a/Runtime/MP1/CSamusHud.cpp b/Runtime/MP1/CSamusHud.cpp index 50ae27d16..4567786e7 100644 --- a/Runtime/MP1/CSamusHud.cpp +++ b/Runtime/MP1/CSamusHud.cpp @@ -825,9 +825,10 @@ void CSamusHud::UpdateHudDynamicLights(float dt, const CStateManager& mgr) return; x33c_lights->BuildAreaLightList(mgr, *mgr.GetWorld()->GetAreaAlways(playerArea), camAABB); for (SCachedHudLight& light : x340_hudLights) - if ((light.x0_pos - fpCam->GetTranslation()).normalized().dot(lookDir) > 0.15707964f) - if (!IsCachedLightInAreaLights(light, *x33c_lights)) - light.x1c_fader *= -1.f; + if (light.x1c_fader > 0.f && + ((light.x0_pos - fpCam->GetTranslation()).normalized().dot(lookDir) <= 0.15707964f || + !IsCachedLightInAreaLights(light, *x33c_lights))) + light.x1c_fader *= -1.f; int negCount = 0; for (SCachedHudLight& light : x340_hudLights) if (light.x1c_fader <= 0.f) @@ -835,6 +836,8 @@ void CSamusHud::UpdateHudDynamicLights(float dt, const CStateManager& mgr) --negCount; for (const CLight& light : x33c_lights->GetAreaLights()) { + if (negCount < 1) + break; if (IsAreaLightInCachedLights(light)) continue; if ((light.GetPosition() - fpCam->GetTranslation()).normalized().dot(lookDir) > 0.15707964f) @@ -842,6 +845,7 @@ void CSamusHud::UpdateHudDynamicLights(float dt, const CStateManager& mgr) int slot = FindEmptyHudLightSlot(light); if (slot == -1) continue; + --negCount; SCachedHudLight& cachedLight = x340_hudLights[slot]; cachedLight.x0_pos = light.GetPosition(); cachedLight.xc_color = light.GetColor(); @@ -856,8 +860,8 @@ void CSamusHud::UpdateHudDynamicLights(float dt, const CStateManager& mgr) for (SCachedHudLight& light : x340_hudLights) { if (light.x1c_fader < 0.f) - light.x1c_fader = std::max(0.f, light.x1c_fader + dt2); - else if (light.x1c_fader < 1.f && light.x1c_fader != 0) + light.x1c_fader = std::min(0.f, light.x1c_fader + dt2); + else if (light.x1c_fader < 1.f && light.x1c_fader != 0.f) light.x1c_fader = std::min(light.x1c_fader + dt2, 1.f); } @@ -879,7 +883,7 @@ void CSamusHud::UpdateHudDynamicLights(float dt, const CStateManager& mgr) for (int i=0 ; i<3 ; ++i) { SCachedHudLight& light = x340_hudLights[i]; - CGuiLight* lightWidget = *lightIt; + CGuiLight* lightWidget = *lightIt++; zeus::CVector3f lightToCam = fpCam->GetTranslation() - light.x0_pos; zeus::CVector3f lightNormal = fpCam->GetTransform().buildMatrix3f() * lightToCam.normalized(); float dist = std::max(lightToCam.magnitude(), FLT_EPSILON); diff --git a/Runtime/MP1/CSamusHud.hpp b/Runtime/MP1/CSamusHud.hpp index 499cf0499..7007a4b53 100644 --- a/Runtime/MP1/CSamusHud.hpp +++ b/Runtime/MP1/CSamusHud.hpp @@ -126,7 +126,6 @@ class CSamusHud u32 x2d4_totalEnergyTanks = 0; u32 x2d8_missileAmount = 0; u32 x2dc_missileCapacity = 0; - rstl::reserved_vector x340_lights; union { diff --git a/Runtime/MkCastTo.py b/Runtime/MkCastTo.py index 8ae8bea57..2665d09e4 100644 --- a/Runtime/MkCastTo.py +++ b/Runtime/MkCastTo.py @@ -188,8 +188,7 @@ for tp in CENTITY_TYPES: sourcef.write('''template void TCastToPtr::Visit(%s* p) { - static_assert(sizeof(T) > 0, "TCastToPtr can not cast to incomplete type"); - static_assert(!std::is_void::value, "TCastToPtr can not cast to incomplete type"); + static_assert(sizeof(T) > 0 && !std::is_void::value, "TCastToPtr can not cast to incomplete type"); ptr = reinterpret_cast(std::is_convertible<%s*, T*>::value ? p : nullptr); } diff --git a/Runtime/World/CEffect.cpp b/Runtime/World/CEffect.cpp index 5825b7c61..3f9d5924c 100644 --- a/Runtime/World/CEffect.cpp +++ b/Runtime/World/CEffect.cpp @@ -5,7 +5,7 @@ namespace urde { CEffect::CEffect(TUniqueId uid, const CEntityInfo& info, bool active, std::string_view name, const zeus::CTransform& xf) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId) { } diff --git a/Runtime/World/CFishCloud.cpp b/Runtime/World/CFishCloud.cpp index ea9322277..5c039d626 100644 --- a/Runtime/World/CFishCloud.cpp +++ b/Runtime/World/CFishCloud.cpp @@ -10,7 +10,7 @@ CFishCloud::CFishCloud(TUniqueId uid, bool active, std::string_view name, const float f7, float f8, float f9, float f10, float f11, float f12, float f13, u32 w2, const zeus::CColor& color, bool b1, float f14, CAssetId part1, u32 w3, CAssetId part2, u32 w4, CAssetId part3, u32 w5, CAssetId part4, u32 w6, u32 w7, bool b2, bool b3) -: CActor(uid, active, name, info, xf, std::move(mData), {EMaterialTypes::Unknown}, +: CActor(uid, active, name, info, xf, std::move(mData), {EMaterialTypes::NoStepLogic}, CActorParameters::None(), kInvalidUniqueId) { diff --git a/Runtime/World/CMorphBall.cpp b/Runtime/World/CMorphBall.cpp index 3c1f70b1d..f7af5ee9c 100644 --- a/Runtime/World/CMorphBall.cpp +++ b/Runtime/World/CMorphBall.cpp @@ -2016,7 +2016,7 @@ void CMorphBall::CollidedWith(TUniqueId id, const CCollisionInfoList& list, CSta zeus::CVector3f vel = x0_player.GetVelocity(); float velMag = vel.magnitude(); - EMaterialTypes wakeMaterial = EMaterialTypes::Unknown; + EMaterialTypes wakeMaterial = EMaterialTypes::NoStepLogic; if (velMag > 7.f && x0_player.GetFluidCounter() == 0) { bool hitWall = false; @@ -2037,7 +2037,7 @@ void CMorphBall::CollidedWith(TUniqueId id, const CCollisionInfoList& list, CSta } } - if (wakeMaterial == EMaterialTypes::Unknown) + if (wakeMaterial == EMaterialTypes::NoStepLogic) { if (info.GetMaterialLeft().HasMaterial(EMaterialTypes::Floor)) { @@ -2063,7 +2063,7 @@ void CMorphBall::CollidedWith(TUniqueId id, const CCollisionInfoList& list, CSta tmpMaterial = EMaterialTypes::Phazon; wakeMaterial = tmpMaterial; - if (tmpMaterial != EMaterialTypes::Unknown) + if (tmpMaterial != EMaterialTypes::NoStepLogic) { int mappedIdx = skWakeEffectMap[int(tmpMaterial)]; if (mappedIdx == 0) // Phazon @@ -2098,7 +2098,7 @@ void CMorphBall::CollidedWith(TUniqueId id, const CCollisionInfoList& list, CSta } } - if (wakeMaterial == EMaterialTypes::Unknown && x1c0c_wakeEffectIdx != -1) + if (wakeMaterial == EMaterialTypes::NoStepLogic && x1c0c_wakeEffectIdx != -1) x1bc8_wakeEffectGens[int(wakeMaterial)]->SetParticleEmission(false); x1954_isProjectile = false; diff --git a/Runtime/World/CPlayer.cpp b/Runtime/World/CPlayer.cpp index 445265e1f..15bbbbbba 100644 --- a/Runtime/World/CPlayer.cpp +++ b/Runtime/World/CPlayer.cpp @@ -1762,9 +1762,6 @@ void CPlayer::ProcessInput(const CFinalInput& input, CStateManager& mgr) if (input.ControllerIdx() != 0) return; - if (input.PLTrigger()) - Teleport(zeus::CTransform::Translate(-73.1577f, 155.273f, 0.f), mgr, true); - if (x2f8_morphBallState != EPlayerMorphBallState::Morphed) UpdateScanningState(input, mgr, input.DeltaTime()); @@ -5774,9 +5771,8 @@ float CPlayer::ForwardInput(const CFinalInput& input, float turnInput) const zeus::CVector3f velFlat = x138_velocity; velFlat.z = 0.f; if (x3dc_inFreeLook || x3dd_lookButtonHeld) - if (x258_movementState != EPlayerMovementState::OnGround) - if (std::fabs(velFlat.magnitude()) < 0.00001f) - return 0.f; + if (x258_movementState == EPlayerMovementState::OnGround || std::fabs(velFlat.magnitude()) < 0.00001f) + return 0.f; } return zeus::clamp(-1.f, forwards - backwards * g_tweakPlayer->GetBackwardsForceMultiplier(), 1.f); diff --git a/Runtime/World/CScriptAiJumpPoint.cpp b/Runtime/World/CScriptAiJumpPoint.cpp index af1974c6a..b88976cf4 100644 --- a/Runtime/World/CScriptAiJumpPoint.cpp +++ b/Runtime/World/CScriptAiJumpPoint.cpp @@ -8,7 +8,7 @@ namespace urde { CScriptAiJumpPoint::CScriptAiJumpPoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, zeus::CTransform& xf, bool active, float f1) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId) , xe8_(f1) { diff --git a/Runtime/World/CScriptCameraHint.cpp b/Runtime/World/CScriptCameraHint.cpp index 1e424eb90..491af57e4 100644 --- a/Runtime/World/CScriptCameraHint.cpp +++ b/Runtime/World/CScriptCameraHint.cpp @@ -14,7 +14,7 @@ CScriptCameraHint::CScriptCameraHint(TUniqueId uid, std::string_view name, const float fov, float attitudeRange, float azimuthRange, float anglePerSecond, float clampVelRange, float f9, float elevation, float f11, float clampVelTime, float controlInterpDur) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId), xe8_priority(priority), xec_hint(overrideFlags, behaviour, minDist, maxDist, backwardsDist, lookAtOffset, chaseLookAtOffset, ballToCam, fov, attitudeRange, azimuthRange, anglePerSecond, clampVelRange, f9, elevation, f11, clampVelTime, diff --git a/Runtime/World/CScriptCameraWaypoint.cpp b/Runtime/World/CScriptCameraWaypoint.cpp index e97216808..8812444d5 100644 --- a/Runtime/World/CScriptCameraWaypoint.cpp +++ b/Runtime/World/CScriptCameraWaypoint.cpp @@ -8,7 +8,7 @@ namespace urde CScriptCameraWaypoint::CScriptCameraWaypoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, bool active, float hfov, u32 w1) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId) , xe8_hfov(hfov) , xec_(w1) diff --git a/Runtime/World/CScriptCoverPoint.cpp b/Runtime/World/CScriptCoverPoint.cpp index fd2021fdf..2698cfedc 100644 --- a/Runtime/World/CScriptCoverPoint.cpp +++ b/Runtime/World/CScriptCoverPoint.cpp @@ -8,7 +8,7 @@ namespace urde CScriptCoverPoint::CScriptCoverPoint(TUniqueId uid, std::string_view name, const CEntityInfo &info, zeus::CTransform xf, bool active, u32 flags, bool crouch, float horizontalAngle, float verticalAngle, float coverTime) : CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), - CMaterialList(EMaterialTypes::Unknown), CActorParameters::None(), kInvalidUniqueId), + CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId), xe8_flags(flags), xf4_coverTime(coverTime) { diff --git a/Runtime/World/CScriptDebugCameraWaypoint.cpp b/Runtime/World/CScriptDebugCameraWaypoint.cpp index af5375de9..16d75a4ef 100644 --- a/Runtime/World/CScriptDebugCameraWaypoint.cpp +++ b/Runtime/World/CScriptDebugCameraWaypoint.cpp @@ -6,7 +6,7 @@ namespace urde CScriptDebugCameraWaypoint::CScriptDebugCameraWaypoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, u32 w1) -: CActor(uid, true, name, info, xf, CModelData::CModelDataNull(), {EMaterialTypes::Unknown}, +: CActor(uid, true, name, info, xf, CModelData::CModelDataNull(), {EMaterialTypes::NoStepLogic}, CActorParameters::None(), kInvalidUniqueId), xe8_w1(w1) { } diff --git a/Runtime/World/CScriptPlatform.cpp b/Runtime/World/CScriptPlatform.cpp index 23aa40f14..444b2d259 100644 --- a/Runtime/World/CScriptPlatform.cpp +++ b/Runtime/World/CScriptPlatform.cpp @@ -31,7 +31,7 @@ CScriptPlatform::CScriptPlatform(TUniqueId uid, std::string_view name, const CEn { CActor::SetMaterialFilter(CMaterialFilter::MakeIncludeExclude( CMaterialList(EMaterialTypes::Solid), - CMaterialList(EMaterialTypes::NoStaticCollision, EMaterialTypes::Twenty, EMaterialTypes::Platform))); + CMaterialList(EMaterialTypes::NoStaticCollision, EMaterialTypes::NoPlatformCollision, EMaterialTypes::Platform))); if (x304_treeGroupContainer) x314_treeGroup = std::make_unique(x304_treeGroupContainer->GetObj(), x68_material); } diff --git a/Runtime/World/CScriptPlayerHint.cpp b/Runtime/World/CScriptPlayerHint.cpp index 642ad2763..a3c44931b 100644 --- a/Runtime/World/CScriptPlayerHint.cpp +++ b/Runtime/World/CScriptPlayerHint.cpp @@ -10,7 +10,7 @@ namespace urde CScriptPlayerHint::CScriptPlayerHint(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, bool active, u32 priority, u32 overrideFlags) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), {EMaterialTypes::Unknown}, +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), {EMaterialTypes::NoStepLogic}, CActorParameters::None(), kInvalidUniqueId), x100_priority(priority), x104_overrideFlags(overrideFlags) {} diff --git a/Runtime/World/CScriptSound.cpp b/Runtime/World/CScriptSound.cpp index ad029c81b..d9a93018a 100644 --- a/Runtime/World/CScriptSound.cpp +++ b/Runtime/World/CScriptSound.cpp @@ -14,7 +14,7 @@ CScriptSound::CScriptSound(TUniqueId uid, std::string_view name, const CEntityIn u16 soundId, bool active, float maxDist, float distComp, float startDelay, u32 minVol, u32 vol, u32 w3, u32 prio, u32 pan, u32 w6, bool looped, bool nonEmitter, bool autoStart, bool occlusionTest, bool acoustics, bool worldSfx, bool allowDuplicates, s32 pitch) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId) , xfc_startDelay(startDelay) , x100_soundId(CSfxManager::TranslateSFXID(soundId)) diff --git a/Runtime/World/CScriptSpiderBallAttractionSurface.cpp b/Runtime/World/CScriptSpiderBallAttractionSurface.cpp index 157ded208..5ce95a2e5 100644 --- a/Runtime/World/CScriptSpiderBallAttractionSurface.cpp +++ b/Runtime/World/CScriptSpiderBallAttractionSurface.cpp @@ -8,7 +8,7 @@ namespace urde CScriptSpiderBallAttractionSurface::CScriptSpiderBallAttractionSurface( TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, const zeus::CVector3f& scale, bool active) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), {EMaterialTypes::Unknown}, +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), {EMaterialTypes::NoStepLogic}, CActorParameters::None(), kInvalidUniqueId), xe8_scale(scale), xf4_aabb(zeus::CAABox(scale * -0.5f, scale * 0.5f).getTransformedAABox(xf.getRotation())) { diff --git a/Runtime/World/CScriptSpiderBallWaypoint.cpp b/Runtime/World/CScriptSpiderBallWaypoint.cpp index 1865094f5..672cd6694 100644 --- a/Runtime/World/CScriptSpiderBallWaypoint.cpp +++ b/Runtime/World/CScriptSpiderBallWaypoint.cpp @@ -7,7 +7,7 @@ namespace urde { CScriptSpiderBallWaypoint::CScriptSpiderBallWaypoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, bool active, u32 w1) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId) , xe8_(w1) { diff --git a/Runtime/World/CScriptTargetingPoint.cpp b/Runtime/World/CScriptTargetingPoint.cpp index d9808b1fd..9954821da 100644 --- a/Runtime/World/CScriptTargetingPoint.cpp +++ b/Runtime/World/CScriptTargetingPoint.cpp @@ -7,7 +7,7 @@ namespace urde CScriptTargetingPoint::CScriptTargetingPoint(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, bool active) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId) { } diff --git a/Runtime/World/CScriptTrigger.cpp b/Runtime/World/CScriptTrigger.cpp index 8a4eedec3..38ab722cd 100644 --- a/Runtime/World/CScriptTrigger.cpp +++ b/Runtime/World/CScriptTrigger.cpp @@ -148,9 +148,10 @@ void CScriptTrigger::UpdateInhabitants(float dt, CStateManager& mgr) } else { + TUniqueId tmpId = it->GetObjectId(); xe8_inhabitants.erase(it); sendExited = true; - if (mgr.GetPlayer().GetUniqueId() == it->GetObjectId() && x148_28_playerTriggerProc) + if (mgr.GetPlayer().GetUniqueId() == tmpId && x148_28_playerTriggerProc) { x148_28_playerTriggerProc = false; if (x148_29_didPhazonDamage) @@ -168,8 +169,9 @@ void CScriptTrigger::UpdateInhabitants(float dt, CStateManager& mgr) } else { + TUniqueId tmpId = it->GetObjectId(); xe8_inhabitants.erase(it); - if (mgr.GetPlayer().GetUniqueId() == it->GetObjectId() && x148_28_playerTriggerProc) + if (mgr.GetPlayer().GetUniqueId() == tmpId && x148_28_playerTriggerProc) { x148_28_playerTriggerProc = false; if (x148_29_didPhazonDamage) diff --git a/Runtime/World/CScriptVisorFlare.cpp b/Runtime/World/CScriptVisorFlare.cpp index 32e8baf47..466d29a00 100644 --- a/Runtime/World/CScriptVisorFlare.cpp +++ b/Runtime/World/CScriptVisorFlare.cpp @@ -13,7 +13,7 @@ CScriptVisorFlare::CScriptVisorFlare(TUniqueId uid, std::string_view name, const bool b1, float f1, float f2, float f3, u32 w1, u32 w2, const std::vector& flares) : CActor(uid, active, name, info, zeus::CTransform::Translate(pos), CModelData::CModelDataNull(), - CMaterialList(EMaterialTypes::Unknown), CActorParameters::None(), kInvalidUniqueId), + CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId), xe8_flare(blendMode, b1, f1, f2, f3, w1, w2, flares) { xe6_27_renderVisorFlags = 2; diff --git a/hecl b/hecl index 6edce1911..0d3f9f345 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 6edce191157151ffb97d574ebd0385ff431bdfa9 +Subproject commit 0d3f9f345c43bd85cc21945dcd62566e2701a971 diff --git a/specter b/specter index 9c6ace8a1..ff9755bc2 160000 --- a/specter +++ b/specter @@ -1 +1 @@ -Subproject commit 9c6ace8a130802b8f9d67f74d9d6328dd46bb868 +Subproject commit ff9755bc27083b7c3bb461a27131ec7f2b886144