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,12 +179,14 @@ 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)];
}
@ -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,12 +103,16 @@ 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)
return EMessageReturn::Exit;

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};
@ -137,10 +136,11 @@ void CDecalDataFactory::GetQuadDecalInfo(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*)
{
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,7 +40,7 @@ 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));
@ -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,7 +38,7 @@ 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));
@ -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,9 +37,9 @@ 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));
@ -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