From 513d9c99cdf099f9c39d683a6eaf1cd94b5c6a9f Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Fri, 15 Jun 2018 10:37:00 -1000 Subject: [PATCH] VisorParameters scan passthrough property --- DataSpec/DNAMP1/ScriptObjects/Parameters.hpp | 4 ++-- Runtime/World/CActor.cpp | 4 ++-- Runtime/World/CVisorParameters.hpp | 10 ++++------ Runtime/World/ScriptLoader.cpp | 10 +++++----- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp b/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp index 090f74495..82de773d3 100644 --- a/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp +++ b/DataSpec/DNAMP1/ScriptObjects/Parameters.hpp @@ -380,8 +380,8 @@ struct VisorParameters : BigDNA AT_DECL_DNA_YAML Value propertyCount; Value unknown1; - Value unknown2; - Value unknown3; + Value scanPassthrough; + Value visorMask; }; struct PlayerParameters : BigDNA diff --git a/Runtime/World/CActor.cpp b/Runtime/World/CActor.cpp index 67458ac30..a43399d17 100644 --- a/Runtime/World/CActor.cpp +++ b/Runtime/World/CActor.cpp @@ -19,9 +19,9 @@ namespace urde static CMaterialList MakeActorMaterialList(const CMaterialList& materialList, const CActorParameters& params) { CMaterialList ret = materialList; - if (params.GetVisorParameters().x0_28_b3) + if (params.GetVisorParameters().x0_4_b1) ret.Add(EMaterialTypes::Unknown46); - if (params.GetVisorParameters().x0_29_b4) + if (params.GetVisorParameters().x0_5_scanPassthrough) ret.Add(EMaterialTypes::ScanPassthrough); return ret; } diff --git a/Runtime/World/CVisorParameters.hpp b/Runtime/World/CVisorParameters.hpp index 999f891f1..2a05e02af 100644 --- a/Runtime/World/CVisorParameters.hpp +++ b/Runtime/World/CVisorParameters.hpp @@ -11,13 +11,11 @@ class CVisorParameters public: u8 x0_mask : 4; bool x0_4_b1 : 1; - bool x0_5_b2 : 1; - bool x0_28_b3 : 1; - bool x0_29_b4 : 1; + bool x0_5_scanPassthrough : 1; CVisorParameters() - : x0_mask(0xf), x0_4_b1(false), x0_5_b2(false) {} - CVisorParameters(u8 mask, bool b1, bool b2) - : x0_mask(mask), x0_4_b1(b1), x0_5_b2(b2) {} + : x0_mask(0xf), x0_4_b1(false), x0_5_scanPassthrough(false) {} + CVisorParameters(u8 mask, bool b1, bool scanPassthrough) + : x0_mask(mask), x0_4_b1(b1), x0_5_scanPassthrough(scanPassthrough) {} u8 GetMask() const { return x0_mask; } }; diff --git a/Runtime/World/ScriptLoader.cpp b/Runtime/World/ScriptLoader.cpp index 96cdc53e1..1d8205835 100644 --- a/Runtime/World/ScriptLoader.cpp +++ b/Runtime/World/ScriptLoader.cpp @@ -262,13 +262,13 @@ CVisorParameters ScriptLoader::LoadVisorParameters(CInputStream& in) if (propCount >= 1 && propCount <= 3) { bool b1 = in.readBool(); - bool b2 = false; + bool scanPassthrough = false; u8 mask = 0xf; - if (propCount > 1) - b2 = in.readBool(); if (propCount > 2) - mask = in.readUint32Big(); - return CVisorParameters(mask, b1, b2); + scanPassthrough = in.readBool(); + if (propCount >= 2) + mask = u8(in.readUint32Big()); + return CVisorParameters(mask, b1, scanPassthrough); } return CVisorParameters(); }