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) if (quad.x10_CLR)
{ {
w.writeBytes((first ? "1CLR" : "2LCR"), 4); w.writeBytes((first ? "1CLR" : "2CLR"), 4);
quad.x10_CLR.write(w); quad.x10_CLR.write(w);
} }
if (quad.x14_TEX) if (quad.x14_TEX)

View File

@ -6,6 +6,11 @@
#include "Runtime/Particle/CGenDescription.hpp" #include "Runtime/Particle/CGenDescription.hpp"
#include "Runtime/Particle/CElectricDescription.hpp" #include "Runtime/Particle/CElectricDescription.hpp"
#include "Runtime/Particle/CSwooshDescription.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/CGuiFrame.hpp"
#include "Runtime/GuiSys/CRasterFont.hpp" #include "Runtime/GuiSys/CRasterFont.hpp"
#include "Runtime/GuiSys/CStringTable.hpp" #include "Runtime/GuiSys/CStringTable.hpp"
@ -17,6 +22,7 @@
#include "Runtime/Character/CAllFormatsAnimSource.hpp" #include "Runtime/Character/CAllFormatsAnimSource.hpp"
#include "Runtime/Character/CAnimPOIData.hpp" #include "Runtime/Character/CAnimPOIData.hpp"
#include "Runtime/Collision/CCollidableOBBTreeGroup.hpp" #include "Runtime/Collision/CCollidableOBBTreeGroup.hpp"
#include "Runtime/Collision/CCollisionResponseData.hpp"
#include "Runtime/CSaveWorld.hpp" #include "Runtime/CSaveWorld.hpp"
#include "Runtime/AutoMapper/CMapWorld.hpp" #include "Runtime/AutoMapper/CMapWorld.hpp"
#include "Runtime/CScannableObjectInfo.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('MAPW'), FFactoryFunc(FMapWorldFactory));
m_factoryMgr.AddFactory(FOURCC('OIDS'), FFactoryFunc(FMP1OriginalIDsFactory)); m_factoryMgr.AddFactory(FOURCC('OIDS'), FFactoryFunc(FMP1OriginalIDsFactory));
m_factoryMgr.AddFactory(FOURCC('SCAN'), FFactoryFunc(FScannableObjectInfoFactory)); 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) void ProjectResourceFactoryMP1::IndexMP1Resources(hecl::Database::Project& proj, CSimplePool& sp)

View File

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

View File

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

View File

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

View File

@ -13,12 +13,12 @@ static logvisor::Module Log("urde::CParticleElectricDataFactory");
using CPF = CParticleDataFactory; using CPF = CParticleDataFactory;
CElectricDescription* CParticleElectricDataFactory::GetGeneratorDesc(CInputStream &in, CSimplePool *resPool) CElectricDescription* CParticleElectricDataFactory::GetGeneratorDesc(CInputStream& in, CSimplePool* resPool)
{ {
return CreateElectricDescription(in, resPool); return CreateElectricDescription(in, resPool);
} }
CElectricDescription* CParticleElectricDataFactory::CreateElectricDescription(CInputStream &in, CSimplePool *resPool) CElectricDescription* CParticleElectricDataFactory::CreateElectricDescription(CInputStream& in, CSimplePool* resPool)
{ {
FourCC cid = CPF::GetClassID(in); FourCC cid = CPF::GetClassID(in);
if (cid == FOURCC('ELSM')) if (cid == FOURCC('ELSM'))
@ -32,7 +32,7 @@ CElectricDescription* CParticleElectricDataFactory::CreateElectricDescription(CI
return nullptr; return nullptr;
} }
bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInputStream &in, CSimplePool *resPool) bool CParticleElectricDataFactory::CreateELSM(CElectricDescription* desc, CInputStream& in, CSimplePool* resPool)
{ {
CRandom16 rand{99}; CRandom16 rand{99};
CGlobalRandom gr{rand}; CGlobalRandom gr{rand};
@ -40,59 +40,59 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInput
FourCC clsId = CPF::GetClassID(in); FourCC clsId = CPF::GetClassID(in);
while (clsId != SBIG('_END')) while (clsId != SBIG('_END'))
{ {
switch(clsId) switch (clsId)
{ {
case SBIG('LIFE'): case SBIG('LIFE'):
desc->x0_LIFE.reset(CPF::GetIntElement(in)); desc->x0_LIFE.reset(CPF::GetIntElement(in));
break; break;
case SBIG('SLIF'): case SBIG('SLIF'):
desc->x4_SLIF.reset(CPF::GetIntElement(in)); desc->x4_SLIF.reset(CPF::GetIntElement(in));
break; break;
case SBIG('GRAT'): case SBIG('GRAT'):
desc->x8_GRAT.reset(CPF::GetRealElement(in)); desc->x8_GRAT.reset(CPF::GetRealElement(in));
break; break;
case SBIG('SCNT'): case SBIG('SCNT'):
desc->xc_SCNT.reset(CPF::GetIntElement(in)); desc->xc_SCNT.reset(CPF::GetIntElement(in));
break; break;
case SBIG('SSEG'): case SBIG('SSEG'):
desc->x10_SSEG.reset(CPF::GetIntElement(in)); desc->x10_SSEG.reset(CPF::GetIntElement(in));
break; break;
case SBIG('COLR'): case SBIG('COLR'):
desc->x14_COLR.reset(CPF::GetColorElement(in)); desc->x14_COLR.reset(CPF::GetColorElement(in));
break; break;
case SBIG('IEMT'): case SBIG('IEMT'):
desc->x18_IEMT.reset(CPF::GetEmitterElement(in)); desc->x18_IEMT.reset(CPF::GetEmitterElement(in));
break; break;
case SBIG('FEMT'): case SBIG('FEMT'):
desc->x1c_FEMT.reset(CPF::GetEmitterElement(in)); desc->x1c_FEMT.reset(CPF::GetEmitterElement(in));
break; break;
case SBIG('AMPL'): case SBIG('AMPL'):
desc->x20_AMPL.reset(CPF::GetRealElement(in)); desc->x20_AMPL.reset(CPF::GetRealElement(in));
break; break;
case SBIG('AMPD'): case SBIG('AMPD'):
desc->x24_AMPD.reset(CPF::GetRealElement(in)); desc->x24_AMPD.reset(CPF::GetRealElement(in));
break; break;
case SBIG('LWD1'): case SBIG('LWD1'):
desc->x28_LWD1.reset(CPF::GetRealElement(in)); desc->x28_LWD1.reset(CPF::GetRealElement(in));
break; break;
case SBIG('LWD2'): case SBIG('LWD2'):
desc->x2c_LWD2.reset(CPF::GetRealElement(in)); desc->x2c_LWD2.reset(CPF::GetRealElement(in));
break; break;
case SBIG('LWD3'): case SBIG('LWD3'):
desc->x30_LWD3.reset(CPF::GetRealElement(in)); desc->x30_LWD3.reset(CPF::GetRealElement(in));
break; break;
case SBIG('LCL1'): case SBIG('LCL1'):
desc->x34_LCL1.reset(CPF::GetColorElement(in)); desc->x34_LCL1.reset(CPF::GetColorElement(in));
break; break;
case SBIG('LCL2'): case SBIG('LCL2'):
desc->x38_LCL2.reset(CPF::GetColorElement(in)); desc->x38_LCL2.reset(CPF::GetColorElement(in));
break; break;
case SBIG('LCL3'): case SBIG('LCL3'):
desc->x3c_LCL3.reset(CPF::GetColorElement(in)); desc->x3c_LCL3.reset(CPF::GetColorElement(in));
break; break;
case SBIG('SSWH'): case SBIG('SSWH'):
desc->x40_SSWH = CPF::GetSwooshGeneratorDesc(in, resPool); desc->x40_SSWH = CPF::GetSwooshGeneratorDesc(in, resPool);
break; break;
case SBIG('GPSM'): case SBIG('GPSM'):
{ {
std::vector<ResId> tracker; std::vector<ResId> tracker;
@ -109,7 +109,7 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInput
} }
case SBIG('ZERY'): case SBIG('ZERY'):
desc->x70_ZERY = CPF::GetBool(in); desc->x70_ZERY = CPF::GetBool(in);
break; break;
default: default:
{ {
uint32_t clsName = clsId.toUint32(); 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(); 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*>(); 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); 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__ #endif // __URDE_CPARTICLEELECTRICDATAFACTORY_HPP__

View File

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

View File

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

View File

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

2
hecl

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