mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Eliminate hsScalar and hsFixed
Modern CPUs support floats just fine... hsFixed was crazy.
This commit is contained in:
@ -82,13 +82,13 @@ public:
|
||||
int fType;
|
||||
|
||||
hsPoint3 fOffset;
|
||||
hsScalar fAccel;
|
||||
hsScalar fDecel;
|
||||
hsScalar fVel;
|
||||
hsScalar fFPAccel;
|
||||
hsScalar fFPDecel;
|
||||
hsScalar fFPVel;
|
||||
hsScalar fFOVw, fFOVh;
|
||||
float fAccel;
|
||||
float fDecel;
|
||||
float fVel;
|
||||
float fFPAccel;
|
||||
float fFPDecel;
|
||||
float fFPVel;
|
||||
float fFOVw, fFOVh;
|
||||
hsBool fWorldspace;
|
||||
|
||||
void Read(hsStream* stream);
|
||||
|
@ -65,7 +65,7 @@ class plEventCallbackMsg : public plMessage
|
||||
protected:
|
||||
|
||||
public:
|
||||
hsScalar fEventTime; // the time for time events
|
||||
float fEventTime; // the time for time events
|
||||
CallbackEvent fEvent; // the event
|
||||
int16_t fIndex; // the index of the object we want the event to come from
|
||||
// (where applicable, required for sounds)
|
||||
@ -79,7 +79,7 @@ public:
|
||||
plMessage(s, r, t),
|
||||
fEventTime(0.0f), fEvent((CallbackEvent)0), fRepeats(-1), fUser(0), fIndex(0) {;}
|
||||
|
||||
plEventCallbackMsg(const plKey &receiver, CallbackEvent e, int idx=0, hsScalar t=0, int16_t repeats=-1, uint16_t user=0) :
|
||||
plEventCallbackMsg(const plKey &receiver, CallbackEvent e, int idx=0, float t=0, int16_t repeats=-1, uint16_t user=0) :
|
||||
plMessage(nil, receiver, nil), fEvent(e), fIndex(idx), fEventTime(t), fRepeats(repeats), fUser(user) {}
|
||||
|
||||
~plEventCallbackMsg(){;}
|
||||
|
@ -502,7 +502,7 @@ void plNotifyMsg::AddContainerEvent( const plKey &container, const plKey &contai
|
||||
// NOTE: To test for duplicate record, it only checks for records of the same type
|
||||
// : Eventually, it might be wise to check if the same 'self' key also?
|
||||
//
|
||||
void plNotifyMsg::AddFacingEvent( const plKey &other, const plKey &self, hsScalar dot, hsBool enabled )
|
||||
void plNotifyMsg::AddFacingEvent( const plKey &other, const plKey &self, float dot, hsBool enabled )
|
||||
{
|
||||
|
||||
// remove records that are like the one being added
|
||||
@ -583,7 +583,7 @@ void plNotifyMsg::AddControlKeyEvent( int32_t key, hsBool down )
|
||||
//
|
||||
// PURPOSE : Add a variable event record to this notify message
|
||||
//
|
||||
void plNotifyMsg::AddVariableEvent( const char* name, hsScalar number )
|
||||
void plNotifyMsg::AddVariableEvent( const char* name, float number )
|
||||
{
|
||||
// create the control key event record
|
||||
proVariableEventData* pED = TRACKED_NEW proVariableEventData;
|
||||
@ -628,7 +628,7 @@ void plNotifyMsg::AddVariableEvent( const char* name, const plKey &key )
|
||||
// NOTE: To test for duplicate record, it only checks for records of the same type
|
||||
// : Eventually, it might be wise to check if the same 'self' key also?
|
||||
//
|
||||
void plNotifyMsg::AddClickDragEvent( const plKey& dragger, const plKey& dragee, hsScalar animPos )
|
||||
void plNotifyMsg::AddClickDragEvent( const plKey& dragger, const plKey& dragee, float animPos )
|
||||
{
|
||||
// remove records that are like the one being added
|
||||
int num_recs = fEvents.GetCount();
|
||||
|
@ -181,7 +181,7 @@ proEventType(Variable)
|
||||
int32_t fDataType; // type of data
|
||||
|
||||
// Can't be a union, sadly, but it isn't that much of a waste of space...
|
||||
hsScalar fNumber; // if its a number
|
||||
float fNumber; // if its a number
|
||||
plKey fKey; // if its a plKey (pointer to something)
|
||||
|
||||
|
||||
@ -198,7 +198,7 @@ protected:
|
||||
proEventType(Facing)
|
||||
plKey fFacer; // what was facing
|
||||
plKey fFacee; // what was being faced
|
||||
hsScalar dot; // the dot prod of their view vectors
|
||||
float dot; // the dot prod of their view vectors
|
||||
hsBool enabled; // Now meets facing requirement (true) or no longer meets requirement (false)
|
||||
|
||||
protected:
|
||||
@ -284,7 +284,7 @@ protected:
|
||||
proEventType(ClickDrag)
|
||||
plKey picker; // always the local avatar in this case
|
||||
plKey picked;
|
||||
hsScalar animPos; // 0.0 to 1.0 animation percentage
|
||||
float animPos; // 0.0 to 1.0 animation percentage
|
||||
};
|
||||
|
||||
proEventType(OfferLinkingBook)
|
||||
@ -355,21 +355,21 @@ public:
|
||||
kResponderChangeState, // Change state without triggering
|
||||
};
|
||||
int32_t fType; // what type of notification
|
||||
hsScalar fState; // state of the notifier 0.0=false, 1.0=true
|
||||
float fState; // state of the notifier 0.0=false, 1.0=true
|
||||
int32_t fID; // special ID mostly for responder State transitions
|
||||
hsTArray<proEventData*> fEvents;// list of events with data
|
||||
|
||||
void SetType(notificationType type) { fType = type; }
|
||||
void SetState(hsScalar state) { fState = state; }
|
||||
void SetState(float state) { fState = state; }
|
||||
|
||||
// event records for the notify message
|
||||
void AddEvent( proEventData* ed);
|
||||
void AddCollisionEvent( hsBool enter, const plKey &other, const plKey &self, hsBool onlyOneCollision=true );
|
||||
void AddPickEvent( const plKey &other, const plKey& self, hsBool enabled, hsPoint3 hitPoint );
|
||||
void AddControlKeyEvent( int32_t key, hsBool down );
|
||||
void AddVariableEvent( const char* name, hsScalar number );
|
||||
void AddVariableEvent( const char* name, float number );
|
||||
void AddVariableEvent( const char *name, const plKey &key);
|
||||
void AddFacingEvent( const plKey &other, const plKey &self, hsScalar dot, hsBool enabled);
|
||||
void AddFacingEvent( const plKey &other, const plKey &self, float dot, hsBool enabled);
|
||||
void AddContainerEvent( const plKey &container, const plKey &contained, hsBool entering);
|
||||
void AddActivateEvent( hsBool activate );
|
||||
void AddCallbackEvent( int32_t event );
|
||||
@ -377,7 +377,7 @@ public:
|
||||
void AddMultiStageEvent( int32_t stage, int32_t event, const plKey& avatar );
|
||||
void AddCoopEvent(uint32_t id, uint16_t serial);
|
||||
void AddSpawnedEvent (const plKey &spawner, const plKey &spawned);
|
||||
void AddClickDragEvent(const plKey& dragger, const plKey& dragee, hsScalar animPos);
|
||||
void AddClickDragEvent(const plKey& dragger, const plKey& dragee, float animPos);
|
||||
void AddOfferBookEvent(const plKey& offerer, int targetAge, int offeree);
|
||||
void AddBookEvent( uint32_t event, uint32_t linkID = 0 );
|
||||
void AddHitClimbingBlockerEvent(const plKey &blocker);
|
||||
|
@ -98,13 +98,13 @@ public:
|
||||
double fBegin;
|
||||
double fEnd;
|
||||
hsBool fLoop;
|
||||
hsScalar fSpeed;
|
||||
float fSpeed;
|
||||
double fTime;
|
||||
int fIndex;
|
||||
int fRepeats;
|
||||
hsBool fPlaying;
|
||||
uint32_t fNameStr;
|
||||
hsScalar fVolume; // Range: 0 - silence, 1.f - loudest
|
||||
float fVolume; // Range: 0 - silence, 1.f - loudest
|
||||
|
||||
enum FadeType
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ plTimeMsg::plTimeMsg()
|
||||
|
||||
plTimeMsg::plTimeMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t, const hsScalar* d)
|
||||
const double* t, const float* d)
|
||||
: plMessage(s, r, t)
|
||||
{
|
||||
fSeconds = t ? *t : hsTimer::GetSysSeconds();
|
||||
@ -70,7 +70,7 @@ plEvalMsg::plEvalMsg()
|
||||
|
||||
plEvalMsg::plEvalMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t, const hsScalar* d)
|
||||
const double* t, const float* d)
|
||||
: plTimeMsg(s, r, t, d)
|
||||
{
|
||||
}
|
||||
@ -85,7 +85,7 @@ plTransformMsg::plTransformMsg()
|
||||
|
||||
plTransformMsg::plTransformMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t, const hsScalar* d)
|
||||
const double* t, const float* d)
|
||||
: plTimeMsg(s, r, t, d)
|
||||
{
|
||||
SetBCastFlag(plMessage::kClearAfterBCast);
|
||||
|
@ -50,23 +50,23 @@ class plTimeMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
double fSeconds;
|
||||
hsScalar fDelSecs;
|
||||
float fDelSecs;
|
||||
|
||||
public:
|
||||
plTimeMsg();
|
||||
plTimeMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t, const hsScalar* del);
|
||||
const double* t, const float* del);
|
||||
~plTimeMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plTimeMsg );
|
||||
GETINTERFACE_ANY( plTimeMsg, plMessage );
|
||||
|
||||
plTimeMsg& SetSeconds(double s) { fSeconds = s; return *this; }
|
||||
plTimeMsg& SetDelSeconds(hsScalar d) { fDelSecs = d; return *this; }
|
||||
plTimeMsg& SetDelSeconds(float d) { fDelSecs = d; return *this; }
|
||||
|
||||
double DSeconds() { return fSeconds; }
|
||||
hsScalar DelSeconds() { return fDelSecs; }
|
||||
float DelSeconds() { return fDelSecs; }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
@ -90,7 +90,7 @@ public:
|
||||
plEvalMsg();
|
||||
plEvalMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t, const hsScalar* del);
|
||||
const double* t, const float* del);
|
||||
~plEvalMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plEvalMsg );
|
||||
@ -107,7 +107,7 @@ public:
|
||||
plTransformMsg();
|
||||
plTransformMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t, const hsScalar* del);
|
||||
const double* t, const float* del);
|
||||
~plTransformMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plTransformMsg );
|
||||
@ -125,7 +125,7 @@ class plDelayedTransformMsg : public plTransformMsg
|
||||
{
|
||||
public:
|
||||
plDelayedTransformMsg() : plTransformMsg() {}
|
||||
plDelayedTransformMsg(const plKey &s, const plKey &r, const double* t, const hsScalar* del) : plTransformMsg(s, r, t, del) {}
|
||||
plDelayedTransformMsg(const plKey &s, const plKey &r, const double* t, const float* del) : plTransformMsg(s, r, t, del) {}
|
||||
|
||||
CLASSNAME_REGISTER( plDelayedTransformMsg );
|
||||
GETINTERFACE_ANY( plDelayedTransformMsg, plTransformMsg );
|
||||
|
Reference in New Issue
Block a user