Implement ParticleAccessParameters properly

SParticleMetrics is still a lie
This commit is contained in:
Phillip Stephens 2016-02-27 17:03:46 -08:00
parent 7032274d66
commit 37da86838d
4 changed files with 24 additions and 22 deletions

View File

@ -46,6 +46,7 @@ std::unique_ptr<pshag::IObj> ProjectResourceFactory::Build(const pshag::SObjectT
if (search == m_resPaths.end()) if (search == m_resPaths.end())
return {}; return {};
fprintf(stderr, "Loading resource %s\n", search->second.getRelativePath().c_str());
Athena::io::FileReader fr(search->second.getAbsolutePath(), 32 * 1024, false); Athena::io::FileReader fr(search->second.getAbsolutePath(), 32 * 1024, false);
if (fr.hasError()) if (fr.hasError())
return {}; return {};

View File

@ -13,6 +13,6 @@ int CParticleGlobals::g_ParticleLifetimePercentage = 0;
float CParticleGlobals::g_ParticleLifetimePercentageReal = 0.0; float CParticleGlobals::g_ParticleLifetimePercentageReal = 0.0;
float CParticleGlobals::g_ParticleLifetimePercentageRemainder = 0.0; float CParticleGlobals::g_ParticleLifetimePercentageRemainder = 0.0;
float* CParticleGlobals::g_papValues = nullptr; float CParticleGlobals::g_papValues[8] = { 0.f };
CParticleGlobals::SParticleSystem* CParticleGlobals::g_currentParticleSystem = nullptr; CParticleGlobals::SParticleSystem* CParticleGlobals::g_currentParticleSystem = nullptr;
} }

View File

@ -38,7 +38,7 @@ public:
g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage; g_ParticleLifetimePercentageRemainder = g_ParticleLifetimePercentageReal - g_ParticleLifetimePercentage;
} }
static float* g_papValues; static float g_papValues[8];
struct SParticleSystem struct SParticleSystem
{ {

View File

@ -1,6 +1,7 @@
#include "CRealElement.hpp" #include "CRealElement.hpp"
#include "CParticleGlobals.hpp" #include "CParticleGlobals.hpp"
#include "CRandom16.hpp" #include "CRandom16.hpp"
#include "CElementGen.hpp"
#include <math.h> #include <math.h>
namespace pshag namespace pshag
@ -228,63 +229,63 @@ bool CRECompareEquals::GetValue(int frame, float& valOut) const
return false; return false;
} }
bool CREParticleAccessParam1::GetValue(int frame, float& valOut) const bool CREParticleAccessParam1::GetValue(int /*frame*/, float& valOut) const
{ {
//valOut = CParticleGlobals::g_papValues[0]; valOut = CParticleGlobals::g_papValues[0];
return false; return false;
} }
bool CREParticleAccessParam2::GetValue(int frame, float& valOut) const bool CREParticleAccessParam2::GetValue(int /*frame*/, float& valOut) const
{ {
//valOut = CParticleGlobals::g_papValues[1]; valOut = CParticleGlobals::g_papValues[1];
return false; return false;
} }
bool CREParticleAccessParam3::GetValue(int frame, float& valOut) const bool CREParticleAccessParam3::GetValue(int /*frame*/, float& valOut) const
{ {
//valOut = CParticleGlobals::g_papValues[2]; valOut = CParticleGlobals::g_papValues[2];
return false; return false;
} }
bool CREParticleAccessParam4::GetValue(int frame, float& valOut) const bool CREParticleAccessParam4::GetValue(int /*frame*/, float& valOut) const
{ {
//valOut = CParticleGlobals::g_papValues[3]; valOut = CParticleGlobals::g_papValues[3];
return false; return false;
} }
bool CREParticleAccessParam5::GetValue(int frame, float& valOut) const bool CREParticleAccessParam5::GetValue(int /*frame*/, float& valOut) const
{ {
//valOut = CParticleGlobals::g_papValues[4]; valOut = CParticleGlobals::g_papValues[4];
return false; return false;
} }
bool CREParticleAccessParam6::GetValue(int frame, float& valOut) const bool CREParticleAccessParam6::GetValue(int /*frame*/, float& valOut) const
{ {
//valOut = CParticleGlobals::g_papValues[5]; valOut = CParticleGlobals::g_papValues[5];
return false; return false;
} }
bool CREParticleAccessParam7::GetValue(int frame, float& valOut) const bool CREParticleAccessParam7::GetValue(int /*frame*/, float& valOut) const
{ {
//valOut = CParticleGlobals::g_papValues[6]; valOut = CParticleGlobals::g_papValues[6];
return false; return false;
} }
bool CREParticleAccessParam8::GetValue(int frame, float& valOut) const bool CREParticleAccessParam8::GetValue(int /*frame*/, float& valOut) const
{ {
//valOut = CParticleGlobals::g_papValues[7]; valOut = CParticleGlobals::g_papValues[7];
return false; return false;
} }
bool CREPSLL::GetValue(int frame, float& valOut) const bool CREPSLL::GetValue(int /*frame*/, float& valOut) const
{ {
//valOut = CParticleGlobals::g_particleMetrics->x2c_psll; valOut = CElementGen::g_currentParticle->x2c_lineLengthOrSize;
return false; return false;
} }
bool CREPRLW::GetValue(int frame, float& valOut) const bool CREPRLW::GetValue(int /*frame*/, float& valOut) const
{ {
//valOut = CParticleGlobals::g_particleMetrics->x30_prlw; valOut = CElementGen::g_currentParticle->x30_lineWidthOrRota;
return false; return false;
} }