1
0
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-21 12:49:10 +00:00

Eliminate hsScalar and hsFixed

Modern CPUs support floats just fine... hsFixed was crazy.
This commit is contained in:
2012-01-21 02:03:37 -05:00
parent 5027b5a4ac
commit e020651e4b
584 changed files with 5401 additions and 6399 deletions

View File

@ -58,7 +58,7 @@ public:
// returns false if it's done generating particles and is safe to delete.
virtual hsBool AddAutoParticles(plParticleEmitter *emitter, float dt, uint32_t numForced = 0) = 0;
virtual void UpdateParam(uint32_t paramID, hsScalar paramValue) = 0;
virtual void UpdateParam(uint32_t paramID, float paramValue) = 0;
CLASSNAME_REGISTER( plParticleGenerator );
GETINTERFACE_ANY( plParticleGenerator, plCreatable );
@ -73,43 +73,43 @@ class plSimpleParticleGenerator : public plParticleGenerator
public:
plSimpleParticleGenerator();
~plSimpleParticleGenerator();
void Init(hsScalar genLife, hsScalar partLifeMin, hsScalar partLifeMax, hsScalar particlesPerSecond,
uint32_t numSources, hsPoint3 *pos, hsScalar *initPitch, hsScalar *initYaw, hsScalar angleRange,
hsScalar initVelMin, hsScalar initVelMax, hsScalar xSize, hsScalar ySize,
hsScalar scaleMin, hsScalar scaleMax,
hsScalar massRange, hsScalar radsPerSecRange);
void Init(float genLife, float partLifeMin, float partLifeMax, float particlesPerSecond,
uint32_t numSources, hsPoint3 *pos, float *initPitch, float *initYaw, float angleRange,
float initVelMin, float initVelMax, float xSize, float ySize,
float scaleMin, float scaleMax,
float massRange, float radsPerSecRange);
CLASSNAME_REGISTER( plSimpleParticleGenerator );
GETINTERFACE_ANY( plSimpleParticleGenerator, plParticleGenerator);
virtual hsBool AddAutoParticles(plParticleEmitter *emitter, float dt, uint32_t numForced);
virtual void UpdateParam(uint32_t paramID, hsScalar paramValue);
virtual void UpdateParam(uint32_t paramID, float paramValue);
virtual void Read(hsStream* s, hsResMgr *mgr);
virtual void Write(hsStream* s, hsResMgr *mgr);
protected:
hsScalar fParticlesPerSecond;
float fParticlesPerSecond;
uint32_t fNumSources;
hsPoint3 *fInitPos;
hsScalar *fInitPitch, *fInitYaw;
hsScalar fAngleRange;
hsScalar fVelMin, fVelMax;
hsScalar fXSize, fYSize, fScaleMin, fScaleMax;
hsScalar fGenLife; // How long shall we spit out particles from this location? When this time runs out, we stop
float *fInitPitch, *fInitYaw;
float fAngleRange;
float fVelMin, fVelMax;
float fXSize, fYSize, fScaleMin, fScaleMax;
float fGenLife; // How long shall we spit out particles from this location? When this time runs out, we stop
// spitting particles, but we don't actually die until all of our particles die naturally.
// (Even the ones that we feel are suffering needlessly.)
hsScalar fPartLifeMin; // lifespan for the particles we generate
hsScalar fPartLifeMax;
float fPartLifeMin; // lifespan for the particles we generate
float fPartLifeMax;
hsScalar fPartInvMassMin; // Doing a uniform variant over the inverse mass range (instead of over the mass range
hsScalar fPartInvMassRange; // and then inverting) will favor the low end of the mass range, but then again,
float fPartInvMassMin; // Doing a uniform variant over the inverse mass range (instead of over the mass range
float fPartInvMassRange; // and then inverting) will favor the low end of the mass range, but then again,
// it's just a freaking game. Note though that fPartInvMassMin == 1.f / massMAX.
hsScalar fPartRadsPerSecRange; // Zero means no rot, otherwise uniform random between [-range..range]
float fPartRadsPerSecRange; // Zero means no rot, otherwise uniform random between [-range..range]
hsScalar fParticleSum;
float fParticleSum;
enum
{
@ -125,24 +125,24 @@ public:
plOneTimeParticleGenerator();
~plOneTimeParticleGenerator();
void Init(hsScalar count, hsPoint3 *pointArray, hsVector3 *dirArray,
hsScalar xSize, hsScalar ySize, hsScalar scaleMin, hsScalar scaleMax, hsScalar radsPerSec);
void Init(float count, hsPoint3 *pointArray, hsVector3 *dirArray,
float xSize, float ySize, float scaleMin, float scaleMax, float radsPerSec);
CLASSNAME_REGISTER( plOneTimeParticleGenerator );
GETINTERFACE_ANY( plOneTimeParticleGenerator, plParticleGenerator);
virtual hsBool AddAutoParticles(plParticleEmitter *emitter, float dt, uint32_t numForced = 0);
virtual void UpdateParam(uint32_t paramID, hsScalar paramValue) {}
virtual void UpdateParam(uint32_t paramID, float paramValue) {}
virtual void Read(hsStream* s, hsResMgr *mgr);
virtual void Write(hsStream* s, hsResMgr *mgr);
protected:
hsScalar fCount;
float fCount;
hsPoint3 *fPosition;
hsVector3 *fDirection;
hsScalar fXSize, fYSize, fScaleMin, fScaleMax;
hsScalar fPartRadsPerSecRange; // Zero means no rot, otherwise uniform random between [-range..range]
float fXSize, fYSize, fScaleMin, fScaleMax;
float fPartRadsPerSecRange; // Zero means no rot, otherwise uniform random between [-range..range]
};
#endif