diff --git a/DataSpec/DNAMP1/ScriptObjects/Actor.hpp b/DataSpec/DNAMP1/ScriptObjects/Actor.hpp index c96e48f57..a682d500e 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Actor.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Actor.hpp @@ -15,24 +15,24 @@ struct Actor : IScriptObject Value scale SO_SCALE_SPECPROP(); Value collisionExtent SO_COLLISION_EXTENT_SPECPROP(); Value collisionOffset SO_COLLISION_OFFSET_SPECPROP(); - Value unknown2; - Value unknown3; + Value mass; + Value zMomentum; HealthInfo healthInfo; DamageVulnerability damageVulnerability; UniqueID32 model; AnimationParameters animationParameters; ActorParameters actorParameters; - Value unkown4; - Value unkown5; - Value unkown6; - Value unkown7; - Value unkown8; - Value unknown9; - Value unknown10; - Value unknown11; - Value unknown12; - Value unknown13; - Value unknown14; + Value looping; + Value snow; + Value solid; + Value cameraPassthrough; + Value active; + Value shaderIdx; + Value xrayAlpha; + Value noThermalHotZ; + Value castsShadow; + Value scaleAdvancementDelta; + Value materialFlag54; void addCMDLRigPairs(PAKRouter& pakRouter, std::unordered_map>& addTo) const diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 400d1a611..67002791c 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -206,7 +206,7 @@ CStateManager::CStateManager(const std::weak_ptr& relayTracker, x90c_loaderFuncs[int(EScriptObjectType::ShadowProjector)] = ScriptLoader::LoadShadowProjector; x90c_loaderFuncs[int(EScriptObjectType::EnergyBall)] = ScriptLoader::LoadEnergyBall; - //CGameCollision::InitCollision(); + CGameCollision::InitCollision(); ControlMapper::ResetCommandFilters(); x8f0_shadowTex = g_SimplePool->GetObj("DefaultShadow"); } @@ -734,7 +734,7 @@ void CStateManager::DrawWorld() const for (TUniqueId id : x86c_stateManagerContainer->xf370_) if (const CActor* ent = static_cast(GetObjectById(id))) - if (!thermal || ent->xe6_27_renderVisorFlags & 0x1) + if (!thermal || ent->xe6_27_thermalVisorFlags & 0x1) ent->Render(*this); bool morphingPlayerVisible = false; @@ -772,9 +772,9 @@ void CStateManager::DrawWorld() const continue; } } - if (!thermal || actor->xe6_27_renderVisorFlags & 0x1) + if (!thermal || actor->xe6_27_thermalVisorFlags & 0x1) actor->AddToRenderer(frustum, *this); - if (thermal && actor->xe6_27_renderVisorFlags & 0x2) + if (thermal && actor->xe6_27_thermalVisorFlags & 0x2) thermalActorArr[thermalActorCount++] = actor.GetPtr(); } } @@ -810,7 +810,7 @@ void CStateManager::DrawWorld() const CGraphics::SetDepthRange(DEPTH_SCREEN_ACTORS, DEPTH_GUN); for (TUniqueId id : x86c_stateManagerContainer->xf39c_renderLast) if (const CActor* actor = static_cast(GetObjectById(id))) - if (actor->xe6_27_renderVisorFlags & 0x1) + if (actor->xe6_27_thermalVisorFlags & 0x1) actor->Render(*this); CGraphics::SetDepthRange(DEPTH_WORLD, DEPTH_FAR); } @@ -819,7 +819,7 @@ void CStateManager::DrawWorld() const for (TUniqueId id : x86c_stateManagerContainer->xf370_) if (const CActor* actor = static_cast(GetObjectById(id))) - if (actor->xe6_27_renderVisorFlags & 0x2) + if (actor->xe6_27_thermalVisorFlags & 0x2) actor->Render(*this); for (int i=areaCount-1 ; i>=0 ; --i) @@ -882,7 +882,7 @@ void CStateManager::DrawWorld() const CGraphics::SetDepthRange(DEPTH_SCREEN_ACTORS, DEPTH_GUN); for (TUniqueId id : x86c_stateManagerContainer->xf39c_renderLast) if (const CActor* actor = static_cast(GetObjectById(id))) - if (actor->xe6_27_renderVisorFlags & 0x2) + if (actor->xe6_27_thermalVisorFlags & 0x2) actor->Render(*this); CGraphics::SetDepthRange(DEPTH_WORLD, DEPTH_FAR); } diff --git a/Runtime/Collision/CGameCollision.cpp b/Runtime/Collision/CGameCollision.cpp index 8385a0384..ca071fa56 100644 --- a/Runtime/Collision/CGameCollision.cpp +++ b/Runtime/Collision/CGameCollision.cpp @@ -587,14 +587,16 @@ bool CGameCollision::DetectCollision_Cached_Moving(const CStateManager& mgr, CAr const zeus::CVector3f& dir, TUniqueId& idOut, CCollisionInfo& infoOut, double& d) { + bool ret = false; idOut = kInvalidUniqueId; if (!filter.GetExcludeList().HasMaterial(EMaterialTypes::NoStaticCollision)) - { if (CGameCollision::DetectStaticCollision_Cached_Moving(mgr, cache, prim, xf, filter, dir, infoOut, d)) - return true; - } + ret = true; - return CGameCollision::DetectDynamicCollisionMoving(prim, xf, nearList, dir, idOut, infoOut, d, mgr); + if (CGameCollision::DetectDynamicCollisionMoving(prim, xf, nearList, dir, idOut, infoOut, d, mgr)) + ret = true; + + return ret; } bool CGameCollision::DetectStaticCollision(const CStateManager& mgr, const CCollisionPrimitive& prim, @@ -604,6 +606,7 @@ bool CGameCollision::DetectStaticCollision(const CStateManager& mgr, const CColl if (prim.GetPrimType() == FOURCC('OBTG')) return false; + bool ret = false; if (prim.GetPrimType() == FOURCC('AABX')) { zeus::CAABox aabb = prim.CalculateAABox(xf); @@ -612,7 +615,7 @@ bool CGameCollision::DetectStaticCollision(const CStateManager& mgr, const CColl if (CMetroidAreaCollider::AABoxCollisionCheck( *area.GetPostConstructed()->x0_collision, aabb, filter, prim.GetMaterial(), list)) - return true; + ret = true; } } else if (prim.GetPrimType() == FOURCC('SPHR')) @@ -625,7 +628,7 @@ bool CGameCollision::DetectStaticCollision(const CStateManager& mgr, const CColl if (CMetroidAreaCollider::SphereCollisionCheck( *area.GetPostConstructed()->x0_collision, aabb, xfSphere, prim.GetMaterial(), filter, list)) - return true; + ret = true; } } else if (prim.GetPrimType() == FOURCC('ABSH')) @@ -633,7 +636,7 @@ bool CGameCollision::DetectStaticCollision(const CStateManager& mgr, const CColl // Combination AABB / Sphere cut from game } - return false; + return ret; } bool CGameCollision::DetectStaticCollision_Cached(const CStateManager& mgr, CAreaCollisionCache& cache, @@ -643,6 +646,7 @@ bool CGameCollision::DetectStaticCollision_Cached(const CStateManager& mgr, CAre if (prim.GetPrimType() == FOURCC('OBTG')) return false; + bool ret = false; zeus::CAABox calcAABB = prim.CalculateAABox(xf); if (!calcAABB.inside(cache.GetCacheBounds())) { @@ -660,7 +664,7 @@ bool CGameCollision::DetectStaticCollision_Cached(const CStateManager& mgr, CAre for (CMetroidAreaCollider::COctreeLeafCache& leafCache : cache) if (CMetroidAreaCollider::AABoxCollisionCheck_Cached(leafCache, calcAABB, filter, prim.GetMaterial(), list)) - return true; + ret = true; } else if (prim.GetPrimType() == FOURCC('SPHR')) { @@ -669,14 +673,14 @@ bool CGameCollision::DetectStaticCollision_Cached(const CStateManager& mgr, CAre for (CMetroidAreaCollider::COctreeLeafCache& leafCache : cache) if (CMetroidAreaCollider::SphereCollisionCheck_Cached(leafCache, calcAABB, xfSphere, prim.GetMaterial(), filter, list)) - return true; + ret = true; } else if (prim.GetPrimType() == FOURCC('ABSH')) { // Combination AABB / Sphere cut from game } - return false; + return ret; } bool CGameCollision::DetectStaticCollision_Cached_Moving(const CStateManager& mgr, CAreaCollisionCache& cache, @@ -782,7 +786,6 @@ bool CGameCollision::DetectDynamicCollisionMoving(const CCollisionPrimitive& pri infoOut = info; dOut = d; idOut = actor->GetUniqueId(); - return true; } } } diff --git a/Runtime/Collision/CollisionUtil.cpp b/Runtime/Collision/CollisionUtil.cpp index d28d90ca1..086b1c3c4 100644 --- a/Runtime/Collision/CollisionUtil.cpp +++ b/Runtime/Collision/CollisionUtil.cpp @@ -1178,8 +1178,8 @@ bool MovingSphereAABox(const zeus::CSphere& sphere, const zeus::CAABox& aabb, co bool AABox_AABox_Moving(const zeus::CAABox& aabb0, const zeus::CAABox& aabb1, const zeus::CVector3f& dir, double& d, zeus::CVector3f& point, zeus::CVector3f& normal) { - zeus::CVector3d vecMin(DBL_MIN); - zeus::CVector3d vecMax(DBL_MAX); + zeus::CVector3d vecMin(-FLT_MAX); + zeus::CVector3d vecMax(FLT_MAX); for (int i=0 ; i<3 ; ++i) { @@ -1221,10 +1221,10 @@ bool AABox_AABox_Moving(const zeus::CAABox& aabb0, const zeus::CAABox& aabb1, co if (vecMin[2] > vecMin[maxAxis]) maxAxis = 2; - float minMax = std::min(std::min(vecMax[2], vecMax[1]), vecMax[0]); + double minMax = std::min(std::min(vecMax[2], vecMax[1]), vecMax[0]); if (vecMin[maxAxis] > minMax) return false; - d = minMax; + d = vecMin[maxAxis]; normal = zeus::CVector3f::skZero; normal[maxAxis] = dir[maxAxis] > 0.f ? -1.f : 1.f; diff --git a/Runtime/Graphics/CModel.hpp b/Runtime/Graphics/CModel.hpp index d3c806be2..5e63e4804 100644 --- a/Runtime/Graphics/CModel.hpp +++ b/Runtime/Graphics/CModel.hpp @@ -48,6 +48,18 @@ struct CModelFlags 0x8: depth greater 0x10: depth non-inclusive */ + + bool operator==(const CModelFlags& other) const + { + return x0_blendMode == other.x0_blendMode && x1_matSetIdx == other.x1_matSetIdx && + x2_flags == other.x2_flags && x4_color == other.x4_color; + } + + bool operator!=(const CModelFlags& other) const + { + return x0_blendMode != other.x0_blendMode || x1_matSetIdx != other.x1_matSetIdx || + x2_flags != other.x2_flags || x4_color != other.x4_color; + } }; /* urde addition: doesn't require hacky stashing of diff --git a/Runtime/Weapon/CEnergyProjectile.cpp b/Runtime/Weapon/CEnergyProjectile.cpp index 3e8a017f3..8aa97c6cd 100644 --- a/Runtime/Weapon/CEnergyProjectile.cpp +++ b/Runtime/Weapon/CEnergyProjectile.cpp @@ -14,7 +14,7 @@ CEnergyProjectile::CEnergyProjectile(bool active, const TToken& particle, TUniqueId xf4_24_ = flags & 0x4; xf4_25_ = true; xf4_26_ = flags & 0x8; - xe6_27_renderVisorFlags = flags & 0x1 ? 1 : 2; + xe6_27_thermalVisorFlags = flags & 0x1 ? 1 : 2; xe8_particleGen->SetGlobalTranslation(xf.origin); xe8_particleGen->SetOrientation(xf.getRotation()); xe8_particleGen->SetGlobalScale(scale); diff --git a/Runtime/World/CPhysicsActor.cpp b/Runtime/World/CPhysicsActor.cpp index a8e265495..c2a604852 100644 --- a/Runtime/World/CPhysicsActor.cpp +++ b/Runtime/World/CPhysicsActor.cpp @@ -75,11 +75,11 @@ zeus::CAABox CPhysicsActor::GetMotionVolume(float dt) const float up = GetStepUpHeight(); up = zeus::max(up, 0.f); - aabox.accumulateBounds(aabox.max + up); + aabox.accumulateBounds(aabox.max + zeus::CVector3f(0.5f, 0.5f, up + 1.f)); float down = GetStepDownHeight(); down = zeus::max(down, 0.f); - aabox.accumulateBounds(aabox.min + down); + aabox.accumulateBounds(aabox.min - zeus::CVector3f(0.5f, 0.5f, down + 1.5f)); return aabox; } @@ -194,7 +194,7 @@ void CPhysicsActor::MoveToOR(const zeus::CVector3f& trans, float d) ComputeDerivedQuantities(); } -void CPhysicsActor::sub_8011B098(const zeus::CVector3f& trans, float d) +void CPhysicsActor::MoveToInOneFrameWR(const zeus::CVector3f& trans, float d) { x18c_moveImpulse += xe8_mass * (trans - x34_transform.origin) * (1.f / d); } diff --git a/Runtime/World/CPhysicsActor.hpp b/Runtime/World/CPhysicsActor.hpp index 177da6ac4..12fa1b13a 100644 --- a/Runtime/World/CPhysicsActor.hpp +++ b/Runtime/World/CPhysicsActor.hpp @@ -170,7 +170,7 @@ public: void MoveInOneFrameOR(const zeus::CVector3f& trans, float d); void RotateToOR(const zeus::CQuaternion& q, float d); void MoveToOR(const zeus::CVector3f& trans, float d); - void sub_8011B098(const zeus::CVector3f& v1, float d); + void MoveToInOneFrameWR(const zeus::CVector3f& v1, float d); void MoveToWR(const zeus::CVector3f& trans, float d); zeus::CAxisAngle GetRotateToORAngularMomentumWR(const zeus::CQuaternion& q, float d) const; zeus::CVector3f GetMoveToORImpulseWR(const zeus::CVector3f& trans, float d) const; diff --git a/Runtime/World/CScriptActor.cpp b/Runtime/World/CScriptActor.cpp index 17f822ac9..dbf9af1d5 100644 --- a/Runtime/World/CScriptActor.cpp +++ b/Runtime/World/CScriptActor.cpp @@ -14,24 +14,25 @@ namespace urde CScriptActor::CScriptActor(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, const zeus::CAABox& aabb, float mass, float zMomentum, const CMaterialList& matList, const CHealthInfo& hInfo, const CDamageVulnerability& dVuln, - const CActorParameters& actParms, bool looping, bool active, u32 w1, float f3, bool b2, - bool castsShadow, bool b4, bool b5) + const CActorParameters& actParms, bool looping, bool active, u32 shaderIdx, float xrayAlpha, + bool noThermalHotZ, bool castsShadow, bool scaleAdvancementDelta, bool materialFlag54) : CPhysicsActor(uid, active, name, info, xf, std::move(mData), matList, aabb, SMoverData(mass), actParms, 0.3f, 0.1f) , x258_initialHealth(hInfo) , x260_currentHealth(hInfo) , x268_damageVulnerability(dVuln) -, x2d8_(w1) -, x2dc_xrayAlpha(f3) -, x2e2_24_(b2) -, x2e2_25_dead(false) -, x2e2_26_animating(true) -, x2e2_27_(std::fabs(1.f - f3) > 0.00001) -, x2e2_28_(false) -, x2e2_29_((x2e2_24_ && x2e2_25_dead && x2d8_ != 0)) -, x2e2_30_transposeRotate(b4) -, x2e2_31_(b5) -, x2e3_24_cameraMoveIntoAlpha(false) +, x2d8_shaderIdx(shaderIdx) +, x2dc_xrayAlpha(xrayAlpha) { + x2e2_24_noThermalHotZ = noThermalHotZ; + x2e2_25_dead = false; + x2e2_26_animating = true; + x2e2_27_xrayAlphaEnabled = !zeus::close_enough(1.f, xrayAlpha); + x2e2_28_inXrayAlpha = false; + x2e2_29_processModelFlags = (x2e2_27_xrayAlphaEnabled || x2e2_24_noThermalHotZ || x2d8_shaderIdx != 0); + x2e2_30_scaleAdvancementDelta = scaleAdvancementDelta; + x2e2_31_materialFlag54 = materialFlag54; + x2e3_24_cameraMoveIntoAlpha = false; + if (x64_modelData && (x64_modelData->HasAnimData() || x64_modelData->HasNormalModel()) && castsShadow) CreateShadow(true); @@ -77,7 +78,7 @@ void CScriptActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CSta } } - if (x2e2_31_) + if (x2e2_31_materialFlag54) CActor::AddMaterial(EMaterialTypes::Unknown54, mgr); } @@ -100,7 +101,7 @@ void CScriptActor::Think(float dt, CStateManager& mgr) { x2e2_26_animating = true; - if (x2e2_30_transposeRotate) + if (x2e2_30_scaleAdvancementDelta) MoveToOR( x34_transform.rotate(x64_modelData->GetScale() * x34_transform.transposeRotate(deltas.x0_posDelta)), dt); @@ -131,42 +132,35 @@ void CScriptActor::PreRender(CStateManager& mgr, const zeus::CFrustum& frustum) if (xe4_30_outOfFrustum && TCastToPtr(mgr.GetCameraManager()->GetCurrentCamera(mgr))) xe4_30_outOfFrustum = false; - if (xe4_30_outOfFrustum && !x2e2_29_ && !x2e2_27_) + if (!xe4_30_outOfFrustum && x2e2_29_processModelFlags) { - zeus::CColor col(1.f, 1.f, x2dc_xrayAlpha); - if (mgr.GetPlayerState()->GetActiveVisor(mgr) == CPlayerState::EPlayerVisor::XRay) + if (x2e2_27_xrayAlphaEnabled) { - xb4_drawFlags.x0_blendMode = 5; - xb4_drawFlags.x1_matSetIdx = 0; - xb4_drawFlags.x2_flags = 3; - xb4_drawFlags.x4_color = col; - x2e2_28_ = true; - } - else if (x2e2_28_) - { - x2e2_28_ = false; - if (xb4_drawFlags.x0_blendMode != 5 && xb4_drawFlags.x1_matSetIdx != 0 && - xb4_drawFlags.x2_flags != 3 && xb4_drawFlags.x4_color != col) + zeus::CColor col(1.f, x2dc_xrayAlpha); + CModelFlags xrayFlags(5, 0, 3, col); + if (mgr.GetPlayerState()->GetActiveVisor(mgr) == CPlayerState::EPlayerVisor::XRay) { - xb4_drawFlags.x0_blendMode = 5; - xb4_drawFlags.x1_matSetIdx = 0; - xb4_drawFlags.x2_flags = 3; - xb4_drawFlags.x4_color = col; + xb4_drawFlags = xrayFlags; + x2e2_28_inXrayAlpha = true; + } + else if (x2e2_28_inXrayAlpha) + { + x2e2_28_inXrayAlpha = false; + if (xb4_drawFlags == xrayFlags) + xb4_drawFlags = CModelFlags(0, 0, 3, zeus::CColor::skWhite); } } - if (!x2e2_24_ && xe6_27_renderVisorFlags == 2 && - mgr.GetPlayerState()->GetActiveVisor(mgr) == CPlayerState::EPlayerVisor::XRay) + if (x2e2_24_noThermalHotZ && xe6_27_thermalVisorFlags == 2) { - xb4_drawFlags.x2_flags &= ~3; - } - else - { - xb4_drawFlags.x2_flags |= 3; + if (mgr.GetPlayerState()->GetActiveVisor(mgr) == CPlayerState::EPlayerVisor::Thermal) + xb4_drawFlags.x2_flags &= ~3; // Disable Z test/update + else + xb4_drawFlags.x2_flags |= 3; // Enable Z test/update } - if (x2d8_ != 0) - xb4_drawFlags.x1_matSetIdx = 0; + if (x2d8_shaderIdx != 0) + xb4_drawFlags.x1_matSetIdx = u8(x2d8_shaderIdx); } if (mgr.GetObjectById(x2e0_triggerId) == nullptr) @@ -187,7 +181,7 @@ zeus::CAABox CScriptActor::GetSortingBounds(const CStateManager& mgr) const EWeaponCollisionResponseTypes CScriptActor::GetCollisionResponseType(const zeus::CVector3f& v1, const zeus::CVector3f& v2, const - CWeaponMode& wMode, int w) const + CWeaponMode& wMode, int w) const { const CDamageVulnerability* dVuln = GetDamageVulnerability(); if (dVuln->GetVulnerability(wMode, false) == EVulnerability::Reflect) @@ -206,5 +200,8 @@ rstl::optional_object CScriptActor::GetTouchBounds() const return {}; } -void CScriptActor::Touch(CActor&, CStateManager&) {} +void CScriptActor::Touch(CActor&, CStateManager&) +{ + // Empty +} } diff --git a/Runtime/World/CScriptActor.hpp b/Runtime/World/CScriptActor.hpp index 8150cb6d5..65e5ef925 100644 --- a/Runtime/World/CScriptActor.hpp +++ b/Runtime/World/CScriptActor.hpp @@ -16,23 +16,25 @@ protected: CDamageVulnerability x268_damageVulnerability; float x2d0_alphaMax; float x2d4_alphaMin; - s32 x2d8_; + s32 x2d8_shaderIdx; float x2dc_xrayAlpha; TUniqueId x2e0_triggerId = kInvalidUniqueId; - bool x2e2_24_ : 1; + bool x2e2_24_noThermalHotZ : 1; bool x2e2_25_dead : 1; bool x2e2_26_animating : 1; - bool x2e2_27_ : 1; - bool x2e2_28_ : 1; - bool x2e2_29_ : 1; - bool x2e2_30_transposeRotate : 1; - bool x2e2_31_ : 1; + bool x2e2_27_xrayAlphaEnabled : 1; + bool x2e2_28_inXrayAlpha : 1; + bool x2e2_29_processModelFlags : 1; + bool x2e2_30_scaleAdvancementDelta : 1; + bool x2e2_31_materialFlag54 : 1; bool x2e3_24_cameraMoveIntoAlpha : 1; public: - CScriptActor(TUniqueId, std::string_view, const CEntityInfo&, const zeus::CTransform&, CModelData&&, - const zeus::CAABox& aabb, float, float, const CMaterialList& matList, const CHealthInfo&, - const CDamageVulnerability&, const CActorParameters&, bool, bool, u32, float, bool, bool, bool, bool); + CScriptActor(TUniqueId uid, std::string_view name, const CEntityInfo& info, const zeus::CTransform& xf, + CModelData&& mData, const zeus::CAABox& aabb, float mass, float zMomentum, + const CMaterialList& matList, const CHealthInfo& hInfo, const CDamageVulnerability& dVuln, + const CActorParameters& actParms, bool looping, bool active, u32 shaderIdx, float xrayAlpha, + bool noThermalHotZ, bool castsShadow, bool scaleAdvancementDelta, bool materialFlag54); void Accept(IVisitor& visitor); void AcceptScriptMsg(EScriptObjectMessage, TUniqueId, CStateManager&); void Think(float, CStateManager&); diff --git a/Runtime/World/CScriptVisorFlare.cpp b/Runtime/World/CScriptVisorFlare.cpp index 466d29a00..2419da7df 100644 --- a/Runtime/World/CScriptVisorFlare.cpp +++ b/Runtime/World/CScriptVisorFlare.cpp @@ -16,7 +16,7 @@ CScriptVisorFlare::CScriptVisorFlare(TUniqueId uid, std::string_view name, const CMaterialList(EMaterialTypes::NoStepLogic), CActorParameters::None(), kInvalidUniqueId), xe8_flare(blendMode, b1, f1, f2, f3, w1, w2, flares) { - xe6_27_renderVisorFlags = 2; + xe6_27_thermalVisorFlags = 2; } void CScriptVisorFlare::Accept(IVisitor& visitor) diff --git a/Runtime/World/CScriptWater.cpp b/Runtime/World/CScriptWater.cpp index 07ba8194e..fff2c3c07 100644 --- a/Runtime/World/CScriptWater.cpp +++ b/Runtime/World/CScriptWater.cpp @@ -88,7 +88,7 @@ CScriptWater::CScriptWater(CStateManager& mgr, TUniqueId uid, std::string_view n x90_actorLights->SetFindNearestDynamicLights(true); x148_24_detectCamera = true; CalculateRenderBounds(); - xe6_27_renderVisorFlags = u8(thermalCold ? 2 : 1); + xe6_27_thermalVisorFlags = u8(thermalCold ? 2 : 1); if (!x30_24_active) { x2bc_alpha = 0.f; diff --git a/Runtime/World/ScriptLoader.cpp b/Runtime/World/ScriptLoader.cpp index 881a2d74b..f9a85449f 100644 --- a/Runtime/World/ScriptLoader.cpp +++ b/Runtime/World/ScriptLoader.cpp @@ -397,12 +397,12 @@ CEntity* ScriptLoader::LoadActor(CStateManager& mgr, CInputStream& in, int propC bool solid = in.readBool(); bool cameraPassthrough = in.readBool(); bool active = in.readBool(); - u32 w2 = in.readUint32Big(); - float f3 = in.readFloatBig(); - bool b6 = in.readBool(); + u32 shaderIdx = in.readUint32Big(); + float xrayAlpha = in.readFloatBig(); + bool noThermalHotZ = in.readBool(); bool castsShadow = in.readBool(); - bool xposeRotate = in.readBool(); - bool b9 = in.readBool(); + bool scaleAdvancementDelta = in.readBool(); + bool materialFlag54 = in.readBool(); FourCC animType = g_ResFactory->GetResourceTypeById(aParms.GetACSFile()); if (!g_ResFactory->GetResourceTypeById(staticId) && !animType) @@ -430,8 +430,8 @@ CEntity* ScriptLoader::LoadActor(CStateManager& mgr, CInputStream& in, int propC aabb = data.GetBounds(head.x10_transform.getRotation()); return new CScriptActor(mgr.AllocateUniqueId(), head.x0_name, info, head.x10_transform, std::move(data), aabb, mass, - zMomentum, list, hInfo, dVuln, actParms, looping, active, w2, f3, b6, castsShadow, - xposeRotate, b9); + zMomentum, list, hInfo, dVuln, actParms, looping, active, shaderIdx, xrayAlpha, + noThermalHotZ, castsShadow, scaleAdvancementDelta, materialFlag54); } CEntity* ScriptLoader::LoadWaypoint(CStateManager& mgr, CInputStream& in, int propCount, const CEntityInfo& info)