This commit is contained in:
Jack Andersen 2016-02-15 19:52:09 -10:00
commit 6614171283
12 changed files with 166 additions and 19 deletions

View File

@ -9,6 +9,8 @@
namespace URDE namespace URDE
{ {
LogVisor::LogModule Log{"URDE"};
struct Application : boo::IApplicationCallback struct Application : boo::IApplicationCallback
{ {
HECL::Runtime::FileStoreManager m_fileMgr; HECL::Runtime::FileStoreManager m_fileMgr;
@ -24,6 +26,7 @@ struct Application : boo::IApplicationCallback
int appMain(boo::IApplication* app) int appMain(boo::IApplication* app)
{ {
initialize(app);
m_viewManager.init(app); m_viewManager.init(app);
while (m_running) while (m_running)
{ {
@ -42,6 +45,50 @@ struct Application : boo::IApplicationCallback
{ {
} }
void initialize(boo::IApplication* app)
{
Zeus::detectCPU();
const Zeus::CPUInfo& cpuInf = Zeus::cpuFeatures();
HECL::SystemString cpuName{reinterpret_cast<const char*>(cpuInf.cpuBrand)};
HECL::SystemString cpuVendor{reinterpret_cast<const char*>(cpuInf.cpuVendor)};
Log.report(LogVisor::Info, _S("CPU Name: %s"), cpuName.c_str());
Log.report(LogVisor::Info, _S("CPU Vendor: %s"), cpuVendor.c_str());
HECL::SystemString features;
if (cpuInf.AESNI)
features += _S("AES-NI");
if (cpuInf.SSE1)
{
if (!features.empty())
features += _S(", SSE1");
else
features += _S("SSE1");
}
else
{
Log.report(LogVisor::FatalError, _S("URDE requires SSE1 minimum"));
return;
}
if (cpuInf.SSE2)
features += _S(", SSE2");
else
{
Log.report(LogVisor::FatalError, _S("URDE requires SSE2 minimum"));
return;
}
if (cpuInf.SSE3)
features += _S(", SSE3");
if (cpuInf.SSSE3)
features += _S(", SSSE3");
if (cpuInf.SSE4a)
features += _S(", SSE4a");
if (cpuInf.SSE41)
features += _S(", SSE4.1");
if (cpuInf.SSE42)
features += _S(", SSE4.2");
Log.report(LogVisor::Info, _S("CPU Features: %s"), features.c_str());
}
}; };
} }

View File

@ -20,13 +20,13 @@ public:
std::unique_ptr<CIntElement> xc_SCNT; std::unique_ptr<CIntElement> xc_SCNT;
std::unique_ptr<CIntElement> x10_SSEG; std::unique_ptr<CIntElement> x10_SSEG;
std::unique_ptr<CColorElement> x14_COLR; std::unique_ptr<CColorElement> x14_COLR;
bool x18_IEMT; std::unique_ptr<CEmitterElement> x18_IEMT;
bool x1c_FEMT; std::unique_ptr<CEmitterElement> x1c_FEMT;
bool x20_AMPL; std::unique_ptr<CRealElement> x20_AMPL;
bool x24_AMPD; std::unique_ptr<CRealElement> x24_AMPD;
bool x28_LWD1; std::unique_ptr<CRealElement> x28_LWD1;
bool x2c_LWD2; std::unique_ptr<CRealElement> x2c_LWD2;
bool x30_LWD3; std::unique_ptr<CRealElement> x30_LWD3;
std::unique_ptr<CColorElement> x34_LCL1; std::unique_ptr<CColorElement> x34_LCL1;
std::unique_ptr<CColorElement> x38_LCL2; std::unique_ptr<CColorElement> x38_LCL2;
std::unique_ptr<CColorElement> x3c_LCL3; std::unique_ptr<CColorElement> x3c_LCL3;

View File

@ -0,0 +1,6 @@
#include "CFlameWarp.hpp"
namespace pshag
{
}

View File

@ -0,0 +1,39 @@
#ifndef __PSHAG_CFLAMEWARP_HPP__
#define __PSHAG_CFLAMEWARP_HPP__
#include "CWarp.hpp"
namespace pshag
{
class CFlameWarp : public CWarp
{
Zeus::CVector3f x4;
Zeus::CVector3f xc;
float x1c;
float x20;
int x24;
bool x28_activated : 1;
public:
CFlameWarp(float a, const Zeus::CVector3f& b)
: x4(b), x1c(0.0), x20(a * a), x24(0)
{
x28_activated = false;
}
~CFlameWarp() {}
bool UpdateWarp() { return x28_activated; }
void ModifyParticles(int, int, int *,
Zeus::CVector3f*,
Zeus::CVector3f*,
Zeus::CVector3f*,
Zeus::CColor*,
float*, float*) {}
void Activate(bool) { x28_activated = true; }
bool IsActivated() { return x28_activated; }
FourCC Get4CharID() { return FOURCC('FWRP'); }
};
}
#endif // __PSHAG_CFLAMEWARP_HPP__

View File

@ -103,6 +103,10 @@ public:
std::unique_ptr<CRealElement> x124_ADV7; std::unique_ptr<CRealElement> x124_ADV7;
std::unique_ptr<CRealElement> x128_ADV8; std::unique_ptr<CRealElement> x128_ADV8;
/* Custom additions */
std::unique_ptr<CColorElement> m_bevelGradient; /* FourCC BGCL */
CGenDescription() CGenDescription()
{ {
x45_25_PMOO = true; x45_25_PMOO = true;

View File

@ -31,6 +31,7 @@ add_library(RuntimeCommonParticle
CDecalManager.hpp CDecalManager.cpp CDecalManager.hpp CDecalManager.cpp
CSpawnSystemKeyframeData.hpp CSpawnSystemKeyframeData.cpp CSpawnSystemKeyframeData.hpp CSpawnSystemKeyframeData.cpp
CWarp.hpp CWarp.cpp CWarp.hpp CWarp.cpp
CFlameWarp.hpp CFlameWarp.cpp
CParticleGlobals.hpp CParticleGlobals.cpp CParticleGlobals.hpp CParticleGlobals.cpp
CElementGenShaders.hpp CElementGenShaders.hpp
CElementGenShadersGLSL.cpp CElementGenShadersGLSL.cpp

View File

@ -2,6 +2,7 @@
#include "CToken.hpp" #include "CToken.hpp"
#include "CSimplePool.hpp" #include "CSimplePool.hpp"
#include "CGenDescription.hpp" #include "CGenDescription.hpp"
#include "CRandom16.hpp"
namespace pshag namespace pshag
{ {
@ -849,6 +850,8 @@ CGenDescription* CParticleDataFactory::CreateGeneratorDescription(CInputStream&
bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& in, bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& in,
std::vector<TResId>& tracker, CSimplePool* resPool) std::vector<TResId>& tracker, CSimplePool* resPool)
{ {
CRandom16 rand{99};
CGlobalRandom gr(rand);
FourCC clsId = GetClassID(in); FourCC clsId = GetClassID(in);
while (clsId != SBIG('_END')) while (clsId != SBIG('_END'))
{ {
@ -1110,6 +1113,25 @@ bool CParticleDataFactory::CreateGPSM(CGenDescription* fillDesc, CInputStream& i
} }
clsId = GetClassID(in); clsId = GetClassID(in);
} }
/* Now for our custom additions, if available */
if (!in.atEnd())
{
clsId = GetClassID(in);
if (clsId == 0xFFFFFFFF)
return true;
while (clsId != SBIG('_END') && !in.atEnd())
{
switch(clsId)
{
case SBIG('BGCL'):
fillDesc->m_bevelGradient.reset(GetColorElement(in));
break;
}
clsId = GetClassID(in);
}
}
return true; return true;
} }

View File

@ -31,11 +31,12 @@ CElectricDescription* CParticleElectricDataFactory::CreateElectricDescription(CI
bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInputStream &in, CSimplePool *resPool) bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInputStream &in, CSimplePool *resPool)
{ {
CRandom16 rand; CRandom16 rand{99};
CGlobalRandom gr{rand};
FourCC clsId = CPF::GetClassID(in); FourCC clsId = CPF::GetClassID(in);
while (clsId != SBIG('_END')) while (clsId != SBIG('_END'))
{ {
CGlobalRandom gr(rand);
switch(clsId) switch(clsId)
{ {
case SBIG('LIFE'): case SBIG('LIFE'):
@ -57,25 +58,25 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInput
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 = CPF::GetBool(in); desc->x18_IEMT.reset(CPF::GetEmitterElement(in));
break; break;
case SBIG('FEMT'): case SBIG('FEMT'):
desc->x1c_FEMT = CPF::GetBool(in); desc->x1c_FEMT.reset(CPF::GetEmitterElement(in));
break; break;
case SBIG('AMPL'): case SBIG('AMPL'):
desc->x20_AMPL = CPF::GetBool(in); desc->x20_AMPL.reset(CPF::GetRealElement(in));
break; break;
case SBIG('AMPD'): case SBIG('AMPD'):
desc->x24_AMPD = CPF::GetBool(in); desc->x24_AMPD.reset(CPF::GetRealElement(in));
break; break;
case SBIG('LWD1'): case SBIG('LWD1'):
desc->x28_LWD1 = CPF::GetBool(in); desc->x28_LWD1.reset(CPF::GetRealElement(in));
break; break;
case SBIG('LWD2'): case SBIG('LWD2'):
desc->x2c_LWD2 = CPF::GetBool(in); desc->x2c_LWD2.reset(CPF::GetRealElement(in));
break; break;
case SBIG('LWD3'): case SBIG('LWD3'):
desc->x30_LWD3 = CPF::GetBool(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));
@ -118,6 +119,16 @@ bool CParticleElectricDataFactory::CreateELSM(CElectricDescription *desc, CInput
return true; return true;
} }
void CParticleElectricDataFactory::LoadELSMTokens(CElectricDescription* desc)
{
if (desc->x40_SSWH.m_found)
desc->x40_SSWH.m_swoosh = desc->x40_SSWH.m_token.GetObj();
if (desc->x50_GPSM.m_found)
desc->x50_GPSM.m_gen = desc->x50_GPSM.m_token.GetObj();
if (desc->x60_EPSM.m_found)
desc->x60_EPSM.m_gen = desc->x60_EPSM.m_token.GetObj();
}
std::unique_ptr<pshag::IObj> FParticleElecrticFactory(const pshag::SObjectTag &tag, pshag::CInputStream &in, const pshag::CVParamTransfer &vparms) std::unique_ptr<pshag::IObj> FParticleElecrticFactory(const pshag::SObjectTag &tag, pshag::CInputStream &in, const pshag::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

@ -14,7 +14,7 @@ class CParticleElectricDataFactory
{ {
static CElectricDescription* CreateElectricDescription(CInputStream& in, CSimplePool* resPool); static CElectricDescription* CreateElectricDescription(CInputStream& in, CSimplePool* resPool);
static bool CreateELSM(CElectricDescription* desc, CInputStream& in, CSimplePool* resPool); static bool CreateELSM(CElectricDescription* desc, CInputStream& in, CSimplePool* resPool);
static bool LoadELSMTokens(CElectricDescription* desc); static void LoadELSMTokens(CElectricDescription* desc);
public: public:
static CElectricDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool); static CElectricDescription* GetGeneratorDesc(CInputStream& in, CSimplePool* resPool);
}; };

View File

@ -28,7 +28,7 @@ CSwooshDescription*CParticleSwooshDataFactory::CreateGeneratorDescription(CInput
bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStream& in, CSimplePool* resPool) bool CParticleSwooshDataFactory::CreateWPSM(CSwooshDescription* desc, CInputStream& in, CSimplePool* resPool)
{ {
CRandom16 rand; CRandom16 rand{99};
FourCC clsId = CPF::GetClassID(in); FourCC clsId = CPF::GetClassID(in);
while (clsId != SBIG('_END')) while (clsId != SBIG('_END'))
{ {

View File

@ -29,7 +29,8 @@ CWeaponDescription* CProjectileWeaponDataFactory::CreateGeneratorDescription(CIn
bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputStream& in, CSimplePool* resPool) bool CProjectileWeaponDataFactory::CreateWPSM(CWeaponDescription* desc, CInputStream& in, CSimplePool* resPool)
{ {
CRandom16 rand; CRandom16 rand{99};
CGlobalRandom gr{rand};
FourCC clsId = CPF::GetClassID(in); FourCC clsId = CPF::GetClassID(in);
while(clsId != SBIG('_END')) while(clsId != SBIG('_END'))

View File

@ -1,11 +1,27 @@
#ifndef __PSHAG_CWARP_HPP__ #ifndef __PSHAG_CWARP_HPP__
#define __PSHAG_CWARP_HPP__ #define __PSHAG_CWARP_HPP__
#include <CColor.hpp>
#include <CVector3f.hpp>
#include "RetroTypes.hpp"
namespace pshag namespace pshag
{ {
class CWarp class CWarp
{ {
public:
virtual ~CWarp() {}
virtual bool UpdateWarp()=0;
virtual void ModifyParticles(int, int, int*,
Zeus::CVector3f*,
Zeus::CVector3f*,
Zeus::CVector3f*,
Zeus::CColor*,
float*, float*)=0;
virtual void Activate(bool)=0;
virtual bool IsActivated()=0;
virtual FourCC Get4CharID()=0;
}; };
} }