From af1e22a62d4eca68081e57f28cf5a9813632d063 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 29 Dec 2016 13:38:59 -0800 Subject: [PATCH] Start naming EMaterialTypes values --- Runtime/CArchitectureMessage.hpp | 2 +- Runtime/CGameState.hpp | 2 + Runtime/CPlayerState.cpp | 2 +- Runtime/CPlayerState.hpp | 4 +- Runtime/CStateManager.cpp | 4 +- Runtime/Camera/CCinematicCamera.cpp | 12 ++-- Runtime/Camera/CFirstPersonCamera.cpp | 3 +- Runtime/Camera/CGameCamera.cpp | 2 +- Runtime/Collision/CMaterialFilter.cpp | 2 +- Runtime/Collision/CMaterialList.hpp | 83 +++++++++++++--------- Runtime/MP1/MP1.cpp | 54 ++++++-------- Runtime/MP1/MP1.hpp | 44 +++++++----- Runtime/Weapon/CGameProjectile.cpp | 8 +-- Runtime/World/CActor.cpp | 12 ++-- Runtime/World/CAi.cpp | 4 +- Runtime/World/CPatterned.cpp | 10 +-- Runtime/World/CScriptAiJumpPoint.cpp | 2 +- Runtime/World/CScriptBeam.cpp | 2 +- Runtime/World/CScriptCameraHint.cpp | 2 +- Runtime/World/CScriptCameraHintTrigger.cpp | 2 +- Runtime/World/CScriptCameraPitchVolume.cpp | 2 +- Runtime/World/CScriptCameraWaypoint.cpp | 2 +- Runtime/World/CScriptCoverPoint.cpp | 2 +- Runtime/World/CScriptDamageableTrigger.cpp | 8 +-- Runtime/World/CScriptDebris.cpp | 2 +- Runtime/World/CScriptDock.cpp | 6 +- Runtime/World/CScriptDoor.cpp | 22 +++--- Runtime/World/CScriptDoor.hpp | 2 +- Runtime/World/CScriptGrapplePoint.cpp | 2 +- Runtime/World/CScriptPlatform.cpp | 8 +-- Runtime/World/CScriptPointOfInterest.cpp | 2 +- Runtime/World/CScriptTrigger.cpp | 2 +- Runtime/World/CWorldTransManager.cpp | 2 +- Runtime/World/ScriptLoader.cpp | 18 ++--- kabufuda | 2 +- 35 files changed, 173 insertions(+), 165 deletions(-) diff --git a/Runtime/CArchitectureMessage.hpp b/Runtime/CArchitectureMessage.hpp index 6967f1cdd..d089f6171 100644 --- a/Runtime/CArchitectureMessage.hpp +++ b/Runtime/CArchitectureMessage.hpp @@ -161,7 +161,7 @@ public: { return *msg.GetParm(); } - static CArchitectureMessage CreateFrameBegin(EArchMsgTarget target, int a) + static CArchitectureMessage CreateFrameBegin(EArchMsgTarget target, const int& a) { return CArchitectureMessage(target, EArchMsgType::FrameBegin, new CArchMsgParmInt32(a)); } diff --git a/Runtime/CGameState.hpp b/Runtime/CGameState.hpp index 3f3f84cfb..45f34bc9e 100644 --- a/Runtime/CGameState.hpp +++ b/Runtime/CGameState.hpp @@ -109,8 +109,10 @@ public: CWorldState& CurrentWorldState() { return StateForWorld(x84_mlvlId); } ResId CurrentWorldAssetId() const { return x84_mlvlId; } void SetHardMode(bool v) { x228_24_hardMode = v; } + void SetPersistentOptions(const CPersistentOptions& opts) { xa8_systemOptions = opts; } void ImportPersistentOptions(const CPersistentOptions& opts); void ExportPersistentOptions(CPersistentOptions& opts) const; + void SetGameOptions(const CGameOptions& opts) { x17c_gameOptions = opts; } void WriteBackupBuf(); void SetCardSerial(u64 serial) { x210_cardSerial = serial; } void PutTo(CBitStreamWriter& writer) const; diff --git a/Runtime/CPlayerState.cpp b/Runtime/CPlayerState.cpp index 13e7b1762..0535c7730 100644 --- a/Runtime/CPlayerState.cpp +++ b/Runtime/CPlayerState.cpp @@ -188,7 +188,7 @@ CHealthInfo CPlayerState::GetHealthInfo() const CPlayerState::EPlayerSuit CPlayerState::GetCurrentSuit() const { - if (GetFusion()) + if (IsFusionEnabled()) return EPlayerSuit::FusionPower; return x20_currentSuit; diff --git a/Runtime/CPlayerState.hpp b/Runtime/CPlayerState.hpp index 16f294f2c..c6764780f 100644 --- a/Runtime/CPlayerState.hpp +++ b/Runtime/CPlayerState.hpp @@ -136,8 +136,8 @@ public: CHealthInfo& HealthInfo(); CHealthInfo GetHealthInfo() const; u32 GetPickupTotal() { return 99; } - void SetFusion(bool val) { x0_26_fusion = val; } - bool GetFusion() const { return x0_26_fusion; } + void SetIsFusionEnabled(bool val) { x0_26_fusion = val; } + bool IsFusionEnabled() const { return x0_26_fusion; } EPlayerSuit GetCurrentSuit() const; EBeamId GetCurrentBeam() const { return x8_currentBeam; } bool CanVisorSeeFog(const CStateManager& stateMgr) const; diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index fe53c0876..cc1f0a847 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -674,8 +674,8 @@ void CStateManager::CreateStandardGameObjects() auto q = zeus::CQuaternion::fromAxisAngle(zeus::CVector3f{0.f, 0.f, 1.f}, zeus::degToRad(129.6f)); x84c_player.reset(new CPlayer(AllocateUniqueId(), zeus::CTransform(q), pBounds, 0, zeus::CVector3f{1.65f, 1.65f, 1.65f}, - 200.f, unk1, unk2, unk3, CMaterialList(EMaterialTypes::ThirtyTwo, - EMaterialTypes::Nineteen, EMaterialTypes::ThirtySeven))); + 200.f, unk1, unk2, unk3, CMaterialList(EMaterialTypes::Player, + EMaterialTypes::Solid, EMaterialTypes::GroundCollider))); AddObject(*x84c_player); } diff --git a/Runtime/Camera/CCinematicCamera.cpp b/Runtime/Camera/CCinematicCamera.cpp index a7634b81b..816a7c8f8 100644 --- a/Runtime/Camera/CCinematicCamera.cpp +++ b/Runtime/Camera/CCinematicCamera.cpp @@ -4,17 +4,13 @@ namespace urde { CCinematicCamera::CCinematicCamera(TUniqueId uid, const std::string& name, const CEntityInfo& info, - const zeus::CTransform& xf, bool active, float, float a, float b, float c, float d, u32 e) + const zeus::CTransform& xf, bool active, float, float a, float b, float c, float d, + u32 e) : CGameCamera(uid, active, name, info, xf, a, b, c, d, kInvalidUniqueId, e & 0x20, 0) { } -void CCinematicCamera::ProcessInput(const CFinalInput&, CStateManager& mgr) -{ -} - -void CCinematicCamera::Reset(const zeus::CTransform&, CStateManager& mgr) -{ -} +void CCinematicCamera::ProcessInput(const CFinalInput&, CStateManager& mgr) {} +void CCinematicCamera::Reset(const zeus::CTransform&, CStateManager& mgr) {} } diff --git a/Runtime/Camera/CFirstPersonCamera.cpp b/Runtime/Camera/CFirstPersonCamera.cpp index d06b7055d..5fe37e264 100644 --- a/Runtime/Camera/CFirstPersonCamera.cpp +++ b/Runtime/Camera/CFirstPersonCamera.cpp @@ -98,8 +98,7 @@ void CFirstPersonCamera::UpdateTransform(CStateManager& mgr, float dt) if (player->x304_ == 4 || player->x304_ == 1) { const CActor* act = dynamic_cast(mgr.GetObjectById(player->x310_grapplePointId)); - /* TODO: Not sure about this */ - if (act && act->GetMaterialList().BitPosition(0x200) != -1) + if (act && act->GetMaterialList().Intersection(CMaterialList(EMaterialTypes::Lava)) != 0) { zeus::CVector3f v = player->x318_ - eyePos; if (v.canBeNormalized()) diff --git a/Runtime/Camera/CGameCamera.cpp b/Runtime/Camera/CGameCamera.cpp index 21e6850e4..12a2dddf8 100644 --- a/Runtime/Camera/CGameCamera.cpp +++ b/Runtime/Camera/CGameCamera.cpp @@ -9,7 +9,7 @@ namespace urde CGameCamera::CGameCamera(TUniqueId uid, bool active, const std::string& name, const CEntityInfo& info, const zeus::CTransform& xf, float fovy, float znear, float zfar, float aspect, TUniqueId uid2, bool b1, u32 w1) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), CActorParameters::None(), kInvalidUniqueId) , xe8_watchedObject(uid2) , x12c_(xf) diff --git a/Runtime/Collision/CMaterialFilter.cpp b/Runtime/Collision/CMaterialFilter.cpp index 570843b65..99bce3113 100644 --- a/Runtime/Collision/CMaterialFilter.cpp +++ b/Runtime/Collision/CMaterialFilter.cpp @@ -13,7 +13,7 @@ CMaterialFilter::CMaterialFilter(const CMaterialList& include, const CMaterialLi CMaterialFilter CMaterialFilter::MakeInclude(const CMaterialList& include) { - return CMaterialFilter(include, {EMaterialTypes::Zero}, EFilterType::Zero); + return CMaterialFilter(include, {EMaterialTypes::Unknown}, EFilterType::Zero); } CMaterialFilter CMaterialFilter::MakeExclude(const CMaterialList& exclude) diff --git a/Runtime/Collision/CMaterialList.hpp b/Runtime/Collision/CMaterialList.hpp index 00f103bb9..e6eeceee5 100644 --- a/Runtime/Collision/CMaterialList.hpp +++ b/Runtime/Collision/CMaterialList.hpp @@ -7,41 +7,53 @@ namespace urde { enum class EMaterialTypes { - Zero = 0, - One = 1, - Two = 2, - Three = 3, - Four = 4, - Five = 5, - Six = 6, - Seven = 7, - Eight = 8, - Nine = 9, + Unknown = 0, + Stone = 1, + Metal = 2, + Grass = 3, + Ice = 4, + Pillar = 5, + MetalGrating = 6, + Phazon = 7, + Dirt = 8, + Lava = 9, Ten = 10, - Eleven = 11, - Twelve = 12, - Thirten = 13, - Fourteen = 14, - Fifteen = 15, - Eighteen = 18, - Nineteen = 19, - TwentyOne = 21, - ThirtyTwo = 32, - ThirtyThree = 33, - ThirtyFour = 34, - ThirtyFive = 35, - ThirtySeven = 37, + Snow = 11, + MudSlow = 12, + HalfPipe = 13, + Mud = 14, + Glass = 15, + Shield = 16, + Sand = 17, + ProjectilePassthrough = 18, + Solid = 19, + CameraPassthrough = 21, + Wood = 22, + Organic = 23, + TwentyFour = 24, + RedundantEdgeOrFlippedTri = 25, + SeeThrough = 26, + ScanPassthrough = 27, + AIPassthrough = 28, + Ceiling = 29, + Wall = 30, + Floor = 31, + Player = 32, + Character = 33, + Trigger = 34, + Projectile = 35, + GroundCollider = 37, ThirtyEight = 38, - ThirtyNine = 39, - Fourty = 40, - FourtyOne = 41, - FourtyTwo = 42, - FourtyThree = 43, - FourtyFour = 44, - FourtyEight = 48, - FourtyNine = 49, - Fifty = 50, - FiftySix = 56, + Scannable = 39, + Target = 40, + Orbit = 41, + Occluder = 42, + Immovable = 43, + Debris = 44, + AIBlock = 48, + Platform = 49, + NonSolidDamageable = 50, + ExcludeFromLineOfSightTest = 56, SixtyThree = 63 }; @@ -115,6 +127,11 @@ public: return false; } + + u64 Intersection(const CMaterialList& other) const + { + return other.x0_list & x0_list; + } }; } diff --git a/Runtime/MP1/MP1.cpp b/Runtime/MP1/MP1.cpp index 93fdf8103..79bbaea31 100644 --- a/Runtime/MP1/MP1.cpp +++ b/Runtime/MP1/MP1.cpp @@ -26,29 +26,29 @@ namespace MP1 CGameArchitectureSupport::CGameArchitectureSupport(CMain& parent, boo::IAudioVoiceEngine* voiceEngine, amuse::IBackendVoiceAllocator& backend) : m_parent(parent), - m_audioSys(voiceEngine, backend, 0,0,0,0,0), - m_inputGenerator(g_tweakPlayer->GetLeftLogicalThreshold(), + x0_audioSys(voiceEngine, backend, 0,0,0,0,0), + x30_inputGenerator(g_tweakPlayer->GetLeftLogicalThreshold(), g_tweakPlayer->GetRightLogicalThreshold()), - m_guiSys(*g_ResFactory, *g_SimplePool, CGuiSys::EUsageMode::Zero) + x44_guiSys(*g_ResFactory, *g_SimplePool, CGuiSys::EUsageMode::Zero) { - g_GuiSys = &m_guiSys; - m_inputGenerator.startScanning(); + g_GuiSys = &x44_guiSys; + x30_inputGenerator.startScanning(); g_Main->ResetGameState(); std::shared_ptr splash = std::make_shared(CSplashScreen::ESplashScreen::Nintendo); - m_ioWinManager.AddIOWin(splash, 1000, 10000); + x58_ioWinManager.AddIOWin(splash, 1000, 10000); std::shared_ptr mf = std::make_shared(); - m_ioWinManager.AddIOWin(mf, 0, 0); + x58_ioWinManager.AddIOWin(mf, 0, 0); std::shared_ptr console = std::make_shared(8, 5.f, 0.75f); - m_ioWinManager.AddIOWin(console, 100, 0); + x58_ioWinManager.AddIOWin(console, 100, 0); std::shared_ptr audState = std::make_shared(); - m_ioWinManager.AddIOWin(audState, 100, -1); + x58_ioWinManager.AddIOWin(audState, 100, -1); std::shared_ptr errWin = std::make_shared(false); - m_ioWinManager.AddIOWin(errWin, 10000, 100000); + x58_ioWinManager.AddIOWin(errWin, 10000, 100000); } bool CGameArchitectureSupport::Update() @@ -57,39 +57,19 @@ bool CGameArchitectureSupport::Update() m_parent.x128_globalObjects.MemoryCardInitializePump(); bool finished = false; - m_inputGenerator.Update(1.0 / 60.0, m_archQueue); g_GameState->GetWorldTransitionManager()->TouchModels(); - int unk = 0; - m_archQueue.Push(MakeMsg::CreateFrameBegin(EArchMsgTarget::Game, unk)); - m_archQueue.Push(MakeMsg::CreateTimerTick(EArchMsgTarget::Game, 1.f / 60.f)); + x4_archQueue.Push(MakeMsg::CreateFrameBegin(EArchMsgTarget::Game, x78_)); + x4_archQueue.Push(MakeMsg::CreateTimerTick(EArchMsgTarget::Game, 1.f / 60.f)); - m_ioWinManager.PumpMessages(m_archQueue); + x58_ioWinManager.PumpMessages(x4_archQueue); - /* - while (m_archQueue) - { - CArchitectureMessage msg = m_archQueue.Pop(); - if (msg.GetTarget() == EArchMsgTarget::ArchitectureSupport) - { - if (msg.GetType() == EArchMsgType::ApplicationExit) - finished = true; - } - - if (msg.GetTarget() == EArchMsgTarget::Game && msg.GetType() == EArchMsgType::UserInput) - { - const CArchMsgParmUserInput* input = msg.GetParm(); - if (input->x4_parm.DStart()) - m_archQueue.Push(std::move(MakeMsg::CreateApplicationExit(EArchMsgTarget::ArchitectureSupport))); - } - } - */ return finished; } void CGameArchitectureSupport::Draw() { - m_ioWinManager.Draw(); + x58_ioWinManager.Draw(); } CMain::CMain(IFactory& resFactory, CSimplePool& resStore, @@ -123,6 +103,12 @@ void CMain::RegisterResourceTweaks() } void CMain::ResetGameState() { + CPersistentOptions sysOpts = g_GameState->SystemOptions(); + CGameOptions gameOpts = g_GameState->GameOptions(); + x128_globalObjects.ResetGameState(); + g_GameState->ImportPersistentOptions(sysOpts); + g_GameState->SetGameOptions(gameOpts); + g_GameState->GetPlayerState()->SetIsFusionEnabled(g_GameState->SystemOptions().GetPlayerHasFusion()); } void CMain::InitializeSubsystems(const hecl::Runtime::FileStoreManager& storeMgr) diff --git a/Runtime/MP1/MP1.hpp b/Runtime/MP1/MP1.hpp index be06d6167..5a3dc31b1 100644 --- a/Runtime/MP1/MP1.hpp +++ b/Runtime/MP1/MP1.hpp @@ -53,7 +53,7 @@ class CGameGlobalObjects CSimplePool& xcc_simplePool; CCharacterFactoryBuilder xec_charFactoryBuilder; CAiFuncMap x110_aiFuncMap; - CGameState x134_gameState; + std::unique_ptr x134_gameState; TLockedToken x13c_mainStringTable; CInGameTweakManager x150_tweakManager; std::unique_ptr m_renderer; @@ -79,7 +79,8 @@ public: g_SimplePool = &xcc_simplePool; g_CharFactoryBuilder = &xec_charFactoryBuilder; g_AiFuncMap = &x110_aiFuncMap; - g_GameState = &x134_gameState; + x134_gameState.reset(new CGameState()); + g_GameState = x134_gameState.get(); g_TweakManager = &x150_tweakManager; } @@ -99,6 +100,12 @@ public: g_MemoryCardSys = x0_memoryCardSys.get(); } } + + void ResetGameState() + { + x134_gameState.reset(new CGameState()); + g_GameState = x134_gameState.get(); + } }; #if MP1_USE_BOO @@ -108,36 +115,37 @@ class CGameArchitectureSupport #endif { CMain& m_parent; - CArchitectureQueue m_archQueue; - CAudioSys m_audioSys; - CInputGenerator m_inputGenerator; - CGuiSys m_guiSys; - CIOWinManager m_ioWinManager; + CArchitectureQueue x4_archQueue; + CAudioSys x0_audioSys; + CInputGenerator x30_inputGenerator; + CGuiSys x44_guiSys; + CIOWinManager x58_ioWinManager; + s32 x78_; boo::SWindowRect m_windowRect; bool m_rectIsDirty; void mouseDown(const boo::SWindowCoord &coord, boo::EMouseButton button, boo::EModifierKey mods) - { m_inputGenerator.mouseDown(coord, button, mods); } + { x30_inputGenerator.mouseDown(coord, button, mods); } void mouseUp(const boo::SWindowCoord &coord, boo::EMouseButton button, boo::EModifierKey mods) - { m_inputGenerator.mouseUp(coord, button, mods); } + { x30_inputGenerator.mouseUp(coord, button, mods); } void mouseMove(const boo::SWindowCoord &coord) - { m_inputGenerator.mouseMove(coord); } + { x30_inputGenerator.mouseMove(coord); } void scroll(const boo::SWindowCoord &coord, const boo::SScrollDelta &scroll) - { m_inputGenerator.scroll(coord, scroll); } + { x30_inputGenerator.scroll(coord, scroll); } void charKeyDown(unsigned long charCode, boo::EModifierKey mods, bool isRepeat) - { m_inputGenerator.charKeyDown(charCode, mods, isRepeat); } + { x30_inputGenerator.charKeyDown(charCode, mods, isRepeat); } void charKeyUp(unsigned long charCode, boo::EModifierKey mods) - { m_inputGenerator.charKeyUp(charCode, mods); } + { x30_inputGenerator.charKeyUp(charCode, mods); } void specialKeyDown(boo::ESpecialKey key, boo::EModifierKey mods, bool isRepeat) - { m_inputGenerator.specialKeyDown(key, mods, isRepeat); } + { x30_inputGenerator.specialKeyDown(key, mods, isRepeat); } void specialKeyUp(boo::ESpecialKey key, boo::EModifierKey mods) - { m_inputGenerator.specialKeyUp(key, mods); } + { x30_inputGenerator.specialKeyUp(key, mods); } void modKeyDown(boo::EModifierKey mod, bool isRepeat) - { m_inputGenerator.modKeyDown(mod, isRepeat);} + { x30_inputGenerator.modKeyDown(mod, isRepeat);} void modKeyUp(boo::EModifierKey mod) - { m_inputGenerator.modKeyUp(mod); } + { x30_inputGenerator.modKeyUp(mod); } - void destroyed() { m_archQueue.Push(MakeMsg::CreateApplicationExit(EArchMsgTarget::ArchitectureSupport)); } + void destroyed() { x4_archQueue.Push(MakeMsg::CreateApplicationExit(EArchMsgTarget::ArchitectureSupport)); } void resized(const boo::SWindowRect &rect) { diff --git a/Runtime/Weapon/CGameProjectile.cpp b/Runtime/Weapon/CGameProjectile.cpp index d82338937..117f14c4e 100644 --- a/Runtime/Weapon/CGameProjectile.cpp +++ b/Runtime/Weapon/CGameProjectile.cpp @@ -8,10 +8,10 @@ CGameProjectile::CGameProjectile(bool active, const TToken&, u32 w1, bool b2, const zeus::CVector3f&, const rstl::optional_object>&, s16, bool b3) : CWeapon(owner, aid, uid, active, wType, name, xf, - CMaterialFilter( - CMaterialList(EMaterialTypes::Fifty, matType), - CMaterialList(EMaterialTypes::ThirtyFive, EMaterialTypes::Eighteen, matType, EMaterialTypes::Nineteen), - CMaterialFilter::EFilterType::Three), + CMaterialFilter(CMaterialList(EMaterialTypes::NonSolidDamageable, matType), + CMaterialList(EMaterialTypes::Projectile, EMaterialTypes::ProjectilePassthrough, matType, + EMaterialTypes::Solid), + CMaterialFilter::EFilterType::Three), CMaterialList(), dInfo, EProjectileAttrib(w1) | GetBeamAttribType(wType), CModelData::CModelDataNull()) { } diff --git a/Runtime/World/CActor.cpp b/Runtime/World/CActor.cpp index a81f26210..d6823c694 100644 --- a/Runtime/World/CActor.cpp +++ b/Runtime/World/CActor.cpp @@ -10,9 +10,9 @@ static CMaterialList MakeActorMaterialList(const CMaterialList& materialList, co { CMaterialList ret = materialList; if (params.GetVisorParameters().x0_28_b3) - ret.Add(EMaterialTypes::Fourteen); + ret.Add(EMaterialTypes::Mud); if (params.GetVisorParameters().x0_29_b4) - ret.Add(EMaterialTypes::Fifteen); + ret.Add(EMaterialTypes::Glass); return ret; } @@ -20,7 +20,7 @@ CActor::CActor(TUniqueId uid, bool active, const std::string& name, const CEntit CModelData&& mData, const CMaterialList& list, const CActorParameters& params, TUniqueId otherUid) : CEntity(uid, info, active, name) , x60_material(MakeActorMaterialList(list, params)) -, x70_(CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Nineteen}, {EMaterialTypes::Zero})) +, x70_(CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {EMaterialTypes::Unknown})) , xc6_(otherUid) { if (mData.x10_animData || mData.x1c_normalModel) @@ -42,10 +42,10 @@ void CActor::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateMana break; case EScriptObjectMessage::InternalMessage11: // 33 { - if (x94_simpleShadow) - AddMaterial(EMaterialTypes::ThirtyNine, mgr); + if (x98_scanObjectInfo) + AddMaterial(EMaterialTypes::Scannable, mgr); else - RemoveMaterial(EMaterialTypes::ThirtyNine, mgr); + RemoveMaterial(EMaterialTypes::Scannable, mgr); if (HasModelData() && x64_modelData->AnimationData()) { diff --git a/Runtime/World/CAi.cpp b/Runtime/World/CAi.cpp index 2311005f1..fef9404fb 100644 --- a/Runtime/World/CAi.cpp +++ b/Runtime/World/CAi.cpp @@ -9,8 +9,8 @@ namespace urde static CMaterialList MakeAiMaterialList(const CMaterialList& in) { CMaterialList ret = in; - ret.Add(EMaterialTypes::FourtyEight); - ret.Add(EMaterialTypes::TwentyOne); + ret.Add(EMaterialTypes::AIBlock); + ret.Add(EMaterialTypes::CameraPassthrough); return ret; } diff --git a/Runtime/World/CPatterned.cpp b/Runtime/World/CPatterned.cpp index f07fe0cd2..2308bf9fa 100644 --- a/Runtime/World/CPatterned.cpp +++ b/Runtime/World/CPatterned.cpp @@ -4,11 +4,11 @@ namespace urde { -CMaterialList gkPatternedGroundMaterialList(EMaterialTypes::ThirtyThree, EMaterialTypes::Nineteen, - EMaterialTypes::FourtyOne, EMaterialTypes::ThirtySeven, - EMaterialTypes::Fourty); -CMaterialList gkPatternedFlyerMaterialList(EMaterialTypes::ThirtyThree, EMaterialTypes::Nineteen, - EMaterialTypes::FourtyOne, EMaterialTypes::Fourty); +CMaterialList gkPatternedGroundMaterialList(EMaterialTypes::Character, EMaterialTypes::Solid, + EMaterialTypes::Orbit, EMaterialTypes::GroundCollider, + EMaterialTypes::Target); +CMaterialList gkPatternedFlyerMaterialList(EMaterialTypes::Character, EMaterialTypes::Solid, + EMaterialTypes::Orbit, EMaterialTypes::Target); CPatterned::CPatterned(EUnknown, TUniqueId uid, const std::string& name, CPatterned::EFlavorType flavor, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, diff --git a/Runtime/World/CScriptAiJumpPoint.cpp b/Runtime/World/CScriptAiJumpPoint.cpp index 264d0253b..d8fe118d3 100644 --- a/Runtime/World/CScriptAiJumpPoint.cpp +++ b/Runtime/World/CScriptAiJumpPoint.cpp @@ -7,7 +7,7 @@ namespace urde { CScriptAiJumpPoint::CScriptAiJumpPoint(TUniqueId uid, const std::string& name, const CEntityInfo& info, zeus::CTransform& xf, bool active, float f1) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), CActorParameters::None(), kInvalidUniqueId) , xe8_(f1) { diff --git a/Runtime/World/CScriptBeam.cpp b/Runtime/World/CScriptBeam.cpp index 40c1fae10..1d398ab1f 100644 --- a/Runtime/World/CScriptBeam.cpp +++ b/Runtime/World/CScriptBeam.cpp @@ -45,7 +45,7 @@ void CScriptBeam::AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId objId, CSt x154_projectileId = mgr.AllocateUniqueId(); mgr.AddObject(new CPlasmaProjectile(xe8_weaponDescription, x10_name + "-Projectile", x138_damageInfo.GetWeaponMode().GetType(), xf4_beamInfo, x34_transform, - EMaterialTypes::ThirtyFive, x138_damageInfo, x8_uid, x4_areaId, + EMaterialTypes::Projectile, x138_damageInfo, x8_uid, x4_areaId, x154_projectileId, 8, false, 2)); } else if (msg == EScriptObjectMessage::InternalMessage12) diff --git a/Runtime/World/CScriptCameraHint.cpp b/Runtime/World/CScriptCameraHint.cpp index ceacc133b..476d504a8 100644 --- a/Runtime/World/CScriptCameraHint.cpp +++ b/Runtime/World/CScriptCameraHint.cpp @@ -9,7 +9,7 @@ CScriptCameraHint::CScriptCameraHint(TUniqueId uid, const std::string& name, con const zeus::CTransform& xf, bool active, u32, u32, u32, float, float, float, const zeus::CVector3f&, const zeus::CVector3f&, const zeus::CVector3f&, float, float, float, float, float, float, float, float, float, float) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), CActorParameters::None(), kInvalidUniqueId) { } diff --git a/Runtime/World/CScriptCameraHintTrigger.cpp b/Runtime/World/CScriptCameraHintTrigger.cpp index 59f555c49..07a35bbaf 100644 --- a/Runtime/World/CScriptCameraHintTrigger.cpp +++ b/Runtime/World/CScriptCameraHintTrigger.cpp @@ -7,7 +7,7 @@ namespace urde CScriptCameraHintTrigger::CScriptCameraHintTrigger(TUniqueId uid, bool active, const std::string& name, const CEntityInfo& info, const zeus::CVector3f& scale, const zeus::CTransform& xf, bool b2, bool b3) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::ThirtyFour), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Trigger), CActorParameters::None(), kInvalidUniqueId) , xe8_obb(xf, scale) , x124_scale(scale) diff --git a/Runtime/World/CScriptCameraPitchVolume.cpp b/Runtime/World/CScriptCameraPitchVolume.cpp index a1fb31046..8a7d20dea 100644 --- a/Runtime/World/CScriptCameraPitchVolume.cpp +++ b/Runtime/World/CScriptCameraPitchVolume.cpp @@ -13,7 +13,7 @@ CScriptCameraPitchVolume::CScriptCameraPitchVolume(TUniqueId uid, bool active, c const CEntityInfo& info, const zeus::CVector3f& scale, const zeus::CTransform& xf, const zeus::CRelAngle& r1, const zeus::CRelAngle& r2, float maxInterpDistance) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::ThirtyFour), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Trigger), CActorParameters::None(), kInvalidUniqueId) , xe8_obbox(xf, scale * skScaleFactor) , x124_(r1) diff --git a/Runtime/World/CScriptCameraWaypoint.cpp b/Runtime/World/CScriptCameraWaypoint.cpp index 8b276c071..4cdff4772 100644 --- a/Runtime/World/CScriptCameraWaypoint.cpp +++ b/Runtime/World/CScriptCameraWaypoint.cpp @@ -6,7 +6,7 @@ namespace urde CScriptCameraWaypoint::CScriptCameraWaypoint(TUniqueId uid, const std::string& name, const CEntityInfo& info, const zeus::CTransform& xf, bool active, float, u32) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Zero), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Unknown), CActorParameters::None(), kInvalidUniqueId) { diff --git a/Runtime/World/CScriptCoverPoint.cpp b/Runtime/World/CScriptCoverPoint.cpp index 5c475d916..b162dc109 100644 --- a/Runtime/World/CScriptCoverPoint.cpp +++ b/Runtime/World/CScriptCoverPoint.cpp @@ -7,7 +7,7 @@ namespace urde CScriptCoverPoint::CScriptCoverPoint(TUniqueId uid, const std::string &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::Zero), CActorParameters::None(), kInvalidUniqueId), + CMaterialList(EMaterialTypes::Unknown), CActorParameters::None(), kInvalidUniqueId), xe8_flags(flags), xf4_coverTime(coverTime), xf8_24_crouch(crouch) diff --git a/Runtime/World/CScriptDamageableTrigger.cpp b/Runtime/World/CScriptDamageableTrigger.cpp index 8ee582e83..80aef9760 100644 --- a/Runtime/World/CScriptDamageableTrigger.cpp +++ b/Runtime/World/CScriptDamageableTrigger.cpp @@ -13,10 +13,10 @@ CActorParameters MakeDamageableTriggerActorParms(const CActorParameters& aParams CMaterialList MakeDamageableTriggerMaterial(CScriptDamageableTrigger::ECanOrbit canOrbit) { if (canOrbit == CScriptDamageableTrigger::ECanOrbit::Orbit) - return CMaterialList(EMaterialTypes::FourtyOne, EMaterialTypes::ThirtyFour, EMaterialTypes::FourtyThree, - EMaterialTypes::Fifty, EMaterialTypes::FiftySix); - return CMaterialList(EMaterialTypes::ThirtyFour, EMaterialTypes::FourtyThree, - EMaterialTypes::Fifty, EMaterialTypes::FiftySix); + return CMaterialList(EMaterialTypes::Orbit, EMaterialTypes::Trigger, EMaterialTypes::Immovable, + EMaterialTypes::NonSolidDamageable, EMaterialTypes::ExcludeFromLineOfSightTest); + return CMaterialList(EMaterialTypes::Trigger, EMaterialTypes::Immovable, + EMaterialTypes::NonSolidDamageable, EMaterialTypes::ExcludeFromLineOfSightTest); } diff --git a/Runtime/World/CScriptDebris.cpp b/Runtime/World/CScriptDebris.cpp index 85d5fb989..69569909e 100644 --- a/Runtime/World/CScriptDebris.cpp +++ b/Runtime/World/CScriptDebris.cpp @@ -8,7 +8,7 @@ CScriptDebris::CScriptDebris(TUniqueId uid, const std::string& name, const CEnti const zeus::CVector3f&, const zeus::CColor&, float f1, float f2, float f3, CScriptDebris::EScaleType, bool, bool, bool active) : CPhysicsActor(uid, active, name, info, xf, std::move(mData), - CMaterialList(EMaterialTypes::Nineteen, EMaterialTypes::FourtyFour), + CMaterialList(EMaterialTypes::Solid, EMaterialTypes::Debris), mData.GetBounds(xf.getRotation()), SMoverData(f2), aParams, 0.3, 0.1) { diff --git a/Runtime/World/CScriptDock.cpp b/Runtime/World/CScriptDock.cpp index 57c7ba2ae..165e5042c 100644 --- a/Runtime/World/CScriptDock.cpp +++ b/Runtime/World/CScriptDock.cpp @@ -10,9 +10,9 @@ namespace urde CMaterialList MakeDockMaterialList() { CMaterialList list; - list.Add(EMaterialTypes::ThirtyFour); - list.Add(EMaterialTypes::FourtyThree); - list.Add(EMaterialTypes::FourtyEight); + list.Add(EMaterialTypes::Trigger); + list.Add(EMaterialTypes::Immovable); + list.Add(EMaterialTypes::AIBlock); return list; } diff --git a/Runtime/World/CScriptDoor.cpp b/Runtime/World/CScriptDoor.cpp index f471f98f4..d7630e18a 100644 --- a/Runtime/World/CScriptDoor.cpp +++ b/Runtime/World/CScriptDoor.cpp @@ -12,14 +12,14 @@ namespace urde { -static CMaterialList MakeDoorMaterialList(bool material) +static CMaterialList MakeDoorMaterialList(bool open) { CMaterialList ret; - ret.Add(EMaterialTypes::Nineteen); - ret.Add(EMaterialTypes::FourtyThree); - ret.Add(EMaterialTypes::FourtyOne); - if (material) - ret.Add(EMaterialTypes::FourtyTwo); + ret.Add(EMaterialTypes::Solid); + ret.Add(EMaterialTypes::Immovable); + ret.Add(EMaterialTypes::Orbit); + if (!open) + ret.Add(EMaterialTypes::Occluder); return ret; } @@ -27,19 +27,19 @@ static CMaterialList MakeDoorMaterialList(bool material) CScriptDoor::CScriptDoor(TUniqueId uid, const std::string& name, const CEntityInfo& info, const zeus::CTransform& xf, CModelData&& mData, const CActorParameters& actParms, const zeus::CVector3f&, const zeus::CAABox& aabb, bool active, - bool material, bool b2, float, bool ballDoor) - : CPhysicsActor(uid, active, name, info, xf, std::move(mData), MakeDoorMaterialList(material), + bool open, bool b2, float, bool ballDoor) + : CPhysicsActor(uid, active, name, info, xf, std::move(mData), MakeDoorMaterialList(open), aabb, SMoverData(1.f), actParms, 0.3f, 0.1f), x2a8_29_ballDoor(ballDoor), - x2a8_25_(material), - x2a8_26_(material), + x2a8_25_(open), + x2a8_26_(open), x2a8_28_(b2), x2a8_27_(true) { x264_ = GetBoundingBox(); x284_modelBounds = x64_modelData->GetBounds(xf.getRotation()); - if (material) + if (open) SetDoorAnimation(EDoorAnimType::Open); SetMass(0.f); diff --git a/Runtime/World/CScriptDoor.hpp b/Runtime/World/CScriptDoor.hpp index 427042aa6..d576f6f82 100644 --- a/Runtime/World/CScriptDoor.hpp +++ b/Runtime/World/CScriptDoor.hpp @@ -54,7 +54,7 @@ public: CScriptDoor(TUniqueId, const std::string& name, const CEntityInfo& info, const zeus::CTransform&, CModelData&&, const CActorParameters&, const zeus::CVector3f&, const zeus::CAABox&, - bool active, bool material, bool, float, bool ballDoor); + bool active, bool open, bool, float, bool ballDoor); zeus::CVector3f GetOrbitPosition(const CStateManager& mgr) const; void AcceptScriptMsg(EScriptObjectMessage msg, TUniqueId uid, CStateManager& mgr); diff --git a/Runtime/World/CScriptGrapplePoint.cpp b/Runtime/World/CScriptGrapplePoint.cpp index 25dc4bf46..80e514aaf 100644 --- a/Runtime/World/CScriptGrapplePoint.cpp +++ b/Runtime/World/CScriptGrapplePoint.cpp @@ -7,7 +7,7 @@ namespace urde { CScriptGrapplePoint::CScriptGrapplePoint(TUniqueId uid, const std::string &name, const CEntityInfo& info, const zeus::CTransform &transform, bool active, const CGrappleParameters ¶ms) - : CActor(uid, active, name, info, transform, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::FourtyOne), + : CActor(uid, active, name, info, transform, CModelData::CModelDataNull(), CMaterialList(EMaterialTypes::Orbit), CActorParameters::None(), kInvalidUniqueId), xe8_(x34_transform.origin - 0.5f, diff --git a/Runtime/World/CScriptPlatform.cpp b/Runtime/World/CScriptPlatform.cpp index 4d0b3bcbf..21ce8a315 100644 --- a/Runtime/World/CScriptPlatform.cpp +++ b/Runtime/World/CScriptPlatform.cpp @@ -7,10 +7,10 @@ namespace urde static CMaterialList MakePlatformMaterialList() { CMaterialList ret; - ret.Add(EMaterialTypes::Nineteen); - ret.Add(EMaterialTypes::FourtyThree); - ret.Add(EMaterialTypes::FourtyNine); - ret.Add(EMaterialTypes::FourtyTwo); + ret.Add(EMaterialTypes::Solid); + ret.Add(EMaterialTypes::Immovable); + ret.Add(EMaterialTypes::Platform); + ret.Add(EMaterialTypes::Occluder); return ret; } diff --git a/Runtime/World/CScriptPointOfInterest.cpp b/Runtime/World/CScriptPointOfInterest.cpp index 6b8e71d6c..f524e453a 100644 --- a/Runtime/World/CScriptPointOfInterest.cpp +++ b/Runtime/World/CScriptPointOfInterest.cpp @@ -9,7 +9,7 @@ namespace urde CScriptPointOfInterest::CScriptPointOfInterest(TUniqueId uid, const std::string& name, const CEntityInfo info, const zeus::CTransform& xf, bool active, const CScannableParameters& parms, float f1) -: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(u64(EMaterialTypes::FourtyOne)), +: CActor(uid, active, name, info, xf, CModelData::CModelDataNull(), CMaterialList(u64(EMaterialTypes::Orbit)), CActorParameters::None().Scannable(parms), kInvalidUniqueId) , xe8_pointSize(f1) { diff --git a/Runtime/World/CScriptTrigger.cpp b/Runtime/World/CScriptTrigger.cpp index cf22ab706..5b455b7b0 100644 --- a/Runtime/World/CScriptTrigger.cpp +++ b/Runtime/World/CScriptTrigger.cpp @@ -12,7 +12,7 @@ CScriptTrigger::CScriptTrigger(TUniqueId uid, const std::string& name, const CEn const CDamageInfo& dInfo, const zeus::CVector3f& forceField, ETriggerFlags triggerFlags, bool active, bool b2, bool b3) : CActor(uid, active, name, info, zeus::CTransform::Translate(pos), CModelData::CModelDataNull(), - CMaterialList(EMaterialTypes::ThirtyFour), CActorParameters::None(), kInvalidUniqueId), + CMaterialList(EMaterialTypes::Trigger), CActorParameters::None(), kInvalidUniqueId), x100_damageInfo(dInfo), x11c_forceField(forceField), x128_forceMagnitude(forceField.magnitude()), diff --git a/Runtime/World/CWorldTransManager.cpp b/Runtime/World/CWorldTransManager.cpp index a711db465..82fe2f5d7 100644 --- a/Runtime/World/CWorldTransManager.cpp +++ b/Runtime/World/CWorldTransManager.cpp @@ -19,7 +19,7 @@ namespace urde int CWorldTransManager::GetSuitCharIdx() { CPlayerState& state = *g_GameState->GetPlayerState(); - if (state.GetFusion()) + if (state.IsFusionEnabled()) { switch (state.x20_currentSuit) { diff --git a/Runtime/World/ScriptLoader.cpp b/Runtime/World/ScriptLoader.cpp index e4d5c7153..a055a4c5b 100644 --- a/Runtime/World/ScriptLoader.cpp +++ b/Runtime/World/ScriptLoader.cpp @@ -385,9 +385,9 @@ CEntity* ScriptLoader::LoadActor(CStateManager& mgr, CInputStream& in, int propC CActorParameters actParms = LoadActorParameters(in); bool b1 = in.readBool(); - bool b2 = in.readBool(); - bool b3 = in.readBool(); - bool b4 = in.readBool(); + bool snow = in.readBool(); + bool grass = in.readBool(); + bool metalGrating = in.readBool(); bool b5 = in.readBool(); u32 w2 = in.readUint32Big(); float f3 = in.readFloatBig(); @@ -403,14 +403,14 @@ CEntity* ScriptLoader::LoadActor(CStateManager& mgr, CInputStream& in, int propC zeus::CAABox aabb = GetCollisionBox(mgr, info.GetAreaId(), collisionExtent, centroid); CMaterialList list; - if (b2) - list.Add(EMaterialTypes::Eleven); + if (snow) // Bool 2 + list.Add(EMaterialTypes::Snow); - if (b3) - list.Add(EMaterialTypes::Three); + if (grass) // Bool 3 + list.Add(EMaterialTypes::Grass); - if (b4) - list.Add(EMaterialTypes::Six); + if (metalGrating) // Bool 4 + list.Add(EMaterialTypes::MetalGrating); bool generateExtent = false; if (collisionExtent.x < 0.f || collisionExtent.y < 0.f || collisionExtent.z < 0.f) diff --git a/kabufuda b/kabufuda index 6892853a1..3121f67f4 160000 --- a/kabufuda +++ b/kabufuda @@ -1 +1 @@ -Subproject commit 6892853a14673334e155da5abc7d8c9cca859085 +Subproject commit 3121f67f4da34f64bcef3aecab1d269fc5a4e035