mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 19:29:09 +00:00
Convert custom HeadSpin integer types to standard types from stdint.h
This commit is contained in:
@ -72,7 +72,7 @@ void hsInterp::LinInterp(const hsScalarTriple* k1, const hsScalarTriple* k2, hsS
|
||||
}
|
||||
|
||||
void hsInterp::LinInterp(const hsColorRGBA* k1, const hsColorRGBA* k2, hsScalar t,
|
||||
hsColorRGBA* result, UInt32 flags)
|
||||
hsColorRGBA* result, uint32_t flags)
|
||||
{
|
||||
if (t==0.0)
|
||||
{
|
||||
@ -103,7 +103,7 @@ void hsInterp::LinInterp(const hsColorRGBA* k1, const hsColorRGBA* k2, hsScalar
|
||||
}
|
||||
|
||||
void hsInterp::LinInterp(const hsMatrix33* k1, const hsMatrix33* k2, hsScalar t,
|
||||
hsMatrix33* result, UInt32 flags)
|
||||
hsMatrix33* result, uint32_t flags)
|
||||
{
|
||||
if (t==0.0)
|
||||
{
|
||||
@ -163,7 +163,7 @@ void hsInterp::LinInterp(const hsMatrix33* k1, const hsMatrix33* k2, hsScalar t,
|
||||
//
|
||||
//
|
||||
void hsInterp::LinInterp(const hsMatrix44* mat1, const hsMatrix44* mat2, hsScalar t,
|
||||
hsMatrix44* out, UInt32 flags)
|
||||
hsMatrix44* out, uint32_t flags)
|
||||
{
|
||||
if (flags == 0)
|
||||
{
|
||||
@ -255,7 +255,7 @@ void hsInterp::LinInterp(const hsScaleValue* k1, const hsScaleValue* k2, hsScala
|
||||
}
|
||||
|
||||
void hsInterp::LinInterp(const hsAffineParts* k1, const hsAffineParts* k2, hsScalar t,
|
||||
hsAffineParts* result, UInt32 flags)
|
||||
hsAffineParts* result, uint32_t flags)
|
||||
{
|
||||
if (t==0.0)
|
||||
{
|
||||
@ -387,7 +387,7 @@ void hsInterp::BezInterp(const hsBezScaleKey* k1, const hsBezScaleKey* k2, const
|
||||
//
|
||||
// Get an element from an array of unknown type
|
||||
//
|
||||
static inline hsKeyFrame* GetKey(Int32 i, void *keys, Int32 size)
|
||||
static inline hsKeyFrame* GetKey(int32_t i, void *keys, int32_t size)
|
||||
{
|
||||
return (hsKeyFrame*) ((char*)keys + size * i);
|
||||
}
|
||||
@ -399,12 +399,12 @@ static inline hsKeyFrame* GetKey(Int32 i, void *keys, Int32 size)
|
||||
// Returns the index of the first key which can be passed in as a hint (lastKeyIdx)
|
||||
// for the next search.
|
||||
//
|
||||
void hsInterp::GetBoundaryKeyFrames(hsScalar time, UInt32 numKeys, void *keys, UInt32 size,
|
||||
hsKeyFrame **kF1, hsKeyFrame **kF2, UInt32 *lastKeyIdx, hsScalar *p, hsBool forwards)
|
||||
void hsInterp::GetBoundaryKeyFrames(hsScalar time, uint32_t numKeys, void *keys, uint32_t size,
|
||||
hsKeyFrame **kF1, hsKeyFrame **kF2, uint32_t *lastKeyIdx, hsScalar *p, hsBool forwards)
|
||||
{
|
||||
hsAssert(numKeys>1, "Must have more than 1 keyframe");
|
||||
int k1, k2;
|
||||
UInt16 frame = (UInt16)(time * MAX_FRAMES_PER_SEC);
|
||||
uint16_t frame = (uint16_t)(time * MAX_FRAMES_PER_SEC);
|
||||
|
||||
// boundary case, past end
|
||||
if (frame > GetKey(numKeys-1, keys, size)->fFrame)
|
||||
|
@ -78,16 +78,16 @@ public:
|
||||
// simple linear interpolation
|
||||
static void LinInterp(const hsScalar k1, const hsScalar k2, const hsScalar t, hsScalar *result);
|
||||
static void LinInterp(const hsScalarTriple *k1, const hsScalarTriple *k2, const hsScalar t, hsScalarTriple *result);
|
||||
static void LinInterp(const hsColorRGBA *k1, const hsColorRGBA *k2, const hsScalar t, hsColorRGBA *result, UInt32 ignoreFlags=0);
|
||||
static void LinInterp(const hsMatrix33 *k1, const hsMatrix33 *k2, const hsScalar t, hsMatrix33 *result, UInt32 ignoreFlags=0);
|
||||
static void LinInterp(const hsMatrix44 *mat1, const hsMatrix44 *mat2, const hsScalar t, hsMatrix44 *out, UInt32 ignoreFlags=0);
|
||||
static void LinInterp(const hsColorRGBA *k1, const hsColorRGBA *k2, const hsScalar t, hsColorRGBA *result, uint32_t ignoreFlags=0);
|
||||
static void LinInterp(const hsMatrix33 *k1, const hsMatrix33 *k2, const hsScalar t, hsMatrix33 *result, uint32_t ignoreFlags=0);
|
||||
static void LinInterp(const hsMatrix44 *mat1, const hsMatrix44 *mat2, const hsScalar t, hsMatrix44 *out, uint32_t ignoreFlags=0);
|
||||
static void LinInterp(const hsQuat *k1, const hsQuat *k2, const hsScalar t, hsQuat *result);
|
||||
static void LinInterp(const hsScaleValue *k1, const hsScaleValue *k2, const hsScalar t, hsScaleValue *result);
|
||||
static void LinInterp(const hsAffineParts *k1, const hsAffineParts *k2, const hsScalar t, hsAffineParts *result, UInt32 ignoreFlags=0);
|
||||
static void LinInterp(const hsAffineParts *k1, const hsAffineParts *k2, const hsScalar t, hsAffineParts *result, uint32_t ignoreFlags=0);
|
||||
|
||||
// Given a time value, find the enclosing keyframes and normalize time (0-1)
|
||||
static void GetBoundaryKeyFrames(hsScalar time, UInt32 numKeys, void *keys,
|
||||
UInt32 keySize, hsKeyFrame **kF1, hsKeyFrame **kF2, UInt32 *lastKeyIdx, hsScalar *p, hsBool forwards);
|
||||
static void GetBoundaryKeyFrames(hsScalar time, uint32_t numKeys, void *keys,
|
||||
uint32_t keySize, hsKeyFrame **kF1, hsKeyFrame **kF2, uint32_t *lastKeyIdx, hsScalar *p, hsBool forwards);
|
||||
|
||||
};
|
||||
|
||||
|
@ -177,7 +177,7 @@ hsBool hsCompressedQuatKey32::CompareValue(hsCompressedQuatKey32 *key)
|
||||
void hsCompressedQuatKey32::SetQuat(hsQuat &q)
|
||||
{
|
||||
q.Normalize();
|
||||
UInt32 maxElement = kCompQuatNukeX;
|
||||
uint32_t maxElement = kCompQuatNukeX;
|
||||
hsScalar maxVal = hsABS(q.fX);
|
||||
if (hsABS(q.fY) > maxVal)
|
||||
{
|
||||
@ -204,9 +204,9 @@ void hsCompressedQuatKey32::SetQuat(hsQuat &q)
|
||||
q = -q;
|
||||
|
||||
fData = (maxElement << 30) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fY + kOneOverRootTwo))) << 20) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fZ + kOneOverRootTwo))) << 10) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
(((uint32_t)(k10BitScaleRange * (q.fY + kOneOverRootTwo))) << 20) |
|
||||
(((uint32_t)(k10BitScaleRange * (q.fZ + kOneOverRootTwo))) << 10) |
|
||||
(((uint32_t)(k10BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
break;
|
||||
}
|
||||
case kCompQuatNukeY:
|
||||
@ -215,9 +215,9 @@ void hsCompressedQuatKey32::SetQuat(hsQuat &q)
|
||||
q = -q;
|
||||
|
||||
fData = (maxElement << 30) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fX + kOneOverRootTwo))) << 20) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fZ + kOneOverRootTwo))) << 10) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
(((uint32_t)(k10BitScaleRange * (q.fX + kOneOverRootTwo))) << 20) |
|
||||
(((uint32_t)(k10BitScaleRange * (q.fZ + kOneOverRootTwo))) << 10) |
|
||||
(((uint32_t)(k10BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
break;
|
||||
}
|
||||
case kCompQuatNukeZ:
|
||||
@ -226,9 +226,9 @@ void hsCompressedQuatKey32::SetQuat(hsQuat &q)
|
||||
q = -q;
|
||||
|
||||
fData = (maxElement << 30) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fX + kOneOverRootTwo))) << 20) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fY + kOneOverRootTwo))) << 10) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
(((uint32_t)(k10BitScaleRange * (q.fX + kOneOverRootTwo))) << 20) |
|
||||
(((uint32_t)(k10BitScaleRange * (q.fY + kOneOverRootTwo))) << 10) |
|
||||
(((uint32_t)(k10BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
break;
|
||||
}
|
||||
case kCompQuatNukeW:
|
||||
@ -238,9 +238,9 @@ void hsCompressedQuatKey32::SetQuat(hsQuat &q)
|
||||
q = -q;
|
||||
|
||||
fData = (maxElement << 30) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fX + kOneOverRootTwo))) << 20) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fY + kOneOverRootTwo))) << 10) |
|
||||
(((UInt32)(k10BitScaleRange * (q.fZ + kOneOverRootTwo))));
|
||||
(((uint32_t)(k10BitScaleRange * (q.fX + kOneOverRootTwo))) << 20) |
|
||||
(((uint32_t)(k10BitScaleRange * (q.fY + kOneOverRootTwo))) << 10) |
|
||||
(((uint32_t)(k10BitScaleRange * (q.fZ + kOneOverRootTwo))));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -248,7 +248,7 @@ void hsCompressedQuatKey32::SetQuat(hsQuat &q)
|
||||
|
||||
void hsCompressedQuatKey32::GetQuat(hsQuat &q)
|
||||
{
|
||||
UInt32 maxElement = fData >> 30;
|
||||
uint32_t maxElement = fData >> 30;
|
||||
switch (maxElement)
|
||||
{
|
||||
case kCompQuatNukeX:
|
||||
@ -320,7 +320,7 @@ hsBool hsCompressedQuatKey64::CompareValue(hsCompressedQuatKey64 *key)
|
||||
void hsCompressedQuatKey64::SetQuat(hsQuat &q)
|
||||
{
|
||||
q.Normalize();
|
||||
UInt32 maxElement = kCompQuatNukeX;
|
||||
uint32_t maxElement = kCompQuatNukeX;
|
||||
hsScalar maxVal = hsABS(q.fX);
|
||||
if (hsABS(q.fY) > maxVal)
|
||||
{
|
||||
@ -347,11 +347,11 @@ void hsCompressedQuatKey64::SetQuat(hsQuat &q)
|
||||
q = -q;
|
||||
|
||||
fData[0] = (maxElement << 30) |
|
||||
(((UInt32)(k20BitScaleRange * (q.fY + kOneOverRootTwo))) << 10) |
|
||||
(((UInt32)(k21BitScaleRange * (q.fZ + kOneOverRootTwo))) >> 11);
|
||||
(((uint32_t)(k20BitScaleRange * (q.fY + kOneOverRootTwo))) << 10) |
|
||||
(((uint32_t)(k21BitScaleRange * (q.fZ + kOneOverRootTwo))) >> 11);
|
||||
fData[1] =
|
||||
(((UInt32)(k21BitScaleRange * (q.fZ + kOneOverRootTwo))) << 21) |
|
||||
(((UInt32)(k21BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
(((uint32_t)(k21BitScaleRange * (q.fZ + kOneOverRootTwo))) << 21) |
|
||||
(((uint32_t)(k21BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
break;
|
||||
}
|
||||
case kCompQuatNukeY:
|
||||
@ -360,11 +360,11 @@ void hsCompressedQuatKey64::SetQuat(hsQuat &q)
|
||||
q = -q;
|
||||
|
||||
fData[0] = (maxElement << 30) |
|
||||
(((UInt32)(k20BitScaleRange * (q.fX + kOneOverRootTwo))) << 10) |
|
||||
(((UInt32)(k21BitScaleRange * (q.fZ + kOneOverRootTwo))) >> 11);
|
||||
(((uint32_t)(k20BitScaleRange * (q.fX + kOneOverRootTwo))) << 10) |
|
||||
(((uint32_t)(k21BitScaleRange * (q.fZ + kOneOverRootTwo))) >> 11);
|
||||
fData[1] =
|
||||
(((UInt32)(k21BitScaleRange * (q.fZ + kOneOverRootTwo))) << 21) |
|
||||
(((UInt32)(k21BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
(((uint32_t)(k21BitScaleRange * (q.fZ + kOneOverRootTwo))) << 21) |
|
||||
(((uint32_t)(k21BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
break;
|
||||
}
|
||||
case kCompQuatNukeZ:
|
||||
@ -373,11 +373,11 @@ void hsCompressedQuatKey64::SetQuat(hsQuat &q)
|
||||
q = -q;
|
||||
|
||||
fData[0] = (maxElement << 30) |
|
||||
(((UInt32)(k20BitScaleRange * (q.fX + kOneOverRootTwo))) << 10) |
|
||||
(((UInt32)(k21BitScaleRange * (q.fY + kOneOverRootTwo))) >> 11);
|
||||
(((uint32_t)(k20BitScaleRange * (q.fX + kOneOverRootTwo))) << 10) |
|
||||
(((uint32_t)(k21BitScaleRange * (q.fY + kOneOverRootTwo))) >> 11);
|
||||
fData[1] =
|
||||
(((UInt32)(k21BitScaleRange * (q.fY + kOneOverRootTwo))) << 21) |
|
||||
(((UInt32)(k21BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
(((uint32_t)(k21BitScaleRange * (q.fY + kOneOverRootTwo))) << 21) |
|
||||
(((uint32_t)(k21BitScaleRange * (q.fW + kOneOverRootTwo))));
|
||||
break;
|
||||
}
|
||||
case kCompQuatNukeW:
|
||||
@ -387,11 +387,11 @@ void hsCompressedQuatKey64::SetQuat(hsQuat &q)
|
||||
q = -q;
|
||||
|
||||
fData[0] = (maxElement << 30) |
|
||||
(((UInt32)(k20BitScaleRange * (q.fX + kOneOverRootTwo))) << 10) |
|
||||
(((UInt32)(k21BitScaleRange * (q.fY + kOneOverRootTwo))) >> 11);
|
||||
(((uint32_t)(k20BitScaleRange * (q.fX + kOneOverRootTwo))) << 10) |
|
||||
(((uint32_t)(k21BitScaleRange * (q.fY + kOneOverRootTwo))) >> 11);
|
||||
fData[1] =
|
||||
(((UInt32)(k21BitScaleRange * (q.fY + kOneOverRootTwo))) << 21) |
|
||||
(((UInt32)(k21BitScaleRange * (q.fZ + kOneOverRootTwo))));
|
||||
(((uint32_t)(k21BitScaleRange * (q.fY + kOneOverRootTwo))) << 21) |
|
||||
(((uint32_t)(k21BitScaleRange * (q.fZ + kOneOverRootTwo))));
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -399,7 +399,7 @@ void hsCompressedQuatKey64::SetQuat(hsQuat &q)
|
||||
|
||||
void hsCompressedQuatKey64::GetQuat(hsQuat &q)
|
||||
{
|
||||
UInt32 maxElement = fData[0] >> 30;
|
||||
uint32_t maxElement = fData[0] >> 30;
|
||||
switch (maxElement)
|
||||
{
|
||||
case kCompQuatNukeX:
|
||||
@ -494,7 +494,7 @@ hsBool hsBezScaleKey::CompareValue(hsBezScaleKey *key)
|
||||
|
||||
//////////////////////
|
||||
|
||||
void hsG3DSMaxKeyFrame::Set(hsMatrix44 *mat, UInt16 frame)
|
||||
void hsG3DSMaxKeyFrame::Set(hsMatrix44 *mat, uint16_t frame)
|
||||
{
|
||||
fFrame = frame;
|
||||
gemAffineParts parts;
|
||||
@ -502,7 +502,7 @@ void hsG3DSMaxKeyFrame::Set(hsMatrix44 *mat, UInt16 frame)
|
||||
AP_SET(fParts, parts);
|
||||
}
|
||||
|
||||
void hsG3DSMaxKeyFrame::Set(const hsAffineParts &parts, UInt16 frame)
|
||||
void hsG3DSMaxKeyFrame::Set(const hsAffineParts &parts, uint16_t frame)
|
||||
{
|
||||
fFrame = frame;
|
||||
fParts = parts;
|
||||
@ -530,7 +530,7 @@ hsBool hsG3DSMaxKeyFrame::CompareValue(hsG3DSMaxKeyFrame *key)
|
||||
void hsMatrix33Key::Read(hsStream *stream)
|
||||
{
|
||||
fFrame = stream->ReadLE16();
|
||||
Int32 i,j;
|
||||
int32_t i,j;
|
||||
for(i=0;i<3;i++)
|
||||
for(j=0;j<3;j++)
|
||||
fValue.fMap[j][i] = stream->ReadLEScalar();
|
||||
@ -539,7 +539,7 @@ void hsMatrix33Key::Read(hsStream *stream)
|
||||
void hsMatrix33Key::Write(hsStream *stream)
|
||||
{
|
||||
stream->WriteLE16(fFrame);
|
||||
Int32 i,j;
|
||||
int32_t i,j;
|
||||
for(i=0;i<3;i++)
|
||||
for(j=0;j<3;j++)
|
||||
stream->WriteLEScalar(fValue.fMap[j][i]);
|
||||
|
@ -70,7 +70,7 @@ struct hsKeyFrame
|
||||
kMatrix44KeyFrame,
|
||||
};
|
||||
|
||||
UInt16 fFrame;
|
||||
uint16_t fFrame;
|
||||
static const int kMaxFrameNumber;
|
||||
};
|
||||
|
||||
@ -150,7 +150,7 @@ struct hsCompressedQuatKey32 : public hsKeyFrame
|
||||
hsBool CompareValue(hsCompressedQuatKey32 *key);
|
||||
|
||||
protected:
|
||||
UInt32 fData;
|
||||
uint32_t fData;
|
||||
};
|
||||
|
||||
struct hsCompressedQuatKey64 : public hsKeyFrame
|
||||
@ -176,7 +176,7 @@ struct hsCompressedQuatKey64 : public hsKeyFrame
|
||||
hsBool CompareValue(hsCompressedQuatKey64 *key);
|
||||
|
||||
protected:
|
||||
UInt32 fData[2];
|
||||
uint32_t fData[2];
|
||||
};
|
||||
|
||||
struct hsScaleValue : public hsKeyFrame
|
||||
@ -221,8 +221,8 @@ struct hsG3DSMaxKeyFrame : public hsKeyFrame
|
||||
|
||||
void Reset() { fParts.Reset(); } // Make parts identity
|
||||
|
||||
void Set(hsMatrix44 *mat, UInt16 frame);
|
||||
void Set(const hsAffineParts &parts, UInt16 frame);
|
||||
void Set(hsMatrix44 *mat, uint16_t frame);
|
||||
void Set(const hsAffineParts &parts, uint16_t frame);
|
||||
|
||||
hsMatrix44* GetMatrix44(hsMatrix44 *mat) { fParts.ComposeMatrix(mat); return mat; }
|
||||
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
kInstant = 0x2
|
||||
};
|
||||
protected:
|
||||
UInt32 fFlags;
|
||||
uint32_t fFlags;
|
||||
hsScalar fDuration;
|
||||
hsScalar fStartTime;
|
||||
|
||||
@ -65,7 +65,7 @@ public:
|
||||
hsTimedValue() : fFlags(kIdle|kInstant), fDuration(0) {}
|
||||
hsTimedValue(const T& v) : fFlags(kIdle|kInstant), fDuration(0) { SetValue(v); }
|
||||
|
||||
UInt32 GetFlags() { return fFlags; }
|
||||
uint32_t GetFlags() { return fFlags; }
|
||||
|
||||
void SetDuration(hsScalar duration);
|
||||
hsScalar GetDuration() const { return fDuration; }
|
||||
|
@ -44,7 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
plATCEaseCurve *plATCEaseCurve::CreateEaseCurve(UInt8 type, hsScalar minLength, hsScalar maxLength, hsScalar length,
|
||||
plATCEaseCurve *plATCEaseCurve::CreateEaseCurve(uint8_t type, hsScalar minLength, hsScalar maxLength, hsScalar length,
|
||||
hsScalar startSpeed, hsScalar goalSpeed)
|
||||
{
|
||||
if (type == plAnimEaseTypes::kConstAccel)
|
||||
|
@ -70,7 +70,7 @@ void plAnimPath::Reset()
|
||||
SetCurTime(0);
|
||||
}
|
||||
|
||||
void plAnimPath::SetCurTime(hsScalar t, UInt32 calcFlags)
|
||||
void plAnimPath::SetCurTime(hsScalar t, uint32_t calcFlags)
|
||||
{
|
||||
fTime = t;
|
||||
if( !fController )
|
||||
@ -502,7 +502,7 @@ hsScalar plAnimPath::IShiftFore(hsPoint3 &pt) const
|
||||
// doesn't use any fancy subdivision or curvature measure when drawing.
|
||||
// Changes current time.
|
||||
//
|
||||
void plAnimPath::IMakeSegment(hsTArray<UInt16>& idx, hsTArray<hsPoint3>& pos,
|
||||
void plAnimPath::IMakeSegment(hsTArray<uint16_t>& idx, hsTArray<hsPoint3>& pos,
|
||||
hsPoint3& p1, hsPoint3& p2)
|
||||
{
|
||||
hsVector3 del(&p2, &p1);
|
||||
@ -576,7 +576,7 @@ void plAnimPath::IMakeSegment(hsTArray<UInt16>& idx, hsTArray<hsPoint3>& pos,
|
||||
}
|
||||
}
|
||||
|
||||
void plAnimPath::MakeDrawList(hsTArray<UInt16>& idx, hsTArray<hsPoint3>& pos)
|
||||
void plAnimPath::MakeDrawList(hsTArray<uint16_t>& idx, hsTArray<hsPoint3>& pos)
|
||||
{
|
||||
hsMatrix44 resetL2W = GetLocalToWorld();
|
||||
hsMatrix44 resetW2L = GetWorldToLocal();
|
||||
@ -623,7 +623,7 @@ void plAnimPath::MakeDrawList(hsTArray<UInt16>& idx, hsTArray<hsPoint3>& pos)
|
||||
// Precompute array of arclen deltas for lookahead ability.
|
||||
// Changes current time!
|
||||
//
|
||||
void plAnimPath::ComputeArcLenDeltas(Int32 numSamples)
|
||||
void plAnimPath::ComputeArcLenDeltas(int32_t numSamples)
|
||||
{
|
||||
if (fArcLenDeltas.GetCount() >= numSamples)
|
||||
return; // already computed enough samples
|
||||
@ -636,7 +636,7 @@ void plAnimPath::ComputeArcLenDeltas(Int32 numSamples)
|
||||
hsScalar time=0;
|
||||
hsPoint3 p1, p2;
|
||||
|
||||
Int32 cnt=0;
|
||||
int32_t cnt=0;
|
||||
|
||||
// prime initial point
|
||||
SetCurTime(0, kCalcPosOnly);
|
||||
@ -672,7 +672,7 @@ void plAnimPath::ComputeArcLenDeltas(Int32 numSamples)
|
||||
// Also sets strtSrchIdx for incremental searching.
|
||||
//
|
||||
hsScalar plAnimPath::GetLookAheadTime(hsScalar startTime, hsScalar arcLengthIn, hsBool bwd,
|
||||
Int32* startSrchIdx)
|
||||
int32_t* startSrchIdx)
|
||||
{
|
||||
if (arcLengthIn==0)
|
||||
return startTime; // default is no look ahead
|
||||
@ -695,7 +695,7 @@ hsScalar plAnimPath::GetLookAheadTime(hsScalar startTime, hsScalar arcLengthIn,
|
||||
|
||||
// find nearest (forward) arcLen sample point, use starting srch index provided
|
||||
hsBool found=false;
|
||||
Int32 i;
|
||||
int32_t i;
|
||||
for(i=(*startSrchIdx); i<fArcLenDeltas.GetCount()-1; i++)
|
||||
{
|
||||
if (fArcLenDeltas[i].fT<=startTime && startTime<fArcLenDeltas[i+1].fT)
|
||||
@ -729,7 +729,7 @@ hsScalar plAnimPath::GetLookAheadTime(hsScalar startTime, hsScalar arcLengthIn,
|
||||
}
|
||||
|
||||
// find distance to nearest arcLen sample point
|
||||
Int32 nearestIdx = bwd ? *startSrchIdx : *startSrchIdx+1;
|
||||
int32_t nearestIdx = bwd ? *startSrchIdx : *startSrchIdx+1;
|
||||
hsAssert(found, "couldn't find arcLength sample");
|
||||
|
||||
hsPoint3 pos;
|
||||
@ -744,7 +744,7 @@ hsScalar plAnimPath::GetLookAheadTime(hsScalar startTime, hsScalar arcLengthIn,
|
||||
hsScalar curTime=0;
|
||||
hsBool quit=false;
|
||||
hsScalar timeOut = 0;
|
||||
Int32 inc = bwd ? -1 : 1;
|
||||
int32_t inc = bwd ? -1 : 1;
|
||||
// now sum distance deltas until we exceed the desired arcLen
|
||||
if (curArcLen<arcLengthIn)
|
||||
{
|
||||
|
@ -73,7 +73,7 @@ protected:
|
||||
hsScalar fTime; // presumably seconds
|
||||
|
||||
// The paramters (and options) for this curve.
|
||||
UInt32 fAnimPathFlags; // currently set at runtime only
|
||||
uint32_t fAnimPathFlags; // currently set at runtime only
|
||||
hsScalar fMinDistSq;
|
||||
hsScalar fLength; // presumably seconds
|
||||
|
||||
@ -116,7 +116,7 @@ protected:
|
||||
: fNextTime); }
|
||||
|
||||
// Visualization helper
|
||||
void IMakeSegment(hsTArray<UInt16>& idx, hsTArray<hsPoint3>& pos,
|
||||
void IMakeSegment(hsTArray<uint16_t>& idx, hsTArray<hsPoint3>& pos,
|
||||
hsPoint3& p1, hsPoint3& p2);
|
||||
|
||||
// For computing arclen
|
||||
@ -142,10 +142,10 @@ public:
|
||||
const hsMatrix44& GetWorldToLocal() const { return fWorldToLocal; }
|
||||
|
||||
// Visualization helper
|
||||
void MakeDrawList(hsTArray<UInt16>& idx, hsTArray<hsPoint3>& pos);
|
||||
void MakeDrawList(hsTArray<uint16_t>& idx, hsTArray<hsPoint3>& pos);
|
||||
|
||||
void SetAnimPathFlags(UInt32 f) { fAnimPathFlags=f; }
|
||||
UInt32 GetAnimPathFlags() const { return fAnimPathFlags; }
|
||||
void SetAnimPathFlags(uint32_t f) { fAnimPathFlags=f; }
|
||||
uint32_t GetAnimPathFlags() const { return fAnimPathFlags; }
|
||||
|
||||
void SetWrap(hsBool on) { if(on)fAnimPathFlags |= kWrap; else fAnimPathFlags &= ~kWrap; }
|
||||
hsBool GetWrap() const { return 0 != (fAnimPathFlags & kWrap); }
|
||||
@ -153,7 +153,7 @@ public:
|
||||
void SetFarthest(hsBool on) { if(on)fAnimPathFlags |= kFarthest; else fAnimPathFlags &= ~kFarthest; }
|
||||
hsBool GetFarthest() const { return 0 != (fAnimPathFlags & kFarthest); }
|
||||
|
||||
void SetCurTime(hsScalar t, UInt32 calcFlags=0);
|
||||
void SetCurTime(hsScalar t, uint32_t calcFlags=0);
|
||||
hsScalar GetCurTime() const { return fTime; }
|
||||
|
||||
void SetController(plCompoundController* tmc);
|
||||
@ -178,8 +178,8 @@ public:
|
||||
hsScalar GetExtremePoint(hsScalar lastTime, hsScalar delTime, hsPoint3 &worldPt) const; // Incremental search
|
||||
|
||||
// for arclen usage
|
||||
void ComputeArcLenDeltas(Int32 numSamples=256);
|
||||
hsScalar GetLookAheadTime(hsScalar startTime, hsScalar arcLength, hsBool bwd, Int32* startSrchIdx);
|
||||
void ComputeArcLenDeltas(int32_t numSamples=256);
|
||||
hsScalar GetLookAheadTime(hsScalar startTime, hsScalar arcLength, hsBool bwd, int32_t* startSrchIdx);
|
||||
|
||||
virtual void Read(hsStream* s, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* s, hsResMgr* mgr);
|
||||
|
@ -362,7 +362,7 @@ plAnimTimeConvert& plAnimTimeConvert::IProcessStateChange(double worldTime, hsSc
|
||||
|
||||
state->fStartWorldTime = fLastStateChange;
|
||||
state->fStartAnimTime = (animTime < 0 ? WorldToAnimTimeNoUpdate(fLastStateChange) : animTime);
|
||||
state->fFlags = (UInt8)fFlags;
|
||||
state->fFlags = (uint8_t)fFlags;
|
||||
state->fBegin = fBegin;
|
||||
state->fEnd = fEnd;
|
||||
state->fLoopBegin = fLoopBegin;
|
||||
@ -395,7 +395,7 @@ void plAnimTimeConvert::IFlushOldStates()
|
||||
{
|
||||
plATCState *state;
|
||||
plATCStateList::const_iterator i = fStates.begin();
|
||||
UInt32 count = 0;
|
||||
uint32_t count = 0;
|
||||
|
||||
for (; i != fStates.end(); i++)
|
||||
{
|
||||
@ -446,7 +446,7 @@ void plAnimTimeConvert::SetOwner(plSynchedObject* o)
|
||||
fOwner = o;
|
||||
}
|
||||
|
||||
hsBool plAnimTimeConvert::IIsStoppedAt(const double &wSecs, const UInt32 &flags,
|
||||
hsBool plAnimTimeConvert::IIsStoppedAt(const double &wSecs, const uint32_t &flags,
|
||||
const plATCEaseCurve *curve) const
|
||||
{
|
||||
if (flags & kStopped)
|
||||
@ -743,7 +743,7 @@ void plAnimTimeConvert::SetCurrentAnimTime(hsScalar s, hsBool jump /* = false */
|
||||
IProcessStateChange(hsTimer::GetSysSeconds(), fCurrentAnimTime);
|
||||
}
|
||||
|
||||
void plAnimTimeConvert::SetEase(hsBool easeIn, UInt8 type, hsScalar minLength, hsScalar maxLength, hsScalar normLength)
|
||||
void plAnimTimeConvert::SetEase(hsBool easeIn, uint8_t type, hsScalar minLength, hsScalar maxLength, hsScalar normLength)
|
||||
{
|
||||
if (easeIn)
|
||||
{
|
||||
@ -889,7 +889,7 @@ void plAnimTimeConvert::Read(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plCreatable::Read(s, mgr);
|
||||
|
||||
fFlags = (UInt16)(s->ReadLE32());
|
||||
fFlags = (uint16_t)(s->ReadLE32());
|
||||
|
||||
fBegin = fInitialBegin = s->ReadLEScalar();
|
||||
fEnd = fInitialEnd = s->ReadLEScalar();
|
||||
@ -1350,7 +1350,7 @@ void plATCState::Read(hsStream *s, hsResMgr *mgr)
|
||||
fStartWorldTime = s->ReadLEDouble();
|
||||
fStartAnimTime = s->ReadLEScalar();
|
||||
|
||||
fFlags = (UInt8)(s->ReadLE32());
|
||||
fFlags = (uint8_t)(s->ReadLE32());
|
||||
fEnd = s->ReadLEScalar();
|
||||
fLoopBegin = s->ReadLEScalar();
|
||||
fLoopEnd = s->ReadLEScalar();
|
||||
|
@ -63,7 +63,7 @@ class plAnimTimeConvert : public plCreatable
|
||||
friend class plAGAnimInstance;
|
||||
|
||||
protected:
|
||||
UInt16 fFlags;
|
||||
uint16_t fFlags;
|
||||
hsScalar fBegin;
|
||||
hsScalar fEnd;
|
||||
hsScalar fLoopEnd;
|
||||
@ -105,14 +105,14 @@ protected:
|
||||
void ISendCallback(int i);
|
||||
|
||||
plAnimTimeConvert& IStop(double time, hsScalar animTime);
|
||||
hsBool IIsStoppedAt(const double &wSecs, const UInt32 &flags, const plATCEaseCurve *curve) const;
|
||||
hsBool IIsStoppedAt(const double &wSecs, const uint32_t &flags, const plATCEaseCurve *curve) const;
|
||||
plAnimTimeConvert& IProcessStateChange(double worldTime, hsScalar animTime = -1);
|
||||
void IFlushOldStates();
|
||||
void IClearAllStates();
|
||||
plATCState *IGetState(double wSecs) const;
|
||||
plATCState *IGetLatestState() const;
|
||||
|
||||
plAnimTimeConvert& SetFlag(UInt8 f, hsBool on) { if(on)fFlags |= f; else fFlags &= ~f; return *this; }
|
||||
plAnimTimeConvert& SetFlag(uint8_t f, hsBool on) { if(on)fFlags |= f; else fFlags &= ~f; return *this; }
|
||||
|
||||
public:
|
||||
plAnimTimeConvert();
|
||||
@ -142,7 +142,7 @@ public:
|
||||
void SetLoopPoints(hsScalar begin, hsScalar end) { SetLoopBegin(begin); SetLoopEnd(end); }
|
||||
void SetLoopBegin(hsScalar s) { fLoopBegin = s; }
|
||||
void SetLoopEnd(hsScalar s) { fLoopEnd = s; }
|
||||
void SetEase(hsBool easeIn, UInt8 inType, hsScalar minLength, hsScalar maxLength, hsScalar inLength);
|
||||
void SetEase(hsBool easeIn, uint8_t inType, hsScalar minLength, hsScalar maxLength, hsScalar inLength);
|
||||
void SetCurrentEaseCurve(int x); // 0=nil, 1=easeIn, 2=easeOut, 3=speed
|
||||
|
||||
hsScalar GetBegin() const { return fBegin; }
|
||||
@ -158,7 +158,7 @@ public:
|
||||
void ResetWrap();
|
||||
|
||||
plAnimTimeConvert& ClearFlags() { fFlags = kNone; return *this; }
|
||||
hsBool GetFlag(UInt8 f) const { return (fFlags & f) ? true : false; }
|
||||
hsBool GetFlag(uint8_t f) const { return (fFlags & f) ? true : false; }
|
||||
|
||||
plAnimTimeConvert& InitStop(); // Called when initializing an anim that doesn't autostart
|
||||
plAnimTimeConvert& Stop(hsBool on);
|
||||
@ -237,7 +237,7 @@ public:
|
||||
hsScalar fLength;
|
||||
hsScalar fSpeed; // The anim's target ("full") speed.
|
||||
|
||||
static plATCEaseCurve *CreateEaseCurve(UInt8 type, hsScalar minLength, hsScalar maxLength, hsScalar normLength,
|
||||
static plATCEaseCurve *CreateEaseCurve(uint8_t type, hsScalar minLength, hsScalar maxLength, hsScalar normLength,
|
||||
hsScalar startSpeed, hsScalar goalSpeed);
|
||||
|
||||
double GetEndWorldTime() const { return fBeginWorldTime + fLength; }
|
||||
@ -309,7 +309,7 @@ public:
|
||||
double fStartWorldTime;
|
||||
hsScalar fStartAnimTime;
|
||||
|
||||
UInt8 fFlags;
|
||||
uint8_t fFlags;
|
||||
hsScalar fBegin;
|
||||
hsScalar fEnd;
|
||||
hsScalar fLoopBegin;
|
||||
|
@ -88,7 +88,7 @@ void plLeafController::Interp(hsScalar time, hsScalar* result, plControllerCache
|
||||
{
|
||||
hsScalarKey *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsScalarKey), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
hsInterp::LinInterp(k1->fValue, k2->fValue, t, result);
|
||||
}
|
||||
@ -96,7 +96,7 @@ void plLeafController::Interp(hsScalar time, hsScalar* result, plControllerCache
|
||||
{
|
||||
hsBezScalarKey *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsBezScalarKey), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
hsInterp::BezInterp(k1, k2, t, result);
|
||||
}
|
||||
@ -111,7 +111,7 @@ void plLeafController::Interp(hsScalar time, hsScalarTriple* result, plControlle
|
||||
{
|
||||
hsPoint3Key *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsPoint3Key), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
hsInterp::LinInterp(&k1->fValue, &k2->fValue, t, result);
|
||||
}
|
||||
@ -119,7 +119,7 @@ void plLeafController::Interp(hsScalar time, hsScalarTriple* result, plControlle
|
||||
{
|
||||
hsBezPoint3Key *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsBezPoint3Key), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
hsInterp::BezInterp(k1, k2, t, result);
|
||||
}
|
||||
@ -134,7 +134,7 @@ void plLeafController::Interp(hsScalar time, hsScaleValue* result, plControllerC
|
||||
{
|
||||
hsScaleKey *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsScaleKey), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
hsInterp::LinInterp(&k1->fValue, &k2->fValue, t, result);
|
||||
}
|
||||
@ -142,7 +142,7 @@ void plLeafController::Interp(hsScalar time, hsScaleValue* result, plControllerC
|
||||
{
|
||||
hsBezScaleKey *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsBezScaleKey), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
hsInterp::BezInterp(k1, k2, t, result);
|
||||
}
|
||||
@ -159,7 +159,7 @@ void plLeafController::Interp(hsScalar time, hsQuat* result, plControllerCacheIn
|
||||
{
|
||||
hsQuatKey *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsQuatKey), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
hsInterp::LinInterp(&k1->fValue, &k2->fValue, t, result);
|
||||
}
|
||||
@ -167,7 +167,7 @@ void plLeafController::Interp(hsScalar time, hsQuat* result, plControllerCacheIn
|
||||
{
|
||||
hsCompressedQuatKey32 *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsCompressedQuatKey32), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
|
||||
hsQuat q1, q2;
|
||||
@ -179,7 +179,7 @@ void plLeafController::Interp(hsScalar time, hsQuat* result, plControllerCacheIn
|
||||
{
|
||||
hsCompressedQuatKey64 *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsCompressedQuatKey64), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
|
||||
hsQuat q1, q2;
|
||||
@ -196,7 +196,7 @@ void plLeafController::Interp(hsScalar time, hsMatrix33* result, plControllerCac
|
||||
hsBool tryForward = (cache? cache->fAtc->IsForewards() : true);
|
||||
hsMatrix33Key *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsMatrix33Key), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
hsInterp::LinInterp(&k1->fValue, &k2->fValue, t, result);
|
||||
}
|
||||
@ -208,7 +208,7 @@ void plLeafController::Interp(hsScalar time, hsMatrix44* result, plControllerCac
|
||||
hsBool tryForward = (cache? cache->fAtc->IsForewards() : true);
|
||||
hsMatrix44Key *k1, *k2;
|
||||
hsScalar t;
|
||||
UInt32 *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
uint32_t *idxStore = (cache ? &cache->fKeyIndex : &fLastKeyIdx);
|
||||
hsInterp::GetBoundaryKeyFrames(time, fNumKeys, fKeys, sizeof(hsMatrix44Key), (hsKeyFrame**)&k1, (hsKeyFrame**)&k2, idxStore, &t, tryForward);
|
||||
hsInterp::LinInterp(&k1->fValue, &k2->fValue, t, result);
|
||||
}
|
||||
@ -231,15 +231,15 @@ plControllerCacheInfo *plLeafController::CreateCache() const
|
||||
|
||||
hsScalar plLeafController::GetLength() const
|
||||
{
|
||||
UInt32 stride = GetStride();
|
||||
uint32_t stride = GetStride();
|
||||
if (stride == 0 || fNumKeys == 0)
|
||||
return 0;
|
||||
|
||||
UInt8 *ptr = (UInt8 *)fKeys;
|
||||
uint8_t *ptr = (uint8_t *)fKeys;
|
||||
return ((hsKeyFrame *)(ptr + (fNumKeys - 1) * stride))->fFrame / MAX_FRAMES_PER_SEC;
|
||||
}
|
||||
|
||||
UInt32 plLeafController::GetStride() const
|
||||
uint32_t plLeafController::GetStride() const
|
||||
{
|
||||
switch (fType)
|
||||
{
|
||||
@ -273,108 +273,108 @@ UInt32 plLeafController::GetStride() const
|
||||
}
|
||||
}
|
||||
|
||||
hsPoint3Key *plLeafController::GetPoint3Key(UInt32 i) const
|
||||
hsPoint3Key *plLeafController::GetPoint3Key(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kPoint3KeyFrame)
|
||||
return nil;
|
||||
|
||||
return (hsPoint3Key *)((UInt8 *)fKeys + i * sizeof(hsPoint3Key));
|
||||
return (hsPoint3Key *)((uint8_t *)fKeys + i * sizeof(hsPoint3Key));
|
||||
}
|
||||
|
||||
hsBezPoint3Key *plLeafController::GetBezPoint3Key(UInt32 i) const
|
||||
hsBezPoint3Key *plLeafController::GetBezPoint3Key(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kBezPoint3KeyFrame)
|
||||
return nil;
|
||||
|
||||
return (hsBezPoint3Key *)((UInt8 *)fKeys + i * sizeof(hsBezPoint3Key));
|
||||
return (hsBezPoint3Key *)((uint8_t *)fKeys + i * sizeof(hsBezPoint3Key));
|
||||
}
|
||||
|
||||
hsScalarKey *plLeafController::GetScalarKey(UInt32 i) const
|
||||
hsScalarKey *plLeafController::GetScalarKey(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kScalarKeyFrame)
|
||||
return nil;
|
||||
|
||||
return (hsScalarKey *)((UInt8 *)fKeys + i * sizeof(hsScalarKey));
|
||||
return (hsScalarKey *)((uint8_t *)fKeys + i * sizeof(hsScalarKey));
|
||||
}
|
||||
|
||||
hsBezScalarKey *plLeafController::GetBezScalarKey(UInt32 i) const
|
||||
hsBezScalarKey *plLeafController::GetBezScalarKey(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kBezScalarKeyFrame)
|
||||
return nil;
|
||||
|
||||
return (hsBezScalarKey *)((UInt8 *)fKeys + i * sizeof(hsBezScalarKey));
|
||||
return (hsBezScalarKey *)((uint8_t *)fKeys + i * sizeof(hsBezScalarKey));
|
||||
}
|
||||
|
||||
hsScaleKey *plLeafController::GetScaleKey(UInt32 i) const
|
||||
hsScaleKey *plLeafController::GetScaleKey(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kScaleKeyFrame)
|
||||
return nil;
|
||||
|
||||
return (hsScaleKey *)((UInt8 *)fKeys + i * sizeof(hsScaleKey));
|
||||
return (hsScaleKey *)((uint8_t *)fKeys + i * sizeof(hsScaleKey));
|
||||
}
|
||||
|
||||
hsBezScaleKey *plLeafController::GetBezScaleKey(UInt32 i) const
|
||||
hsBezScaleKey *plLeafController::GetBezScaleKey(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kBezScaleKeyFrame)
|
||||
return nil;
|
||||
|
||||
return (hsBezScaleKey *)((UInt8 *)fKeys + i * sizeof(hsBezScaleKey));
|
||||
return (hsBezScaleKey *)((uint8_t *)fKeys + i * sizeof(hsBezScaleKey));
|
||||
}
|
||||
|
||||
hsQuatKey *plLeafController::GetQuatKey(UInt32 i) const
|
||||
hsQuatKey *plLeafController::GetQuatKey(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kQuatKeyFrame)
|
||||
return nil;
|
||||
|
||||
return (hsQuatKey *)((UInt8 *)fKeys + i * sizeof(hsQuatKey));
|
||||
return (hsQuatKey *)((uint8_t *)fKeys + i * sizeof(hsQuatKey));
|
||||
}
|
||||
|
||||
hsCompressedQuatKey32 *plLeafController::GetCompressedQuatKey32(UInt32 i) const
|
||||
hsCompressedQuatKey32 *plLeafController::GetCompressedQuatKey32(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kCompressedQuatKeyFrame32)
|
||||
return nil;
|
||||
|
||||
return (hsCompressedQuatKey32 *)((UInt8 *)fKeys + i * sizeof(hsCompressedQuatKey32));
|
||||
return (hsCompressedQuatKey32 *)((uint8_t *)fKeys + i * sizeof(hsCompressedQuatKey32));
|
||||
}
|
||||
|
||||
hsCompressedQuatKey64 *plLeafController::GetCompressedQuatKey64(UInt32 i) const
|
||||
hsCompressedQuatKey64 *plLeafController::GetCompressedQuatKey64(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kCompressedQuatKeyFrame64)
|
||||
return nil;
|
||||
|
||||
return (hsCompressedQuatKey64 *)((UInt8 *)fKeys + i * sizeof(hsCompressedQuatKey64));
|
||||
return (hsCompressedQuatKey64 *)((uint8_t *)fKeys + i * sizeof(hsCompressedQuatKey64));
|
||||
}
|
||||
|
||||
hsG3DSMaxKeyFrame *plLeafController::Get3DSMaxKey(UInt32 i) const
|
||||
hsG3DSMaxKeyFrame *plLeafController::Get3DSMaxKey(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::k3dsMaxKeyFrame)
|
||||
return nil;
|
||||
|
||||
return (hsG3DSMaxKeyFrame *)((UInt8 *)fKeys + i * sizeof(hsG3DSMaxKeyFrame));
|
||||
return (hsG3DSMaxKeyFrame *)((uint8_t *)fKeys + i * sizeof(hsG3DSMaxKeyFrame));
|
||||
}
|
||||
|
||||
hsMatrix33Key *plLeafController::GetMatrix33Key(UInt32 i) const
|
||||
hsMatrix33Key *plLeafController::GetMatrix33Key(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kMatrix33KeyFrame)
|
||||
return nil;
|
||||
|
||||
return (hsMatrix33Key *)((UInt8 *)fKeys + i * sizeof(hsMatrix33Key));
|
||||
return (hsMatrix33Key *)((uint8_t *)fKeys + i * sizeof(hsMatrix33Key));
|
||||
}
|
||||
|
||||
hsMatrix44Key *plLeafController::GetMatrix44Key(UInt32 i) const
|
||||
hsMatrix44Key *plLeafController::GetMatrix44Key(uint32_t i) const
|
||||
{
|
||||
if (fType != hsKeyFrame::kMatrix44KeyFrame)
|
||||
return nil;
|
||||
|
||||
return (hsMatrix44Key *)((UInt8 *)fKeys + i * sizeof(hsMatrix44Key));
|
||||
return (hsMatrix44Key *)((uint8_t *)fKeys + i * sizeof(hsMatrix44Key));
|
||||
}
|
||||
|
||||
void plLeafController::GetKeyTimes(hsTArray<hsScalar> &keyTimes) const
|
||||
{
|
||||
int cIdx;
|
||||
int kIdx;
|
||||
UInt32 stride = GetStride();
|
||||
UInt8 *keyPtr = (UInt8 *)fKeys;
|
||||
uint32_t stride = GetStride();
|
||||
uint8_t *keyPtr = (uint8_t *)fKeys;
|
||||
for (cIdx = 0, kIdx = 0; cIdx < fNumKeys, kIdx < keyTimes.GetCount();)
|
||||
{
|
||||
hsScalar kTime = keyTimes[kIdx];
|
||||
@ -404,7 +404,7 @@ void plLeafController::GetKeyTimes(hsTArray<hsScalar> &keyTimes) const
|
||||
}
|
||||
}
|
||||
|
||||
void plLeafController::AllocKeys(UInt32 numKeys, UInt8 type)
|
||||
void plLeafController::AllocKeys(uint32_t numKeys, uint8_t type)
|
||||
{
|
||||
delete fKeys;
|
||||
fNumKeys = numKeys;
|
||||
@ -467,15 +467,15 @@ void plLeafController::AllocKeys(UInt32 numKeys, UInt8 type)
|
||||
}
|
||||
}
|
||||
|
||||
void plLeafController::QuickScalarController(int numKeys, hsScalar* times, hsScalar* values, UInt32 valueStrides)
|
||||
void plLeafController::QuickScalarController(int numKeys, hsScalar* times, hsScalar* values, uint32_t valueStrides)
|
||||
{
|
||||
AllocKeys(numKeys, hsKeyFrame::kScalarKeyFrame);
|
||||
int i;
|
||||
for( i = 0; i < numKeys; i++ )
|
||||
{
|
||||
((hsScalarKey*)fKeys)[i].fFrame = (UInt16)(*times++ * MAX_FRAMES_PER_SEC);
|
||||
((hsScalarKey*)fKeys)[i].fFrame = (uint16_t)(*times++ * MAX_FRAMES_PER_SEC);
|
||||
((hsScalarKey*)fKeys)[i].fValue = *values;
|
||||
values = (hsScalar *)((UInt8 *)values + valueStrides);
|
||||
values = (hsScalar *)((uint8_t *)values + valueStrides);
|
||||
}
|
||||
}
|
||||
|
||||
@ -604,8 +604,8 @@ hsBool plLeafController::PurgeRedundantSubcontrollers()
|
||||
|
||||
void plLeafController::Read(hsStream* s, hsResMgr *mgr)
|
||||
{
|
||||
UInt8 type = s->ReadByte();
|
||||
UInt32 numKeys = s->ReadLE32();
|
||||
uint8_t type = s->ReadByte();
|
||||
uint32_t numKeys = s->ReadLE32();
|
||||
AllocKeys(numKeys, type);
|
||||
|
||||
int i;
|
||||
@ -889,12 +889,12 @@ plControllerCacheInfo* plCompoundController::CreateCache() const
|
||||
return cache;
|
||||
}
|
||||
|
||||
plController* plCompoundController::GetController(Int32 i) const
|
||||
plController* plCompoundController::GetController(int32_t i) const
|
||||
{
|
||||
return (i==0 ? fXController : (i==1 ? fYController : fZController));
|
||||
}
|
||||
|
||||
void plCompoundController::SetController(Int32 i, plController* c)
|
||||
void plCompoundController::SetController(int32_t i, plController* c)
|
||||
{
|
||||
delete GetController(i);
|
||||
(i==0 ? fXController : (i==1 ? fYController : fZController)) = c;
|
||||
|
@ -76,10 +76,10 @@ class plCompoundController;
|
||||
class plControllerCacheInfo
|
||||
{
|
||||
public:
|
||||
UInt8 fNumSubControllers;
|
||||
uint8_t fNumSubControllers;
|
||||
plControllerCacheInfo **fSubControllers;
|
||||
|
||||
UInt32 fKeyIndex;
|
||||
uint32_t fKeyIndex;
|
||||
plAnimTimeConvert *fAtc;
|
||||
|
||||
plControllerCacheInfo();
|
||||
@ -126,10 +126,10 @@ class plLeafController : public plController
|
||||
friend class plCompoundController;
|
||||
|
||||
protected:
|
||||
UInt8 fType;
|
||||
uint8_t fType;
|
||||
void *fKeys; // Need to pay attend to fType to determine what these actually are
|
||||
UInt32 fNumKeys;
|
||||
mutable UInt32 fLastKeyIdx;
|
||||
uint32_t fNumKeys;
|
||||
mutable uint32_t fLastKeyIdx;
|
||||
|
||||
public:
|
||||
plLeafController() : fType(hsKeyFrame::kUnknownKeyFrame), fKeys(nil), fNumKeys(0), fLastKeyIdx(0) {}
|
||||
@ -148,27 +148,27 @@ public:
|
||||
|
||||
virtual plControllerCacheInfo* CreateCache() const;
|
||||
hsScalar GetLength() const;
|
||||
UInt32 GetStride() const;
|
||||
uint32_t GetStride() const;
|
||||
|
||||
hsPoint3Key *GetPoint3Key(UInt32 i) const;
|
||||
hsBezPoint3Key *GetBezPoint3Key(UInt32 i) const;
|
||||
hsScalarKey *GetScalarKey(UInt32 i) const;
|
||||
hsBezScalarKey *GetBezScalarKey(UInt32 i) const;
|
||||
hsScaleKey *GetScaleKey(UInt32 i) const;
|
||||
hsBezScaleKey *GetBezScaleKey(UInt32 i) const;
|
||||
hsQuatKey *GetQuatKey(UInt32 i) const;
|
||||
hsCompressedQuatKey32 *GetCompressedQuatKey32(UInt32 i) const;
|
||||
hsCompressedQuatKey64 *GetCompressedQuatKey64(UInt32 i) const;
|
||||
hsG3DSMaxKeyFrame *Get3DSMaxKey(UInt32 i) const;
|
||||
hsMatrix33Key *GetMatrix33Key(UInt32 i) const;
|
||||
hsMatrix44Key *GetMatrix44Key(UInt32 i) const;
|
||||
hsPoint3Key *GetPoint3Key(uint32_t i) const;
|
||||
hsBezPoint3Key *GetBezPoint3Key(uint32_t i) const;
|
||||
hsScalarKey *GetScalarKey(uint32_t i) const;
|
||||
hsBezScalarKey *GetBezScalarKey(uint32_t i) const;
|
||||
hsScaleKey *GetScaleKey(uint32_t i) const;
|
||||
hsBezScaleKey *GetBezScaleKey(uint32_t i) const;
|
||||
hsQuatKey *GetQuatKey(uint32_t i) const;
|
||||
hsCompressedQuatKey32 *GetCompressedQuatKey32(uint32_t i) const;
|
||||
hsCompressedQuatKey64 *GetCompressedQuatKey64(uint32_t i) const;
|
||||
hsG3DSMaxKeyFrame *Get3DSMaxKey(uint32_t i) const;
|
||||
hsMatrix33Key *GetMatrix33Key(uint32_t i) const;
|
||||
hsMatrix44Key *GetMatrix44Key(uint32_t i) const;
|
||||
|
||||
UInt8 GetType() const { return fType; }
|
||||
UInt32 GetNumKeys() const { return fNumKeys; }
|
||||
uint8_t GetType() const { return fType; }
|
||||
uint32_t GetNumKeys() const { return fNumKeys; }
|
||||
void *GetKeyBuffer() const { return fKeys; }
|
||||
void GetKeyTimes(hsTArray<hsScalar> &keyTimes) const;
|
||||
void AllocKeys(UInt32 n, UInt8 type);
|
||||
void QuickScalarController(int numKeys, hsScalar* times, hsScalar* values, UInt32 valueStrides);
|
||||
void AllocKeys(uint32_t n, uint8_t type);
|
||||
void QuickScalarController(int numKeys, hsScalar* times, hsScalar* values, uint32_t valueStrides);
|
||||
hsBool AllKeysMatch() const;
|
||||
hsBool PurgeRedundantSubcontrollers();
|
||||
|
||||
@ -208,7 +208,7 @@ public:
|
||||
plController *GetPosController() const { return fXController; }
|
||||
plController *GetRotController() const { return fYController; }
|
||||
plController *GetScaleController() const { return fZController; }
|
||||
plController *GetController(Int32 i) const;
|
||||
plController *GetController(int32_t i) const;
|
||||
hsScalar GetLength() const;
|
||||
void GetKeyTimes(hsTArray<hsScalar> &keyTimes) const;
|
||||
hsBool AllKeysMatch() const;
|
||||
@ -220,7 +220,7 @@ public:
|
||||
void SetPosController(plController *c) { delete fXController; fXController = c; }
|
||||
void SetRotController(plController *c) { delete fYController; fYController = c; }
|
||||
void SetScaleController(plController *c) { delete fZController; fZController = c; }
|
||||
void SetController(Int32 i, plController* c);
|
||||
void SetController(int32_t i, plController* c);
|
||||
|
||||
void Read(hsStream* s, hsResMgr* mgr);
|
||||
void Write(hsStream* s, hsResMgr* mgr);
|
||||
|
Reference in New Issue
Block a user