Add missing factories, update hecl

This commit is contained in:
Phillip Stephens 2017-02-13 13:29:00 -08:00
parent 7085b837b7
commit ac5f28eeff
22 changed files with 279 additions and 257 deletions

View File

@ -350,7 +350,7 @@ void DPSM<IDType>::writeQuadDecalInfo(athena::io::IStreamWriter& w,
}
if (quad.x10_CLR)
{
w.writeBytes((first ? "1CLR" : "2LCR"), 4);
w.writeBytes((first ? "1CLR" : "2CLR"), 4);
quad.x10_CLR.write(w);
}
if (quad.x14_TEX)

View File

@ -6,6 +6,11 @@
#include "Runtime/Particle/CGenDescription.hpp"
#include "Runtime/Particle/CElectricDescription.hpp"
#include "Runtime/Particle/CSwooshDescription.hpp"
#include "Runtime/Particle/CParticleElectricDataFactory.hpp"
#include "Runtime/Particle/CParticleSwooshDataFactory.hpp"
#include "Runtime/Particle/CWeaponDescription.hpp"
#include "Runtime/Particle/CProjectileWeaponDataFactory.hpp"
#include "Runtime/Particle/CDecalDataFactory.hpp"
#include "Runtime/GuiSys/CGuiFrame.hpp"
#include "Runtime/GuiSys/CRasterFont.hpp"
#include "Runtime/GuiSys/CStringTable.hpp"
@ -17,6 +22,7 @@
#include "Runtime/Character/CAllFormatsAnimSource.hpp"
#include "Runtime/Character/CAnimPOIData.hpp"
#include "Runtime/Collision/CCollidableOBBTreeGroup.hpp"
#include "Runtime/Collision/CCollisionResponseData.hpp"
#include "Runtime/CSaveWorld.hpp"
#include "Runtime/AutoMapper/CMapWorld.hpp"
#include "Runtime/CScannableObjectInfo.hpp"
@ -110,6 +116,11 @@ ProjectResourceFactoryMP1::ProjectResourceFactoryMP1(hecl::ClientProcess& client
m_factoryMgr.AddFactory(FOURCC('MAPW'), FFactoryFunc(FMapWorldFactory));
m_factoryMgr.AddFactory(FOURCC('OIDS'), FFactoryFunc(FMP1OriginalIDsFactory));
m_factoryMgr.AddFactory(FOURCC('SCAN'), FFactoryFunc(FScannableObjectInfoFactory));
m_factoryMgr.AddFactory(FOURCC('CRSC'), FFactoryFunc(FCollisionResponseDataFactory));
m_factoryMgr.AddFactory(FOURCC('SWHC'), FFactoryFunc(FParticleSwooshDataFactory));
m_factoryMgr.AddFactory(FOURCC('ELSC'), FFactoryFunc(FParticleElectricDataFactory));
m_factoryMgr.AddFactory(FOURCC('WPSC'), FFactoryFunc(FProjectileWeaponDataFactory));
m_factoryMgr.AddFactory(FOURCC('DPSC'), FFactoryFunc(FDecalDataFactory));
}
void ProjectResourceFactoryMP1::IndexMP1Resources(hecl::Database::Project& proj, CSimplePool& sp)

View File

@ -10,111 +10,64 @@
namespace urde
{
const EWeaponCollisionResponseTypes CCollisionResponseData::skWorldMaterialTable[32] =
{
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Unknown2,
EWeaponCollisionResponseTypes::Metal,
EWeaponCollisionResponseTypes::Grass,
EWeaponCollisionResponseTypes::Ice,
EWeaponCollisionResponseTypes::Goo,
EWeaponCollisionResponseTypes::Metal,
EWeaponCollisionResponseTypes::Wood,
EWeaponCollisionResponseTypes::Grass,
EWeaponCollisionResponseTypes::Lava,
EWeaponCollisionResponseTypes::Lava,
EWeaponCollisionResponseTypes::Ice,
EWeaponCollisionResponseTypes::Mud,
EWeaponCollisionResponseTypes::Metal,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Goo,
EWeaponCollisionResponseTypes::Goo,
EWeaponCollisionResponseTypes::Sand,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Metal,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default,
const EWeaponCollisionResponseTypes CCollisionResponseData::skWorldMaterialTable[32] = {
EWeaponCollisionResponseTypes::Default, EWeaponCollisionResponseTypes::Unknown2,
EWeaponCollisionResponseTypes::Metal, EWeaponCollisionResponseTypes::Grass,
EWeaponCollisionResponseTypes::Ice, EWeaponCollisionResponseTypes::Goo,
EWeaponCollisionResponseTypes::Metal, EWeaponCollisionResponseTypes::Wood,
EWeaponCollisionResponseTypes::Grass, EWeaponCollisionResponseTypes::Lava,
EWeaponCollisionResponseTypes::Lava, EWeaponCollisionResponseTypes::Ice,
EWeaponCollisionResponseTypes::Mud, EWeaponCollisionResponseTypes::Metal,
EWeaponCollisionResponseTypes::Default, EWeaponCollisionResponseTypes::Goo,
EWeaponCollisionResponseTypes::Goo, EWeaponCollisionResponseTypes::Sand,
EWeaponCollisionResponseTypes::Default, EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default, EWeaponCollisionResponseTypes::Metal,
EWeaponCollisionResponseTypes::Default, EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default, EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default, EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default, EWeaponCollisionResponseTypes::Default,
EWeaponCollisionResponseTypes::Default, EWeaponCollisionResponseTypes::Default,
};
const s32 CCollisionResponseData::kInvalidSFX = -1;
static const std::vector<FourCC> kWCRTSFXIDs =
{
SBIG('NSFX'),SBIG('DSFX'),SBIG('CSFX'),SBIG('MSFX'),
SBIG('GRFX'),SBIG('ICFX'),SBIG('GOFX'),SBIG('WSFX'),
SBIG('WTFX'),SBIG('2MUD'),SBIG('2LAV'),SBIG('2SAN'),
SBIG('2PRJ'),SBIG('DCFX'),SBIG('DSFX'),SBIG('DSHX'),
SBIG('DEFX'),SBIG('ESFX'),SBIG('SHFX'),SBIG('BEFX'),
SBIG('WWFX'),SBIG('TAFX'),SBIG('GTFX'),SBIG('SPFX'),
SBIG('FPFX'),SBIG('FFFX'),SBIG('PAFX'),SBIG('BMFX'),
SBIG('BFFX'),SBIG('PBFX'),SBIG('IBFX'),SBIG('4SVA'),
SBIG('4RPR'),SBIG('4MTR'),SBIG('4PDS'),SBIG('4FLB'),
SBIG('4DRN'),SBIG('4MRE'),SBIG('CZFX'),SBIG('JZAS'),
SBIG('2ISE'),SBIG('2BSE'),SBIG('2ATB'),SBIG('2ATA'),
SBIG('BSFX'),SBIG('WSFX'),SBIG('TSFX'),SBIG('GSFX'),
SBIG('SSFX'),SBIG('FSFX'),SBIG('SFFX'),SBIG('PSFX'),
SBIG('MSFX'),SBIG('SBFX'),SBIG('PBSX'),SBIG('IBSX'),
SBIG('5SVA'),SBIG('5RPR'),SBIG('5MTR'),SBIG('5PDS'),
SBIG('5FLB'),SBIG('5DRN'),SBIG('5MRE'),SBIG('CSFX'),
SBIG('JZPS'),SBIG('4ISE'),SBIG('4BSE'),SBIG('4ATB'),
SBIG('4ATA'),SBIG('BHFX'),SBIG('WHFX'),SBIG('THFX'),
SBIG('GHFX'),SBIG('SHFX'),SBIG('FHFX'),SBIG('HFFX'),
SBIG('PHFX'),SBIG('MHFX'),SBIG('HBFX'),SBIG('PBHX'),
SBIG('IBHX'),SBIG('6SVA'),SBIG('6RPR'),SBIG('6MTR'),
SBIG('6PDS'),SBIG('6FLB'),SBIG('6DRN'),SBIG('6MRE'),
SBIG('CHFX'),SBIG('JZHS'),SBIG('6ISE'),SBIG('6BSE'),
SBIG('6ATB'),SBIG('6ATA'),
static const std::vector<FourCC> kWCRTSFXIDs = {
SBIG('NSFX'), SBIG('DSFX'), SBIG('CSFX'), SBIG('MSFX'), SBIG('GRFX'), SBIG('ICFX'), SBIG('GOFX'), SBIG('WSFX'),
SBIG('WTFX'), SBIG('2MUD'), SBIG('2LAV'), SBIG('2SAN'), SBIG('2PRJ'), SBIG('DCFX'), SBIG('DSFX'), SBIG('DSHX'),
SBIG('DEFX'), SBIG('ESFX'), SBIG('SHFX'), SBIG('BEFX'), SBIG('WWFX'), SBIG('TAFX'), SBIG('GTFX'), SBIG('SPFX'),
SBIG('FPFX'), SBIG('FFFX'), SBIG('PAFX'), SBIG('BMFX'), SBIG('BFFX'), SBIG('PBFX'), SBIG('IBFX'), SBIG('4SVA'),
SBIG('4RPR'), SBIG('4MTR'), SBIG('4PDS'), SBIG('4FLB'), SBIG('4DRN'), SBIG('4MRE'), SBIG('CZFX'), SBIG('JZAS'),
SBIG('2ISE'), SBIG('2BSE'), SBIG('2ATB'), SBIG('2ATA'), SBIG('BSFX'), SBIG('WSFX'), SBIG('TSFX'), SBIG('GSFX'),
SBIG('SSFX'), SBIG('FSFX'), SBIG('SFFX'), SBIG('PSFX'), SBIG('MSFX'), SBIG('SBFX'), SBIG('PBSX'), SBIG('IBSX'),
SBIG('5SVA'), SBIG('5RPR'), SBIG('5MTR'), SBIG('5PDS'), SBIG('5FLB'), SBIG('5DRN'), SBIG('5MRE'), SBIG('CSFX'),
SBIG('JZPS'), SBIG('4ISE'), SBIG('4BSE'), SBIG('4ATB'), SBIG('4ATA'), SBIG('BHFX'), SBIG('WHFX'), SBIG('THFX'),
SBIG('GHFX'), SBIG('SHFX'), SBIG('FHFX'), SBIG('HFFX'), SBIG('PHFX'), SBIG('MHFX'), SBIG('HBFX'), SBIG('PBHX'),
SBIG('IBHX'), SBIG('6SVA'), SBIG('6RPR'), SBIG('6MTR'), SBIG('6PDS'), SBIG('6FLB'), SBIG('6DRN'), SBIG('6MRE'),
SBIG('CHFX'), SBIG('JZHS'), SBIG('6ISE'), SBIG('6BSE'), SBIG('6ATB'), SBIG('6ATA'),
};
static const std::vector<FourCC> kWCRTIDs =
{
SBIG('NODP'),SBIG('DEFS'),SBIG('CRTS'),SBIG('MTLS'),
SBIG('GRAS'),SBIG('ICEE'),SBIG('GOOO'),SBIG('WODS'),
SBIG('WATR'),SBIG('1MUD'),SBIG('1LAV'),SBIG('1SAN'),
SBIG('1PRJ'),SBIG('DCHR'),SBIG('DCHS'),SBIG('DCSH'),
SBIG('DENM'),SBIG('DESP'),SBIG('DESH'),SBIG('BTLE'),
SBIG('WASP'),SBIG('TALP'),SBIG('PTGM'),SBIG('SPIR'),
SBIG('FPIR'),SBIG('FFLE'),SBIG('PARA'),SBIG('BMON'),
SBIG('BFLR'),SBIG('PBOS'),SBIG('IBOS'),SBIG('1SVA'),
SBIG('1RPR'),SBIG('1MTR'),SBIG('1PDS'),SBIG('1FLB'),
SBIG('1DRN'),SBIG('1MRE'),SBIG('CHOZ'),SBIG('JZAP'),
SBIG('1ISE'),SBIG('1BSE'),SBIG('1ATB'),SBIG('1ATA'),
SBIG('BTSP'),SBIG('WWSP'),SBIG('TASP'),SBIG('TGSP'),
SBIG('SPSP'),SBIG('FPSP'),SBIG('FFSP'),SBIG('PSSP'),
SBIG('BMSP'),SBIG('BFSP'),SBIG('PBSP'),SBIG('IBSP'),
SBIG('2SVA'),SBIG('2RPR'),SBIG('2MTR'),SBIG('2PDS'),
SBIG('2FLB'),SBIG('2DRN'),SBIG('2MRE'),SBIG('CHSP'),
SBIG('JZSP'),SBIG('3ISE'),SBIG('3BSE'),SBIG('3ATB'),
SBIG('3ATA'),SBIG('BTSH'),SBIG('WWSH'),SBIG('TASH'),
SBIG('TGSH'),SBIG('SPSH'),SBIG('FPSH'),SBIG('FFSH'),
SBIG('PSSH'),SBIG('BMSH'),SBIG('BFSH'),SBIG('PBSH'),
SBIG('IBSH'),SBIG('3SVA'),SBIG('3RPR'),SBIG('3MTR'),
SBIG('3PDS'),SBIG('3FLB'),SBIG('3DRN'),SBIG('3MRE'),
SBIG('CHSH'),SBIG('JZSH'),SBIG('5ISE'),SBIG('5BSE'),
SBIG('5ATB'),SBIG('5ATA')
};
static const std::vector<FourCC> kWCRTIDs = {
SBIG('NODP'), SBIG('DEFS'), SBIG('CRTS'), SBIG('MTLS'), SBIG('GRAS'), SBIG('ICEE'), SBIG('GOOO'), SBIG('WODS'),
SBIG('WATR'), SBIG('1MUD'), SBIG('1LAV'), SBIG('1SAN'), SBIG('1PRJ'), SBIG('DCHR'), SBIG('DCHS'), SBIG('DCSH'),
SBIG('DENM'), SBIG('DESP'), SBIG('DESH'), SBIG('BTLE'), SBIG('WASP'), SBIG('TALP'), SBIG('PTGM'), SBIG('SPIR'),
SBIG('FPIR'), SBIG('FFLE'), SBIG('PARA'), SBIG('BMON'), SBIG('BFLR'), SBIG('PBOS'), SBIG('IBOS'), SBIG('1SVA'),
SBIG('1RPR'), SBIG('1MTR'), SBIG('1PDS'), SBIG('1FLB'), SBIG('1DRN'), SBIG('1MRE'), SBIG('CHOZ'), SBIG('JZAP'),
SBIG('1ISE'), SBIG('1BSE'), SBIG('1ATB'), SBIG('1ATA'), SBIG('BTSP'), SBIG('WWSP'), SBIG('TASP'), SBIG('TGSP'),
SBIG('SPSP'), SBIG('FPSP'), SBIG('FFSP'), SBIG('PSSP'), SBIG('BMSP'), SBIG('BFSP'), SBIG('PBSP'), SBIG('IBSP'),
SBIG('2SVA'), SBIG('2RPR'), SBIG('2MTR'), SBIG('2PDS'), SBIG('2FLB'), SBIG('2DRN'), SBIG('2MRE'), SBIG('CHSP'),
SBIG('JZSP'), SBIG('3ISE'), SBIG('3BSE'), SBIG('3ATB'), SBIG('3ATA'), SBIG('BTSH'), SBIG('WWSH'), SBIG('TASH'),
SBIG('TGSH'), SBIG('SPSH'), SBIG('FPSH'), SBIG('FFSH'), SBIG('PSSH'), SBIG('BMSH'), SBIG('BFSH'), SBIG('PBSH'),
SBIG('IBSH'), SBIG('3SVA'), SBIG('3RPR'), SBIG('3MTR'), SBIG('3PDS'), SBIG('3FLB'), SBIG('3DRN'), SBIG('3MRE'),
SBIG('CHSH'), SBIG('JZSH'), SBIG('5ISE'), SBIG('5BSE'), SBIG('5ATB'), SBIG('5ATA')};
static const std::vector<FourCC> kWCRTDecalIDs =
{
SBIG('NCDL'),SBIG('DDCL'),SBIG('CODL'),SBIG('MEDL'),
SBIG('GRDL'),SBIG('ICDL'),SBIG('GODL'),SBIG('WODL'),
SBIG('WTDL'),SBIG('3MUD'),SBIG('3LAV'),SBIG('3SAN'),
SBIG('CHDL'),SBIG('ENDL')
};
static const std::vector<FourCC> kWCRTDecalIDs = {SBIG('NCDL'), SBIG('DDCL'), SBIG('CODL'), SBIG('MEDL'), SBIG('GRDL'),
SBIG('ICDL'), SBIG('GODL'), SBIG('WODL'), SBIG('WTDL'), SBIG('3MUD'),
SBIG('3LAV'), SBIG('3SAN'), SBIG('CHDL'), SBIG('ENDL')};
using CPF = CParticleDataFactory;
void CCollisionResponseData::AddParticleSystemToResponse(EWeaponCollisionResponseTypes type, CInputStream &in, CSimplePool *resPool)
void CCollisionResponseData::AddParticleSystemToResponse(EWeaponCollisionResponseTypes type, CInputStream& in,
CSimplePool* resPool)
{
int i = int(type);
std::vector<ResId> tracker;
@ -192,8 +145,7 @@ bool CCollisionResponseData::CheckAndAddResourceToResponse(FourCC clsId, CInputS
return false;
}
CCollisionResponseData::CCollisionResponseData(CInputStream& in, CSimplePool* resPool)
: x30_RNGE(50.f), x34_FOFF(0.2f)
CCollisionResponseData::CCollisionResponseData(CInputStream& in, CSimplePool* resPool) : x30_RNGE(50.f), x34_FOFF(0.2f)
{
x0_generators.resize(94);
x10_sfx.resize(94);
@ -227,31 +179,33 @@ CCollisionResponseData::CCollisionResponseData(CInputStream& in, CSimplePool* re
}
}
const rstl::optional_object<TLockedToken<CGenDescription>>& CCollisionResponseData::GetParticleDescription(EWeaponCollisionResponseTypes type) const
const rstl::optional_object<TLockedToken<CGenDescription>>&
CCollisionResponseData::GetParticleDescription(EWeaponCollisionResponseTypes type) const
{
return x0_generators[u32(type)];
}
const rstl::optional_object<TLockedToken<CDecalDescription>>& CCollisionResponseData::GetDecalDescription(EWeaponCollisionResponseTypes type) const
const rstl::optional_object<TLockedToken<CDecalDescription>>&
CCollisionResponseData::GetDecalDescription(EWeaponCollisionResponseTypes type) const
{
return x20_decals[u32(type)];
}
s32 CCollisionResponseData::GetSoundEffectId(EWeaponCollisionResponseTypes type) const
{
if (x10_sfx[u32(type)] == kInvalidSFX)
{
if (ResponseTypeIsEnemyNormal(type))
type = EWeaponCollisionResponseTypes::EnemyNormal;
else if (ResponseTypeIsEnemySpecial(type))
type = EWeaponCollisionResponseTypes::EnemySpecial;
else if (ResponseTypeIsEnemyShielded(type))
type = EWeaponCollisionResponseTypes::EnemyShielded;
else
type = EWeaponCollisionResponseTypes::Default;
}
if (x10_sfx[u32(type)] == kInvalidSFX)
{
if (ResponseTypeIsEnemyNormal(type))
type = EWeaponCollisionResponseTypes::EnemyNormal;
else if (ResponseTypeIsEnemySpecial(type))
type = EWeaponCollisionResponseTypes::EnemySpecial;
else if (ResponseTypeIsEnemyShielded(type))
type = EWeaponCollisionResponseTypes::EnemyShielded;
else
type = EWeaponCollisionResponseTypes::Default;
}
return x10_sfx[u32(type)];
return x10_sfx[u32(type)];
}
EWeaponCollisionResponseTypes CCollisionResponseData::GetWorldCollisionResponseType(s32 id)
@ -277,15 +231,13 @@ bool CCollisionResponseData::ResponseTypeIsEnemyShielded(EWeaponCollisionRespons
return (type >= EWeaponCollisionResponseTypes::Unknown69 && type <= EWeaponCollisionResponseTypes::Unknown93);
}
FourCC CCollisionResponseData::UncookedResType()
{
return SBIG('CRSM');
}
FourCC CCollisionResponseData::UncookedResType() { return SBIG('CRSM'); }
CFactoryFnReturn FCollisionResponseDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms)
CFactoryFnReturn FCollisionResponseDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
CObjectReference*)
{
CSimplePool* sp = vparms.GetOwnedObj<CSimplePool*>();
return TToken<CCollisionResponseData>::GetIObjObjectFor(std::unique_ptr<CCollisionResponseData>(new CCollisionResponseData(in, sp)));
return TToken<CCollisionResponseData>::GetIObjObjectFor(
std::unique_ptr<CCollisionResponseData>(new CCollisionResponseData(in, sp)));
}
}

View File

@ -71,7 +71,8 @@ public:
static FourCC UncookedResType();
};
CFactoryFnReturn FCollisionResponseDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
CFactoryFnReturn FCollisionResponseDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
CObjectReference*);
}
#endif // __URDE_CCOLLISIONRESPONSEDATA_HPP__

View File

@ -0,0 +1,6 @@
#include "CCompoundTargetReticle.hpp"
namespace urde
{
}

View File

@ -0,0 +1,14 @@
#ifndef __CCOMPOUNDTARGETRETICLE_HPP__
#define __CCOMPOUNDTARGETRETICLE_HPP__
namespace urde
{
class CStateManager;
class CCompoundTargetReticle
{
public:
CCompoundTargetReticle(const CStateManager&);
};
}
#endif // __CCOMPOUNDTARGETRETICLE_HPP__

View File

@ -35,6 +35,8 @@ set(GUISYS_SOURCES
CWordBreakTables.hpp CWordBreakTables.cpp
CFontImageDef.hpp CFontImageDef.cpp
CStringTable.hpp CStringTable.cpp
CTargetingManager.hpp CTargetingManager.cpp)
CTargetingManager.hpp CTargetingManager.cpp
CCompoundTargetReticle.hpp CCompoundTargetReticle.cpp
COrbitPointMarker.hpp COrbitPointMarker.cpp)
runtime_add_list(GuiSys GUISYS_SOURCES)

View File

View File

View File

@ -0,0 +1,21 @@
#ifndef __URDE_CTARGETINGMANAGER_HPP__
#define __URDE_CTARGETINGMANAGER_HPP__
#include "CCompoundTargetReticle.hpp"
#include "COrbitPointMarker.hpp"
namespace urde
{
class CStateManager;
class CTargetingManager
{
public:
CTargetingManager(const CStateManager&);
bool CheckLoadComplete();
void Update(float, const CStateManager&);
void Draw(const CStateManager&) const;
void Touch() const;
};
}
#endif // __URDE_CTARGETINGMANAGER_HPP__

View File

@ -106,7 +106,7 @@ private:
u32 m_activeFontCh = -1;
zeus::CColor m_main;
zeus::CColor m_outline;
zeus::CColor m_outline = zeus::CColor::skBlack;
CGuiWidget::EGuiModelDrawFlags m_drawFlags;

View File

@ -103,11 +103,15 @@ CIOWin::EMessageReturn CMFGameLoader::OnMessage(const CArchitectureMessage& msg,
return EMessageReturn::Exit;
}
u32 loadingCount = 0;
std::vector<const SObjectTag*> unloaded;
for (CToken& tok : x1c_loadList)
{
tok.Lock();
if (!tok.IsLoaded())
{
unloaded.push_back(tok.GetObjectTag());
++loadingCount;
}
}
wtMgr->Update(dt);
if (loadingCount)

View File

@ -31,7 +31,6 @@ CDecalDescription* CDecalDataFactory::CreateGeneratorDescription(CInputStream& i
return nullptr;
}
bool CDecalDataFactory::CreateDPSM(CDecalDescription* desc, CInputStream& in, CSimplePool* resPool)
{
CRandom16 rand{99};
@ -62,32 +61,32 @@ bool CDecalDataFactory::CreateDPSM(CDecalDescription* desc, CInputStream& in, CS
GetQuadDecalInfo(in, resPool, clsId, desc->x0_Quad);
else
GetQuadDecalInfo(in, resPool, clsId, desc->x1c_Quad);
break;
break;
case SBIG('DMDL'):
desc->x38_DMDL = CPF::GetModel(in, resPool);
break;
break;
case SBIG('DLFT'):
desc->x48_DLFT.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('DMOP'):
desc->x4c_DMOP.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('DMRT'):
desc->x50_DMRT.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('DMSC'):
desc->x54_DMSC.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('DMCL'):
desc->x58_DMCL.reset(CPF::GetColorElement(in));
break;
break;
case SBIG('DMAB'):
desc->x5c_24_DMAB = CPF::GetBool(in);
break;
break;
case SBIG('DMOO'):
desc->x5c_25_DMOO = CPF::GetBool(in);
break;
break;
default:
{
uint32_t clsName = clsId.toUint32();
@ -109,38 +108,39 @@ void CDecalDataFactory::GetQuadDecalInfo(CInputStream& in, CSimplePool* resPool,
case SBIG('1LFT'):
case SBIG('2LFT'):
quad.x0_LFT.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('1SZE'):
case SBIG('2SZE'):
quad.x4_SZE.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('1ROT'):
case SBIG('2ROT'):
quad.x8_ROT.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('1OFF'):
case SBIG('2OFF'):
quad.xc_OFF.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('1CLR'):
case SBIG('2CLR'):
quad.x10_CLR.reset(CPF::GetColorElement(in));
break;
break;
case SBIG('1TEX'):
case SBIG('2TEX'):
quad.x14_TEX.reset(CPF::GetTextureElement(in, resPool));
break;
break;
case SBIG('1ADD'):
case SBIG('2ADD'):
quad.x18_ADD = CPF::GetBool(in);
break;
break;
}
}
CFactoryFnReturn FDecalDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms)
CFactoryFnReturn FDecalDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
CObjectReference*)
{
CSimplePool* sp = vparms.GetOwnedObj<CSimplePool*>();
return TToken<CDecalDescription>::GetIObjObjectFor(std::unique_ptr<CDecalDescription>(CDecalDataFactory::GetGeneratorDesc(in, sp)));
return TToken<CDecalDescription>::GetIObjObjectFor(
std::unique_ptr<CDecalDescription>(CDecalDataFactory::GetGeneratorDesc(in, sp)));
}
}

View File

@ -14,13 +14,16 @@ class CSimplePool;
class CDecalDataFactory
{
static bool CreateDPSM(CDecalDescription* desc,CInputStream& in,CSimplePool* resPool);
static bool CreateDPSM(CDecalDescription* desc, CInputStream& in, CSimplePool* resPool);
static CDecalDescription* CreateGeneratorDescription(CInputStream& in, CSimplePool* resPool);
static void GetQuadDecalInfo(CInputStream& in, CSimplePool* resPool, FourCC clsId, CDecalDescription::SQuadDescr& quad);
static void GetQuadDecalInfo(CInputStream& in, CSimplePool* resPool, FourCC clsId,
CDecalDescription::SQuadDescr& quad);
public:
static CDecalDescription* GetGeneratorDesc(CInputStream& in,CSimplePool* resPool);
static CDecalDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
};
CFactoryFnReturn FDecalDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
CFactoryFnReturn FDecalDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
CObjectReference*);
}
#endif // __URDE_CDECALDATAFACTORY_HPP__

View File

@ -13,12 +13,12 @@ static logvisor::Module Log("urde::CParticleElectricDataFactory");
using CPF = CParticleDataFactory;
CElectricDescription* CParticleElectricDataFactory::GetGeneratorDesc(CInputStream &in, CSimplePool *resPool)
CElectricDescription* CParticleElectricDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool)
{
return CreateElectricDescription(in, resPool);
}
CElectricDescription* CParticleElectricDataFactory::CreateElectricDescription(CInputStream &in, CSimplePool *resPool)
CElectricDescription* CParticleElectricDataFactory::CreateElectricDescription(CInputStream& in, CSimplePool* resPool)
{
FourCC cid = CPF::GetClassID(in);
if (cid == FOURCC('ELSM'))
@ -32,7 +32,7 @@ CElectricDescription* CParticleElectricDataFactory::CreateElectricDescription(CI
return nullptr;
}
bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInputStream &in, CSimplePool *resPool)
bool CParticleElectricDataFactory::CreateELSM(CElectricDescription* desc, CInputStream& in, CSimplePool* resPool)
{
CRandom16 rand{99};
CGlobalRandom gr{rand};
@ -40,59 +40,59 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInput
FourCC clsId = CPF::GetClassID(in);
while (clsId != SBIG('_END'))
{
switch(clsId)
switch (clsId)
{
case SBIG('LIFE'):
desc->x0_LIFE.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('SLIF'):
desc->x4_SLIF.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('GRAT'):
desc->x8_GRAT.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('SCNT'):
desc->xc_SCNT.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('SSEG'):
desc->x10_SSEG.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('COLR'):
desc->x14_COLR.reset(CPF::GetColorElement(in));
break;
break;
case SBIG('IEMT'):
desc->x18_IEMT.reset(CPF::GetEmitterElement(in));
break;
break;
case SBIG('FEMT'):
desc->x1c_FEMT.reset(CPF::GetEmitterElement(in));
break;
break;
case SBIG('AMPL'):
desc->x20_AMPL.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('AMPD'):
desc->x24_AMPD.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('LWD1'):
desc->x28_LWD1.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('LWD2'):
desc->x2c_LWD2.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('LWD3'):
desc->x30_LWD3.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('LCL1'):
desc->x34_LCL1.reset(CPF::GetColorElement(in));
break;
break;
case SBIG('LCL2'):
desc->x38_LCL2.reset(CPF::GetColorElement(in));
break;
break;
case SBIG('LCL3'):
desc->x3c_LCL3.reset(CPF::GetColorElement(in));
break;
break;
case SBIG('SSWH'):
desc->x40_SSWH = CPF::GetSwooshGeneratorDesc(in, resPool);
break;
break;
case SBIG('GPSM'):
{
std::vector<ResId> tracker;
@ -109,7 +109,7 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInput
}
case SBIG('ZERY'):
desc->x70_ZERY = CPF::GetBool(in);
break;
break;
default:
{
uint32_t clsName = clsId.toUint32();
@ -132,10 +132,11 @@ void CParticleElectricDataFactory::LoadELSMTokens(CElectricDescription* desc)
desc->x60_EPSM.m_gen = desc->x60_EPSM.m_token.GetObj();
}
CFactoryFnReturn FParticleElectricDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms)
CFactoryFnReturn FParticleElectricDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
CObjectReference*)
{
CSimplePool* sp = vparms.GetOwnedObj<CSimplePool*>();
return TToken<CElectricDescription>::GetIObjObjectFor(std::unique_ptr<CElectricDescription>(CParticleElectricDataFactory::GetGeneratorDesc(in, sp)));
return TToken<CElectricDescription>::GetIObjObjectFor(
std::unique_ptr<CElectricDescription>(CParticleElectricDataFactory::GetGeneratorDesc(in, sp)));
}
}

View File

@ -20,7 +20,8 @@ public:
static CElectricDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
};
CFactoryFnReturn FParticleElectricDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
CFactoryFnReturn FParticleElectricDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
CObjectReference*);
}
#endif // __URDE_CPARTICLEELECTRICDATAFACTORY_HPP__

View File

@ -12,12 +12,12 @@ static logvisor::Module Log("urde::CParticleSwooshDataFactory");
using CPF = CParticleDataFactory;
CSwooshDescription*CParticleSwooshDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool)
CSwooshDescription* CParticleSwooshDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool)
{
return CreateGeneratorDescription(in, resPool);
}
CSwooshDescription*CParticleSwooshDataFactory::CreateGeneratorDescription(CInputStream& in, CSimplePool* resPool)
CSwooshDescription* CParticleSwooshDataFactory::CreateGeneratorDescription(CInputStream& in, CSimplePool* resPool)
{
FourCC clsId = CPF::GetClassID(in);
if (clsId == FOURCC('SWSH'))
@ -38,92 +38,92 @@ bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStre
while (clsId != SBIG('_END'))
{
CGlobalRandom gr(rand);
switch(clsId)
switch (clsId)
{
case SBIG('PSLT'):
desc->x0_PSLT.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('TIME'):
desc->x4_TIME.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('LRAD'):
desc->x8_LRAD.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('RRAD'):
desc->xc_RRAD.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('LENG'):
desc->x10_LENG.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('COLR'):
desc->x14_COLR.reset(CPF::GetColorElement(in));
break;
break;
case SBIG('SIDE'):
desc->x18_SIDE.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('IROT'):
desc->x1c_IROT.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('ROTM'):
desc->x20_ROTM.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('POFS'):
desc->x24_POFS.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('IVEL'):
desc->x28_IVEL.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('NPOS'):
desc->x2c_NPOS.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('VELM'):
desc->x30_VELM.reset(CPF::GetModVectorElement(in));
break;
break;
case SBIG('VLM2'):
desc->x34_VLM2.reset(CPF::GetModVectorElement(in));
break;
break;
case SBIG('SPLN'):
desc->x38_SPLN.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('TEXR'):
desc->x3c_TEXR.reset(CPF::GetTextureElement(in, resPool));
break;
break;
case SBIG('TSPN'):
desc->x40_TSPN.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('LLRD'):
desc->x44_24_LLRD = CPF::GetBool(in);
break;
break;
case SBIG('CROS'):
desc->x44_25_CROS = CPF::GetBool(in);
break;
break;
case SBIG('VLS1'):
desc->x44_26_VLS1 = CPF::GetBool(in);
break;
break;
case SBIG('VLS2'):
desc->x44_27_VLS2 = CPF::GetBool(in);
break;
break;
case SBIG('SROT'):
desc->x44_28_SROT = CPF::GetBool(in);
break;
break;
case SBIG('WIRE'):
desc->x44_29_WIRE = CPF::GetBool(in);
break;
break;
case SBIG('TEXW'):
desc->x44_30_TEXW = CPF::GetBool(in);
break;
break;
case SBIG('AALP'):
desc->x44_31_AALP = CPF::GetBool(in);
break;
break;
case SBIG('ZBUF'):
desc->x45_24_ZBUF = CPF::GetBool(in);
break;
break;
case SBIG('ORNT'):
desc->x45_25_ORNT = CPF::GetBool(in);
break;
break;
case SBIG('CRND'):
desc->x45_26_CRND = CPF::GetBool(in);
break;
break;
default:
{
uint32_t clsName = clsId.toUint32();
@ -137,10 +137,11 @@ bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStre
return true;
}
CFactoryFnReturn FParticleSwooshDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms)
CFactoryFnReturn FParticleSwooshDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
CObjectReference*)
{
CSimplePool* sp = vparms.GetOwnedObj<CSimplePool*>();
return TToken<CSwooshDescription>::GetIObjObjectFor(std::unique_ptr<CSwooshDescription>(CParticleSwooshDataFactory::GetGeneratorDesc(in, sp)));
return TToken<CSwooshDescription>::GetIObjObjectFor(
std::unique_ptr<CSwooshDescription>(CParticleSwooshDataFactory::GetGeneratorDesc(in, sp)));
}
}

View File

@ -19,7 +19,8 @@ public:
static CSwooshDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
};
CFactoryFnReturn FParticleSwooshDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
CFactoryFnReturn FParticleSwooshDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
CObjectReference*);
}
#endif // __URDE_CPARTICLESWOOSHDATAFACTORY_HPP__

View File

@ -14,7 +14,7 @@ static logvisor::Module Log("urde::CProjectileWeaponDataFactory");
using CPF = CParticleDataFactory;
CWeaponDescription*CProjectileWeaponDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool)
CWeaponDescription* CProjectileWeaponDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool)
{
return CreateGeneratorDescription(in, resPool);
}
@ -37,61 +37,61 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt
CGlobalRandom gr{rand};
FourCC clsId = CPF::GetClassID(in);
while(clsId != SBIG('_END'))
while (clsId != SBIG('_END'))
{
switch(clsId)
switch (clsId)
{
case SBIG('IORN'):
desc->x0_IORN.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('IVEC'):
desc->x4_IVEC.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('PSVM'):
desc->xc_PSVM.reset(CPF::GetModVectorElement(in));
break;
break;
case SBIG('VMD2'):
desc->x10_VMD2 = CPF::GetBool(in);
break;
break;
case SBIG('PSLT'):
desc->x14_PSLT.reset(CPF::GetIntElement(in));
break;
break;
case SBIG('PCSL'):
desc->x18_PCSL.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('PCOL'):
desc->x1c_PCOL.reset(CPF::GetColorElement(in));
break;
break;
case SBIG('POFS'):
desc->x20_POFS.reset(CPF::GetVectorElement(in));
break;
desc->x20_POFS.reset(CPF::GetVectorElement(in));
break;
case SBIG('OFST'):
desc->x24_OFST.reset(CPF::GetVectorElement(in));
break;
break;
case SBIG('APSO'):
desc->x28_APSO = CPF::GetBool(in);
break;
break;
case SBIG('HOMG'):
desc->x29_HOMG = CPF::GetBool(in);
break;
break;
case SBIG('AP11'):
desc->x2a_AP11 = CPF::GetBool(in);
break;
break;
case SBIG('AP21'):
desc->x2b_AP21 = CPF::GetBool(in);
break;
break;
case SBIG('AS11'):
desc->x2c_AS11 = CPF::GetBool(in);
break;
break;
case SBIG('AS12'):
desc->x2d_AS12 = CPF::GetBool(in);
break;
break;
case SBIG('AS13'):
desc->x2e_AS13 = CPF::GetBool(in);
break;
break;
case SBIG('TRAT'):
desc->x30_TRAT.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('APSM'):
{
std::vector<ResId> tracker;
@ -108,16 +108,16 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt
}
case SBIG('ASW1'):
desc->x54_ASW1 = CPF::GetSwooshGeneratorDesc(in, resPool);
break;
break;
case SBIG('ASW2'):
desc->x64_ASW2 = CPF::GetSwooshGeneratorDesc(in, resPool);
break;
break;
case SBIG('ASW3'):
desc->x74_ASW3 = CPF::GetSwooshGeneratorDesc(in, resPool);
break;
break;
case SBIG('OHEF'):
desc->x84_OHEF = CPF::GetModel(in, resPool);
break;
break;
case SBIG('COLR'):
{
FourCC cid = CPF::GetClassID(in);
@ -130,13 +130,13 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt
}
case SBIG('EWTR'):
desc->xa4_EWTR = CPF::GetBool(in);
break;
break;
case SBIG('LWTR'):
desc->xa5_LWTR = CPF::GetBool(in);
break;
break;
case SBIG('SWTR'):
desc->xa6_SWTR = CPF::GetBool(in);
break;
break;
case SBIG('PJFX'):
{
FourCC cid = CPF::GetClassID(in);
@ -148,10 +148,10 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt
}
case SBIG('RNGE'):
desc->xac_RNGE.reset(CPF::GetRealElement(in));
break;
break;
case SBIG('FOFF'):
desc->xb0_FOFF.reset(CPF::GetRealElement(in));
break;
break;
default:
{
uint32_t clsName = clsId.toUint32();
@ -164,10 +164,11 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt
return true;
}
CFactoryFnReturn FProjectileWeaponDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms)
CFactoryFnReturn FProjectileWeaponDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
CObjectReference*)
{
CSimplePool* sp = vparms.GetOwnedObj<CSimplePool*>();
return TToken<CWeaponDescription>::GetIObjObjectFor(std::unique_ptr<CWeaponDescription>(CProjectileWeaponDataFactory::GetGeneratorDesc(in, sp)));
return TToken<CWeaponDescription>::GetIObjObjectFor(
std::unique_ptr<CWeaponDescription>(CProjectileWeaponDataFactory::GetGeneratorDesc(in, sp)));
}
}

View File

@ -15,11 +15,13 @@ class CProjectileWeaponDataFactory
{
static CWeaponDescription* CreateGeneratorDescription(CInputStream& in, CSimplePool* resPool);
static bool CreateWPSM(CWeaponDescription* desc, CInputStream& in, CSimplePool* resPool);
public:
static CWeaponDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
};
CFactoryFnReturn FProjectileWeaponDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
CFactoryFnReturn FProjectileWeaponDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms,
CObjectReference*);
}
#endif // __URDE_CPROJECTILEWEAPONDATAFACTORY_HPP__

View File

@ -29,10 +29,7 @@ CScriptTrigger::CScriptTrigger(TUniqueId uid, const std::string& name, const CEn
x148_27_deactivateOnExited = b3;
}
void CScriptTrigger::Accept(IVisitor& visitor)
{
visitor.Visit(this);
}
void CScriptTrigger::Accept(IVisitor& visitor) { visitor.Visit(this); }
void CScriptTrigger::Think(float dt, CStateManager& mgr)
{
@ -81,6 +78,8 @@ CScriptTrigger::CObjectTracker* CScriptTrigger::FindObject(TUniqueId id)
void CScriptTrigger::UpdateInhabitants(float dt, CStateManager& mgr)
{
#if 0
bool inhabitantExited = false;
bool player = false;
for (auto it = xe8_inhabitants.begin(); it != xe8_inhabitants.end();)
{
TCastToPtr<CActor> act(mgr.ObjectById((*it).GetObjectId()));
@ -89,6 +88,7 @@ void CScriptTrigger::UpdateInhabitants(float dt, CStateManager& mgr)
TCastToPtr<CPlayer> pl(act);
if (bool(x12c_flags & ETriggerFlags::DetectPlayer))
{
player = true;
using EPlayerMorphBallState = CPlayer::EPlayerMorphBallState;
EPlayerMorphBallState mState = pl->GetMorphballTransitionState();
if ((mState == EPlayerMorphBallState::Morphed &&
@ -106,8 +106,8 @@ void CScriptTrigger::UpdateInhabitants(float dt, CStateManager& mgr)
x148_29_didPhazonDamage = false;
}
if (mgr.GetLastTrigger() == GetUniqueId())
mgr.SetLastTrigger(kInvalidUniqueId);
if (mgr.GetLastTriggerId() == GetUniqueId())
mgr.SetLastTriggerId(kInvalidUniqueId);
}
InhabitantExited(*act, mgr);
@ -124,14 +124,16 @@ void CScriptTrigger::UpdateInhabitants(float dt, CStateManager& mgr)
inhabitantExited = true;
InhabitantIdle(*act, mgr);
if (act->HealthInfo() && x100_damageInfo.GetDamage() > 0.f)
mgr.ApplyDamage(GetUniqueId(), act->GetUniqueId(), GetUniqueId(), x100_damageInfo, CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {0ull}));
mgr.ApplyDamage(GetUniqueId(), act->GetUniqueId(), GetUniqueId(), x100_damageInfo,
CMaterialFilter::MakeIncludeExclude({EMaterialTypes::Solid}, {0ull}));
TCastToPtr<CPhysicsActor> physAct{act};
if (physAct)
{
float forceMult = 1.f;
if (bool(x12c_flags & ETriggerFlags::UseBooleanIntersection))
forceMult = touchBounds->booleanIntersection(*actTouchBounds).volume() / actTouchBounds->volume();
forceMult =
touchBounds->booleanIntersection(*actTouchBounds).volume() / actTouchBounds->volume();
zeus::CVector3f force = forceMult * x11c_forceField;
if (bool(x12c_flags & ETriggerFlags::UseCollisionImpulses))
@ -160,8 +162,8 @@ void CScriptTrigger::UpdateInhabitants(float dt, CStateManager& mgr)
}
}
if (mgr.GetLastTrigger() == GetUniqueId())
mgr.SetLastTrigger(kInvalidUniqueId);
if (mgr.GetLastTriggerId() == GetUniqueId())
mgr.SetLastTriggerId(kInvalidUniqueId);
InhabitantExited(*act, mgr);
continue;
@ -183,8 +185,8 @@ void CScriptTrigger::UpdateInhabitants(float dt, CStateManager& mgr)
}
}
if (mgr.GetLastTrigger() == GetUniqueId())
mgr.SetLastTrigger(kInvalidUniqueId);
if (mgr.GetLastTriggerId() == GetUniqueId())
mgr.SetLastTriggerId(kInvalidUniqueId);
}
}
@ -194,14 +196,13 @@ void CScriptTrigger::UpdateInhabitants(float dt, CStateManager& mgr)
return;
}
if (!player)
{
SendScriptMsgs(EScriptObjectState::Exited, mgr, EScriptObjectMessage::None);
if (x148_27_deactivateOnExited)
{
mgr.SendScriptMsg(GetUniqueId(), mgr.GetEditorIdForUniqueId(GetUniqueId()), EScriptObjectMessage::Deactivate,
EScriptObjectState::Exited);
mgr.SendScriptMsg(GetUniqueId(), mgr.GetEditorIdForUniqueId(GetUniqueId()),
EScriptObjectMessage::Deactivate, EScriptObjectState::Exited);
}
}
#endif

2
hecl

@ -1 +1 @@
Subproject commit 406079b5bcfffd2953f541d27fdc869a07c88c95
Subproject commit be31b7d4ac28cf28e441bcdae972fcc21353959d