Unify factory return type

This commit is contained in:
Phillip Stephens 2016-03-30 17:38:03 -07:00
parent c5761b6c41
commit d7672226a2
14 changed files with 21 additions and 14 deletions

View File

@ -2,6 +2,7 @@
#define __PSHAG_CTEXTURE_HPP__ #define __PSHAG_CTEXTURE_HPP__
#include "GCNTypes.hpp" #include "GCNTypes.hpp"
#include "CFactoryMgr.hpp"
#include "IObj.hpp" #include "IObj.hpp"
#include "IOStreams.hpp" #include "IOStreams.hpp"
#include "Graphics/CGraphics.hpp" #include "Graphics/CGraphics.hpp"
@ -48,7 +49,7 @@ public:
boo::ITexture* GetBooTexture() {return m_booTex;} boo::ITexture* GetBooTexture() {return m_booTex;}
}; };
std::unique_ptr<IObj> FTextureFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms); CFactoryFnReturn FTextureFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
} }

View File

@ -697,7 +697,7 @@ void CTexture::Load(int slot, EClampMode clamp)
} }
std::unique_ptr<IObj> FTextureFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms) CFactoryFnReturn FTextureFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms)
{ {
return TToken<CTexture>::GetIObjObjectFor(std::make_unique<CTexture>(in)); return TToken<CTexture>::GetIObjObjectFor(std::make_unique<CTexture>(in));
} }

View File

@ -187,7 +187,7 @@ CCollisionResponseData::CCollisionResponseData(CInputStream& in, CSimplePool* re
} }
} }
std::unique_ptr<IObj> FCollisionResponseDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms) CFactoryFnReturn FCollisionResponseDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms)
{ {
CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam()); CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam());
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

@ -2,6 +2,7 @@
#define __PSHAG_CCOLLISIONRESPONSEDATA_HPP__ #define __PSHAG_CCOLLISIONRESPONSEDATA_HPP__
#include "RetroTypes.hpp" #include "RetroTypes.hpp"
#include "CFactoryMgr.hpp"
#include "IObj.hpp" #include "IObj.hpp"
#include "CToken.hpp" #include "CToken.hpp"
#include "IOStreams.hpp" #include "IOStreams.hpp"
@ -54,7 +55,7 @@ public:
CCollisionResponseData(CInputStream& in, CSimplePool* resPool); CCollisionResponseData(CInputStream& in, CSimplePool* resPool);
}; };
std::unique_ptr<IObj> FCollisionResponseDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms); CFactoryFnReturn FCollisionResponseDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
} }
#endif // __PSHAG_CCOLLISIONRESPONSEDATA_HPP__ #endif // __PSHAG_CCOLLISIONRESPONSEDATA_HPP__

View File

@ -137,7 +137,7 @@ void CDecalDataFactory::GetQuadDecalInfo(CInputStream& in, CSimplePool* resPool,
} }
} }
std::unique_ptr<IObj> FDecalDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms) CFactoryFnReturn FDecalDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms)
{ {
CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam()); CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam());
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

@ -2,6 +2,7 @@
#define __PSHAG_CDECALDATAFACTORY_HPP__ #define __PSHAG_CDECALDATAFACTORY_HPP__
#include "RetroTypes.hpp" #include "RetroTypes.hpp"
#include "CFactoryMgr.hpp"
#include "IObj.hpp" #include "IObj.hpp"
#include "CToken.hpp" #include "CToken.hpp"
#include "IOStreams.hpp" #include "IOStreams.hpp"
@ -22,6 +23,6 @@ public:
static CDecalDescription* GetGeneratorDesc(CInputStream& in,CSimplePool* resPool); static CDecalDescription* GetGeneratorDesc(CInputStream& in,CSimplePool* resPool);
}; };
std::unique_ptr<IObj> FDecalDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms); CFactoryFnReturn FDecalDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
} }
#endif // __PSHAG_CDECALDATAFACTORY_HPP__ #endif // __PSHAG_CDECALDATAFACTORY_HPP__

View File

@ -1156,7 +1156,7 @@ void CParticleDataFactory::LoadGPSMTokens(CGenDescription* desc)
desc->xd4_xc0_SSWH.m_swoosh = desc->xd4_xc0_SSWH.m_token.GetObj(); desc->xd4_xc0_SSWH.m_swoosh = desc->xd4_xc0_SSWH.m_token.GetObj();
} }
std::unique_ptr<IObj> FParticleFactory(const SObjectTag& tag, CInputStream& in, CFactoryFnReturn FParticleFactory(const SObjectTag& tag, CInputStream& in,
const CVParamTransfer& vparms) const CVParamTransfer& vparms)
{ {
CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam()); CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam());

View File

@ -2,6 +2,7 @@
#define __PSHAG_CPARTICLEDATAFACTORY_HPP__ #define __PSHAG_CPARTICLEDATAFACTORY_HPP__
#include "RetroTypes.hpp" #include "RetroTypes.hpp"
#include "CFactoryMgr.hpp"
#include "IObj.hpp" #include "IObj.hpp"
#include "CToken.hpp" #include "CToken.hpp"
#include "IOStreams.hpp" #include "IOStreams.hpp"
@ -96,7 +97,7 @@ public:
static CGenDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool); static CGenDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
}; };
std::unique_ptr<IObj> FParticleFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms); CFactoryFnReturn FParticleFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
} }

View File

@ -132,7 +132,7 @@ 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();
} }
std::unique_ptr<IObj> FParticleElectricDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms) CFactoryFnReturn FParticleElectricDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms)
{ {
CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam()); CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam());
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

@ -2,6 +2,7 @@
#define __PSHAG_CPARTICLEELECTRICDATAFACTORY_HPP__ #define __PSHAG_CPARTICLEELECTRICDATAFACTORY_HPP__
#include "RetroTypes.hpp" #include "RetroTypes.hpp"
#include "CFactoryMgr.hpp"
#include "IObj.hpp" #include "IObj.hpp"
#include "CToken.hpp" #include "CToken.hpp"
#include "IOStreams.hpp" #include "IOStreams.hpp"
@ -19,7 +20,7 @@ public:
static CElectricDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool); static CElectricDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
}; };
std::unique_ptr<IObj> FParticleElectricDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms); CFactoryFnReturn FParticleElectricDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
} }
#endif // __PSHAG_CPARTICLEELECTRICDATAFACTORY_HPP__ #endif // __PSHAG_CPARTICLEELECTRICDATAFACTORY_HPP__

View File

@ -137,7 +137,7 @@ bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStre
return true; return true;
} }
std::unique_ptr<urde::IObj> FParticleSwooshDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms) CFactoryFnReturn FParticleSwooshDataFactory(const SObjectTag &tag, CInputStream &in, const CVParamTransfer &vparms)
{ {
CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam()); CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam());
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

@ -2,6 +2,7 @@
#define __PSHAG_CPARTICLESWOOSHDATAFACTORY_HPP__ #define __PSHAG_CPARTICLESWOOSHDATAFACTORY_HPP__
#include "RetroTypes.hpp" #include "RetroTypes.hpp"
#include "CFactoryMgr.hpp"
#include "IObj.hpp" #include "IObj.hpp"
#include "CToken.hpp" #include "CToken.hpp"
#include "IOStreams.hpp" #include "IOStreams.hpp"
@ -18,7 +19,7 @@ public:
static CSwooshDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool); static CSwooshDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
}; };
std::unique_ptr<IObj> FParticleSwooshDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms); CFactoryFnReturn FParticleSwooshDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
} }
#endif // __PSHAG_CPARTICLESWOOSHDATAFACTORY_HPP__ #endif // __PSHAG_CPARTICLESWOOSHDATAFACTORY_HPP__

View File

@ -164,7 +164,7 @@ bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputSt
return true; return true;
} }
std::unique_ptr<IObj> FProjectileWeaponDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms) CFactoryFnReturn FProjectileWeaponDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms)
{ {
CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam()); CSimplePool* sp = static_cast<CSimplePool*>(static_cast<TObjOwnerParam<IObjectStore*>*>(vparms.GetObj())->GetParam());
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

@ -2,6 +2,7 @@
#define __PSHAG_CPROJECTILEWEAPONDATAFACTORY_HPP__ #define __PSHAG_CPROJECTILEWEAPONDATAFACTORY_HPP__
#include "RetroTypes.hpp" #include "RetroTypes.hpp"
#include "CFactoryMgr.hpp"
#include "IObj.hpp" #include "IObj.hpp"
#include "CToken.hpp" #include "CToken.hpp"
#include "IOStreams.hpp" #include "IOStreams.hpp"
@ -18,7 +19,7 @@ public:
static CWeaponDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool); static CWeaponDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
}; };
std::unique_ptr<IObj> FProjectileWeaponDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms); CFactoryFnReturn FProjectileWeaponDataFactory(const SObjectTag& tag, CInputStream& in, const CVParamTransfer& vparms);
} }
#endif // __PSHAG_CPROJECTILEWEAPONDATAFACTORY_HPP__ #endif // __PSHAG_CPROJECTILEWEAPONDATAFACTORY_HPP__