1
0
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:
2012-01-19 21:19:26 -05:00
parent a0d54e2644
commit 5027b5a4ac
1301 changed files with 14497 additions and 14532 deletions

View File

@ -52,13 +52,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class EdgeBin
{
public:
UInt16 fVtx;
UInt16 fCount;
uint16_t fVtx;
uint16_t fCount;
EdgeBin() : fVtx(0), fCount(0) {}
};
void plAccMeshSmooth::FindEdges(UInt32 maxVtxIdx, UInt32 nTris, UInt16* idxList, hsTArray<UInt16>& edgeVerts)
void plAccMeshSmooth::FindEdges(uint32_t maxVtxIdx, uint32_t nTris, uint16_t* idxList, hsTArray<uint16_t>& edgeVerts)
{
hsTArray<EdgeBin>* bins = TRACKED_NEW hsTArray<EdgeBin>[maxVtxIdx+1];
@ -138,7 +138,7 @@ void plAccMeshSmooth::FindEdges(UInt32 maxVtxIdx, UInt32 nTris, UInt16* idxList,
delete [] bins;
}
void plAccMeshSmooth::FindEdges(hsTArray<plGeometrySpan*>& spans, hsTArray<UInt16>* edgeVerts)
void plAccMeshSmooth::FindEdges(hsTArray<plGeometrySpan*>& spans, hsTArray<uint16_t>* edgeVerts)
{
fSpans.SetCount(spans.GetCount());
@ -151,9 +151,9 @@ void plAccMeshSmooth::FindEdges(hsTArray<plGeometrySpan*>& spans, hsTArray<UInt1
plAccessTriSpan& triSpan = fSpans[i].AccessTri();
UInt32 nTris = triSpan.TriCount();
UInt16* idxList = triSpan.fTris;
UInt32 maxVertIdx = triSpan.VertCount()-1;
uint32_t nTris = triSpan.TriCount();
uint16_t* idxList = triSpan.fTris;
uint32_t maxVertIdx = triSpan.VertCount()-1;
FindEdges(maxVertIdx, nTris, idxList, edgeVerts[i]);
}
@ -161,8 +161,8 @@ void plAccMeshSmooth::FindEdges(hsTArray<plGeometrySpan*>& spans, hsTArray<UInt1
void plAccMeshSmooth::Smooth(hsTArray<plGeometrySpan*>& spans)
{
hsTArray<UInt16>* shareVtx = TRACKED_NEW hsTArray<UInt16>[spans.GetCount()];
hsTArray<UInt16>* edgeVerts = TRACKED_NEW hsTArray<UInt16>[spans.GetCount()];
hsTArray<uint16_t>* shareVtx = TRACKED_NEW hsTArray<uint16_t>[spans.GetCount()];
hsTArray<uint16_t>* edgeVerts = TRACKED_NEW hsTArray<uint16_t>[spans.GetCount()];
FindEdges(spans, edgeVerts);
int i;
@ -278,7 +278,7 @@ hsVector3 plAccMeshSmooth::INormalToLocal(plAccessSpan& span, const hsVector3& w
return ret;
}
void plAccMeshSmooth::FindSharedVerts(plAccessSpan& span, int numEdgeVerts, hsTArray<UInt16>& edgeVerts, hsTArray<UInt16>& shareVtx, VtxAccum& accum)
void plAccMeshSmooth::FindSharedVerts(plAccessSpan& span, int numEdgeVerts, hsTArray<uint16_t>& edgeVerts, hsTArray<uint16_t>& shareVtx, VtxAccum& accum)
{
plAccessTriSpan& triSpan = span.AccessTri();
int i;
@ -311,7 +311,7 @@ void plAccMeshSmooth::FindSharedVerts(plAccessSpan& span, int numEdgeVerts, hsTA
}
}
void plAccMeshSmooth::SetPositions(plAccessSpan& span, hsTArray<UInt16>& shareVtx, const hsPoint3& pos) const
void plAccMeshSmooth::SetPositions(plAccessSpan& span, hsTArray<uint16_t>& shareVtx, const hsPoint3& pos) const
{
plAccessTriSpan& triSpan = span.AccessTri();
int i;
@ -319,7 +319,7 @@ void plAccMeshSmooth::SetPositions(plAccessSpan& span, hsTArray<UInt16>& shareVt
triSpan.Position(shareVtx[i]) = IPositionToLocal(span, pos);
}
void plAccMeshSmooth::SetNormals(plAccessSpan& span, hsTArray<UInt16>& shareVtx, const hsVector3& norm) const
void plAccMeshSmooth::SetNormals(plAccessSpan& span, hsTArray<uint16_t>& shareVtx, const hsVector3& norm) const
{
plAccessTriSpan& triSpan = span.AccessTri();
int i;
@ -327,7 +327,7 @@ void plAccMeshSmooth::SetNormals(plAccessSpan& span, hsTArray<UInt16>& shareVtx,
triSpan.Normal(shareVtx[i]) = INormalToLocal(span, norm);
}
void plAccMeshSmooth::SetDiffuse(plAccessSpan& span, hsTArray<UInt16>& shareVtx, const hsColorRGBA& diff) const
void plAccMeshSmooth::SetDiffuse(plAccessSpan& span, hsTArray<uint16_t>& shareVtx, const hsColorRGBA& diff) const
{
plAccessTriSpan& triSpan = span.AccessTri();
hsAssert(triSpan.HasDiffuse(), "Calling SetColors on data with no color");

View File

@ -69,7 +69,7 @@ protected:
hsColorRGBA fDiffuse;
};
UInt32 fFlags;
uint32_t fFlags;
hsScalar fMinNormDot;
hsScalar fDistTolSq;
@ -82,12 +82,12 @@ protected:
hsPoint3 IPositionToLocal(plAccessSpan& span, const hsPoint3& wPos) const;
hsVector3 INormalToLocal(plAccessSpan& span, const hsVector3& wNorm) const;
void FindEdges(UInt32 maxVtxIdx, UInt32 nTris, UInt16* idxList, hsTArray<UInt16>& edgeVerts);
void FindEdges(hsTArray<plGeometrySpan*>& sets, hsTArray<UInt16>* edgeVerts);
void FindSharedVerts(plAccessSpan& span, int numEdgeVerts, hsTArray<UInt16>& edgeVerts, hsTArray<UInt16>& shareVtx, VtxAccum& accum);
void SetNormals(plAccessSpan& span, hsTArray<UInt16>& shareVtx, const hsVector3& norm) const;
void SetPositions(plAccessSpan& span, hsTArray<UInt16>& shareVtx, const hsPoint3& pos) const;
void SetDiffuse(plAccessSpan& span, hsTArray<UInt16>& shareVtx, const hsColorRGBA& diff) const;
void FindEdges(uint32_t maxVtxIdx, uint32_t nTris, uint16_t* idxList, hsTArray<uint16_t>& edgeVerts);
void FindEdges(hsTArray<plGeometrySpan*>& sets, hsTArray<uint16_t>* edgeVerts);
void FindSharedVerts(plAccessSpan& span, int numEdgeVerts, hsTArray<uint16_t>& edgeVerts, hsTArray<uint16_t>& shareVtx, VtxAccum& accum);
void SetNormals(plAccessSpan& span, hsTArray<uint16_t>& shareVtx, const hsVector3& norm) const;
void SetPositions(plAccessSpan& span, hsTArray<uint16_t>& shareVtx, const hsPoint3& pos) const;
void SetDiffuse(plAccessSpan& span, hsTArray<uint16_t>& shareVtx, const hsColorRGBA& diff) const;
public:
plAccMeshSmooth() : fFlags(kSmoothNorm), fMinNormDot(0.25f), fDistTolSq(1.e-4f), fAccGeom() {}
@ -100,8 +100,8 @@ public:
void Smooth(hsTArray<plGeometrySpan*>& sets);
void SetFlags(UInt32 f) { fFlags = f; }
UInt32 GetFlags() const { return fFlags; }
void SetFlags(uint32_t f) { fFlags = f; }
uint32_t GetFlags() const { return fFlags; }
};
#endif // plAccMeshSmooth_inc

View File

@ -194,7 +194,7 @@ void plAccessGeometry::Close(hsTArray<plAccessSpan>& accs) const
Close(accs[i]);
}
void plAccessGeometry::TakeSnapShot(const plDrawInterface* di, UInt32 channels) const
void plAccessGeometry::TakeSnapShot(const plDrawInterface* di, uint32_t channels) const
{
int j;
for( j = 0; j < di->GetNumDrawables(); j++ )
@ -216,7 +216,7 @@ void plAccessGeometry::TakeSnapShot(const plDrawInterface* di, UInt32 channels)
}
}
void plAccessGeometry::RestoreSnapShot(const plDrawInterface* di, UInt32 channels) const
void plAccessGeometry::RestoreSnapShot(const plDrawInterface* di, uint32_t channels) const
{
int j;
for( j = 0; j < di->GetNumDrawables(); j++ )
@ -271,7 +271,7 @@ void plAccessGeometry::Close(plAccessSpan& acc) const
fPipe->CloseAccess(acc);
}
void plAccessGeometry::IOpen(plDrawable* d, UInt32 spanIdx, plAccessSpan& acc, hsBool useSnap, hsBool readOnly, hsBool idxToo) const
void plAccessGeometry::IOpen(plDrawable* d, uint32_t spanIdx, plAccessSpan& acc, hsBool useSnap, hsBool readOnly, hsBool idxToo) const
{
acc.SetType(plAccessSpan::kUndefined);
@ -304,12 +304,12 @@ void plAccessGeometry::IOpen(plDrawable* d, UInt32 spanIdx, plAccessSpan& acc, h
}
}
void plAccessGeometry::OpenRO(plDrawable* d, UInt32 spanIdx, plAccessSpan& acc, hsBool useSnap) const
void plAccessGeometry::OpenRO(plDrawable* d, uint32_t spanIdx, plAccessSpan& acc, hsBool useSnap) const
{
IOpen(d, spanIdx, acc, useSnap, true);
}
void plAccessGeometry::OpenRW(plDrawable* drawable, UInt32 spanIdx, plAccessSpan& acc, hsBool idxToo) const
void plAccessGeometry::OpenRW(plDrawable* drawable, uint32_t spanIdx, plAccessSpan& acc, hsBool idxToo) const
{
IOpen(drawable, spanIdx, acc, false, false, idxToo);
@ -318,7 +318,7 @@ void plAccessGeometry::OpenRW(plDrawable* drawable, UInt32 spanIdx, plAccessSpan
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
void plAccessGeometry::TakeSnapShot(plDrawable* drawable, UInt32 spanIdx, UInt32 channels) const
void plAccessGeometry::TakeSnapShot(plDrawable* drawable, uint32_t spanIdx, uint32_t channels) const
{
plDrawableSpans* ds = plDrawableSpans::ConvertNoRef(drawable);
if( !ds )
@ -338,7 +338,7 @@ void plAccessGeometry::TakeSnapShot(plDrawable* drawable, UInt32 spanIdx, UInt32
}
}
void plAccessGeometry::RestoreSnapShot(plDrawable* drawable, UInt32 spanIdx, UInt32 channels) const
void plAccessGeometry::RestoreSnapShot(plDrawable* drawable, uint32_t spanIdx, uint32_t channels) const
{
plDrawableSpans* ds = plDrawableSpans::ConvertNoRef(drawable);
if( !ds )
@ -355,7 +355,7 @@ void plAccessGeometry::RestoreSnapShot(plDrawable* drawable, UInt32 spanIdx, UIn
span->fSnapShot->CopyTo(tmp.AccessVtx(), channels);
}
void plAccessGeometry::ReleaseSnapShot(plDrawable* drawable, UInt32 spanIdx) const
void plAccessGeometry::ReleaseSnapShot(plDrawable* drawable, uint32_t spanIdx) const
{
plDrawableSpans* ds = plDrawableSpans::ConvertNoRef(drawable);
if( !ds )
@ -384,16 +384,16 @@ void plAccessGeometry::IAccessSpanFromSourceSpan(plAccessSpan& dst, const plGeom
dst.SetMaterial(src->fMaterial);
plAccessVtxSpan& acc = dst.AccessVtx();
acc.fNumVerts = (UInt16)(src->fNumVerts);
UInt32 sz = src->GetVertexSize(src->fFormat);
UInt8* ptr = src->fVertexData;
acc.PositionStream(ptr, (UInt16)sz, 0);
acc.fNumVerts = (uint16_t)(src->fNumVerts);
uint32_t sz = src->GetVertexSize(src->fFormat);
uint8_t* ptr = src->fVertexData;
acc.PositionStream(ptr, (uint16_t)sz, 0);
ptr += sizeof(hsPoint3);
acc.NormalStream(ptr, (UInt16)sz, 0);
acc.NormalStream(ptr, (uint16_t)sz, 0);
ptr += sizeof(hsVector3);
acc.DiffuseStream(src->fDiffuseRGBA, sizeof(UInt32), 0);
acc.SpecularStream(src->fSpecularRGBA, sizeof(UInt32), 0);
acc.UVWStream(ptr, (UInt16)sz, 0);
acc.DiffuseStream(src->fDiffuseRGBA, sizeof(uint32_t), 0);
acc.SpecularStream(src->fSpecularRGBA, sizeof(uint32_t), 0);
acc.UVWStream(ptr, (uint16_t)sz, 0);
acc.SetNumUVWs(src->CalcNumUVs(src->fFormat));
acc.fVtxDeviceRef = nil;
@ -446,33 +446,33 @@ void plAccessGeometry::IAccessSpanFromVertexSpan(plAccessSpan& dst, plDrawableSp
return;
}
acc.fNumVerts = (UInt16)(span->fVLength);
acc.fNumVerts = (uint16_t)(span->fVLength);
plGBufferCell* cell = grp->GetCell(span->fVBufferIdx, span->fCellIdx);
UInt8* ptr = grp->GetVertBufferData(span->fVBufferIdx);
uint8_t* ptr = grp->GetVertBufferData(span->fVBufferIdx);
// Interleaved
if( cell->fColorStart == UInt32(-1) )
if( cell->fColorStart == uint32_t(-1) )
{
UInt32 stride = grp->GetVertexSize();
uint32_t stride = grp->GetVertexSize();
ptr += cell->fVtxStart + span->fCellOffset * stride;
Int32 offset = (-(Int32)(span->fVStartIdx)) * (Int32)stride;
int32_t offset = (-(int32_t)(span->fVStartIdx)) * (int32_t)stride;
acc.PositionStream(ptr, (UInt16)stride, offset);
acc.PositionStream(ptr, (uint16_t)stride, offset);
ptr += sizeof(hsPoint3);
int numWgts = grp->GetNumWeights();
if( numWgts )
{
acc.SetNumWeights(numWgts);
acc.WeightStream(ptr, (UInt16)stride, offset);
acc.WeightStream(ptr, (uint16_t)stride, offset);
ptr += numWgts * sizeof(hsScalar);
if( grp->GetVertexFormat() & plGBufferGroup::kSkinIndices )
{
acc.WgtIndexStream(ptr, (UInt16)stride, offset);
ptr += sizeof(UInt32);
acc.WgtIndexStream(ptr, (uint16_t)stride, offset);
ptr += sizeof(uint32_t);
}
else
{
@ -484,40 +484,40 @@ void plAccessGeometry::IAccessSpanFromVertexSpan(plAccessSpan& dst, plDrawableSp
acc.SetNumWeights(0);
}
acc.NormalStream(ptr, (UInt16)stride, offset);
acc.NormalStream(ptr, (uint16_t)stride, offset);
ptr += sizeof(hsVector3);
acc.DiffuseStream(ptr, (UInt16)stride, offset);
ptr += sizeof(UInt32);
acc.DiffuseStream(ptr, (uint16_t)stride, offset);
ptr += sizeof(uint32_t);
acc.SpecularStream(ptr, (UInt16)stride, offset);
ptr += sizeof(UInt32);
acc.SpecularStream(ptr, (uint16_t)stride, offset);
ptr += sizeof(uint32_t);
acc.UVWStream(ptr, (UInt16)stride, offset);
acc.UVWStream(ptr, (uint16_t)stride, offset);
acc.SetNumUVWs(grp->GetNumUVs());
}
else
{
UInt32 stride = grp->GetVertexLiteStride();
uint32_t stride = grp->GetVertexLiteStride();
ptr += cell->fVtxStart + span->fCellOffset * stride;
Int32 posOffset = (-(Int32)(span->fVStartIdx)) * (Int32)stride;
int32_t posOffset = (-(int32_t)(span->fVStartIdx)) * (int32_t)stride;
acc.PositionStream(ptr, (UInt16)stride, posOffset);
acc.PositionStream(ptr, (uint16_t)stride, posOffset);
ptr += sizeof(hsPoint3);
int numWgts = grp->GetNumWeights();
if( numWgts )
{
acc.SetNumWeights(numWgts);
acc.WeightStream(ptr, (UInt16)stride, posOffset);
acc.WeightStream(ptr, (uint16_t)stride, posOffset);
ptr += numWgts * sizeof(hsScalar);
if( grp->GetVertexFormat() & plGBufferGroup::kSkinIndices )
{
acc.WgtIndexStream(ptr, (UInt16)stride, posOffset);
ptr += sizeof(UInt32);
acc.WgtIndexStream(ptr, (uint16_t)stride, posOffset);
ptr += sizeof(uint32_t);
}
else
{
@ -529,19 +529,19 @@ void plAccessGeometry::IAccessSpanFromVertexSpan(plAccessSpan& dst, plDrawableSp
acc.SetNumWeights(0);
}
acc.NormalStream(ptr, (UInt16)stride, posOffset);
acc.NormalStream(ptr, (uint16_t)stride, posOffset);
ptr += sizeof(hsVector3);
plGBufferColor* col = grp->GetColorBufferData(span->fVBufferIdx) + cell->fColorStart;
Int16 colOffset = (Int16)((-(Int32)(span->fVStartIdx)) * (Int32)stride);
colOffset = (Int16)((-(Int32)(span->fVStartIdx)) * sizeof(*col));
int16_t colOffset = (int16_t)((-(int32_t)(span->fVStartIdx)) * (int32_t)stride);
colOffset = (int16_t)((-(int32_t)(span->fVStartIdx)) * sizeof(*col));
acc.DiffuseStream(&col->fDiffuse, sizeof(*col), colOffset);
acc.SpecularStream(&col->fSpecular, sizeof(*col), colOffset);
acc.UVWStream(ptr, (UInt16)stride, posOffset);
acc.UVWStream(ptr, (uint16_t)stride, posOffset);
acc.SetNumUVWs(grp->GetNumUVs());
}

View File

@ -108,8 +108,8 @@ public:
// then take the snapshot if you are going to be performing more modifications.
// In ALL MODIFICATION CASES, if the modified data is paged out, and the original paged back in, you will
// need to perform your operation again - your modifications aren't saved anywhere.
void OpenRO(plDrawable* drawable, UInt32 spanIdx, plAccessSpan& acc, hsBool useSnapShot=true) const;
void OpenRW(plDrawable* drawable, UInt32 spanIdx, plAccessSpan& acc, hsBool idxToo=false) const;
void OpenRO(plDrawable* drawable, uint32_t spanIdx, plAccessSpan& acc, hsBool useSnapShot=true) const;
void OpenRW(plDrawable* drawable, uint32_t spanIdx, plAccessSpan& acc, hsBool idxToo=false) const;
// What do we need to close up here?
void Close(plAccessSpan& acc) const;
@ -147,12 +147,12 @@ public:
// the state when the snapshot was taken. Note that channels not SnapShotted might have been modified
// via OpenRW.
//
void TakeSnapShot(plDrawable* drawable, UInt32 spanIdx, UInt32 channels) const;
void RestoreSnapShot(plDrawable* drawable, UInt32 spanIdx, UInt32 channels) const;
void ReleaseSnapShot(plDrawable* drawable, UInt32 spanIdx) const;
void TakeSnapShot(plDrawable* drawable, uint32_t spanIdx, uint32_t channels) const;
void RestoreSnapShot(plDrawable* drawable, uint32_t spanIdx, uint32_t channels) const;
void ReleaseSnapShot(plDrawable* drawable, uint32_t spanIdx) const;
void TakeSnapShot(const plDrawInterface* di, UInt32 channels) const;
void RestoreSnapShot(const plDrawInterface* di, UInt32 channels) const;
void TakeSnapShot(const plDrawInterface* di, uint32_t channels) const;
void RestoreSnapShot(const plDrawInterface* di, uint32_t channels) const;
void ReleaseSnapShot(const plDrawInterface* di) const;
// We often have geometry spans just sitting around devoid of any DI's, drawables or sceneobjects.
@ -169,7 +169,7 @@ protected:
void IAccessSpanFromParticle(plAccessSpan& dst, plDrawableSpans* drawable, const plParticleSpan* span, hsBool readOnly) const;
void IAccessSpanFromSnap(plAccessSpan& dst, plDrawableSpans* drawable, const plSpan* src) const;
void IOpen(plDrawable* d, UInt32 spanIdx, plAccessSpan& acc, hsBool useSnap, hsBool readOnly, hsBool idxToo=true) const;
void IOpen(plDrawable* d, uint32_t spanIdx, plAccessSpan& acc, hsBool useSnap, hsBool readOnly, hsBool idxToo=true) const;
};
#endif // plAccessGeometry_inc

View File

@ -74,7 +74,7 @@ void plAccessSnapShot::Release()
}
}
UInt32 plAccessSnapShot::ICheckAlloc(const plAccessVtxSpan& src, UInt32 chanMask, UInt32 chan, UInt16 chanSize)
uint32_t plAccessSnapShot::ICheckAlloc(const plAccessVtxSpan& src, uint32_t chanMask, uint32_t chan, uint16_t chanSize)
{
if( ((1 << chan) & chanMask) && src.fStrides[chan] )
{
@ -98,16 +98,16 @@ UInt32 plAccessSnapShot::ICheckAlloc(const plAccessVtxSpan& src, UInt32 chanMask
return chanMask;
}
void plAccessSnapShot::IRecordSizes(UInt16 sizes[]) const
void plAccessSnapShot::IRecordSizes(uint16_t sizes[]) const
{
int chan;
for( chan = 0; chan < kNumValidChans; chan++ )
sizes[chan] = fChanSize[chan];
}
UInt16 plAccessSnapShot::IComputeStride() const
uint16_t plAccessSnapShot::IComputeStride() const
{
UInt16 stride = 0;
uint16_t stride = 0;
int chan;
for( chan = 0; chan < kNumValidChans; chan++ )
stride += fChanSize[chan];
@ -115,12 +115,12 @@ UInt16 plAccessSnapShot::IComputeStride() const
return stride;
}
void plAccessSnapShot::ICopyOldData(UInt8* data, const UInt16* const oldSizes, UInt16 oldStride, UInt16 newStride)
void plAccessSnapShot::ICopyOldData(uint8_t* data, const uint16_t* const oldSizes, uint16_t oldStride, uint16_t newStride)
{
UInt32 oldOffset = 0;
UInt32 newOffset = 0;
UInt8* srcChannels[kNumValidChans];
UInt8* dstChannels[kNumValidChans];
uint32_t oldOffset = 0;
uint32_t newOffset = 0;
uint8_t* srcChannels[kNumValidChans];
uint8_t* dstChannels[kNumValidChans];
int chan;
for( chan = 0; chan < kNumValidChans; chan++ )
{
@ -152,9 +152,9 @@ void plAccessSnapShot::ICopyOldData(UInt8* data, const UInt16* const oldSizes, U
}
}
void plAccessSnapShot::ISetupPointers(UInt16 newStride)
void plAccessSnapShot::ISetupPointers(uint16_t newStride)
{
fData = TRACKED_NEW UInt8[fNumVerts * newStride];
fData = TRACKED_NEW uint8_t[fNumVerts * newStride];
int size = 0;
int chan;
@ -169,17 +169,17 @@ void plAccessSnapShot::ISetupPointers(UInt16 newStride)
}
}
UInt32 plAccessSnapShot::CopyFrom(const plAccessVtxSpan& src, UInt32 chanMask)
uint32_t plAccessSnapShot::CopyFrom(const plAccessVtxSpan& src, uint32_t chanMask)
{
hsAssert(!fNumVerts || (fNumVerts == src.fNumVerts), "Copying from a different sized span");
fNumVerts = src.fNumVerts;
UInt16 oldSize[kNumValidChans];
UInt8* oldData = fData;
uint16_t oldSize[kNumValidChans];
uint8_t* oldData = fData;
IRecordSizes(oldSize);
UInt16 oldStride = IComputeStride();
uint16_t oldStride = IComputeStride();
// First, allocate any storage we need. Kill any requested channels out of the
// mask that we already have.
@ -189,13 +189,13 @@ UInt32 plAccessSnapShot::CopyFrom(const plAccessVtxSpan& src, UInt32 chanMask)
if( fChanSize[kWeight] )
fNumWeights = src.fNumWeights;
chanMask = ICheckAlloc(src, chanMask, kWgtIndex, sizeof(UInt32));
chanMask = ICheckAlloc(src, chanMask, kWgtIndex, sizeof(uint32_t));
chanMask = ICheckAlloc(src, chanMask, kNormal, sizeof(hsVector3));
chanMask = ICheckAlloc(src, chanMask, kDiffuse, sizeof(UInt32));
chanMask = ICheckAlloc(src, chanMask, kDiffuse, sizeof(uint32_t));
chanMask = ICheckAlloc(src, chanMask, kSpecular, sizeof(UInt32));
chanMask = ICheckAlloc(src, chanMask, kSpecular, sizeof(uint32_t));
chanMask = ICheckAlloc(src, chanMask, kUVW, sizeof(hsPoint3) * src.fNumUVWsPerVert);
if( fChanSize[kUVW] )
@ -206,14 +206,14 @@ UInt32 plAccessSnapShot::CopyFrom(const plAccessVtxSpan& src, UInt32 chanMask)
if( !chanMask )
return 0;
UInt16 newStride = IComputeStride();
uint16_t newStride = IComputeStride();
ISetupPointers(newStride);
ICopyOldData(oldData, oldSize, oldStride, newStride);
UInt8* srcChannels[kNumValidChans];
UInt8* dstChannels[kNumValidChans];
uint8_t* srcChannels[kNumValidChans];
uint8_t* dstChannels[kNumValidChans];
int chan;
for( chan = 0; chan < kNumValidChans; chan++ )
{
@ -238,7 +238,7 @@ UInt32 plAccessSnapShot::CopyFrom(const plAccessVtxSpan& src, UInt32 chanMask)
return chanMask;
}
UInt32 plAccessSnapShot::CopyTo(const plAccessVtxSpan& dst, UInt32 chanMask)
uint32_t plAccessSnapShot::CopyTo(const plAccessVtxSpan& dst, uint32_t chanMask)
{
hsAssert(fNumVerts == dst.fNumVerts, "Vertex count mismatch, is this our real source?");

View File

@ -55,23 +55,23 @@ public:
protected:
UInt16 fRefCnt;
uint16_t fRefCnt;
UInt8* fData;
uint8_t* fData;
UInt16 fChanSize[kNumValidChans];
uint16_t fChanSize[kNumValidChans];
void ICopyOldData(UInt8* data, const UInt16* const oldSizes, UInt16 oldStride, UInt16 newStride);
UInt16 IComputeStride() const;
void IRecordSizes(UInt16 sizes[]) const;
UInt32 ICheckAlloc(const plAccessVtxSpan& src, UInt32 chanMask, UInt32 chan, UInt16 chanSize);
void ICopyOldData(uint8_t* data, const uint16_t* const oldSizes, uint16_t oldStride, uint16_t newStride);
uint16_t IComputeStride() const;
void IRecordSizes(uint16_t sizes[]) const;
uint32_t ICheckAlloc(const plAccessVtxSpan& src, uint32_t chanMask, uint32_t chan, uint16_t chanSize);
void ISetupPointers(UInt16 newStride);
void ISetupPointers(uint16_t newStride);
void SetupChannels(plAccessVtxSpan& dst) const;
UInt32 CopyTo(const plAccessVtxSpan& dst, UInt32 chanMask);
UInt32 CopyFrom(const plAccessVtxSpan& src, UInt32 chanMask);
uint32_t CopyTo(const plAccessVtxSpan& dst, uint32_t chanMask);
uint32_t CopyFrom(const plAccessVtxSpan& src, uint32_t chanMask);
void Release(); // Decrements refcnt, calls Destroy on zero
void Clear(); // Initialize to zeros

View File

@ -50,13 +50,13 @@ class plAccessTriSpan : public plAccessVtxSpan
public:
hsGDeviceRef* fIdxDeviceRef;
UInt16* fTris; // array length fNumTris*3
uint16_t* fTris; // array length fNumTris*3
UInt32 fNumTris;
uint32_t fNumTris;
void ClearTris() { fTris = nil; fNumTris = 0; }
UInt32 TriCount() const { return fNumTris; }
uint32_t TriCount() const { return fNumTris; }
void SetIdxDeviceRef(hsGDeviceRef* ref) { fIdxDeviceRef = ref; }
hsGDeviceRef* GetIdxDeviceRef() const { return fIdxDeviceRef; }
@ -66,8 +66,8 @@ class plAccTriIterator
{
protected:
UInt16* fCurrIdx;
UInt16* fEndIdx;
uint16_t* fCurrIdx;
uint16_t* fEndIdx;
plAccessTriSpan* fAccess;
public:
@ -81,14 +81,14 @@ public:
void SetTri(int i);
hsBool More() const;
UInt32 NumTris() const { return fAccess->fNumTris; }
uint32_t NumTris() const { return fAccess->fNumTris; }
UInt16& RawIndex(int iVtx) const { return fCurrIdx[iVtx]; }
uint16_t& RawIndex(int iVtx) const { return fCurrIdx[iVtx]; }
hsPoint3& Position(int iVtx) const { return fAccess->PositionOff(fCurrIdx[iVtx]); }
hsVector3& Normal(int iVtx) const { return fAccess->NormalOff(fCurrIdx[iVtx]); }
UInt32 Diffuse32(int iVtx) const { return fAccess->Diffuse32Off(fCurrIdx[iVtx]); }
UInt32 Specular32(int iVtx) const { return fAccess->Specular32Off(fCurrIdx[iVtx]); }
uint32_t Diffuse32(int iVtx) const { return fAccess->Diffuse32Off(fCurrIdx[iVtx]); }
uint32_t Specular32(int iVtx) const { return fAccess->Specular32Off(fCurrIdx[iVtx]); }
hsColorRGBA DiffuseRGBA(int iVtx) const { return fAccess->DiffuseRGBAOff(fCurrIdx[iVtx]); }
hsColorRGBA SpecularRGBA(int iVtx) const { return fAccess->SpecularRGBAOff(fCurrIdx[iVtx]); }
hsPoint3* UVWs(int iVtx) const { return fAccess->UVWsOff(fCurrIdx[iVtx]); }
@ -96,8 +96,8 @@ public:
hsPoint3 InterpPosition(const hsPoint3& bary) const;
hsVector3 InterpNormal(const hsPoint3& bary) const;
UInt32 InterpDiffuse32(const hsPoint3& bary) const;
UInt32 InterpSpecular32(const hsPoint3& bary) const;
uint32_t InterpDiffuse32(const hsPoint3& bary) const;
uint32_t InterpSpecular32(const hsPoint3& bary) const;
hsColorRGBA InterpDiffuseRGBA(const hsPoint3& bary) const;
hsColorRGBA InterpSpecularRGBA(const hsPoint3& bary) const;
hsPoint3 InterpUVW(const hsPoint3& bary, int i) const;
@ -154,12 +154,12 @@ inline hsColorRGBA plAccTriIterator::InterpSpecularRGBA(const hsPoint3& bary) co
+ SpecularRGBA(2) * bary[2];
}
inline UInt32 plAccTriIterator::InterpDiffuse32(const hsPoint3& bary) const
inline uint32_t plAccTriIterator::InterpDiffuse32(const hsPoint3& bary) const
{
return InterpDiffuseRGBA(bary).ToARGB32();
}
inline UInt32 plAccTriIterator::InterpSpecular32(const hsPoint3& bary) const
inline uint32_t plAccTriIterator::InterpSpecular32(const hsPoint3& bary) const
{
return InterpSpecularRGBA(bary).ToARGB32();
}

View File

@ -102,18 +102,18 @@ public:
hsGDeviceRef* fVtxDeviceRef;
UInt8* fChannels[kNumValidChans];
UInt16 fStrides[kNumValidChans];
Int32 fOffsets[kNumValidChans];
uint8_t* fChannels[kNumValidChans];
uint16_t fStrides[kNumValidChans];
int32_t fOffsets[kNumValidChans];
UInt16 fNumWeights;
UInt16 fNumUVWsPerVert;
UInt16 fNumVerts;
uint16_t fNumWeights;
uint16_t fNumUVWsPerVert;
uint16_t fNumVerts;
//////////////////////////////////
// QUERY SECTION
// Queries on how much of what we got.
UInt32 VertCount() const { return fNumVerts; }
uint32_t VertCount() const { return fNumVerts; }
hsBool HasChannel(Channel chan) const { return fStrides[chan] > 0; }
hsBool HasPositions() const { return HasChannel(kPosition); }
hsBool HasWeights() const { return HasChannel(kWeight); }
@ -133,11 +133,11 @@ public:
hsScalar& Weight(int iVtx, int iWgt) const { return *(hsScalar*)(fChannels[kWeight] + iVtx*fStrides[kWeight] + iWgt*sizeof(hsScalar)); }
hsScalar* Weights(int i) const { return (hsScalar*)(fChannels[kWeight] + i*fStrides[kWeight]); }
UInt32& WgtIndices(int i) const { return *(UInt32*)(fChannels[kWgtIndex] + i * fStrides[kWgtIndex]); }
UInt8& WgtIndex(int iVtx, int iWgt) const { return *(fChannels[kWgtIndex] + iVtx*fStrides[kWgtIndex] + iWgt); }
uint32_t& WgtIndices(int i) const { return *(uint32_t*)(fChannels[kWgtIndex] + i * fStrides[kWgtIndex]); }
uint8_t& WgtIndex(int iVtx, int iWgt) const { return *(fChannels[kWgtIndex] + iVtx*fStrides[kWgtIndex] + iWgt); }
UInt32& Diffuse32(int i) const { return *(UInt32*)(fChannels[kDiffuse] + i*fStrides[kDiffuse]); }
UInt32& Specular32(int i) const { return *(UInt32*)(fChannels[kSpecular] + i*fStrides[kSpecular]); }
uint32_t& Diffuse32(int i) const { return *(uint32_t*)(fChannels[kDiffuse] + i*fStrides[kDiffuse]); }
uint32_t& Specular32(int i) const { return *(uint32_t*)(fChannels[kSpecular] + i*fStrides[kSpecular]); }
hsColorRGBA DiffuseRGBA(int i) const { return hsColorRGBA().FromARGB32(Diffuse32(i)); }
hsColorRGBA SpecularRGBA(int i) const { return hsColorRGBA().FromARGB32(Specular32(i)); }
@ -155,11 +155,11 @@ public:
hsScalar& WeightOff(int iVtx, int iWgt) const { return *(hsScalar*)(fChannels[kWeight] + iVtx*fStrides[kWeight] + fOffsets[kWeight] + iWgt*sizeof(hsScalar)); }
hsScalar* WeightsOff(int i) const { return (hsScalar*)(fChannels[kWeight] + i*fStrides[kWeight] + fOffsets[kWeight]); }
UInt32& WgtIndicesOff(int i) const { return *(UInt32*)(fChannels[kWgtIndex] + i * fStrides[kWgtIndex] + fOffsets[kWgtIndex]); }
UInt8& WgtIndexOff(int iVtx, int iWgt) const { return *(fChannels[kWgtIndex] + iVtx*fStrides[kWgtIndex] + fOffsets[kWgtIndex] + iWgt); }
uint32_t& WgtIndicesOff(int i) const { return *(uint32_t*)(fChannels[kWgtIndex] + i * fStrides[kWgtIndex] + fOffsets[kWgtIndex]); }
uint8_t& WgtIndexOff(int iVtx, int iWgt) const { return *(fChannels[kWgtIndex] + iVtx*fStrides[kWgtIndex] + fOffsets[kWgtIndex] + iWgt); }
UInt32& Diffuse32Off(int i) const { return *(UInt32*)(fChannels[kDiffuse] + i*fStrides[kDiffuse] + fOffsets[kDiffuse]); }
UInt32& Specular32Off(int i) const { return *(UInt32*)(fChannels[kSpecular] + i*fStrides[kSpecular] + fOffsets[kSpecular]); }
uint32_t& Diffuse32Off(int i) const { return *(uint32_t*)(fChannels[kDiffuse] + i*fStrides[kDiffuse] + fOffsets[kDiffuse]); }
uint32_t& Specular32Off(int i) const { return *(uint32_t*)(fChannels[kSpecular] + i*fStrides[kSpecular] + fOffsets[kSpecular]); }
hsColorRGBA DiffuseRGBAOff(int i) const { return hsColorRGBA().FromARGB32(Diffuse32Off(i)); }
hsColorRGBA SpecularRGBAOff(int i) const { return hsColorRGBA().FromARGB32(Specular32Off(i)); }
@ -178,24 +178,24 @@ public:
void ClearVerts();
// Must at least set a count and the valid channels. Note below on setting up for UVW access.
plAccessVtxSpan& SetVertCount(UInt16 c) { fNumVerts = c; return *this; }
plAccessVtxSpan& SetStream(void* p, UInt16 stride, Int32 offset, Channel chan) { fChannels[chan] = (UInt8*)p; fStrides[chan] = stride; fOffsets[chan] = offset; return *this; }
plAccessVtxSpan& SetVertCount(uint16_t c) { fNumVerts = c; return *this; }
plAccessVtxSpan& SetStream(void* p, uint16_t stride, int32_t offset, Channel chan) { fChannels[chan] = (uint8_t*)p; fStrides[chan] = stride; fOffsets[chan] = offset; return *this; }
//////////////////////////////////
// Convenience versions. You get the idea.
plAccessVtxSpan& PositionStream(void* p, UInt16 stride, Int32 offset) { return SetStream(p, stride, offset, kPosition); }
plAccessVtxSpan& NormalStream(void* p, UInt16 stride, Int32 offset) { return SetStream(p, stride, offset, kNormal); }
plAccessVtxSpan& DiffuseStream(void* p, UInt16 stride, Int32 offset) { return SetStream(p, stride, offset, kDiffuse); }
plAccessVtxSpan& SpecularStream(void* p, UInt16 stride, Int32 offset) { return SetStream(p, stride, offset, kSpecular); }
plAccessVtxSpan& WeightStream(void* p, UInt16 stride, Int32 offset) { return SetStream(p, stride, offset, kWeight); }
plAccessVtxSpan& WgtIndexStream(void* p, UInt16 stride, Int32 offset) { return SetStream(p, stride, offset, kWgtIndex); }
plAccessVtxSpan& PositionStream(void* p, uint16_t stride, int32_t offset) { return SetStream(p, stride, offset, kPosition); }
plAccessVtxSpan& NormalStream(void* p, uint16_t stride, int32_t offset) { return SetStream(p, stride, offset, kNormal); }
plAccessVtxSpan& DiffuseStream(void* p, uint16_t stride, int32_t offset) { return SetStream(p, stride, offset, kDiffuse); }
plAccessVtxSpan& SpecularStream(void* p, uint16_t stride, int32_t offset) { return SetStream(p, stride, offset, kSpecular); }
plAccessVtxSpan& WeightStream(void* p, uint16_t stride, int32_t offset) { return SetStream(p, stride, offset, kWeight); }
plAccessVtxSpan& WgtIndexStream(void* p, uint16_t stride, int32_t offset) { return SetStream(p, stride, offset, kWgtIndex); }
plAccessVtxSpan& SetNumWeights(int n) { if( !(fNumWeights = n) ) SetStream(nil, 0, 0, kWeight).SetStream(nil, 0, 0, kWgtIndex); return *this; }
// Note on UVW access setup, you don't actually "have" to set the number of uvws per vertex,
// but one way or another you'll need to know to access the uvws. If you're going to be setting
// up the AccessSpan and passing it off for processing, you definitely better set it. But the
// accessor and iterators don't ever use it.
// Note that this means the UVWStream stride is from uvw[0][0] to uvw[1][0] in bytes.
plAccessVtxSpan& UVWStream(void* p, UInt16 stride, Int32 offset) { return SetStream(p, stride, offset, kUVW); }
plAccessVtxSpan& UVWStream(void* p, uint16_t stride, int32_t offset) { return SetStream(p, stride, offset, kUVW); }
plAccessVtxSpan& SetNumUVWs(int n) { if( !(fNumUVWsPerVert = n) )SetStream(nil, 0, 0, kUVW); return *this; }
//////////////////////////////////
@ -224,9 +224,9 @@ private:
union
{
T* fValue;
UInt8* fValueByte;
uint8_t* fValueByte;
};
UInt8* fValueEnd;
uint8_t* fValueEnd;
plAccessVtxSpan* fAccess;
plAccessVtxSpan::Channel fChan;
@ -355,7 +355,7 @@ public:
class plAccDiffuseIterator
{
plAccIterator<UInt32> fDiffuse;
plAccIterator<uint32_t> fDiffuse;
public:
plAccDiffuseIterator(plAccessVtxSpan* acc)
: fDiffuse(acc, plAccessVtxSpan::kDiffuse) {}
@ -367,7 +367,7 @@ public:
return *this;
}
UInt32* Diffuse32() const { return fDiffuse.Value(); }
uint32_t* Diffuse32() const { return fDiffuse.Value(); }
hsColorRGBA DiffuseRGBA() const { return hsColorRGBA().FromARGB32(*Diffuse32()); }
@ -379,8 +379,8 @@ public:
class plAccDiffSpecIterator
{
protected:
plAccIterator<UInt32> fDiffuse;
plAccIterator<UInt32> fSpecular;
plAccIterator<uint32_t> fDiffuse;
plAccIterator<uint32_t> fSpecular;
public:
plAccDiffSpecIterator(plAccessVtxSpan* acc)
: fDiffuse(acc, plAccessVtxSpan::kDiffuse),
@ -394,8 +394,8 @@ public:
return *this;
}
UInt32* Diffuse32() const { return fDiffuse.Value(); }
UInt32* Specular32() const { return fSpecular.Value(); }
uint32_t* Diffuse32() const { return fDiffuse.Value(); }
uint32_t* Specular32() const { return fSpecular.Value(); }
hsColorRGBA DiffuseRGBA() const { return hsColorRGBA().FromARGB32(*Diffuse32()); }
hsColorRGBA SpecularRGBA() const { return hsColorRGBA().FromARGB32(*Specular32()); }
@ -411,10 +411,10 @@ class plAccVertexIterator
protected:
plAccIterator<hsPoint3> fPosition;
plAccIterator<hsScalar> fWeight;
plAccIterator<UInt8> fWgtIndex;
plAccIterator<uint8_t> fWgtIndex;
plAccIterator<hsVector3> fNormal;
plAccIterator<UInt32> fDiffuse;
plAccIterator<UInt32> fSpecular;
plAccIterator<uint32_t> fDiffuse;
plAccIterator<uint32_t> fSpecular;
plAccIterator<hsPoint3> fUVW;
public:
plAccVertexIterator(plAccessVtxSpan* acc)
@ -442,14 +442,14 @@ public:
hsPoint3* Position() const { return fPosition.Value(); }
hsScalar* Weights() const { return fWeight.Value(); }
hsScalar* Weight(int i) const { return fWeight.Value() + i; }
UInt32* WgtIndices() const { return (UInt32*)(fWgtIndex.Value()); }
UInt8* WgtIndex(int i) const { return fWgtIndex.Value() + i; }
uint32_t* WgtIndices() const { return (uint32_t*)(fWgtIndex.Value()); }
uint8_t* WgtIndex(int i) const { return fWgtIndex.Value() + i; }
hsVector3* Normal() const { return fNormal.Value(); }
hsPoint3* UVWs() const { return fUVW.Value(); }
hsPoint3* UVW(int i) const { return fUVW.Value() + i; }
UInt32* Diffuse32() const { return fDiffuse.Value(); }
UInt32* Specular32() const { return fSpecular.Value(); }
uint32_t* Diffuse32() const { return fDiffuse.Value(); }
uint32_t* Specular32() const { return fSpecular.Value(); }
hsColorRGBA DiffuseRGBA() const { return hsColorRGBA().FromARGB32(*Diffuse32()); }
hsColorRGBA SpecularRGBA() const { return hsColorRGBA().FromARGB32(*Specular32()); }

View File

@ -65,7 +65,7 @@ void plActivePrintShape::Read(hsStream* stream, hsResMgr* mgr)
{
plPrintShape::Read(stream, mgr);
UInt32 n = stream->ReadLE32();
uint32_t n = stream->ReadLE32();
fDecalMgrs.SetCount(n);
int i;
for( i = 0; i < n; i++ )

View File

@ -68,43 +68,43 @@ public:
void* fOwner;
plDrawableSpans* fDrawable;
UInt32 fBaseSpanIdx;
uint32_t fBaseSpanIdx;
hsGMaterial* fMaterial;
UInt32 fFlags;
uint32_t fFlags;
hsTArray<hsPoint3> fOrigPos;
hsTArray<hsPoint3> fOrigUVW;
plGBufferGroup* fGroup; // Which buffer group, i.e. which vertex format
UInt32 fVBufferIdx; // Which vertex buffer in group
UInt32 fCellIdx; // Cell index inside the vertex buffer
UInt32 fCellOffset; // Offset inside the cell
UInt32 fVStartIdx; // Start vertex # in the actual interlaced buffer
UInt32 fVLength; // Length of this span in the buffer
uint32_t fVBufferIdx; // Which vertex buffer in group
uint32_t fCellIdx; // Cell index inside the vertex buffer
uint32_t fCellOffset; // Offset inside the cell
uint32_t fVStartIdx; // Start vertex # in the actual interlaced buffer
uint32_t fVLength; // Length of this span in the buffer
UInt32 fVBufferInit;
UInt32 fVBufferLimit;
uint32_t fVBufferInit;
uint32_t fVBufferLimit;
UInt32 fIBufferIdx; // Which index buffer in group
UInt32 fIStartIdx; // Redundant, since all spans are contiguous. Here for debugging
UInt32 fILength; // Length of this span in the buffer
uint32_t fIBufferIdx; // Which index buffer in group
uint32_t fIStartIdx; // Redundant, since all spans are contiguous. Here for debugging
uint32_t fILength; // Length of this span in the buffer
UInt32 fIBufferInit;
UInt32 fIBufferLimit;
uint32_t fIBufferInit;
uint32_t fIBufferLimit;
plDecalVtxFormat* GetBaseVtxPtr() const
{
plGBufferGroup* grp = fGroup;
plGBufferCell* cell = grp->GetCell(fVBufferIdx, fCellIdx);
UInt8* ptr = grp->GetVertBufferData(fVBufferIdx);
uint8_t* ptr = grp->GetVertBufferData(fVBufferIdx);
ptr += cell->fVtxStart + fCellOffset;
return (plDecalVtxFormat*)ptr;
}
UInt16* GetBaseIdxPtr() const
uint16_t* GetBaseIdxPtr() const
{
plGBufferGroup* grp = fGroup;

View File

@ -52,13 +52,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class EdgeBin
{
public:
UInt16 fVtx;
UInt16 fCount;
uint16_t fVtx;
uint16_t fCount;
EdgeBin() : fVtx(0), fCount(0) {}
};
void plAvMeshSmooth::FindEdges(UInt32 maxVtxIdx, UInt32 nTris, UInt16* idxList, hsTArray<UInt16>& edgeVerts)
void plAvMeshSmooth::FindEdges(uint32_t maxVtxIdx, uint32_t nTris, uint16_t* idxList, hsTArray<uint16_t>& edgeVerts)
{
hsTArray<EdgeBin>* bins = TRACKED_NEW hsTArray<EdgeBin>[maxVtxIdx+1];
@ -138,7 +138,7 @@ void plAvMeshSmooth::FindEdges(UInt32 maxVtxIdx, UInt32 nTris, UInt16* idxList,
delete [] bins;
}
void plAvMeshSmooth::FindEdges(hsTArray<XfmSpan>& spans, hsTArray<UInt16>* edgeVerts)
void plAvMeshSmooth::FindEdges(hsTArray<XfmSpan>& spans, hsTArray<uint16_t>* edgeVerts)
{
int i;
for( i = 0; i < spans.GetCount(); i++ )
@ -149,9 +149,9 @@ void plAvMeshSmooth::FindEdges(hsTArray<XfmSpan>& spans, hsTArray<UInt16>* edgeV
plAccessTriSpan& triSpan = spans[i].fAccSpan.AccessTri();
UInt32 nTris = triSpan.TriCount();
UInt16* idxList = triSpan.fTris;
UInt32 maxVertIdx = triSpan.VertCount()-1;
uint32_t nTris = triSpan.TriCount();
uint16_t* idxList = triSpan.fTris;
uint32_t maxVertIdx = triSpan.VertCount()-1;
FindEdges(maxVertIdx, nTris, idxList, edgeVerts[i]);
}
@ -171,10 +171,10 @@ void plAvMeshSmooth::FindEdges(hsTArray<XfmSpan>& spans, hsTArray<UInt16>* edgeV
// morph target mesh's local space. Whatever.
void plAvMeshSmooth::Smooth(hsTArray<XfmSpan>& srcSpans, hsTArray<XfmSpan>& dstSpans)
{
hsTArray<UInt16>* dstEdgeVerts = TRACKED_NEW hsTArray<UInt16>[dstSpans.GetCount()];
hsTArray<uint16_t>* dstEdgeVerts = TRACKED_NEW hsTArray<uint16_t>[dstSpans.GetCount()];
FindEdges(dstSpans, dstEdgeVerts);
hsTArray<UInt16>* srcEdgeVerts = TRACKED_NEW hsTArray<UInt16>[srcSpans.GetCount()];
hsTArray<uint16_t>* srcEdgeVerts = TRACKED_NEW hsTArray<uint16_t>[srcSpans.GetCount()];
FindEdges(srcSpans, srcEdgeVerts);
int i;

View File

@ -75,7 +75,7 @@ public:
};
protected:
UInt32 fFlags;
uint32_t fFlags;
hsScalar fMinNormDot;
hsScalar fDistTolSq;
@ -87,8 +87,8 @@ protected:
hsPoint3 IPositionToSpan(XfmSpan& span, const hsPoint3& wPos) const;
hsVector3 INormalToSpan(XfmSpan& span, const hsVector3& wNorm) const;
void FindEdges(UInt32 maxVtxIdx, UInt32 nTris, UInt16* idxList, hsTArray<UInt16>& edgeVerts);
void FindEdges(hsTArray<XfmSpan>& spans, hsTArray<UInt16>* edgeVerts);
void FindEdges(uint32_t maxVtxIdx, uint32_t nTris, uint16_t* idxList, hsTArray<uint16_t>& edgeVerts);
void FindEdges(hsTArray<XfmSpan>& spans, hsTArray<uint16_t>* edgeVerts);
public:
plAvMeshSmooth() : fFlags(kSmoothNorm), fMinNormDot(0.25f), fDistTolSq(1.e-4f), fAccGeom() {}
@ -101,8 +101,8 @@ public:
void Smooth(hsTArray<XfmSpan>& srcSpans, hsTArray<XfmSpan>& dstSpans);
void SetFlags(UInt32 f) { fFlags = f; }
UInt32 GetFlags() const { return fFlags; }
void SetFlags(uint32_t f) { fFlags = f; }
uint32_t GetFlags() const { return fFlags; }
};
#endif // plAvMeshSmooth_inc

View File

@ -113,7 +113,7 @@ inline void inlTESTPOINT(const hsPoint3& destP,
maxZ = destP.fZ;
}
void plCluster::UnPack(UInt8* vDst, UInt16* iDst, int idxOffset, hsBounds3Ext& wBnd) const
void plCluster::UnPack(uint8_t* vDst, uint16_t* iDst, int idxOffset, hsBounds3Ext& wBnd) const
{
hsScalar minX = 1.e33f;
hsScalar minY = 1.e33f;
@ -129,7 +129,7 @@ void plCluster::UnPack(UInt8* vDst, UInt16* iDst, int idxOffset, hsBounds3Ext& w
for( i = 0; i < fInsts.GetCount(); i++ )
{
// First, just copy our template, offsetting by prescribed amount.
const UInt16* iSrc = templ.IndexData();
const uint16_t* iSrc = templ.IndexData();
int n = templ.NumIndices();
while( n-- )
{
@ -173,7 +173,7 @@ void plCluster::UnPack(UInt8* vDst, UInt16* iDst, int idxOffset, hsBounds3Ext& w
*norm = w2l * *norm;
hsFastMath::NormalizeAppr(*norm);
UInt32* color = (UInt32*)(vDst + colOff);
uint32_t* color = (uint32_t*)(vDst + colOff);
*color = iter.Color(*color);
vDst += stride;

View File

@ -63,7 +63,7 @@ class plCluster
public:
enum
{
kNoIdx = UInt8(-1)
kNoIdx = uint8_t(-1)
};
protected:
plClusterGroup* fGroup;
@ -83,10 +83,10 @@ public:
void Read(hsStream* s, plClusterGroup* grp);
void Write(hsStream* s) const;
UInt32 NumInsts() const { return fInsts.GetCount(); }
uint32_t NumInsts() const { return fInsts.GetCount(); }
const plSpanInstance& GetInst(int i) const { return *fInsts[i]; }
void UnPack(UInt8* vDst, UInt16* iDst, int idxOffset, hsBounds3Ext& wBnd) const;
void UnPack(uint8_t* vDst, uint16_t* iDst, int idxOffset, hsBounds3Ext& wBnd) const;
// Getters and setters, mostly for export construction.
const plSpanTemplate* GetTemplate() const { return fGroup->GetTemplate(); }

View File

@ -316,9 +316,9 @@ void plClusterGroup::SetVisible(bool visible)
}
}
UInt32 plClusterGroup::NumInst() const
uint32_t plClusterGroup::NumInst() const
{
UInt32 numInst = 0;
uint32_t numInst = 0;
int i;
for( i = 0; i < fClusters.GetCount(); i++ )
numInst += fClusters[i]->NumInsts();

View File

@ -101,7 +101,7 @@ protected:
plLODDist fLOD;
hsTArray<plCluster*> fClusters;
UInt32 fUnPacked;
uint32_t fUnPacked;
plKey fSceneNode;
plKey fDrawable;
@ -144,7 +144,7 @@ public:
const plCluster* GetCluster(int i) const;
int GetNumClusters() const { return fClusters.GetCount(); }
UInt32 NumInst() const;
uint32_t NumInst() const;
// The drawable needs us to be able to convert our data
// into, well, drawable stuff.

View File

@ -1043,7 +1043,7 @@ void TestCutter(const plKey& key, const hsVector3& size, const hsPoint3& pos)
hsBool newDrawable = !drawable;
hsBool haveNormal = true;
hsTArray<UInt32> retIndex;
hsTArray<uint32_t> retIndex;
hsTArray<plAccessSpan> src;
plAccessGeometry::Instance()->OpenRO(di, src);
@ -1190,12 +1190,12 @@ void TestCutter(const plKey& key, const hsVector3& size, const hsPoint3& pos)
}
}
hsTArray<UInt16> idx;
hsTArray<uint16_t> idx;
UInt16 base = 0;
uint16_t base = 0;
for( j = 0; j < dst.GetCount(); j++ )
{
UInt16 next = base+1;
uint16_t next = base+1;
int k;
for( k = 2; k < dst[j].fVerts.GetCount(); k++ )
{
@ -1249,7 +1249,7 @@ void TestCutter2(const plKey& key, const hsVector3& size, const hsPoint3& pos, h
hsBool newDrawable = !drawable;
hsBool haveNormal = true;
hsTArray<UInt32> retIndex;
hsTArray<uint32_t> retIndex;
hsTArray<plDrawVisList> drawVis;
node->Harvest(&cutter.GetIsect(), drawVis);
@ -1345,12 +1345,12 @@ void TestCutter2(const plKey& key, const hsVector3& size, const hsPoint3& pos, h
}
}
hsTArray<UInt16> idx;
hsTArray<uint16_t> idx;
UInt16 base = 0;
uint16_t base = 0;
for( j = 0; j < dst.GetCount(); j++ )
{
UInt16 next = base+1;
uint16_t next = base+1;
int k;
for( k = 2; k < dst[j].fVerts.GetCount(); k++ )
{

View File

@ -95,7 +95,7 @@ class plFlatGridMesh
{
public:
hsTArray<plCutoutMiniVtx> fVerts;
hsTArray<UInt16> fIdx;
hsTArray<uint16_t> fIdx;
void Reset() { fVerts.SetCount(0); fIdx.SetCount(0); }
};

View File

@ -80,7 +80,7 @@ void plDrawableGenerator::SetFauxLightColors( hsColorRGBA &lite, hsColorRGBA
// Quickly shades vertices based on a fake directional light. Good for doing
// faux shadings on proxy objects.
void plDrawableGenerator::IQuickShadeVerts( UInt32 count, hsVector3 *normals, hsColorRGBA *colors, hsColorRGBA* origColors, const hsColorRGBA* multColor )
void plDrawableGenerator::IQuickShadeVerts( uint32_t count, hsVector3 *normals, hsColorRGBA *colors, hsColorRGBA* origColors, const hsColorRGBA* multColor )
{
hsVector3 lightDir;
float scale;
@ -105,10 +105,10 @@ void plDrawableGenerator::IQuickShadeVerts( UInt32 count, hsVector3 *normals,
}
}
void plDrawableGenerator::IFillSpan( UInt32 vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, UInt32 uvwsPerVtx,
void plDrawableGenerator::IFillSpan( uint32_t vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, uint32_t uvwsPerVtx,
hsColorRGBA *origColors, hsBool fauxShade, const hsColorRGBA* multColor,
UInt32 numIndices, UInt16 *indices,
uint32_t numIndices, uint16_t *indices,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended,
plGeometrySpan* span )
{
@ -144,7 +144,7 @@ void plDrawableGenerator::IFillSpan( UInt32 vertCount, hsPoint3 *positions, hsVe
if( uvws == nil )
uvwsPerVtx = 0;
span->BeginCreate( material, localToWorld, plGeometrySpan::UVCountToFormat( (UInt8)uvwsPerVtx ) );
span->BeginCreate( material, localToWorld, plGeometrySpan::UVCountToFormat( (uint8_t)uvwsPerVtx ) );
if( !origColors && !fauxShade )
span->AddVertexArray( vertCount, positions, normals, nil, uvws, uvwsPerVtx );
@ -165,19 +165,19 @@ void plDrawableGenerator::IFillSpan( UInt32 vertCount, hsPoint3 *positions, hsVe
}
hsTArray<UInt32> tempColors;
hsTArray<uint32_t> tempColors;
int i;
UInt8 a, r, g, b;
uint8_t a, r, g, b;
tempColors.SetCount( vertCount );
for( i = 0; i < vertCount; i++ )
{
hsColorRGBA *color = &colors[ i ];
a = (UInt8)( color->a >= 1 ? 255 : color->a <= 0 ? 0 : color->a * 255.0 );
r = (UInt8)( color->r >= 1 ? 255 : color->r <= 0 ? 0 : color->r * 255.0 );
g = (UInt8)( color->g >= 1 ? 255 : color->g <= 0 ? 0 : color->g * 255.0 );
b = (UInt8)( color->b >= 1 ? 255 : color->b <= 0 ? 0 : color->b * 255.0 );
a = (uint8_t)( color->a >= 1 ? 255 : color->a <= 0 ? 0 : color->a * 255.0 );
r = (uint8_t)( color->r >= 1 ? 255 : color->r <= 0 ? 0 : color->r * 255.0 );
g = (uint8_t)( color->g >= 1 ? 255 : color->g <= 0 ? 0 : color->g * 255.0 );
b = (uint8_t)( color->b >= 1 ? 255 : color->b <= 0 ? 0 : color->b * 255.0 );
tempColors[ i ] = ( a << 24 ) | ( r << 16 ) | ( g << 8 ) | ( b );
}
@ -196,12 +196,12 @@ void plDrawableGenerator::IFillSpan( UInt32 vertCount, hsPoint3 *positions, hsVe
// data given. That data had better match the data the drawable was first filled
// with (i.e. vertex/index count
hsBool plDrawableGenerator::RegenerateDrawable( UInt32 vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, UInt32 uvwsPerVtx,
hsBool plDrawableGenerator::RegenerateDrawable( uint32_t vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, uint32_t uvwsPerVtx,
hsColorRGBA *origColors, hsBool fauxShade, const hsColorRGBA* multColor,
UInt32 numIndices, UInt16 *indices,
uint32_t numIndices, uint16_t *indices,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended,
UInt32 diIndex, plDrawableSpans *destDraw )
uint32_t diIndex, plDrawableSpans *destDraw )
{
plDISpanIndex spanList = destDraw->GetDISpans( diIndex );
if( spanList.GetCount() != 1 )
@ -234,12 +234,12 @@ hsBool plDrawableGenerator::RegenerateDrawable( UInt32 vertCount, hsPoint3 *posi
// Static function that creates a new drawable based on the vertex/index
// data given.
plDrawableSpans *plDrawableGenerator::GenerateDrawable( UInt32 vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, UInt32 uvwsPerVtx,
plDrawableSpans *plDrawableGenerator::GenerateDrawable( uint32_t vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, uint32_t uvwsPerVtx,
hsColorRGBA *origColors, hsBool fauxShade, const hsColorRGBA* multColor,
UInt32 numIndices, UInt16 *indices,
uint32_t numIndices, uint16_t *indices,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended,
hsTArray<UInt32> *retIndex, plDrawableSpans *toAddTo )
hsTArray<uint32_t> *retIndex, plDrawableSpans *toAddTo )
{
plDrawableSpans *newDraw;
hsTArray<plGeometrySpan *> spanArray;
@ -276,8 +276,8 @@ plDrawableSpans *plDrawableGenerator::GenerateDrawable( UInt32 vertCount, hsPoin
span );
/// Now add the span to the new drawable, clear up the span's buffers and return!
UInt32 trash = UInt32(-1);
UInt32 idx = newDraw->AppendDISpans( spanArray, trash, false );
uint32_t trash = uint32_t(-1);
uint32_t idx = newDraw->AppendDISpans( spanArray, trash, false );
if( retIndex != nil )
retIndex->Append(idx);
@ -289,12 +289,12 @@ plDrawableSpans *plDrawableGenerator::GenerateDrawable( UInt32 vertCount, hsPoin
plDrawableSpans *plDrawableGenerator::GenerateSphericalDrawable( const hsPoint3& pos, hsScalar radius, hsGMaterial *material,
const hsMatrix44 &localToWorld, hsBool blended,
const hsColorRGBA* multColor,
hsTArray<UInt32> *retIndex, plDrawableSpans *toAddTo,
hsTArray<uint32_t> *retIndex, plDrawableSpans *toAddTo,
hsScalar qualityScalar )
{
hsTArray<hsPoint3> points;
hsTArray<hsVector3> normals;
hsTArray<UInt16> indices;
hsTArray<uint16_t> indices;
hsTArray<hsColorRGBA> colors;
hsPoint3 point;
hsVector3 normal;
@ -370,7 +370,7 @@ plDrawableSpans *plDrawableGenerator::GenerateSphericalDrawable( const hsPoi
plDrawableSpans *plDrawableGenerator::GenerateBoxDrawable( hsScalar width, hsScalar height, hsScalar depth,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended,
const hsColorRGBA* multColor,
hsTArray<UInt32> *retIndex, plDrawableSpans *toAddTo )
hsTArray<uint32_t> *retIndex, plDrawableSpans *toAddTo )
{
hsVector3 xVec, yVec, zVec;
hsPoint3 pt;
@ -393,11 +393,11 @@ plDrawableSpans *plDrawableGenerator::GenerateBoxDrawable( hsScalar width, h
plDrawableSpans *plDrawableGenerator::GenerateBoxDrawable( const hsPoint3 &corner, const hsVector3 &xVec, const hsVector3 &yVec, const hsVector3 &zVec,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended,
const hsColorRGBA* multColor,
hsTArray<UInt32> *retIndex, plDrawableSpans *toAddTo )
hsTArray<uint32_t> *retIndex, plDrawableSpans *toAddTo )
{
hsTArray<hsPoint3> points;
hsTArray<hsVector3> normals;
hsTArray<UInt16> indices;
hsTArray<uint16_t> indices;
hsTArray<hsColorRGBA> colors;
hsTArray<hsPoint3> uvws;
hsPoint3 point;
@ -476,11 +476,11 @@ plDrawableSpans *plDrawableGenerator::GenerateBoxDrawable( const hsPoint3 &c
plDrawableSpans *plDrawableGenerator::GenerateBoundsDrawable( hsBounds3Ext *bounds,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended,
const hsColorRGBA* multColor,
hsTArray<UInt32> *retIndex, plDrawableSpans *toAddTo )
hsTArray<uint32_t> *retIndex, plDrawableSpans *toAddTo )
{
hsTArray<hsPoint3> points;
hsTArray<hsVector3> normals;
hsTArray<UInt16> indices;
hsTArray<uint16_t> indices;
hsTArray<hsColorRGBA> colors;
hsPoint3 point;
hsVector3 normal;
@ -540,7 +540,7 @@ plDrawableSpans *plDrawableGenerator::GenerateBoundsDrawable( hsBounds3Ext *
plDrawableSpans *plDrawableGenerator::GenerateConicalDrawable( hsScalar radius, hsScalar height, hsGMaterial *material,
const hsMatrix44 &localToWorld, hsBool blended,
const hsColorRGBA* multColor,
hsTArray<UInt32> *retIndex, plDrawableSpans *toAddTo )
hsTArray<uint32_t> *retIndex, plDrawableSpans *toAddTo )
{
hsVector3 direction;
@ -558,11 +558,11 @@ plDrawableSpans *plDrawableGenerator::GenerateConicalDrawable( hsScalar radi
plDrawableSpans *plDrawableGenerator::GenerateConicalDrawable( hsPoint3 &apex, hsVector3 &direction, hsScalar radius, hsGMaterial *material,
const hsMatrix44 &localToWorld, hsBool blended,
const hsColorRGBA* multColor,
hsTArray<UInt32> *retIndex, plDrawableSpans *toAddTo )
hsTArray<uint32_t> *retIndex, plDrawableSpans *toAddTo )
{
hsTArray<hsPoint3> points;
hsTArray<hsVector3> normals;
hsTArray<UInt16> indices;
hsTArray<uint16_t> indices;
hsTArray<hsColorRGBA> colors;
hsPoint3 point;
hsVector3 normal;
@ -645,12 +645,12 @@ plDrawableSpans *plDrawableGenerator::GenerateConicalDrawable( hsPoint3 &ape
plDrawableSpans *plDrawableGenerator::GenerateAxesDrawable( hsGMaterial *material,
const hsMatrix44 &localToWorld, hsBool blended,
const hsColorRGBA* multColor,
hsTArray<UInt32> *retIndex, plDrawableSpans *toAddTo )
hsTArray<uint32_t> *retIndex, plDrawableSpans *toAddTo )
{
hsTArray<hsPoint3> points;
hsTArray<hsVector3> normals;
hsTArray<hsColorRGBA> colors;
hsTArray<UInt16> indices;
hsTArray<uint16_t> indices;
int i;
float size = 15;
@ -716,11 +716,11 @@ plDrawableSpans *plDrawableGenerator::GenerateAxesDrawable( hsGMaterial *mat
plDrawableSpans *plDrawableGenerator::GeneratePlanarDrawable( const hsPoint3 &corner, const hsVector3 &xVec, const hsVector3 &yVec,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended,
const hsColorRGBA* multColor,
hsTArray<UInt32> *retIndex, plDrawableSpans *toAddTo )
hsTArray<uint32_t> *retIndex, plDrawableSpans *toAddTo )
{
hsTArray<hsPoint3> points;
hsTArray<hsVector3> normals;
hsTArray<UInt16> indices;
hsTArray<uint16_t> indices;
hsTArray<hsColorRGBA> colors;
hsTArray<hsPoint3> uvws;
hsPoint3 point;

View File

@ -76,76 +76,76 @@ class plDrawableGenerator
// Refills a drawable previously created with GenerateDrawable with the new data. New data
// must match previous data in counts.
hsBool RegenerateDrawable( UInt32 vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, UInt32 uvwsPerVtx,
hsBool RegenerateDrawable( uint32_t vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, uint32_t uvwsPerVtx,
hsColorRGBA *origColors, hsBool fauxShade, const hsColorRGBA* multColor,
UInt32 numIndices, UInt16 *indices,
uint32_t numIndices, uint16_t *indices,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended,
UInt32 diIndex, plDrawableSpans *destDraw );
uint32_t diIndex, plDrawableSpans *destDraw );
// Generates a drawable based on the vertex/index data given
// uvws is an array vertCount*uvwsPerVtx long in order [uvw(s) for vtx0, uvw(s) for vtx1, ...], or is nil
static plDrawableSpans *GenerateDrawable( UInt32 vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, UInt32 uvwsPerVtx,
static plDrawableSpans *GenerateDrawable( uint32_t vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, uint32_t uvwsPerVtx,
hsColorRGBA *origColors, hsBool fauxShade, const hsColorRGBA* multColor,
UInt32 numIndices, UInt16 *indices,
uint32_t numIndices, uint16_t *indices,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended = false,
hsTArray<UInt32> *retIndex = nil, plDrawableSpans *toAddTo = nil );
hsTArray<uint32_t> *retIndex = nil, plDrawableSpans *toAddTo = nil );
// Generates a spherical drawable
static plDrawableSpans *GenerateSphericalDrawable( const hsPoint3& localPos, hsScalar radius, hsGMaterial *material,
const hsMatrix44 &localToWorld, hsBool blended = false,
const hsColorRGBA* multColor = nil,
hsTArray<UInt32> *retIndex = nil, plDrawableSpans *toAddTo = nil,
hsTArray<uint32_t> *retIndex = nil, plDrawableSpans *toAddTo = nil,
hsScalar qualityScalar = 1.f );
// Generates a rectangular drawable
static plDrawableSpans *GenerateBoxDrawable( hsScalar width, hsScalar height, hsScalar depth,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended = false,
const hsColorRGBA* multColor = nil,
hsTArray<UInt32> *retIndex = nil, plDrawableSpans *toAddTo = nil );
hsTArray<uint32_t> *retIndex = nil, plDrawableSpans *toAddTo = nil );
// Generate a rectangular drawable based on a corner and three vectors
static plDrawableSpans *GenerateBoxDrawable( const hsPoint3 &corner, const hsVector3 &xVec, const hsVector3 &yVec, const hsVector3 &zVec,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended = false,
const hsColorRGBA* multColor = nil,
hsTArray<UInt32> *retIndex = nil, plDrawableSpans *toAddTo = nil );
hsTArray<uint32_t> *retIndex = nil, plDrawableSpans *toAddTo = nil );
// Generates a bounds-based drawable
static plDrawableSpans *GenerateBoundsDrawable( hsBounds3Ext *bounds,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended = false,
const hsColorRGBA* multColor = nil,
hsTArray<UInt32> *retIndex = nil, plDrawableSpans *toAddTo = nil );
hsTArray<uint32_t> *retIndex = nil, plDrawableSpans *toAddTo = nil );
// Generates a conical drawable
static plDrawableSpans *GenerateConicalDrawable( hsScalar radius, hsScalar height, hsGMaterial *material,
const hsMatrix44 &localToWorld, hsBool blended = false,
const hsColorRGBA* multColor = nil,
hsTArray<UInt32> *retIndex = nil, plDrawableSpans *toAddTo = nil );
hsTArray<uint32_t> *retIndex = nil, plDrawableSpans *toAddTo = nil );
// Generates a general conical drawable based on a center and direction
static plDrawableSpans *GenerateConicalDrawable( hsPoint3 &apex, hsVector3 &direction, hsScalar radius, hsGMaterial *material,
const hsMatrix44 &localToWorld, hsBool blended = false,
const hsColorRGBA* multColor = nil,
hsTArray<UInt32> *retIndex = nil, plDrawableSpans *toAddTo = nil );
hsTArray<uint32_t> *retIndex = nil, plDrawableSpans *toAddTo = nil );
// Generates a drawable representing 3 axes
static plDrawableSpans *GenerateAxesDrawable( hsGMaterial *material,
const hsMatrix44 &localToWorld, hsBool blended = false,
const hsColorRGBA* multColor = nil,
hsTArray<UInt32> *retIndex = nil, plDrawableSpans *toAddTo = nil );
hsTArray<uint32_t> *retIndex = nil, plDrawableSpans *toAddTo = nil );
// Generate a planar drawable based on a corner and two vectors
static plDrawableSpans *GeneratePlanarDrawable( const hsPoint3 &corner, const hsVector3 &xVec, const hsVector3 &yVec,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended = false,
const hsColorRGBA* multColor = nil,
hsTArray<UInt32> *retIndex = nil, plDrawableSpans *toAddTo = nil );
hsTArray<uint32_t> *retIndex = nil, plDrawableSpans *toAddTo = nil );
protected:
// Shade the vertices given based on a quick fake directional light.
// If origColors is non-nil, it must be an array of length count. Each outColor[i] *= origColor[i].
// If multColor is non-nil, modulate the output by multColor.
static void IQuickShadeVerts( UInt32 count, hsVector3 *normals,
static void IQuickShadeVerts( uint32_t count, hsVector3 *normals,
hsColorRGBA *colors,
hsColorRGBA* origColors = nil,
const hsColorRGBA* multColor = nil );
@ -153,10 +153,10 @@ class plDrawableGenerator
// Take the vertex and connectivity info supplied and fill out a geometry span with it.
// Output span is ready to be added to a Drawable, or refreshed in a Drawable if it's
// already in the SourceSpans.
static void IFillSpan( UInt32 vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, UInt32 uvwsPerVtx,
static void IFillSpan( uint32_t vertCount, hsPoint3 *positions, hsVector3 *normals,
hsPoint3 *uvws, uint32_t uvwsPerVtx,
hsColorRGBA *origColors, hsBool fauxShade, const hsColorRGBA* multColor,
UInt32 numIndices, UInt16 *indices,
uint32_t numIndices, uint16_t *indices,
hsGMaterial *material, const hsMatrix44 &localToWorld, hsBool blended,
plGeometrySpan* span );

File diff suppressed because it is too large Load Diff

View File

@ -97,16 +97,16 @@ public:
kMatrixOnly = 0x1,
kDontTransformSpans = 0x2 // Only used for particle systems right now
};
UInt8 fFlags;
hsTArray<UInt32> fIndices;
uint8_t fFlags;
hsTArray<uint32_t> fIndices;
hsBool IsMatrixOnly() const { return 0 != (fFlags & kMatrixOnly); }
hsBool DontTransform() const { return 0 != ( fFlags & kDontTransformSpans ); }
void Append(UInt32 i) { fIndices.Append(i); }
void Append(uint32_t i) { fIndices.Append(i); }
void Reset() { fFlags = kNone; fIndices.Reset(); }
void SetCountAndZero(int c) { fIndices.SetCountAndZero(c); }
UInt32 GetCount() const { return fIndices.GetCount(); }
UInt32& operator[](int i) const { return fIndices[i]; }
uint32_t GetCount() const { return fIndices.GetCount(); }
uint32_t& operator[](int i) const { return fIndices[i]; }
};
struct hsColorRGBA;
@ -115,12 +115,12 @@ class plDrawableSpans : public plDrawable
{
protected:
static const UInt32 kSpanTypeMask;
static const UInt32 kSpanIDMask;
static const UInt32 kSpanTypeIcicle;
static const UInt32 kSpanTypeParticleSpan;
static const uint32_t kSpanTypeMask;
static const uint32_t kSpanIDMask;
static const uint32_t kSpanTypeIcicle;
static const uint32_t kSpanTypeParticleSpan;
UInt32 fType;
uint32_t fType;
hsBool fReadyToRender;
@ -151,12 +151,12 @@ class plDrawableSpans : public plDrawable
hsTArray<plParticleSpan> fParticleSpans;
hsTArray<plSpan *> fSpans; // Pointers into the above two arrays
hsTArray<UInt32> fSpanSourceIndices; // For volatile drawables only
hsTArray<uint32_t> fSpanSourceIndices; // For volatile drawables only
hsTArray<plGBufferGroup *> fGroups;
hsTArray<plDISpanIndex*> fDIIndices;
UInt32 fProps;
UInt32 fCriteria;
uint32_t fProps;
uint32_t fCriteria;
plRenderLevel fRenderLevel;
plLoadMask fLoadMask;
@ -171,7 +171,7 @@ class plDrawableSpans : public plDrawable
hsBool fSettingMatIdxLock;
UInt32 fSkinTime;
uint32_t fSkinTime;
/// Export-only members
hsTArray<plGeometrySpan *> fSourceSpans;
@ -184,7 +184,7 @@ class plDrawableSpans : public plDrawable
void ICleanupMatrices();
void IRemoveGarbage( void );
void IAdjustSortData( plGBufferTriangle *triList, UInt32 count, UInt32 threshhold, Int32 delta );
void IAdjustSortData( plGBufferTriangle *triList, uint32_t count, uint32_t threshhold, int32_t delta );
// The following two functions return true if they create a new span, false if it's just an instance
hsBool IConvertGeoSpanToVertexSpan( plGeometrySpan *geoSpan, plVertexSpan *span, int lod, plVertexSpan *instancedParent );
@ -193,11 +193,11 @@ class plDrawableSpans : public plDrawable
void IUpdateIcicleFromGeoSpan( plGeometrySpan *geoSpan, plIcicle *icicle );
void IUpdateVertexSpanFromGeoSpan( plGeometrySpan *geoSpan, plVertexSpan *span );
UInt32 IXlateSpanProps( UInt32 props, hsBool xlateToSpan );
uint32_t IXlateSpanProps( uint32_t props, hsBool xlateToSpan );
UInt32 IAddAMaterial( hsGMaterial *material );
UInt32 IRefMaterial( UInt32 index );
void ICheckToRemoveMaterial( UInt32 materialIdx );
uint32_t IAddAMaterial( hsGMaterial *material );
uint32_t IRefMaterial( uint32_t index );
void ICheckToRemoveMaterial( uint32_t materialIdx );
// Annoying to need this, but necessary until materials can test for properties on any of their layers (might add in the future)
hsBool ITestMatForSpecularity( hsGMaterial *mat );
@ -205,8 +205,8 @@ class plDrawableSpans : public plDrawable
void IAssignMatIdxToSpan( plSpan *span, hsGMaterial *mtl );
// Create the sorting data for a given span and flag it as sortable
void ICheckSpanForSortable( UInt32 idx ) { if( !(fSpans[idx]->fProps & plSpan::kPropFacesSortable) )IMakeSpanSortable(idx); }
void IMakeSpanSortable( UInt32 index );
void ICheckSpanForSortable( uint32_t idx ) { if( !(fSpans[idx]->fProps & plSpan::kPropFacesSortable) )IMakeSpanSortable(idx); }
void IMakeSpanSortable( uint32_t index );
/// Bit vector build thingies
virtual void IBuildVectors( void );
@ -221,13 +221,13 @@ class plDrawableSpans : public plDrawable
// Compare two spans for sorting
short ICompareSpans( plGeometrySpan *span1, plGeometrySpan *span2 );
// Find a buffer group of the given format (returns its index into fGroups)
UInt8 IFindBufferGroup( UInt8 vtxFormat, UInt32 numVertsNeeded, int lod, hsBool vertVolatile, hsBool idxVolatile);
uint8_t IFindBufferGroup( uint8_t vtxFormat, uint32_t numVertsNeeded, int lod, hsBool vertVolatile, hsBool idxVolatile);
// Write a span to a stream
void IWriteSpan( hsStream *s, plSpan *span );
/// EXPORT-ONLY FUNCTIONS
/// DYNAMIC FUNCTIONS
plDISpanIndex *IFindDIIndices( UInt32 &index );
plDISpanIndex *IFindDIIndices( uint32_t &index );
void IRebuildSpanArray( void );
plParticleSpan *ICreateParticleIcicle( hsGMaterial *material, plParticleSet *set );
@ -240,13 +240,13 @@ class plDrawableSpans : public plDrawable
CLASSNAME_REGISTER( plDrawableSpans );
GETINTERFACE_ANY( plDrawableSpans, plDrawable );
virtual void SetNativeTransform(UInt32 idx, const hsMatrix44& l2w, const hsMatrix44& w2l);
virtual plDrawable& SetTransform( UInt32 index, const hsMatrix44& l2w, const hsMatrix44& w2l);
virtual const hsMatrix44& GetLocalToWorld( UInt32 index = (UInt32)-1 ) const;
virtual const hsMatrix44& GetWorldToLocal( UInt32 index = (UInt32)-1 ) const;
virtual void SetNativeTransform(uint32_t idx, const hsMatrix44& l2w, const hsMatrix44& w2l);
virtual plDrawable& SetTransform( uint32_t index, const hsMatrix44& l2w, const hsMatrix44& w2l);
virtual const hsMatrix44& GetLocalToWorld( uint32_t index = (uint32_t)-1 ) const;
virtual const hsMatrix44& GetWorldToLocal( uint32_t index = (uint32_t)-1 ) const;
virtual plDrawable& SetProperty( UInt32 index, int prop, hsBool on );
virtual hsBool GetProperty( UInt32 index, int prop ) const;
virtual plDrawable& SetProperty( uint32_t index, int prop, hsBool on );
virtual hsBool GetProperty( uint32_t index, int prop ) const;
virtual plDrawable& SetProperty( int prop, hsBool on );
virtual hsBool GetProperty( int prop ) const;
@ -254,21 +254,21 @@ class plDrawableSpans : public plDrawable
virtual plDrawable& SetNativeProperty( int prop, hsBool on ) { if( on ) fProps |= prop; else fProps &= ~prop; return *this; }
virtual hsBool GetNativeProperty( int prop ) const { return ( fProps & prop ) ? true : false; }
virtual plDrawable& SetNativeProperty( UInt32 index, int prop, hsBool on );
virtual hsBool GetNativeProperty( UInt32 index, int prop ) const;
virtual plDrawable& SetNativeProperty( uint32_t index, int prop, hsBool on );
virtual hsBool GetNativeProperty( uint32_t index, int prop ) const;
virtual plDrawable& SetSubType( UInt32 index, plSubDrawableType t, hsBool on );
virtual UInt32 GetSubType( UInt32 index ) const; // returns or of all spans with this index (index==-1 is all spans).
virtual plDrawable& SetSubType( uint32_t index, plSubDrawableType t, hsBool on );
virtual uint32_t GetSubType( uint32_t index ) const; // returns or of all spans with this index (index==-1 is all spans).
virtual UInt32 GetType( void ) const { return fType; }
virtual void SetType( UInt32 type ) { fType = type; }
virtual uint32_t GetType( void ) const { return fType; }
virtual void SetType( uint32_t type ) { fType = type; }
virtual void SetRenderLevel(const plRenderLevel& l);
virtual const plRenderLevel& GetRenderLevel() const;
const hsBounds3Ext& GetLocalBounds( UInt32 index = (UInt32)-1 ) const;
const hsBounds3Ext& GetWorldBounds( UInt32 index = (UInt32)-1 ) const;
const hsBounds3Ext& GetMaxWorldBounds( UInt32 index = (UInt32)-1 ) const;
const hsBounds3Ext& GetLocalBounds( uint32_t index = (uint32_t)-1 ) const;
const hsBounds3Ext& GetWorldBounds( uint32_t index = (uint32_t)-1 ) const;
const hsBounds3Ext& GetMaxWorldBounds( uint32_t index = (uint32_t)-1 ) const;
virtual void Read(hsStream* s, hsResMgr* mgr);
virtual void Write(hsStream* s, hsResMgr* mgr);
@ -276,11 +276,11 @@ class plDrawableSpans : public plDrawable
virtual plSpaceTree* GetSpaceTree() const { if(!fSpaceTree)IQuickSpaceTree(); return fSpaceTree; }
virtual void SetSpaceTree(plSpaceTree* st) const;
virtual void SetVisSet(plVisMgr* visMgr);
virtual void SetDISpanVisSet(UInt32 diIndex, hsKeyedObject* reg, hsBool on);
virtual void SetDISpanVisSet(uint32_t diIndex, hsKeyedObject* reg, hsBool on);
virtual const plSpan *GetSpan( UInt32 index ) const { return fSpans[ index ]; }
virtual const plSpan *GetSpan( UInt32 diIndex, UInt32 index ) const { return fSpans[ (*fDIIndices[ diIndex ])[ index ] ]; }
virtual const UInt32 GetNumSpans( void ) const { return fSpans.GetCount(); }
virtual const plSpan *GetSpan( uint32_t index ) const { return fSpans[ index ]; }
virtual const plSpan *GetSpan( uint32_t diIndex, uint32_t index ) const { return fSpans[ (*fDIIndices[ diIndex ])[ index ] ]; }
virtual const uint32_t GetNumSpans( void ) const { return fSpans.GetCount(); }
virtual const hsTArray<plSpan *> &GetSpanArray( void ) const { return fSpans; }
hsMatrix44* GetMatrixPalette(int baseMatrix) const { return &fLocalToWorlds[baseMatrix]; }
@ -288,17 +288,17 @@ class plDrawableSpans : public plDrawable
void SetInitialBone(int i, const hsMatrix44& l2b, const hsMatrix44& b2l);
// Get the vertex buffer ref of a given group
hsGDeviceRef *GetVertexRef( UInt32 group, UInt32 idx );
hsGDeviceRef *GetVertexRef( uint32_t group, uint32_t idx );
// Get the index buffer ref of a given group
hsGDeviceRef *GetIndexRef( UInt32 group, UInt32 idx );
hsGDeviceRef *GetIndexRef( uint32_t group, uint32_t idx );
// BufferGroups accessed only by Pipeline and it's close personal acquaintances.
plGBufferGroup* GetBufferGroup(UInt32 i) const { return fGroups[i]; }
UInt32 GetNumBufferGroups() const { return fGroups.GetCount(); }
plGBufferGroup* GetBufferGroup(uint32_t i) const { return fGroups[i]; }
uint32_t GetNumBufferGroups() const { return fGroups.GetCount(); }
const hsTArray<plGeometrySpan*>& GetSourceSpans() const { return fSourceSpans; }
void DirtyVertexBuffer(UInt32 group, UInt32 idx);
void DirtyIndexBuffer(UInt32 group, UInt32 idx);
void DirtyVertexBuffer(uint32_t group, uint32_t idx);
void DirtyIndexBuffer(uint32_t group, uint32_t idx);
// Prepare all internal data structures for rendering
virtual void PrepForRender( plPipeline *p );
@ -311,8 +311,8 @@ class plDrawableSpans : public plDrawable
virtual void SetSceneNode(plKey newNode);
// Lookup a material in the material array
hsGMaterial *GetMaterial( UInt32 index ) const { return ( ( index == (UInt32)-1 ) ? nil : fMaterials[ index ] ); }
UInt32 GetNumMaterials( void ) const { return fMaterials.GetCount(); }
hsGMaterial *GetMaterial( uint32_t index ) const { return ( ( index == (uint32_t)-1 ) ? nil : fMaterials[ index ] ); }
uint32_t GetNumMaterials( void ) const { return fMaterials.GetCount(); }
// Convert intermediate data into export/run-time-ready data
virtual void Optimize( void );
@ -328,62 +328,62 @@ class plDrawableSpans : public plDrawable
virtual hsBitVector const &GetBlendingSpanVector( void ) const;
// Set a single bit in the bitVector of spans that are blending
virtual void SetBlendingSpanVectorBit( UInt32 bitNumber, hsBool on );
virtual void SetBlendingSpanVectorBit( uint32_t bitNumber, hsBool on );
// Taking span index. DI Index doesn't make sense here, because one object's DI can dereference into many materials etc.
virtual hsGMaterial* GetSubMaterial(int index) const;
virtual hsBool GetSubVisDists(int index, hsScalar& minDist, hsScalar& maxDist) const; // return true if span invisible before minDist and/or after maxDist
// Used by the pipeline to keep from reskinning on multiple renders per frame.
UInt32 GetSkinTime() const { return fSkinTime; }
void SetSkinTime(UInt32 t) { fSkinTime = t; }
uint32_t GetSkinTime() const { return fSkinTime; }
void SetSkinTime(uint32_t t) { fSkinTime = t; }
void UnPackCluster(plClusterGroup* cluster);
/// EXPORT-ONLY FUNCTIONS
virtual UInt32 AddDISpans( hsTArray<plGeometrySpan *> &spans, UInt32 index = (UInt32)-1);
virtual plDISpanIndex& GetDISpans( UInt32 index ) const;
virtual uint32_t AddDISpans( hsTArray<plGeometrySpan *> &spans, uint32_t index = (uint32_t)-1);
virtual plDISpanIndex& GetDISpans( uint32_t index ) const;
// Data Access functions
// Runtime
hsPoint3& GetPosition(int spanIdx, int vtxIdx);
hsVector3& GetNormal(int spanIdx, int vtxIdx);
UInt32 GetNumTris(int spanIdx);
UInt16* GetIndexList(int spanIdx);
uint32_t GetNumTris(int spanIdx);
uint16_t* GetIndexList(int spanIdx);
// Conversion (before geometryspans get tossed (at write)).
UInt32 CvtGetNumVerts(int spanIdx) const;
uint32_t CvtGetNumVerts(int spanIdx) const;
hsPoint3& CvtGetPosition(int spanIdx, int vtxIdx);
hsVector3& CvtGetNormal(int spanIdx, int vtxIdx);
UInt32 CvtGetNumTris(int spanIdx);
UInt16* CvtGetIndexList(int spanIdx);
uint32_t CvtGetNumTris(int spanIdx);
uint16_t* CvtGetIndexList(int spanIdx);
plGeometrySpan* GetGeometrySpan(int spanIdx);
/// DYNAMIC FUNCTIONS
virtual void RemoveDISpans( UInt32 index );
virtual UInt32 AppendDISpans( hsTArray<plGeometrySpan *> &spans, UInt32 index = (UInt32)-1, hsBool clearSpansAfterAdd = true, hsBool doNotAddToSource = false, hsBool addToFront = false, int lod = 0 );
virtual UInt32 RefreshDISpans( UInt32 diIndex );
virtual UInt32 RefreshSpan( UInt32 srcSpanIndex );
virtual void RemoveDIMatrixSpans(UInt32 index);
virtual UInt32 AppendDIMatrixSpans(int n);
virtual UInt32 FindBoneBaseMatrix(const hsTArray<hsMatrix44>& initL2B, hsBool searchAll) const;
virtual UInt32 NewDIMatrixIndex();
void SortSpan( UInt32 index, plPipeline *pipe );
void SortVisibleSpans(const hsTArray<Int16>& visList, plPipeline* pipe);
void SortVisibleSpansPartial(const hsTArray<Int16>& visList, plPipeline* pipe);
virtual void RemoveDISpans( uint32_t index );
virtual uint32_t AppendDISpans( hsTArray<plGeometrySpan *> &spans, uint32_t index = (uint32_t)-1, hsBool clearSpansAfterAdd = true, hsBool doNotAddToSource = false, hsBool addToFront = false, int lod = 0 );
virtual uint32_t RefreshDISpans( uint32_t diIndex );
virtual uint32_t RefreshSpan( uint32_t srcSpanIndex );
virtual void RemoveDIMatrixSpans(uint32_t index);
virtual uint32_t AppendDIMatrixSpans(int n);
virtual uint32_t FindBoneBaseMatrix(const hsTArray<hsMatrix44>& initL2B, hsBool searchAll) const;
virtual uint32_t NewDIMatrixIndex();
void SortSpan( uint32_t index, plPipeline *pipe );
void SortVisibleSpans(const hsTArray<int16_t>& visList, plPipeline* pipe);
void SortVisibleSpansPartial(const hsTArray<int16_t>& visList, plPipeline* pipe);
void CleanUpGarbage( void ) { IRemoveGarbage(); }
/// Funky particle system functions
virtual UInt32 CreateParticleSystem( UInt32 maxNumEmitters, UInt32 maxNumParticles, hsGMaterial *material );
virtual void ResetParticleSystem( UInt32 index );
virtual void AssignEmitterToParticleSystem( UInt32 index, plParticleEmitter *emitter );
virtual uint32_t CreateParticleSystem( uint32_t maxNumEmitters, uint32_t maxNumParticles, hsGMaterial *material );
virtual void ResetParticleSystem( uint32_t index );
virtual void AssignEmitterToParticleSystem( uint32_t index, plParticleEmitter *emitter );
/// SceneViewer only!
void GetOrigGeometrySpans( UInt32 diIndex, hsTArray<plGeometrySpan *> &arrayToFill );
void ClearAndSetMaterialCount(UInt32 count);
void GetOrigGeometrySpans( uint32_t diIndex, hsTArray<plGeometrySpan *> &arrayToFill );
void ClearAndSetMaterialCount(uint32_t count);
};

View File

@ -79,7 +79,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr )
{
UInt32 i, j, count;
uint32_t i, j, count;
// Make sure we're optimized before we write (should be tho)
// Optimize();
@ -115,8 +115,8 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr )
s->WriteLE32( count );
for( i = 0; i < count; i++ )
{
UInt8 *icicle = (UInt8 *)fSpans[ i ], *base = (UInt8 *)fIcicles.AcquireArray();
j = (UInt32)( icicle - base ) / sizeof( plIcicle );
uint8_t *icicle = (uint8_t *)fSpans[ i ], *base = (uint8_t *)fIcicles.AcquireArray();
j = (uint32_t)( icicle - base ) / sizeof( plIcicle );
s->WriteLE32( j );
}
@ -139,7 +139,7 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr )
{
if( fSpans[i]->fProps & plSpan::kPropHasPermaLights )
{
UInt32 lcnt = fSpans[i]->fPermaLights.GetCount();
uint32_t lcnt = fSpans[i]->fPermaLights.GetCount();
s->WriteLE32(lcnt);
int j;
for( j = 0; j < lcnt; j++ )
@ -147,7 +147,7 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr )
}
if( fSpans[i]->fProps & plSpan::kPropHasPermaProjs )
{
UInt32 lcnt = fSpans[i]->fPermaProjs.GetCount();
uint32_t lcnt = fSpans[i]->fPermaProjs.GetCount();
s->WriteLE32(lcnt);
int j;
for( j = 0; j < lcnt; j++ )
@ -216,10 +216,10 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr )
// Adds a drawInterface's geometry spans to the list to be collapsed into
// buffers.
UInt32 plDrawableSpans::AddDISpans( hsTArray<plGeometrySpan *> &spans, UInt32 index )
uint32_t plDrawableSpans::AddDISpans( hsTArray<plGeometrySpan *> &spans, uint32_t index )
{
int i;
UInt32 spanIdx;
uint32_t spanIdx;
plSpan *span;
hsBounds3Ext bounds;
@ -228,7 +228,7 @@ UInt32 plDrawableSpans::AddDISpans( hsTArray<plGeometrySpan *> &spans, UInt32 i
if( fNeedCleanup )
IRemoveGarbage();
if (index == (UInt32)-1) // need a new one
if (index == (uint32_t)-1) // need a new one
{
/// Create a lookup entry
index = fDIIndices.GetCount();
@ -276,7 +276,7 @@ UInt32 plDrawableSpans::AddDISpans( hsTArray<plGeometrySpan *> &spans, UInt32 i
span->fBaseMatrix = spans[ i ]->fBaseMatrix;
span->fLocalUVWChans = spans[i]->fLocalUVWChans;
span->fMaxBoneIdx = spans[i]->fMaxBoneIdx;
span->fPenBoneIdx = (UInt16)(spans[i]->fPenBoneIdx);
span->fPenBoneIdx = (uint16_t)(spans[i]->fPenBoneIdx);
bounds = spans[ i ]->fLocalBounds;
span->fLocalBounds = bounds;
@ -382,13 +382,13 @@ static void ILogSpan(plStatusLog* statusLog, plGeometrySpan* geo, plVertexSpan*
if( geo->fProps & plGeometrySpan::kFirstInstance )
{
plGBufferCell* cell = group->GetCell(span->fVBufferIdx, span->fCellIdx);
UInt32 stride = group->GetVertexSize();
UInt32 ptr = cell->fVtxStart + span->fCellOffset * stride;
uint32_t stride = group->GetVertexSize();
uint32_t ptr = cell->fVtxStart + span->fCellOffset * stride;
statusLog->AddLineF("From obj <%s> mat <%s> size %d bytes grp=%d (%d offset)",
geo->fMaxOwner ? geo->fMaxOwner : "<unknown>",
geo->fMaterial ? geo->fMaterial->GetKey()->GetName() : "<unknown>",
geo->GetVertexSize(geo->fFormat) * geo->fNumVerts + sizeof(UInt16) * geo->fNumIndices,
geo->GetVertexSize(geo->fFormat) * geo->fNumVerts + sizeof(uint16_t) * geo->fNumIndices,
span->fGroupIdx,
ptr
);
@ -425,7 +425,7 @@ static void ILogSpan(plStatusLog* statusLog, plGeometrySpan* geo, plVertexSpan*
statusLog->AddLineF("From obj <%s> mat <%s> size %d bytes grp=%d (%d/%d/%d/%d/%d)",
geo->fMaxOwner ? geo->fMaxOwner : "<unknown>",
geo->fMaterial ? geo->fMaterial->GetKey()->GetName() : "<unknown>",
geo->GetVertexSize(geo->fFormat) * geo->fNumVerts + sizeof(UInt16) * geo->fNumIndices,
geo->GetVertexSize(geo->fFormat) * geo->fNumVerts + sizeof(uint16_t) * geo->fNumIndices,
span->fGroupIdx,
span->fVBufferIdx,
span->fCellIdx,
@ -611,10 +611,10 @@ void plDrawableSpans::IPackSourceSpans( void )
void plDrawableSpans::ISortSourceSpans( void )
{
hsTArray<UInt32> spanReorderTable, spanInverseTable;
hsTArray<uint32_t> spanReorderTable, spanInverseTable;
int i, j, idx;
plGeometrySpan *tmpSpan;
UInt32 tmpIdx;
uint32_t tmpIdx;
plSpan *tmpSpanPtr;

View File

@ -103,7 +103,7 @@ hsBool plDynaBulletMgr::IHandleShot(plBulletMsg* bull)
fCutter->SetLength(hsVector3(bull->Radius() * fScale.fX, bull->Radius() * fScale.fY, bull->Range()));
fCutter->Set(pos, up, -bull->Dir());
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(this), GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(this), GetKey());
if( bull->PartyTime() > 0 )
fPartyTime = bull->PartyTime();

View File

@ -83,7 +83,7 @@ hsBool plDynaSplot::Age(double t, hsScalar ramp, hsScalar decay, hsScalar life)
while( n-- )
{
UInt32 diff = UInt32(origUVW->fZ * atten * 255.99f);
uint32_t diff = uint32_t(origUVW->fZ * atten * 255.99f);
vtx->fDiffuse = 0xff000000
| (diff << 16)
| (diff << 8)
@ -161,7 +161,7 @@ hsBool plDynaRipple::Age(double t, hsScalar ramp, hsScalar decay, hsScalar life)
while( n-- )
{
UInt32 diff = UInt32(origUVW->fZ * atten * 255.99f);
uint32_t diff = uint32_t(origUVW->fZ * atten * 255.99f);
vtx->fDiffuse = 0xff000000
| (diff << 16)
| (diff << 8)
@ -241,7 +241,7 @@ hsBool plDynaWake::Age(double t, hsScalar ramp, hsScalar decay, hsScalar life)
while( n-- )
{
UInt32 diff = UInt32(origUVW->fZ * atten * 255.99f);
uint32_t diff = uint32_t(origUVW->fZ * atten * 255.99f);
vtx->fDiffuse = 0xff000000
| (diff << 16)
| (diff << 8)
@ -321,7 +321,7 @@ hsBool plDynaWave::Age(double t, hsScalar ramp, hsScalar decay, hsScalar life)
while( n-- )
{
UInt32 diff = UInt32(origUVW->fZ * atten * 255.99f);
uint32_t diff = uint32_t(origUVW->fZ * atten * 255.99f);
vtx->fDiffuse = 0xff000000
| (diff << 16)
| (diff << 8)

View File

@ -54,14 +54,14 @@ class plDecalVtxFormat
public:
hsPoint3 fPos;
hsVector3 fNorm;
UInt32 fDiffuse;
UInt32 fSpecular; // Not used anywhere, carried around everywhere.
uint32_t fDiffuse;
uint32_t fSpecular; // Not used anywhere, carried around everywhere.
hsPoint3 fUVW[2];
};
// UVW[0] is the currently used UVW.
// UVW[1] is for the alpha hack (when necessary).
const UInt8 kDecalVtxFormat = 0x2; // Two UVW's, otherwise vanilla.
const uint8_t kDecalVtxFormat = 0x2; // Two UVW's, otherwise vanilla.
class plDynaDecal
@ -78,11 +78,11 @@ protected:
// StartVtx and StartIdx are relative to the start of the data
// owned by this decal's span, not relative to the start of the
// underlying buffers.
UInt16 fStartVtx;
UInt16 fNumVerts;
uint16_t fStartVtx;
uint16_t fNumVerts;
UInt16 fStartIdx;
UInt16 fNumIdx;
uint16_t fStartIdx;
uint16_t fNumIdx;
double fBirth;
hsScalar fInitAtten;

View File

@ -107,8 +107,8 @@ plProfile_CreateTimerNoReset("Callback", "DynaDecal", Callback);
static plRandom sRand;
static const int kBinBlockSize = 20;
static const UInt16 kDefMaxNumVerts = 1000;
static const UInt16 kDefMaxNumIdx = kDefMaxNumVerts;
static const uint16_t kDefMaxNumVerts = 1000;
static const uint16_t kDefMaxNumIdx = kDefMaxNumVerts;
static const hsScalar kDefLifeSpan = 30.f;
static const hsScalar kDefDecayStart = kDefLifeSpan * 0.5f;
@ -211,8 +211,8 @@ void plDynaDecalMgr::Read(hsStream* stream, hsResMgr* mgr)
mgr->ReadKeyNotifyMe(stream, TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, 0, kRefPartyObject), plRefFlags::kPassiveRef);
}
fMaxNumVerts = (UInt16)(stream->ReadLE32());
fMaxNumIdx = (UInt16)(stream->ReadLE32());
fMaxNumVerts = (uint16_t)(stream->ReadLE32());
fMaxNumIdx = (uint16_t)(stream->ReadLE32());
fWaitOnEnable = stream->ReadLE32();
@ -321,7 +321,7 @@ const plPrintShape* plDynaDecalMgr::IGetPrintShape(const plKey& objKey) const
return shape;
}
const plPrintShape* plDynaDecalMgr::IGetPrintShape(plArmatureMod* avMod, UInt32 id) const
const plPrintShape* plDynaDecalMgr::IGetPrintShape(plArmatureMod* avMod, uint32_t id) const
{
const plPrintShape* shape = nil;
const plSceneObject* part = avMod->FindBone(id);
@ -348,12 +348,12 @@ hsBool plDynaDecalMgr::IWetParts(const plDynaDecalEnableMsg* enaMsg)
const plPrintShape* shape = IGetPrintShape(enaMsg->GetShapeKey());
if( shape )
{
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(shape), shape->GetKey());
IWetInfo(info, enaMsg);
}
}
else
if( enaMsg->GetID() == UInt32(-1) )
if( enaMsg->GetID() == uint32_t(-1) )
{
plArmatureMod* avMod = plArmatureMod::ConvertNoRef(enaMsg->GetArmKey()->ObjectIsLoaded());
int i;
@ -362,7 +362,7 @@ hsBool plDynaDecalMgr::IWetParts(const plDynaDecalEnableMsg* enaMsg)
const plPrintShape* shape = IGetPrintShape(avMod, fPartIDs[i]);
if( shape )
{
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(shape), shape->GetKey());
IWetInfo(info, enaMsg);
}
}
@ -374,14 +374,14 @@ hsBool plDynaDecalMgr::IWetParts(const plDynaDecalEnableMsg* enaMsg)
return true;
}
hsBool plDynaDecalMgr::IWetPart(UInt32 id, const plDynaDecalEnableMsg* enaMsg)
hsBool plDynaDecalMgr::IWetPart(uint32_t id, const plDynaDecalEnableMsg* enaMsg)
{
plArmatureMod* avMod = plArmatureMod::ConvertNoRef(enaMsg->GetArmKey()->ObjectIsLoaded());
const plPrintShape* shape = IGetPrintShape(avMod, id);
if( shape )
{
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(shape), shape->GetKey());
IWetInfo(info, enaMsg);
}
return true;
@ -484,7 +484,7 @@ hsBool plDynaDecalMgr::MsgReceive(plMessage* msg)
return true;
case kRefAvatar:
if( refMsg->GetContext() & (plRefMsg::kOnRemove|plRefMsg::kOnDestroy) )
IRemoveDecalInfo(unsigned_ptr(refMsg->GetRef()));
IRemoveDecalInfo(uintptr_t(refMsg->GetRef()));
return true;
}
}
@ -494,7 +494,7 @@ hsBool plDynaDecalMgr::MsgReceive(plMessage* msg)
//////////////////////////////////////////////////////////////////////////////////
//
void plDynaDecalMgr::INotifyActive(plDynaDecalInfo& info, const plKey& armKey, UInt32 id) const
void plDynaDecalMgr::INotifyActive(plDynaDecalInfo& info, const plKey& armKey, uint32_t id) const
{
if( !(info.fFlags & plDynaDecalInfo::kActive) )
{
@ -509,7 +509,7 @@ void plDynaDecalMgr::INotifyActive(plDynaDecalInfo& info, const plKey& armKey, U
}
}
void plDynaDecalMgr::INotifyInactive(plDynaDecalInfo& info, const plKey& armKey, UInt32 id) const
void plDynaDecalMgr::INotifyInactive(plDynaDecalInfo& info, const plKey& armKey, uint32_t id) const
{
if( info.fFlags & plDynaDecalInfo::kActive )
{
@ -537,7 +537,7 @@ plDynaDecalInfo& plDynaDecalInfo::Init(const plKey& key)
return *this;
}
plDynaDecalInfo& plDynaDecalMgr::IGetDecalInfo(unsigned_ptr id, const plKey& key)
plDynaDecalInfo& plDynaDecalMgr::IGetDecalInfo(uintptr_t id, const plKey& key)
{
plDynaDecalMap::iterator iter = fDecalMap.find(id);
if( iter == fDecalMap.end() )
@ -555,7 +555,7 @@ plDynaDecalInfo& plDynaDecalMgr::IGetDecalInfo(unsigned_ptr id, const plKey& key
return iter->second;
}
void plDynaDecalMgr::IRemoveDecalInfo(UInt32 id)
void plDynaDecalMgr::IRemoveDecalInfo(uint32_t id)
{
plDynaDecalMap::iterator iter = fDecalMap.find(id);
if( iter != fDecalMap.end() )
@ -613,7 +613,7 @@ hsScalar plDynaDecalMgr::IHowWet(plDynaDecalInfo& info, double t) const
//////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////
plAuxSpan* plDynaDecalMgr::IGetAuxSpan(plDrawableSpans* targ, int iSpan, hsGMaterial* mat, UInt16 numVerts, UInt16 numIdx)
plAuxSpan* plDynaDecalMgr::IGetAuxSpan(plDrawableSpans* targ, int iSpan, hsGMaterial* mat, uint16_t numVerts, uint16_t numIdx)
{
// Some of this code just assumes you get the number of verts you ask for.
// Which was causing errors when you asked for more than the max and didn't
@ -718,7 +718,7 @@ void plDynaDecalMgr::InitAuxSpans()
}
}
void plDynaDecalMgr::IAllocAuxSpan(plAuxSpan* aux, UInt32 maxNumVerts, UInt32 maxNumIdx)
void plDynaDecalMgr::IAllocAuxSpan(plAuxSpan* aux, uint32_t maxNumVerts, uint32_t maxNumIdx)
{
int iGrp = fGroups.GetCount();
plGBufferGroup* grp = TRACKED_NEW plGBufferGroup(kDecalVtxFormat, true, false);
@ -735,7 +735,7 @@ void plDynaDecalMgr::IAllocAuxSpan(plAuxSpan* aux, UInt32 maxNumVerts, UInt32 ma
aux->fVStartIdx = grp->GetVertStartFromCell(aux->fVBufferIdx, aux->fCellIdx, aux->fCellOffset);
aux->fVLength = 0;
UInt16* dataPtr = nil;
uint16_t* dataPtr = nil;
grp->ReserveIndexStorage(maxNumIdx, &aux->fIBufferIdx, &aux->fIStartIdx, &dataPtr);
aux->fIStartIdx;
@ -816,13 +816,13 @@ hsGMaterial* plDynaDecalMgr::ISetAuxMaterial(plAuxSpan* aux, hsGMaterial* mat, h
//////////////////////////////////////////////////////////////////////////////////
plDynaDecal* plDynaDecalMgr::IInitDecal(plAuxSpan* aux, double t, UInt16 numVerts, UInt16 numIdx)
plDynaDecal* plDynaDecalMgr::IInitDecal(plAuxSpan* aux, double t, uint16_t numVerts, uint16_t numIdx)
{
int idx = INewDecal();
fDecals[idx]->fStartVtx = (UInt16)(aux->fVStartIdx + aux->fVLength);
fDecals[idx]->fStartVtx = (uint16_t)(aux->fVStartIdx + aux->fVLength);
fDecals[idx]->fNumVerts = numVerts;
fDecals[idx]->fStartIdx = (UInt16)(aux->fIStartIdx + aux->fILength);
fDecals[idx]->fStartIdx = (uint16_t)(aux->fIStartIdx + aux->fILength);
fDecals[idx]->fNumIdx = numIdx;
fDecals[idx]->fBirth = t;
@ -931,7 +931,7 @@ void plDynaDecalMgr::IUpdateDecals(double t)
//////////////////////////////////////////////////////////////////////////////////
void plDynaDecalMgr::ICountIncoming(hsTArray<plCutoutPoly>& src, UInt16& numVerts, UInt16& numIdx) const
void plDynaDecalMgr::ICountIncoming(hsTArray<plCutoutPoly>& src, uint16_t& numVerts, uint16_t& numIdx) const
{
numVerts = 0;
numIdx = 0;
@ -952,7 +952,7 @@ plDecalVtxFormat* plDynaDecalMgr::IGetBaseVtxPtr(const plAuxSpan* auxSpan) const
plGBufferGroup* grp = auxSpan->fGroup;
plGBufferCell* cell = grp->GetCell(auxSpan->fVBufferIdx, auxSpan->fCellIdx);
UInt8* ptr = grp->GetVertBufferData(auxSpan->fVBufferIdx);
uint8_t* ptr = grp->GetVertBufferData(auxSpan->fVBufferIdx);
ptr += cell->fVtxStart + auxSpan->fCellOffset;
@ -960,7 +960,7 @@ plDecalVtxFormat* plDynaDecalMgr::IGetBaseVtxPtr(const plAuxSpan* auxSpan) const
}
UInt16* plDynaDecalMgr::IGetBaseIdxPtr(const plAuxSpan* auxSpan) const
uint16_t* plDynaDecalMgr::IGetBaseIdxPtr(const plAuxSpan* auxSpan) const
{
plGBufferGroup* grp = auxSpan->fGroup;
@ -978,7 +978,7 @@ hsBool plDynaDecalMgr::IConvertFlatGrid(plAuxSpan* auxSpan,
hsPoint3* origPos = &auxSpan->fOrigPos[decal->fStartVtx];
hsPoint3* origUVW = &auxSpan->fOrigUVW[decal->fStartVtx];
UInt32 initColor = decal->fFlags & plDynaDecal::kAttenColor
uint32_t initColor = decal->fFlags & plDynaDecal::kAttenColor
? 0xff000000
: 0x00ffffff;
int iv;
@ -1001,12 +1001,12 @@ hsBool plDynaDecalMgr::IConvertFlatGrid(plAuxSpan* auxSpan,
origUVW++;
}
UInt16* idx = IGetBaseIdxPtr(auxSpan);
uint16_t* idx = IGetBaseIdxPtr(auxSpan);
idx += decal->fStartIdx;
hsAssert(grid.fIdx.GetCount() == decal->fNumIdx, "Mismatch on dynamic indices");
UInt16 base = decal->fStartVtx;
uint16_t base = decal->fStartVtx;
int ii;
for( ii = 0; ii < grid.fIdx.GetCount(); ii++ )
{
@ -1137,14 +1137,14 @@ hsBool plDynaDecalMgr::IConvertPolysAlpha(plAuxSpan* auxSpan,
}
hsAssert(vtx <= IGetBaseVtxPtr(auxSpan) + auxSpan->fVBufferLimit, "Vtx pointer gone wild");
UInt16* idx = IGetBaseIdxPtr(auxSpan);
uint16_t* idx = IGetBaseIdxPtr(auxSpan);
idx += decal->fStartIdx;
UInt16 base = decal->fStartVtx;
uint16_t base = decal->fStartVtx;
int j;
for( j = 0; j < src.GetCount(); j++ )
{
UInt16 next = base+1;
uint16_t next = base+1;
int k;
for( k = 2; k < src[j].fVerts.GetCount(); k++ )
{
@ -1230,14 +1230,14 @@ hsBool plDynaDecalMgr::IConvertPolysColor(plAuxSpan* auxSpan,
}
hsAssert(vtx <= IGetBaseVtxPtr(auxSpan) + auxSpan->fVBufferLimit, "Vtx pointer gone wild");
UInt16* idx = IGetBaseIdxPtr(auxSpan);
uint16_t* idx = IGetBaseIdxPtr(auxSpan);
idx += decal->fStartIdx;
UInt16 base = decal->fStartVtx;
uint16_t base = decal->fStartVtx;
int j;
for( j = 0; j < src.GetCount(); j++ )
{
UInt16 next = base+1;
uint16_t next = base+1;
int k;
for( k = 2; k < src[j].fVerts.GetCount(); k++ )
{
@ -1312,14 +1312,14 @@ hsBool plDynaDecalMgr::IConvertPolysVS(plAuxSpan* auxSpan,
}
hsAssert(vtx <= IGetBaseVtxPtr(auxSpan) + auxSpan->fVBufferLimit, "Vtx pointer gone wild");
UInt16* idx = IGetBaseIdxPtr(auxSpan);
uint16_t* idx = IGetBaseIdxPtr(auxSpan);
idx += decal->fStartIdx;
UInt16 base = decal->fStartVtx;
uint16_t base = decal->fStartVtx;
int j;
for( j = 0; j < src.GetCount(); j++ )
{
UInt16 next = base+1;
uint16_t next = base+1;
int k;
for( k = 2; k < src[j].fVerts.GetCount(); k++ )
{
@ -1371,7 +1371,7 @@ hsBool plDynaDecalMgr::IHitTestPolys(hsTArray<plCutoutPoly>& src) const
hsBool plDynaDecalMgr::IProcessPolys(plDrawableSpans* targ, int iSpan, double t, hsTArray<plCutoutPoly>& src)
{
// Figure out how many verts and idxs are coming in.
UInt16 numVerts, numIdx;
uint16_t numVerts, numIdx;
ICountIncoming(src, numVerts, numIdx);
if( !numVerts )
return false;

View File

@ -99,12 +99,12 @@ public:
hsPoint3 fLastPos;
double fWetTime;
hsScalar fWetLength;
UInt32 fFlags;
uint32_t fFlags;
plDynaDecalInfo& Init(const plKey& key);
};
typedef std::map< unsigned_ptr, plDynaDecalInfo, std::less<unsigned_ptr> > plDynaDecalMap;
typedef std::map< uintptr_t, plDynaDecalInfo, std::less<uintptr_t> > plDynaDecalMap;
// plDynaDecalMgr
// Primary responsibilities:
@ -152,10 +152,10 @@ protected:
hsScalar fPartyTime;
UInt16 fMaxNumVerts;
UInt16 fMaxNumIdx;
uint16_t fMaxNumVerts;
uint16_t fMaxNumIdx;
UInt32 fWaitOnEnable;
uint32_t fWaitOnEnable;
hsScalar fWetLength;
hsScalar fRampEnd;
@ -176,37 +176,37 @@ protected:
hsScalar fMaxDepth;
hsScalar fMaxDepthRange;
hsTArray<UInt32> fPartIDs;
hsTArray<uint32_t> fPartIDs;
hsTArray<plKey> fNotifies;
const plPrintShape* IGetPrintShape(const plKey& objKey) const;
const plPrintShape* IGetPrintShape(plArmatureMod* avMod, UInt32 id) const;
const plPrintShape* IGetPrintShape(plArmatureMod* avMod, uint32_t id) const;
virtual hsBool IHandleEnableMsg(const plDynaDecalEnableMsg* enaMsg);
void INotifyActive(plDynaDecalInfo& info, const plKey& armKey, UInt32 id) const;
void INotifyInactive(plDynaDecalInfo& info, const plKey& armKey, UInt32 id) const;
void INotifyActive(plDynaDecalInfo& info, const plKey& armKey, uint32_t id) const;
void INotifyInactive(plDynaDecalInfo& info, const plKey& armKey, uint32_t id) const;
hsBool IWetParts(const plDynaDecalEnableMsg* enaMsg);
hsBool IWetPart(UInt32 id, const plDynaDecalEnableMsg* enaMsg);
hsBool IWetPart(uint32_t id, const plDynaDecalEnableMsg* enaMsg);
void IWetInfo(plDynaDecalInfo& info, const plDynaDecalEnableMsg* enaMsg) const;
hsScalar IHowWet(plDynaDecalInfo& info, double t) const;
plDynaDecalInfo& IGetDecalInfo(unsigned_ptr id, const plKey& key);
void IRemoveDecalInfo(UInt32 id);
plDynaDecalInfo& IGetDecalInfo(uintptr_t id, const plKey& key);
void IRemoveDecalInfo(uint32_t id);
void IRemoveDecalInfos(const plKey& key);
hsGMaterial* ISetAuxMaterial(plAuxSpan* aux, hsGMaterial* mat, hsBool rtLit);
void IAllocAuxSpan(plAuxSpan* aux, UInt32 maxNumVerts, UInt32 maxNumIdx);
plAuxSpan* IGetAuxSpan(plDrawableSpans* targ, int iSpan, hsGMaterial* mat, UInt16 numVerts, UInt16 numIdx);
void IAllocAuxSpan(plAuxSpan* aux, uint32_t maxNumVerts, uint32_t maxNumIdx);
plAuxSpan* IGetAuxSpan(plDrawableSpans* targ, int iSpan, hsGMaterial* mat, uint16_t numVerts, uint16_t numIdx);
hsBool IMakeAuxRefs(plPipeline* pipe);
UInt16* IGetBaseIdxPtr(const plAuxSpan* auxSpan) const;
uint16_t* IGetBaseIdxPtr(const plAuxSpan* auxSpan) const;
plDecalVtxFormat* IGetBaseVtxPtr(const plAuxSpan* auxSpan) const;
virtual int INewDecal() = 0;
plDynaDecal* IInitDecal(plAuxSpan* aux, double t, UInt16 numVerts, UInt16 numIdx);
plDynaDecal* IInitDecal(plAuxSpan* aux, double t, uint16_t numVerts, uint16_t numIdx);
void IKillDecal(int i);
void IUpdateDecals(double t);
void ICountIncoming(hsTArray<plCutoutPoly>& src, UInt16& numVerts, UInt16& numIdx) const;
void ICountIncoming(hsTArray<plCutoutPoly>& src, uint16_t& numVerts, uint16_t& numIdx) const;
hsBool IConvertPolysColor(plAuxSpan* auxSpan, plDynaDecal* decal, hsTArray<plCutoutPoly>& src);
hsBool IConvertPolysAlpha(plAuxSpan* auxSpan, plDynaDecal* decal, hsTArray<plCutoutPoly>& src);
hsBool IConvertPolysVS(plAuxSpan* auxSpan, plDynaDecal* decal, hsTArray<plCutoutPoly>& src);
@ -277,7 +277,7 @@ public:
const plMipmap* GetMipmap() const;
void AddNotify(const plKey& k) { fNotifies.Append(k); }
UInt32 GetNumNotifies() const { return fNotifies.GetCount(); }
uint32_t GetNumNotifies() const { return fNotifies.GetCount(); }
const plKey& GetNotify(int i) const { return fNotifies[i]; }
static void SetDisableAccumulate(hsBool on) { fDisableAccumulate = on; }

View File

@ -63,8 +63,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plMath/plRandom.h"
static plRandom sRand;
static const UInt32 kNumPrintIDs = 2;
static const UInt32 kPrintIDs[kNumPrintIDs] =
static const uint32_t kNumPrintIDs = 2;
static const uint32_t kPrintIDs[kNumPrintIDs] =
{
plAvBrainHuman::RFootPrint,
plAvBrainHuman::LFootPrint
@ -109,13 +109,13 @@ hsBool plDynaFootMgr::MsgReceive(plMessage* msg)
plAvatarFootMsg* footMsg = plAvatarFootMsg::ConvertNoRef(msg);
if( footMsg )
{
UInt32 id = footMsg->IsLeft() ? plAvBrainHuman::LFootPrint : plAvBrainHuman::RFootPrint;
uint32_t id = footMsg->IsLeft() ? plAvBrainHuman::LFootPrint : plAvBrainHuman::RFootPrint;
plArmatureMod* armMod = footMsg->GetArmature();
const plPrintShape* shape = IGetPrintShape(armMod, id);
if( shape )
{
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(shape), shape->GetKey());
if( IPrintFromShape(shape, footMsg->IsLeft()) )
{
INotifyActive(info, armMod->GetKey(), id);
@ -138,7 +138,7 @@ hsBool plDynaFootMgr::IPrintFromShape(const plPrintShape* shape, hsBool flip)
if( shape )
{
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(shape), shape->GetKey());
double secs = hsTimer::GetSysSeconds();
hsScalar wetness = IHowWet(info, secs);

View File

@ -55,8 +55,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAvatar/plAvBrainHuman.h"
#include "plAvatar/plArmatureMod.h"
static const UInt32 kNumPrintIDs = 2;
static const UInt32 kPrintIDs[kNumPrintIDs] =
static const uint32_t kNumPrintIDs = 2;
static const uint32_t kPrintIDs[kNumPrintIDs] =
{
plAvBrainHuman::RFootPrint,
plAvBrainHuman::LFootPrint
@ -94,7 +94,7 @@ hsBool plDynaPuddleMgr::MsgReceive(plMessage* msg)
const plPrintShape* shape = IGetPrintShape(armMod, fPartIDs[i]);
if( shape )
{
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(shape), shape->GetKey());
if( IRippleFromShape(shape, true) )
{
INotifyActive(info, armMod->GetKey(), fPartIDs[i]);

View File

@ -66,8 +66,8 @@ static plRandom sRand;
#include "plTweak.h"
static const UInt32 kNumPrintIDs = 5;
static const UInt32 kPrintIDs[kNumPrintIDs] =
static const uint32_t kNumPrintIDs = 5;
static const uint32_t kPrintIDs[kNumPrintIDs] =
{
plAvBrainHuman::TrunkPrint,
plAvBrainHuman::LHandPrint,
@ -146,7 +146,7 @@ hsBool plDynaRippleMgr::MsgReceive(plMessage* msg)
const plPrintShape* shape = IGetPrintShape(armMsg->fArmature, fPartIDs[i]);
if( shape )
{
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(shape), shape->GetKey());
if( IRippleFromShape(shape, false) )
{
INotifyActive(info, armMsg->fArmature->GetKey(), fPartIDs[i]);
@ -182,7 +182,7 @@ hsBool plDynaRippleMgr::IRippleFromShape(const plPrintShape* shape, hsBool force
hsBool retVal = false;
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(shape), shape->GetKey());
const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld();

View File

@ -172,7 +172,7 @@ hsBool plDynaRippleVSMgr::IRippleFromShape(const plPrintShape* shape, hsBool for
hsBool retVal = false;
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(shape), shape->GetKey());
const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld();

View File

@ -56,7 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plMath/plRandom.h"
static const UInt32 kNumPrintIDs = 0;
static const uint32_t kNumPrintIDs = 0;
static plRandom sRand;
@ -124,7 +124,7 @@ hsBool plDynaTorpedoMgr::IHandleShot(plBulletMsg* bull)
fCutter->SetLength(hsVector3(scaleX, scaleY, bull->Range()));
fCutter->Set(pos, up, -bull->Dir());
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(this), GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(this), GetKey());
if( bull->PartyTime() > 0 )
fPartyTime = bull->PartyTime();

View File

@ -173,7 +173,7 @@ hsBool plDynaWakeMgr::IRippleFromShape(const plPrintShape* shape, hsBool force)
hsBool retVal = false;
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
plDynaDecalInfo& info = IGetDecalInfo(uintptr_t(shape), shape->GetKey());
const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld();

View File

@ -123,10 +123,10 @@ hsBool plGeoSpanDice::IHalf(plGeometrySpan* src, hsTArray<plGeometrySpan*>& out,
hsScalar midPoint = src->fLocalBounds.GetCenter()[iAxis];
hsTArray<UInt32> loTris;
hsTArray<UInt32> hiTris;
hsTArray<uint32_t> loTris;
hsTArray<uint32_t> hiTris;
UInt16* indexData = src->fIndexData;
uint16_t* indexData = src->fIndexData;
int numTris = src->fNumIndices / 3;
@ -189,21 +189,21 @@ int plGeoSpanDice::ISelectAxis(int exclAxis, plGeometrySpan* src) const
return iAxis;
}
plGeometrySpan* plGeoSpanDice::IExtractTris(plGeometrySpan* src, hsTArray<UInt32>& tris) const
plGeometrySpan* plGeoSpanDice::IExtractTris(plGeometrySpan* src, hsTArray<uint32_t>& tris) const
{
// First off, find out how many and which vers we're talking here.
// Easiest way is while we're building the LUTs we'll want later anyway.
hsTArray<Int16> fwdLUT;
hsTArray<int16_t> fwdLUT;
fwdLUT.SetCount(src->fNumVerts);
memset(fwdLUT.AcquireArray(), -1, src->fNumVerts * sizeof(*fwdLUT.AcquireArray()));
hsTArray<UInt16> bckLUT;
hsTArray<uint16_t> bckLUT;
bckLUT.SetCount(0);
int i;
for( i = 0; i < tris.GetCount(); i++ )
{
UInt16* idx = src->fIndexData + tris[i] * 3;
uint16_t* idx = src->fIndexData + tris[i] * 3;
if( fwdLUT[*idx] < 0 )
{
@ -234,7 +234,7 @@ plGeometrySpan* plGeoSpanDice::IExtractTris(plGeometrySpan* src, hsTArray<UInt32
plGeometrySpan* dst = IAllocSpace(src, numVerts, numTris);
// Okay, set the index data.
UInt16* idxTrav = dst->fIndexData;
uint16_t* idxTrav = dst->fIndexData;
for( i = 0; i < tris.GetCount(); i++ )
{
*idxTrav++ = fwdLUT[src->fIndexData[ tris[i] * 3 + 0] ];
@ -248,7 +248,7 @@ plGeometrySpan* plGeoSpanDice::IExtractTris(plGeometrySpan* src, hsTArray<UInt32
hsBounds3Ext localBnd;
localBnd.MakeEmpty();
UInt8* vtxTrav = dst->fVertexData;
uint8_t* vtxTrav = dst->fVertexData;
for( i = 0; i < numVerts; i++ )
{
memcpy(vtxTrav, src->fVertexData + bckLUT[i] * stride, stride);
@ -308,10 +308,10 @@ plGeometrySpan* plGeoSpanDice::IAllocSpace(plGeometrySpan* src, int numVerts, in
int stride = src->GetVertexSize(src->fFormat);
dst->fNumIndices = numTris * 3;
dst->fIndexData = TRACKED_NEW UInt16[dst->fNumIndices];
dst->fIndexData = TRACKED_NEW uint16_t[dst->fNumIndices];
dst->fNumVerts = numVerts;
dst->fVertexData = TRACKED_NEW UInt8[numVerts * stride];
dst->fVertexData = TRACKED_NEW uint8_t[numVerts * stride];
if( src->fMultColor )
{
@ -323,11 +323,11 @@ plGeometrySpan* plGeoSpanDice::IAllocSpace(plGeometrySpan* src, int numVerts, in
}
if( src->fDiffuseRGBA )
{
dst->fDiffuseRGBA = TRACKED_NEW UInt32[numVerts];
dst->fDiffuseRGBA = TRACKED_NEW uint32_t[numVerts];
}
if( src->fSpecularRGBA )
{
dst->fSpecularRGBA = TRACKED_NEW UInt32[numVerts];
dst->fSpecularRGBA = TRACKED_NEW uint32_t[numVerts];
}
return dst;

View File

@ -51,13 +51,13 @@ class plGeometrySpan;
class plGeoSpanDice
{
protected:
UInt32 fMinFaces;
UInt32 fMaxFaces;
uint32_t fMinFaces;
uint32_t fMaxFaces;
hsPoint3 fMaxSize;
hsBool INeedSplitting(plGeometrySpan* src) const;
plGeometrySpan* IAllocSpace(plGeometrySpan* src, int numVerts, int numTris) const;
plGeometrySpan* IExtractTris(plGeometrySpan* src, hsTArray<UInt32>& tris) const;
plGeometrySpan* IExtractTris(plGeometrySpan* src, hsTArray<uint32_t>& tris) const;
int ISelectAxis(int exclAxis, plGeometrySpan* src) const;
hsBool IHalf(plGeometrySpan* src, hsTArray<plGeometrySpan*>& out, int exclAxis=0) const;

View File

@ -60,7 +60,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//// Static Data /////////////////////////////////////////////////////////////
hsBitVector plGeometrySpan::fInstanceGroupIDFlags;
UInt32 plGeometrySpan::fHighestReadInstanceGroup = 0;
uint32_t plGeometrySpan::fHighestReadInstanceGroup = 0;
hsTArray<hsTArray<plGeometrySpan *> *> plGeometrySpan::fInstanceGroups;
@ -108,7 +108,7 @@ void plGeometrySpan::IClearMembers( void )
fSpecularRGBA = nil;
fInstanceRefs = nil;
fInstanceGroupID = kNoGroupID;
fSpanRefIndex = (UInt32)-1;
fSpanRefIndex = (uint32_t)-1;
fLocalToOBB.Reset();
fOBBToLocal.Reset();
@ -216,11 +216,11 @@ void plGeometrySpan::IUnShareData()
{
if( fVertexData )
{
UInt8* oldVtxData = fVertexData;
uint8_t* oldVtxData = fVertexData;
UInt32 size = GetVertexSize( fFormat );
uint32_t size = GetVertexSize( fFormat );
fVertexData = TRACKED_NEW UInt8[ size * fNumVerts ];
fVertexData = TRACKED_NEW uint8_t[ size * fNumVerts ];
memcpy( fVertexData, oldVtxData, size * fNumVerts );
}
@ -303,9 +303,9 @@ void plGeometrySpan::UnInstance()
// Static function that allocates a new groupID by finding an empty slot in
// the bitVector, then marking it as used and returning that bit #
UInt32 plGeometrySpan::IAllocateNewGroupID( void )
uint32_t plGeometrySpan::IAllocateNewGroupID( void )
{
UInt32 id;
uint32_t id;
for( id = 0; id < fInstanceGroupIDFlags.GetSize(); id++ )
@ -321,7 +321,7 @@ UInt32 plGeometrySpan::IAllocateNewGroupID( void )
//// IClearGroupID ///////////////////////////////////////////////////////////
// Done with this groupID, so clear the entry in the bit table.
void plGeometrySpan::IClearGroupID( UInt32 groupID )
void plGeometrySpan::IClearGroupID( uint32_t groupID )
{
fInstanceGroupIDFlags.ClearBit( groupID - 1 );
}
@ -340,7 +340,7 @@ void plGeometrySpan::IClearGroupID( UInt32 groupID )
// we remove an entry, we decrement this ID until we hit a used pointer again;
// if we don't find one, we reset the array.
hsTArray<plGeometrySpan *> *plGeometrySpan::IGetInstanceGroup( UInt32 groupID, UInt32 expectedCount )
hsTArray<plGeometrySpan *> *plGeometrySpan::IGetInstanceGroup( uint32_t groupID, uint32_t expectedCount )
{
hsTArray<plGeometrySpan *> *array;
@ -416,24 +416,24 @@ void plGeometrySpan::IDuplicateUniqueData( const plGeometrySpan *source )
if( source->fIndexData != nil )
{
fIndexData = TRACKED_NEW UInt16[ fNumIndices ];
memcpy( fIndexData, source->fIndexData, sizeof( UInt16 ) * fNumIndices );
fIndexData = TRACKED_NEW uint16_t[ fNumIndices ];
memcpy( fIndexData, source->fIndexData, sizeof( uint16_t ) * fNumIndices );
}
else
fIndexData = nil;
if( source->fDiffuseRGBA )
{
fDiffuseRGBA = TRACKED_NEW UInt32[ fNumVerts ];
memcpy( fDiffuseRGBA, source->fDiffuseRGBA, sizeof( UInt32 ) * fNumVerts );
fDiffuseRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
memcpy( fDiffuseRGBA, source->fDiffuseRGBA, sizeof( uint32_t ) * fNumVerts );
}
else
fDiffuseRGBA = nil;
if( source->fSpecularRGBA )
{
fSpecularRGBA = TRACKED_NEW UInt32[ fNumVerts ];
memcpy( fSpecularRGBA, source->fSpecularRGBA, sizeof( UInt32 ) * fNumVerts );
fSpecularRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
memcpy( fSpecularRGBA, source->fSpecularRGBA, sizeof( uint32_t ) * fNumVerts );
}
else
fSpecularRGBA = nil;
@ -447,7 +447,7 @@ void plGeometrySpan::IDuplicateUniqueData( const plGeometrySpan *source )
void plGeometrySpan::CopyFrom( const plGeometrySpan *source )
{
UInt32 size;
uint32_t size;
// Just to make sure
@ -462,7 +462,7 @@ void plGeometrySpan::CopyFrom( const plGeometrySpan *source )
{
size = GetVertexSize( fFormat );
fVertexData = TRACKED_NEW UInt8[ size * fNumVerts ];
fVertexData = TRACKED_NEW uint8_t[ size * fNumVerts ];
memcpy( fVertexData, source->fVertexData, size * fNumVerts );
}
else
@ -493,7 +493,7 @@ void plGeometrySpan::CopyFrom( const plGeometrySpan *source )
void plGeometrySpan::Read( hsStream *stream )
{
UInt32 size, i;
uint32_t size, i;
hsAssert( !fCreating, "Cannot read geometry span while creating" );
@ -543,7 +543,7 @@ void plGeometrySpan::Read( hsStream *stream )
{
size = GetVertexSize( fFormat );
fVertexData = TRACKED_NEW UInt8[ size * fNumVerts ];
fVertexData = TRACKED_NEW uint8_t[ size * fNumVerts ];
stream->Read( size * fNumVerts, fVertexData );
fMultColor = TRACKED_NEW hsColorRGBA[ fNumVerts ];
@ -554,8 +554,8 @@ void plGeometrySpan::Read( hsStream *stream )
fAddColor[ i ].Read( stream );
}
fDiffuseRGBA = TRACKED_NEW UInt32[ fNumVerts ];
fSpecularRGBA = TRACKED_NEW UInt32[ fNumVerts ];
fDiffuseRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
fSpecularRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
stream->ReadLE32( fNumVerts, fDiffuseRGBA );
stream->ReadLE32( fNumVerts, fSpecularRGBA );
}
@ -570,7 +570,7 @@ void plGeometrySpan::Read( hsStream *stream )
if( fNumIndices > 0 )
{
fIndexData = TRACKED_NEW UInt16[ fNumIndices ];
fIndexData = TRACKED_NEW uint16_t[ fNumIndices ];
stream->ReadLE16( fNumIndices, fIndexData );
}
else
@ -580,7 +580,7 @@ void plGeometrySpan::Read( hsStream *stream )
fInstanceGroupID = stream->ReadLE32();
if( fInstanceGroupID != kNoGroupID )
{
UInt32 count = stream->ReadLE32();
uint32_t count = stream->ReadLE32();
fInstanceRefs = IGetInstanceGroup( fInstanceGroupID, count );
fInstanceRefs->Append( this );
@ -592,7 +592,7 @@ void plGeometrySpan::Read( hsStream *stream )
void plGeometrySpan::Write( hsStream *stream )
{
UInt32 size, i;
uint32_t size, i;
hsAssert( !fCreating, "Cannot write geometry span while creating" );
@ -611,7 +611,7 @@ void plGeometrySpan::Write( hsStream *stream )
stream->WriteByte( fNumMatrices );
stream->WriteLE16(fLocalUVWChans);
stream->WriteLE16(fMaxBoneIdx);
stream->WriteLE16((UInt16)fPenBoneIdx);
stream->WriteLE16((uint16_t)fPenBoneIdx);
stream->WriteLEScalar(fMinDist);
stream->WriteLEScalar(fMaxDist);
@ -663,9 +663,9 @@ void plGeometrySpan::Write( hsStream *stream )
//// GetVertexSize ///////////////////////////////////////////////////////////
UInt32 plGeometrySpan::GetVertexSize( UInt8 format )
uint32_t plGeometrySpan::GetVertexSize( uint8_t format )
{
UInt32 size;
uint32_t size;
size = sizeof( float ) * ( 3 + 3 ); // pos + normal
@ -683,14 +683,14 @@ UInt32 plGeometrySpan::GetVertexSize( UInt8 format )
default: hsAssert( false, "Bad weight count in GetVertexSize()" );
}
if( format & kSkinIndices )
size += sizeof(UInt32);
size += sizeof(uint32_t);
return size;
}
//// BeginCreate //////////////////////////////////////////////////////////////
void plGeometrySpan::BeginCreate( hsGMaterial *material, const hsMatrix44 &l2wMatrix, UInt8 format )
void plGeometrySpan::BeginCreate( hsGMaterial *material, const hsMatrix44 &l2wMatrix, uint8_t format )
{
fCreating = true;
@ -705,8 +705,8 @@ void plGeometrySpan::BeginCreate( hsGMaterial *material, const hsMatrix44 &l2
// that UV channel (and all above them) are not used. The array of pointers
// MUST be of size kMaxNumUVChannels.
UInt16 plGeometrySpan::AddVertex( hsPoint3 *position, hsPoint3 *normal, hsColorRGBA& multColor, hsColorRGBA& addColor,
hsPoint3 **uvPtrArray, float weight1, float weight2, float weight3, UInt32 indices )
uint16_t plGeometrySpan::AddVertex( hsPoint3 *position, hsPoint3 *normal, hsColorRGBA& multColor, hsColorRGBA& addColor,
hsPoint3 **uvPtrArray, float weight1, float weight2, float weight3, uint32_t indices )
{
AddVertex( position, normal, 0, 0, uvPtrArray, weight1, weight2, weight3, indices );
@ -720,8 +720,8 @@ UInt16 plGeometrySpan::AddVertex( hsPoint3 *position, hsPoint3 *normal, hsColor
return idx;
}
UInt16 plGeometrySpan::AddVertex( hsPoint3 *position, hsPoint3 *normal, UInt32 hexColor, UInt32 specularColor,
hsPoint3 **uvPtrArray, float weight1, float weight2, float weight3, UInt32 indices )
uint16_t plGeometrySpan::AddVertex( hsPoint3 *position, hsPoint3 *normal, uint32_t hexColor, uint32_t specularColor,
hsPoint3 **uvPtrArray, float weight1, float weight2, float weight3, uint32_t indices )
{
TempVertex vert;
int i, numWeights;
@ -782,14 +782,14 @@ UInt16 plGeometrySpan::AddVertex( hsPoint3 *position, hsPoint3 *normal, UInt32
//// AddIndex Variations //////////////////////////////////////////////////////
void plGeometrySpan::AddIndex( UInt16 index )
void plGeometrySpan::AddIndex( uint16_t index )
{
hsAssert( fCreating, "Calling AddIndex() on a non-creating plGeometrySpan!" );
fIndexAccum.Append( index );
}
void plGeometrySpan::AddTriIndices( UInt16 index1, UInt16 index2, UInt16 index3 )
void plGeometrySpan::AddTriIndices( uint16_t index1, uint16_t index2, uint16_t index3 )
{
hsAssert( fCreating, "Calling AddTriIndices() on a non-creating plGeometrySpan!" );
@ -800,7 +800,7 @@ void plGeometrySpan::AddTriIndices( UInt16 index1, UInt16 index2, UInt16 inde
//// AddTriangle //////////////////////////////////////////////////////////////
void plGeometrySpan::AddTriangle( hsPoint3 *vert1, hsPoint3 *vert2, hsPoint3 *vert3, UInt32 color )
void plGeometrySpan::AddTriangle( hsPoint3 *vert1, hsPoint3 *vert2, hsPoint3 *vert3, uint32_t color )
{
hsVector3 twoTo1, twoTo3, normal;
hsPoint3 normalPt;
@ -823,12 +823,12 @@ void plGeometrySpan::AddTriangle( hsPoint3 *vert1, hsPoint3 *vert2, hsPoint3
//// AddVertexArray ///////////////////////////////////////////////////////////
void plGeometrySpan::AddVertexArray( UInt32 count, hsPoint3 *positions, hsVector3 *normals, UInt32 *colors, hsPoint3* uvws, int uvwsPerVtx )
void plGeometrySpan::AddVertexArray( uint32_t count, hsPoint3 *positions, hsVector3 *normals, uint32_t *colors, hsPoint3* uvws, int uvwsPerVtx )
{
hsAssert( fCreating, "Calling AddTriIndices() on a non-creating plGeometrySpan!" );
UInt32 i, dest;
uint32_t i, dest;
// This test actually does work, even if it's bad form...
hsAssert( GetNumUVs() == uvwsPerVtx, "Calling wrong AddVertex() for plGeometrySpan format" );
@ -866,12 +866,12 @@ void plGeometrySpan::AddVertexArray( UInt32 count, hsPoint3 *positions, hsVec
//// AddIndexArray ////////////////////////////////////////////////////////////
void plGeometrySpan::AddIndexArray( UInt32 count, UInt16 *indices )
void plGeometrySpan::AddIndexArray( uint32_t count, uint16_t *indices )
{
hsAssert( fCreating, "Calling AddTriIndices() on a non-creating plGeometrySpan!" );
UInt32 i, dest;
uint32_t i, dest;
dest = fIndexAccum.GetCount();
@ -885,8 +885,8 @@ void plGeometrySpan::AddIndexArray( UInt32 count, UInt16 *indices )
void plGeometrySpan::EndCreate( void )
{
hsBounds3Ext bounds;
UInt32 i, size;
UInt8 *tempPtr;
uint32_t i, size;
uint8_t *tempPtr;
hsAssert( fCreating, "Calling EndCreate() on a non-creating plGeometrySpan!" );
@ -918,7 +918,7 @@ void plGeometrySpan::EndCreate( void )
delete [] fVertexData;
fNumVerts = fVertAccum.GetCount();
fVertexData = TRACKED_NEW UInt8[ size * fNumVerts ];
fVertexData = TRACKED_NEW uint8_t[ size * fNumVerts ];
delete [] fMultColor;
fMultColor = TRACKED_NEW hsColorRGBA[ fNumVerts ];
@ -928,8 +928,8 @@ void plGeometrySpan::EndCreate( void )
delete [] fDiffuseRGBA;
delete [] fSpecularRGBA;
fDiffuseRGBA = TRACKED_NEW UInt32[ fNumVerts ];
fSpecularRGBA = TRACKED_NEW UInt32[ fNumVerts ];
fDiffuseRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
fSpecularRGBA = TRACKED_NEW uint32_t[ fNumVerts ];
}
else
fNumVerts = fVertAccum.GetCount();
@ -963,8 +963,8 @@ void plGeometrySpan::EndCreate( void )
tempPtr += numWeights * sizeof(float);
if( fFormat & kSkinIndices )
{
memcpy( tempPtr, &fVertAccum[ i ].fIndices, sizeof(UInt32) );
tempPtr += sizeof(UInt32);
memcpy( tempPtr, &fVertAccum[ i ].fIndices, sizeof(uint32_t) );
tempPtr += sizeof(uint32_t);
}
}
@ -1000,7 +1000,7 @@ void plGeometrySpan::EndCreate( void )
delete [] fIndexData;
fNumIndices = fIndexAccum.GetCount();
fIndexData = TRACKED_NEW UInt16[ fNumIndices ];
fIndexData = TRACKED_NEW uint16_t[ fNumIndices ];
}
else
fNumIndices = fIndexAccum.GetCount();
@ -1033,7 +1033,7 @@ void plGeometrySpan::AdjustBounds(hsBounds3Ext& bnd) const
}
//// ExtractVertex ////////////////////////////////////////////////////////////
void plGeometrySpan::ExtractInitColor( UInt32 index, hsColorRGBA *multColor, hsColorRGBA *addColor) const
void plGeometrySpan::ExtractInitColor( uint32_t index, hsColorRGBA *multColor, hsColorRGBA *addColor) const
{
if( multColor )
*multColor = fMultColor[index];
@ -1044,9 +1044,9 @@ void plGeometrySpan::ExtractInitColor( UInt32 index, hsColorRGBA *multColor,
// Extracts the given vertex out of the vertex buffer and into the pointers
// given.
void plGeometrySpan::ExtractVertex( UInt32 index, hsPoint3 *pos, hsVector3 *normal, hsColorRGBA *color, hsColorRGBA *specColor )
void plGeometrySpan::ExtractVertex( uint32_t index, hsPoint3 *pos, hsVector3 *normal, hsColorRGBA *color, hsColorRGBA *specColor )
{
UInt32 hex, spec;
uint32_t hex, spec;
ExtractVertex( index, pos, normal, &hex, &spec );
@ -1067,9 +1067,9 @@ void plGeometrySpan::ExtractVertex( UInt32 index, hsPoint3 *pos, hsVector3 *n
//// ExtractVertex ////////////////////////////////////////////////////////////
// Hex-color version of ExtractVertex.
void plGeometrySpan::ExtractVertex( UInt32 index, hsPoint3 *pos, hsVector3 *normal, UInt32 *color, UInt32 *specColor )
void plGeometrySpan::ExtractVertex( uint32_t index, hsPoint3 *pos, hsVector3 *normal, uint32_t *color, uint32_t *specColor )
{
UInt8 *basePtr;
uint8_t *basePtr;
float *fPtr;
@ -1095,9 +1095,9 @@ void plGeometrySpan::ExtractVertex( UInt32 index, hsPoint3 *pos, hsVector3 *n
//// ExtractUv ////////////////////////////////////////////////////////////////
void plGeometrySpan::ExtractUv( UInt32 vIdx, UInt8 uvIdx, hsPoint3 *uv )
void plGeometrySpan::ExtractUv( uint32_t vIdx, uint8_t uvIdx, hsPoint3 *uv )
{
UInt8 *basePtr;
uint8_t *basePtr;
float *fPtr;
@ -1119,11 +1119,11 @@ void plGeometrySpan::ExtractUv( UInt32 vIdx, UInt8 uvIdx, hsPoint3 *uv )
//// ExtractWeights ///////////////////////////////////////////////////////////
// Gets the weights out of the vertex data.
void plGeometrySpan::ExtractWeights( UInt32 vIdx, float *weightArray, UInt32 *indices )
void plGeometrySpan::ExtractWeights( uint32_t vIdx, float *weightArray, uint32_t *indices )
{
UInt8 *basePtr;
uint8_t *basePtr;
float *fPtr;
UInt32 *dPtr;
uint32_t *dPtr;
int numWeights;
@ -1149,7 +1149,7 @@ void plGeometrySpan::ExtractWeights( UInt32 vIdx, float *weightArray, UInt32
{
fPtr += numWeights;
dPtr = (UInt32 *)fPtr;
dPtr = (uint32_t *)fPtr;
*indices = *dPtr;
}
}
@ -1158,9 +1158,9 @@ void plGeometrySpan::ExtractWeights( UInt32 vIdx, float *weightArray, UInt32
// Stuffs the given vertex data into the vertex buffer. Vertex must already
// exist!
void plGeometrySpan::StuffVertex( UInt32 index, hsPoint3 *pos, hsPoint3 *normal, hsColorRGBA *color, hsColorRGBA *specColor )
void plGeometrySpan::StuffVertex( uint32_t index, hsPoint3 *pos, hsPoint3 *normal, hsColorRGBA *color, hsColorRGBA *specColor )
{
UInt8 *basePtr;
uint8_t *basePtr;
float *fPtr;
@ -1183,27 +1183,27 @@ void plGeometrySpan::StuffVertex( UInt32 index, hsPoint3 *pos, hsPoint3 *norm
StuffVertex( index, color, specColor );
}
void plGeometrySpan::StuffVertex( UInt32 index, hsColorRGBA *color, hsColorRGBA *specColor )
void plGeometrySpan::StuffVertex( uint32_t index, hsColorRGBA *color, hsColorRGBA *specColor )
{
UInt8 r, g, b, a;
uint8_t r, g, b, a;
/// Where?
hsAssert( index < fNumVerts, "Invalid index passed to StuffVertex()" );
a = (UInt8)( color->a >= 1 ? 255 : color->a <= 0 ? 0 : color->a * 255.0 );
r = (UInt8)( color->r >= 1 ? 255 : color->r <= 0 ? 0 : color->r * 255.0 );
g = (UInt8)( color->g >= 1 ? 255 : color->g <= 0 ? 0 : color->g * 255.0 );
b = (UInt8)( color->b >= 1 ? 255 : color->b <= 0 ? 0 : color->b * 255.0 );
a = (uint8_t)( color->a >= 1 ? 255 : color->a <= 0 ? 0 : color->a * 255.0 );
r = (uint8_t)( color->r >= 1 ? 255 : color->r <= 0 ? 0 : color->r * 255.0 );
g = (uint8_t)( color->g >= 1 ? 255 : color->g <= 0 ? 0 : color->g * 255.0 );
b = (uint8_t)( color->b >= 1 ? 255 : color->b <= 0 ? 0 : color->b * 255.0 );
fDiffuseRGBA[ index ] = ( a << 24 ) | ( r << 16 ) | ( g << 8 ) | ( b );
if( specColor != nil )
{
a = (UInt8)( specColor->a >= 1 ? 255 : specColor->a <= 0 ? 0 : specColor->a * 255.0 );
r = (UInt8)( specColor->r >= 1 ? 255 : specColor->r <= 0 ? 0 : specColor->r * 255.0 );
g = (UInt8)( specColor->g >= 1 ? 255 : specColor->g <= 0 ? 0 : specColor->g * 255.0 );
b = (UInt8)( specColor->b >= 1 ? 255 : specColor->b <= 0 ? 0 : specColor->b * 255.0 );
a = (uint8_t)( specColor->a >= 1 ? 255 : specColor->a <= 0 ? 0 : specColor->a * 255.0 );
r = (uint8_t)( specColor->r >= 1 ? 255 : specColor->r <= 0 ? 0 : specColor->r * 255.0 );
g = (uint8_t)( specColor->g >= 1 ? 255 : specColor->g <= 0 ? 0 : specColor->g * 255.0 );
b = (uint8_t)( specColor->b >= 1 ? 255 : specColor->b <= 0 ? 0 : specColor->b * 255.0 );
fSpecularRGBA[ index ] = ( a << 24 ) | ( r << 16 ) | ( g << 8 ) | ( b );
}

View File

@ -136,40 +136,40 @@ class plGeometrySpan
hsBounds3Ext fWorldBounds;
plFogEnvironment *fFogEnviron;
UInt32 fBaseMatrix;
UInt8 fNumMatrices;
UInt16 fLocalUVWChans;
UInt16 fMaxBoneIdx;
UInt32 fPenBoneIdx;
uint32_t fBaseMatrix;
uint8_t fNumMatrices;
uint16_t fLocalUVWChans;
uint16_t fMaxBoneIdx;
uint32_t fPenBoneIdx;
hsScalar fMinDist;
hsScalar fMaxDist;
hsScalar fWaterHeight;
UInt8 fFormat;
UInt32 fProps;
UInt32 fNumVerts, fNumIndices;
uint8_t fFormat;
uint32_t fProps;
uint32_t fNumVerts, fNumIndices;
/// Current vertex format:
/// float position[ 3 ];
/// float normal[ 3 ];
/// float uvCoords[ ][ 3 ];
/// float weights[]; // 0-3 blending weights
/// UInt32 weightIndices; // Only if there are >= 1 blending weights
/// uint32_t weightIndices; // Only if there are >= 1 blending weights
UInt8* fVertexData;
UInt16* fIndexData;
UInt32 fDecalLevel;
uint8_t* fVertexData;
uint16_t* fIndexData;
uint32_t fDecalLevel;
hsColorRGBA* fMultColor;
hsColorRGBA* fAddColor;
UInt32* fDiffuseRGBA;
UInt32* fSpecularRGBA;
uint32_t* fDiffuseRGBA;
uint32_t* fSpecularRGBA;
mutable hsTArray<plGeometrySpan *>* fInstanceRefs;
mutable UInt32 fInstanceGroupID; // For writing out/reading in instance refs
mutable uint32_t fInstanceGroupID; // For writing out/reading in instance refs
// The following is only used for logging during export. It is never set
// at runtime. Don't even think about using it for anything.
@ -177,7 +177,7 @@ class plGeometrySpan
// The following is ONLY used during pack; it's so we can do a reverse lookup
// from the instanceRefs list to the correct span in the drawable
UInt32 fSpanRefIndex;
uint32_t fSpanRefIndex;
// These two matrices are inverses of each other (duh). They are only used on computing the local
// bounds. fLocalBounds is always the bounds in the space defined by fWorldToLocal, but the bounds
@ -191,34 +191,34 @@ class plGeometrySpan
~plGeometrySpan();
/// UV stuff
UInt8 GetNumUVs( void ) const { return ( fFormat & kUVCountMask ); }
void SetNumUVs( UInt8 numUVs )
uint8_t GetNumUVs( void ) const { return ( fFormat & kUVCountMask ); }
void SetNumUVs( uint8_t numUVs )
{
hsAssert( numUVs < kMaxNumUVChannels, "Invalid UV count to plGeometrySpan" );
fFormat = ( fFormat & ~kUVCountMask ) | numUVs;
}
static UInt8 CalcNumUVs( UInt8 format ) { return ( format & kUVCountMask ); }
static UInt8 UVCountToFormat( UInt8 numUVs ) { return numUVs & kUVCountMask; }
static uint8_t CalcNumUVs( uint8_t format ) { return ( format & kUVCountMask ); }
static uint8_t UVCountToFormat( uint8_t numUVs ) { return numUVs & kUVCountMask; }
/// Creation functions
void BeginCreate( hsGMaterial *material, const hsMatrix44 &l2wMatrix, UInt8 format );
void BeginCreate( hsGMaterial *material, const hsMatrix44 &l2wMatrix, uint8_t format );
// Phasing these in...
// Note: uvArray should be a fixed array with enough pointers for the max # of uv channels.
// Any unused UVs should be nil
UInt16 AddVertex( hsPoint3 *position, hsPoint3 *normal, hsColorRGBA& multColor, hsColorRGBA& addColor,
hsPoint3 **uvPtrArray, float weight1 = -1.0f, float weight2 = -1.0f, float weight3 = -1.0f, UInt32 weightIndices = 0 );
UInt16 AddVertex( hsPoint3 *position, hsPoint3 *normal, UInt32 hexColor, UInt32 specularColor = 0,
hsPoint3 **uvPtrArray = nil, float weight1 = -1.0f, float weight2 = -1.0f, float weight3 = -1.0f, UInt32 weightIndices = 0 );
uint16_t AddVertex( hsPoint3 *position, hsPoint3 *normal, hsColorRGBA& multColor, hsColorRGBA& addColor,
hsPoint3 **uvPtrArray, float weight1 = -1.0f, float weight2 = -1.0f, float weight3 = -1.0f, uint32_t weightIndices = 0 );
uint16_t AddVertex( hsPoint3 *position, hsPoint3 *normal, uint32_t hexColor, uint32_t specularColor = 0,
hsPoint3 **uvPtrArray = nil, float weight1 = -1.0f, float weight2 = -1.0f, float weight3 = -1.0f, uint32_t weightIndices = 0 );
void AddIndex( UInt16 index );
void AddTriIndices( UInt16 index1, UInt16 index2, UInt16 index3 );
void AddTriangle( hsPoint3 *vert1, hsPoint3 *vert2, hsPoint3 *vert3, UInt32 color );
void AddIndex( uint16_t index );
void AddTriIndices( uint16_t index1, uint16_t index2, uint16_t index3 );
void AddTriangle( hsPoint3 *vert1, hsPoint3 *vert2, hsPoint3 *vert3, uint32_t color );
// uvws is an array count*uvwsPerVtx long in order [uvw(s) for vtx0, uvw(s) for vtx1, ...], or is nil
void AddVertexArray( UInt32 count, hsPoint3 *positions, hsVector3 *normals, UInt32 *colors, hsPoint3 *uvws=nil, int uvwsPerVtx=0 );
void AddIndexArray( UInt32 count, UInt16 *indices );
void AddVertexArray( uint32_t count, hsPoint3 *positions, hsVector3 *normals, uint32_t *colors, hsPoint3 *uvws=nil, int uvwsPerVtx=0 );
void AddIndexArray( uint32_t count, uint16_t *indices );
void EndCreate( void );
@ -226,13 +226,13 @@ class plGeometrySpan
/// Manipulation--currently only used for applying static lighting, which of course needs individual vertices
// Wrong. Also used for the interleaving of the multiple vertex data streams here into single vertex
// stream within the plGBufferGroups. mf.
void ExtractInitColor( UInt32 index, hsColorRGBA *multColor, hsColorRGBA *addColor) const;
void ExtractVertex( UInt32 index, hsPoint3 *pos, hsVector3 *normal, hsColorRGBA *color, hsColorRGBA *specColor = nil );
void ExtractVertex( UInt32 index, hsPoint3 *pos, hsVector3 *normal, UInt32 *color, UInt32 *specColor = nil );
void ExtractUv( UInt32 vIdx, UInt8 uvIdx, hsPoint3* uv );
void ExtractWeights( UInt32 vIdx, float *weightArray, UInt32 *indices );
void StuffVertex( UInt32 index, hsPoint3 *pos, hsPoint3 *normal, hsColorRGBA *color, hsColorRGBA *specColor = nil );
void StuffVertex( UInt32 index, hsColorRGBA *color, hsColorRGBA *specColor = nil );
void ExtractInitColor( uint32_t index, hsColorRGBA *multColor, hsColorRGBA *addColor) const;
void ExtractVertex( uint32_t index, hsPoint3 *pos, hsVector3 *normal, hsColorRGBA *color, hsColorRGBA *specColor = nil );
void ExtractVertex( uint32_t index, hsPoint3 *pos, hsVector3 *normal, uint32_t *color, uint32_t *specColor = nil );
void ExtractUv( uint32_t vIdx, uint8_t uvIdx, hsPoint3* uv );
void ExtractWeights( uint32_t vIdx, float *weightArray, uint32_t *indices );
void StuffVertex( uint32_t index, hsPoint3 *pos, hsPoint3 *normal, hsColorRGBA *color, hsColorRGBA *specColor = nil );
void StuffVertex( uint32_t index, hsColorRGBA *color, hsColorRGBA *specColor = nil );
// Clear out the buffers
void ClearBuffers( void );
@ -244,12 +244,12 @@ class plGeometrySpan
void MakeInstanceOf( const plGeometrySpan *instance );
// Get the size of one vertex in a span, based on a format
static UInt32 GetVertexSize( UInt8 format );
static uint32_t GetVertexSize( uint8_t format );
void Read( hsStream *stream );
void Write( hsStream *stream );
static UInt32 AllocateNewGroupID() { return IAllocateNewGroupID(); }
static uint32_t AllocateNewGroupID() { return IAllocateNewGroupID(); }
void BreakInstance();
void ChangeInstance(plGeometrySpan* newInstance);
@ -263,16 +263,16 @@ class plGeometrySpan
{
hsPoint3 fPosition;
hsPoint3 fNormal;
UInt32 fColor, fSpecularColor;
uint32_t fColor, fSpecularColor;
hsColorRGBA fMultColor, fAddColor;
hsPoint3 fUVs[ kMaxNumUVChannels ];
float fWeights[ 3 ];
UInt32 fIndices;
uint32_t fIndices;
};
hsBool fCreating;
hsTArray<TempVertex> fVertAccum;
hsTArray<UInt16> fIndexAccum;
hsTArray<uint16_t> fIndexAccum;
void IUnShareData();
void IDuplicateUniqueData( const plGeometrySpan *source );
@ -300,12 +300,12 @@ class plGeometrySpan
// THIS is so we can clear fInstanceGroups as early and as efficiently as possible; see
// the notes on IGetInstanceGroup().
static UInt32 fHighestReadInstanceGroup;
static uint32_t fHighestReadInstanceGroup;
static UInt32 IAllocateNewGroupID( void );
static void IClearGroupID( UInt32 groupID );
static uint32_t IAllocateNewGroupID( void );
static void IClearGroupID( uint32_t groupID );
static hsTArray<plGeometrySpan *> *IGetInstanceGroup( UInt32 groupID, UInt32 expectedCount );
static hsTArray<plGeometrySpan *> *IGetInstanceGroup( uint32_t groupID, uint32_t expectedCount );
};

View File

@ -113,7 +113,7 @@ void plInstanceDrawInterface::AddSharedMesh(plSharedMesh *mesh, hsGMaterial *mat
#ifdef MF_NOSHADOW_ACC
// TESTHACKERY FOLLOWS - GlassesNoShadow
UInt32 noShadHack = 0;
uint32_t noShadHack = 0;
if( mesh->GetKey() && (strstr(mesh->GetKey()->GetName(), "lasses") || strstr(mesh->GetKey()->GetName(), "oggles")) )
noShadHack = plGeometrySpan::kPropNoShadowCast;
#endif // MF_NOSHADOW_ACC
@ -136,11 +136,11 @@ void plInstanceDrawInterface::AddSharedMesh(plSharedMesh *mesh, hsGMaterial *mat
}
// Add the spans to the drawable
UInt32 index = (UInt32)-1;
uint32_t index = (uint32_t)-1;
index = fDrawable->AppendDISpans(mesh->fSpans, index, false, true, addToFront, lod);
// Tell the drawInterface what drawable and index it wants.
UInt8 iDraw = (UInt8)GetNumDrawables();
uint8_t iDraw = (uint8_t)GetNumDrawables();
ISetDrawable(iDraw, fDrawable);
SetDrawableMeshIndex(iDraw, index);
SetSharedMesh(iDraw, mesh);
@ -173,10 +173,10 @@ void plInstanceDrawInterface::AddSharedMesh(plSharedMesh *mesh, hsGMaterial *mat
void plInstanceDrawInterface::RemoveSharedMesh(plSharedMesh *mesh)
{
UInt32 geoIndex = fMeshes.Find(mesh);
uint32_t geoIndex = fMeshes.Find(mesh);
if (geoIndex != fMeshes.kMissingIndex)
{
IClearIndex((UInt8)geoIndex);
IClearIndex((uint8_t)geoIndex);
plSharedMeshBCMsg *smMsg = TRACKED_NEW plSharedMeshBCMsg;
smMsg->SetSender(GetKey());
@ -197,7 +197,7 @@ void plInstanceDrawInterface::RemoveSharedMesh(plSharedMesh *mesh)
}
}
void plInstanceDrawInterface::ICheckDrawableIndex(UInt8 which)
void plInstanceDrawInterface::ICheckDrawableIndex(uint8_t which)
{
if( which >= fMeshes.GetCount() )
{
@ -214,13 +214,13 @@ void plInstanceDrawInterface::ReleaseData()
plDrawInterface::ReleaseData();
}
void plInstanceDrawInterface::SetSharedMesh(UInt8 which, plSharedMesh *mesh)
void plInstanceDrawInterface::SetSharedMesh(uint8_t which, plSharedMesh *mesh)
{
ICheckDrawableIndex(which);
fMeshes[which] = mesh;
}
void plInstanceDrawInterface::IClearIndex(UInt8 which)
void plInstanceDrawInterface::IClearIndex(uint8_t which)
{
plDrawableSpans *drawable = plDrawableSpans::ConvertNoRef(fDrawables[which]);
if (drawable != nil)
@ -236,7 +236,7 @@ void plInstanceDrawInterface::IClearIndex(UInt8 which)
}
// Temp testing - not really ideal. Check with Bob for real soln.
Int32 plInstanceDrawInterface::GetSharedMeshIndex(const plSharedMesh *mesh) const
int32_t plInstanceDrawInterface::GetSharedMeshIndex(const plSharedMesh *mesh) const
{
int i;
for( i = 0; i < fMeshes.GetCount(); i++ )

View File

@ -53,10 +53,10 @@ protected:
plDrawableSpans *fDrawable;
hsTArray<plSharedMesh*> fMeshes;
virtual void ICheckDrawableIndex(UInt8 which);
virtual void ICheckDrawableIndex(uint8_t which);
public:
UInt32 fTargetID;
uint32_t fTargetID;
plInstanceDrawInterface();
virtual ~plInstanceDrawInterface();
@ -73,11 +73,11 @@ public:
void RemoveSharedMesh(plSharedMesh *mesh);
virtual void ReleaseData();
virtual void SetSharedMesh(UInt8 which, plSharedMesh *mesh);
virtual void IClearIndex(UInt8 which);
virtual void SetSharedMesh(uint8_t which, plSharedMesh *mesh);
virtual void IClearIndex(uint8_t which);
plDrawableSpans *GetInstanceDrawable() const { return fDrawable; }
Int32 GetSharedMeshIndex(const plSharedMesh *mesh) const;
int32_t GetSharedMeshIndex(const plSharedMesh *mesh) const;
};

View File

@ -48,13 +48,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class EdgeBin
{
public:
UInt16 fVtx;
UInt16 fCount;
uint16_t fVtx;
uint16_t fCount;
EdgeBin() : fVtx(0), fCount(0) {}
};
void plInterMeshSmooth::FindEdges(UInt32 maxVtxIdx, UInt32 nTris, UInt16* idxList, hsTArray<UInt16>& edgeVerts)
void plInterMeshSmooth::FindEdges(uint32_t maxVtxIdx, uint32_t nTris, uint16_t* idxList, hsTArray<uint16_t>& edgeVerts)
{
hsTArray<EdgeBin>* bins = TRACKED_NEW hsTArray<EdgeBin>[maxVtxIdx+1];
@ -134,7 +134,7 @@ void plInterMeshSmooth::FindEdges(UInt32 maxVtxIdx, UInt32 nTris, UInt16* idxLis
delete [] bins;
}
void plInterMeshSmooth::FindEdges(hsTArray<plSpanHandle>& sets, hsTArray<UInt16>* edgeVerts)
void plInterMeshSmooth::FindEdges(hsTArray<plSpanHandle>& sets, hsTArray<uint16_t>* edgeVerts)
{
int i;
for( i = 0; i < sets.GetCount(); i++ )
@ -143,9 +143,9 @@ void plInterMeshSmooth::FindEdges(hsTArray<plSpanHandle>& sets, hsTArray<UInt16>
if( !(span->fTypeMask & plSpan::kIcicleSpan) )
continue;
UInt32 nTris = sets[i].fDrawable->CvtGetNumTris(sets[i].fSpanIdx);
UInt16* idxList = sets[i].fDrawable->CvtGetIndexList(sets[i].fSpanIdx);
UInt32 maxVertIdx = sets[i].fDrawable->CvtGetNumVerts(sets[i].fSpanIdx)-1;
uint32_t nTris = sets[i].fDrawable->CvtGetNumTris(sets[i].fSpanIdx);
uint16_t* idxList = sets[i].fDrawable->CvtGetIndexList(sets[i].fSpanIdx);
uint32_t maxVertIdx = sets[i].fDrawable->CvtGetNumVerts(sets[i].fSpanIdx)-1;
FindEdges(maxVertIdx, nTris, idxList, edgeVerts[i]);
}
@ -153,8 +153,8 @@ void plInterMeshSmooth::FindEdges(hsTArray<plSpanHandle>& sets, hsTArray<UInt16>
void plInterMeshSmooth::SmoothNormals(hsTArray<plSpanHandle>& sets)
{
hsTArray<UInt16>* shareVtx = TRACKED_NEW hsTArray<UInt16>[sets.GetCount()];
hsTArray<UInt16>* edgeVerts = TRACKED_NEW hsTArray<UInt16>[sets.GetCount()];
hsTArray<uint16_t>* shareVtx = TRACKED_NEW hsTArray<uint16_t>[sets.GetCount()];
hsTArray<uint16_t>* edgeVerts = TRACKED_NEW hsTArray<uint16_t>[sets.GetCount()];
FindEdges(sets, edgeVerts);
int i;
@ -202,7 +202,7 @@ void plInterMeshSmooth::SmoothNormals(hsTArray<plSpanHandle>& sets)
delete [] edgeVerts;
}
void plInterMeshSmooth::FindSharedVerts(hsPoint3& searchPos, plSpanHandle& set, hsTArray<UInt16>& edgeVerts, hsTArray<UInt16>& shareVtx, hsVector3& normAccum)
void plInterMeshSmooth::FindSharedVerts(hsPoint3& searchPos, plSpanHandle& set, hsTArray<uint16_t>& edgeVerts, hsTArray<uint16_t>& shareVtx, hsVector3& normAccum)
{
int i;
for( i = 0; i < edgeVerts.GetCount(); i++ )
@ -220,19 +220,19 @@ void plInterMeshSmooth::FindSharedVerts(hsPoint3& searchPos, plSpanHandle& set,
}
}
void plInterMeshSmooth::SetNormals(plSpanHandle& set, hsTArray<UInt16>& shareVtx, hsVector3& norm)
void plInterMeshSmooth::SetNormals(plSpanHandle& set, hsTArray<uint16_t>& shareVtx, hsVector3& norm)
{
int i;
for( i = 0; i < shareVtx.GetCount(); i++ )
GetNormal(set, shareVtx[i]) = norm;
}
hsPoint3& plInterMeshSmooth::GetPosition(plSpanHandle& set, UInt16 idx)
hsPoint3& plInterMeshSmooth::GetPosition(plSpanHandle& set, uint16_t idx)
{
return set.fDrawable->CvtGetPosition(set.fSpanIdx, idx);
}
hsVector3& plInterMeshSmooth::GetNormal(plSpanHandle& set, UInt16 idx)
hsVector3& plInterMeshSmooth::GetNormal(plSpanHandle& set, uint16_t idx)
{
return set.fDrawable->CvtGetNormal(set.fSpanIdx, idx);
}

View File

@ -53,7 +53,7 @@ class plSpanHandle
{
public:
plDrawableSpans* fDrawable;
UInt32 fSpanIdx;
uint32_t fSpanIdx;
};
class plInterMeshSmooth
@ -61,12 +61,12 @@ class plInterMeshSmooth
protected:
hsScalar fMinNormDot;
void FindEdges(UInt32 maxVtxIdx, UInt32 nTris, UInt16* idxList, hsTArray<UInt16>& edgeVerts);
void FindEdges(hsTArray<plSpanHandle>& sets, hsTArray<UInt16>* edgeVerts);
void FindSharedVerts(hsPoint3& searchPos, plSpanHandle& set, hsTArray<UInt16>& edgeVerts, hsTArray<UInt16>& shareVtx, hsVector3& normAccum);
void SetNormals(plSpanHandle& set, hsTArray<UInt16>& shareVtx, hsVector3& norm);
hsPoint3& GetPosition(plSpanHandle& set, UInt16 idx);
hsVector3& GetNormal(plSpanHandle& set, UInt16 idx);
void FindEdges(uint32_t maxVtxIdx, uint32_t nTris, uint16_t* idxList, hsTArray<uint16_t>& edgeVerts);
void FindEdges(hsTArray<plSpanHandle>& sets, hsTArray<uint16_t>* edgeVerts);
void FindSharedVerts(hsPoint3& searchPos, plSpanHandle& set, hsTArray<uint16_t>& edgeVerts, hsTArray<uint16_t>& shareVtx, hsVector3& normAccum);
void SetNormals(plSpanHandle& set, hsTArray<uint16_t>& shareVtx, hsVector3& norm);
hsPoint3& GetPosition(plSpanHandle& set, uint16_t idx);
hsVector3& GetNormal(plSpanHandle& set, uint16_t idx);
public:
plInterMeshSmooth() : fMinNormDot(0.25f) {}

View File

@ -189,7 +189,7 @@ void plMorphDelta::ComputeDeltas(const hsTArray<plGeometrySpan*>& base, const hs
plMorphSpan& dst = fSpans[iSpan];
const UInt16 numUVWs = baseAcc.AccessVtx().NumUVWs();
const uint16_t numUVWs = baseAcc.AccessVtx().NumUVWs();
hsTArray<plVertDelta> deltas;
hsTArray<hsPoint3> uvws;

View File

@ -52,8 +52,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
class plVertDelta
{
public:
UInt16 fIdx;
UInt16 fPadding;
uint16_t fIdx;
uint16_t fPadding;
hsVector3 fPos;
hsVector3 fNorm;
};
@ -66,7 +66,7 @@ public:
hsTArray<plVertDelta> fDeltas;
UInt16 fNumUVWChans;
uint16_t fNumUVWChans;
hsPoint3* fUVWs; // Length is fUVWChans*fDeltas.GetCount() (*sizeof(hsPoint3) in bytes).
};
@ -94,7 +94,7 @@ public:
void ComputeDeltas(const hsTArray<plAccessSpan>& base, const hsTArray<plAccessSpan>& moved);
void ComputeDeltas(const hsTArray<plGeometrySpan*>& base, const hsTArray<plGeometrySpan*>& moved, const hsMatrix44& d2b, const hsMatrix44& d2bTInv);
UInt32 GetNumSpans() const { return fSpans.GetCount(); }
uint32_t GetNumSpans() const { return fSpans.GetCount(); }
void SetNumSpans(int n);
void SetDeltas(int iSpan, const hsTArray<plVertDelta>& deltas, int numUVWChans, const hsPoint3* uvws); // len uvws is deltas.GetCount() * numUVWChans

View File

@ -89,7 +89,7 @@ void plMorphDataSet::Write(hsStream* s, hsResMgr* mgr)
///////////////////////////////////////////////////////////////////////////
const UInt32 kChanMask = plAccessVtxSpan::kPositionMask
const uint32_t kChanMask = plAccessVtxSpan::kPositionMask
| plAccessVtxSpan::kNormalMask
| plAccessVtxSpan::kUVWMask;
@ -103,8 +103,8 @@ plConst(hsScalar) kMorphTime(0.5);
class plMorphTarget
{
public:
UInt16 fLayer;
UInt16 fDelta;
uint16_t fLayer;
uint16_t fDelta;
hsScalar fWeight;
};
@ -642,17 +642,17 @@ hsBool plMorphSequence::IFindIndices(int iShare)
if( !di )
return false;
Int32 meshIdx = di->GetSharedMeshIndex(mInfo.fMesh);
int32_t meshIdx = di->GetSharedMeshIndex(mInfo.fMesh);
if( meshIdx < 0 )
return false;
plDrawableSpans* dr = plDrawableSpans::ConvertNoRef(di->GetDrawable((UInt8)meshIdx));
plDrawableSpans* dr = plDrawableSpans::ConvertNoRef(di->GetDrawable((uint8_t)meshIdx));
if( !dr )
return false;
mInfo.fCurrDraw = dr;
plDISpanIndex& diIndex = dr->GetDISpans(di->GetDrawableMeshIndex((UInt8)meshIdx));
plDISpanIndex& diIndex = dr->GetDISpans(di->GetDrawableMeshIndex((uint8_t)meshIdx));
hsAssert(mInfo.fMesh->fSpans.GetCount() == diIndex.GetCount(), "Mismatch between geometry and indices");
@ -671,7 +671,7 @@ void plMorphSequence::IReleaseIndices(int iShare)
mInfo.fCurrDraw = nil;
}
Int32 plMorphSequence::IFindSharedMeshIndex(plKey meshKey) const
int32_t plMorphSequence::IFindSharedMeshIndex(plKey meshKey) const
{
int i;
for( i = 0; i < fSharedMeshes.GetCount(); i++ )
@ -683,7 +683,7 @@ Int32 plMorphSequence::IFindSharedMeshIndex(plKey meshKey) const
return -1;
}
Int32 plMorphSequence::IFindPendingStateIndex(plKey meshKey) const
int32_t plMorphSequence::IFindPendingStateIndex(plKey meshKey) const
{
int i;
for( i = 0; i < fPendingStates.GetCount(); i++ )

View File

@ -66,10 +66,10 @@ public:
};
plSharedMesh* fMesh;
hsTArray<Int32> fCurrIdx;
hsTArray<int32_t> fCurrIdx;
plDrawable* fCurrDraw;
hsTArray<plMorphArrayWeights> fArrayWeights;
UInt8 fFlags;
uint8_t fFlags;
plSharedMeshInfo() : fMesh(nil), fCurrDraw(nil), fFlags(0) {}
};
@ -109,19 +109,19 @@ protected:
kHaveShared = 0x4,
kDirtyIndices = 0x8
};
UInt32 fMorphFlags;
uint32_t fMorphFlags;
hsTArray<plMorphArray> fMorphs;
//Int32 fActiveMesh; // Doesn't appear to be used.
//int32_t fActiveMesh; // Doesn't appear to be used.
hsTArray<plSharedMeshInfo> fSharedMeshes;
hsTArray<plMorphState> fPendingStates;
plMorphSequenceSDLMod* fMorphSDLMod;
Int8 fGlobalLayerRef;
int8_t fGlobalLayerRef;
const plDrawInterface* IGetDrawInterface() const;
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty) { return false; }
virtual hsBool IEval(double secs, hsScalar del, uint32_t dirty) { return false; }
void ISetHaveSnap(hsBool on) { if(on)fMorphFlags |= kHaveSnap; else fMorphFlags &= ~kHaveSnap; }
void ISetDirty(hsBool on);
@ -138,8 +138,8 @@ protected:
void IFindIndices(); // Refresh Indicies
void IApplyShared(); // Apply whatever morphs are active
Int32 IFindPendingStateIndex(plKey meshKey) const; // Do we have pending state for this mesh?
Int32 IFindSharedMeshIndex(plKey meshKey) const; // What's this mesh's index in our array?
int32_t IFindPendingStateIndex(plKey meshKey) const; // Do we have pending state for this mesh?
int32_t IFindSharedMeshIndex(plKey meshKey) const; // What's this mesh's index in our array?
hsBool IIsUsingDrawable(plDrawable *draw); // Are we actively looking at spans in this drawable?
// Internal functions for maintaining that all meshes share the same global weight(s) (fGlobalLayerRef)

View File

@ -117,7 +117,7 @@ void plMorphSequenceSDLMod::IPutCurrentStateIn(plStateDataRecord* dstState)
// store both in a single byte
// Translate the range [-1.0, 1.0] into a 0-255 byte
UInt8 weight = (UInt8)((1.f + morphMod->GetWeight(j, 0, meshKey) - morphMod->GetWeight(j, 1, meshKey)) * 255 / 2);
uint8_t weight = (uint8_t)((1.f + morphMod->GetWeight(j, 0, meshKey) - morphMod->GetWeight(j, 1, meshKey)) * 255 / 2);
weights->Set(&weight, j);
}
@ -167,7 +167,7 @@ void plMorphSequenceSDLMod::ISetCurrentStateFrom(const plStateDataRecord* srcSta
// of plMorphSequence only has to resize the array once.
for (j = weights->GetCount() - 1; j >= 0; j--)
{
UInt8 weight;
uint8_t weight;
weights->Get(&weight, j);
hsScalar posWeight = weight * 2.f / 255.f - 1.f;
hsScalar negWeight = 0;

View File

@ -57,7 +57,7 @@ protected:
void IPutCurrentStateIn(plStateDataRecord* dstState);
void ISetCurrentStateFrom(const plStateDataRecord* srcState);
UInt32 IApplyModFlags(UInt32 sendFlags)
uint32_t IApplyModFlags(uint32_t sendFlags)
{
if (fIsAvatar)
return (sendFlags | plSynchedObject::kDontPersistOnServer | plSynchedObject::kIsAvatarState);

View File

@ -71,8 +71,8 @@ static hsScalar sInvDelSecs;
fPtr[ 0 ] = point.fX; fPtr[ 1 ] = point.fY; fPtr[ 2 ] = point.fZ; \
ptr += sizeof( float ) * 3; }
#define STUFF_UINT32( ptr, uint ) { UInt32 *dPtr = (UInt32 *)ptr; \
dPtr[ 0 ] = uint; ptr += sizeof( UInt32 ); }
#define STUFF_UINT32( ptr, uint ) { uint32_t *dPtr = (uint32_t *)ptr; \
dPtr[ 0 ] = uint; ptr += sizeof( uint32_t ); }
#define EXTRACT_POINT( ptr, pt ) { float *fPtr = (float *)ptr; \
pt.fX = fPtr[ 0 ]; pt.fY = fPtr[ 1 ]; pt.fZ = fPtr[ 2 ]; \
@ -81,8 +81,8 @@ static hsScalar sInvDelSecs;
f = fPtr[ 0 ]; \
ptr += sizeof( float ); }
#define EXTRACT_UINT32( ptr, uint ) { UInt32 *dPtr = (UInt32 *)ptr; \
uint = dPtr[ 0 ]; ptr += sizeof( UInt32 ); }
#define EXTRACT_UINT32( ptr, uint ) { uint32_t *dPtr = (uint32_t *)ptr; \
uint = dPtr[ 0 ]; ptr += sizeof( uint32_t ); }
static hsScalar sCurrMinWidth = 0;
@ -259,7 +259,7 @@ void inline IInlSetParticleExplicit( const hsMatrix44 &viewToWorld, const plPart
}
void inline IInlSetParticlePoints( const hsVector3 &xVec, const hsVector3 &yVec, const plParticleCore &particle,
hsPoint3 *partPts, UInt32 &partColor )
hsPoint3 *partPts, uint32_t &partColor )
{
/// Do the 4 verts for this particle
partPts[ 0 ] = partPts[ 1 ] = partPts[ 2 ] = partPts[ 3 ] = particle.fPos;
@ -272,7 +272,7 @@ void inline IInlSetParticlePoints( const hsVector3 &xVec, const hsVector3 &yVec,
}
void inline IInlSetParticlePointsStretch( const hsVector3 &xVec, const hsVector3 &yVec, const plParticleCore &particle,
hsPoint3 *partPts, UInt32 &partColor )
hsPoint3 *partPts, uint32_t &partColor )
{
/// Do the 4 verts for this particle
partPts[ 0 ] = partPts[ 1 ] = partPts[ 2 ] = partPts[ 3 ] = particle.fPos;
@ -284,10 +284,10 @@ void inline IInlSetParticlePointsStretch( const hsVector3 &xVec, const hsVector3
partColor = particle.fColor;
}
void inline IInlStuffParticle1UV( UInt8 *&destPtr, const hsPoint3 *partPts, const hsVector3 &partNorm,
const UInt32 &partColor, const plParticleCore &particle )
void inline IInlStuffParticle1UV( uint8_t *&destPtr, const hsPoint3 *partPts, const hsVector3 &partNorm,
const uint32_t &partColor, const plParticleCore &particle )
{
UInt8 j;
uint8_t j;
for( j = 0; j < 4; j++ )
@ -300,10 +300,10 @@ void inline IInlStuffParticle1UV( UInt8 *&destPtr, const hsPoint3 *partPts, cons
}
}
void inline IInlStuffParticleNoUVs( UInt8 *&destPtr, const hsPoint3 *partPts, const hsVector3 &partNorm,
const UInt32 &partColor )
void inline IInlStuffParticleNoUVs( uint8_t *&destPtr, const hsPoint3 *partPts, const hsVector3 &partNorm,
const uint32_t &partColor )
{
UInt8 j;
uint8_t j;
for( j = 0; j < 4; j++ )
@ -352,12 +352,12 @@ void inline IInlSetNormalExplicit( hsVector3 &partNorm, const plParticleCore &pa
// or NExp (for explicit)
#define IIPL_PROLOG \
UInt32 i, partColor; \
uint32_t i, partColor; \
hsVector3 xVec, yVec, zVec, partNorm; \
hsPoint3 partPts[ 4 ]; \
for( i = 0; i < numParticles; i++ )
void inline IIPL_1UV_OVel_NViewFace( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_1UV_OVel_NViewFace( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -368,7 +368,7 @@ void inline IIPL_1UV_OVel_NViewFace( const UInt32 &numParticles, const plParticl
}
}
void inline IIPL_1UV_OVel_NLite( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr,
void inline IIPL_1UV_OVel_NLite( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr,
const plOmniLightInfo *omniLight, const plDirectionalLightInfo *directionLight )
{
IIPL_PROLOG
@ -380,7 +380,7 @@ void inline IIPL_1UV_OVel_NLite( const UInt32 &numParticles, const plParticleCor
}
}
void inline IIPL_1UV_OVel_NExp( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_1UV_OVel_NExp( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -391,7 +391,7 @@ void inline IIPL_1UV_OVel_NExp( const UInt32 &numParticles, const plParticleCore
}
}
void inline IIPL_1UV_OStr_NViewFace( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_1UV_OStr_NViewFace( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -402,7 +402,7 @@ void inline IIPL_1UV_OStr_NViewFace( const UInt32 &numParticles, const plParticl
}
}
void inline IIPL_1UV_OStr_NLite( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr,
void inline IIPL_1UV_OStr_NLite( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr,
const plOmniLightInfo *omniLight, const plDirectionalLightInfo *directionLight )
{
IIPL_PROLOG
@ -414,7 +414,7 @@ void inline IIPL_1UV_OStr_NLite( const UInt32 &numParticles, const plParticleCor
}
}
void inline IIPL_1UV_OStr_NExp( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_1UV_OStr_NExp( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -425,7 +425,7 @@ void inline IIPL_1UV_OStr_NExp( const UInt32 &numParticles, const plParticleCore
}
}
void inline IIPL_1UV_OFlo_NViewFace( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_1UV_OFlo_NViewFace( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -436,7 +436,7 @@ void inline IIPL_1UV_OFlo_NViewFace( const UInt32 &numParticles, const plParticl
}
}
void inline IIPL_1UV_OFlo_NLite( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr,
void inline IIPL_1UV_OFlo_NLite( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr,
const plOmniLightInfo *omniLight, const plDirectionalLightInfo *directionLight )
{
IIPL_PROLOG
@ -448,7 +448,7 @@ void inline IIPL_1UV_OFlo_NLite( const UInt32 &numParticles, const plParticleCor
}
}
void inline IIPL_1UV_OFlo_NExp( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_1UV_OFlo_NExp( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -459,7 +459,7 @@ void inline IIPL_1UV_OFlo_NExp( const UInt32 &numParticles, const plParticleCore
}
}
void inline IIPL_1UV_OExp_NViewFace( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_1UV_OExp_NViewFace( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -470,7 +470,7 @@ void inline IIPL_1UV_OExp_NViewFace( const UInt32 &numParticles, const plParticl
}
}
void inline IIPL_1UV_OExp_NLite( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr,
void inline IIPL_1UV_OExp_NLite( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr,
const plOmniLightInfo *omniLight, const plDirectionalLightInfo *directionLight )
{
IIPL_PROLOG
@ -482,7 +482,7 @@ void inline IIPL_1UV_OExp_NLite( const UInt32 &numParticles, const plParticleCor
}
}
void inline IIPL_1UV_OExp_NExp( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_1UV_OExp_NExp( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -493,7 +493,7 @@ void inline IIPL_1UV_OExp_NExp( const UInt32 &numParticles, const plParticleCore
}
}
void inline IIPL_0UV_OVel_NViewFace( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_0UV_OVel_NViewFace( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -504,7 +504,7 @@ void inline IIPL_0UV_OVel_NViewFace( const UInt32 &numParticles, const plParticl
}
}
void inline IIPL_0UV_OVel_NLite( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr,
void inline IIPL_0UV_OVel_NLite( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr,
const plOmniLightInfo *omniLight, const plDirectionalLightInfo *directionLight )
{
IIPL_PROLOG
@ -516,7 +516,7 @@ void inline IIPL_0UV_OVel_NLite( const UInt32 &numParticles, const plParticleCor
}
}
void inline IIPL_0UV_OVel_NExp( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_0UV_OVel_NExp( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -527,7 +527,7 @@ void inline IIPL_0UV_OVel_NExp( const UInt32 &numParticles, const plParticleCore
}
}
void inline IIPL_0UV_OStr_NViewFace( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_0UV_OStr_NViewFace( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -538,7 +538,7 @@ void inline IIPL_0UV_OStr_NViewFace( const UInt32 &numParticles, const plParticl
}
}
void inline IIPL_0UV_OStr_NLite( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr,
void inline IIPL_0UV_OStr_NLite( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr,
const plOmniLightInfo *omniLight, const plDirectionalLightInfo *directionLight )
{
IIPL_PROLOG
@ -550,7 +550,7 @@ void inline IIPL_0UV_OStr_NLite( const UInt32 &numParticles, const plParticleCor
}
}
void inline IIPL_0UV_OStr_NExp( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_0UV_OStr_NExp( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -561,7 +561,7 @@ void inline IIPL_0UV_OStr_NExp( const UInt32 &numParticles, const plParticleCore
}
}
void inline IIPL_0UV_OFlo_NViewFace( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_0UV_OFlo_NViewFace( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -572,7 +572,7 @@ void inline IIPL_0UV_OFlo_NViewFace( const UInt32 &numParticles, const plParticl
}
}
void inline IIPL_0UV_OFlo_NLite( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr,
void inline IIPL_0UV_OFlo_NLite( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr,
const plOmniLightInfo *omniLight, const plDirectionalLightInfo *directionLight )
{
IIPL_PROLOG
@ -584,7 +584,7 @@ void inline IIPL_0UV_OFlo_NLite( const UInt32 &numParticles, const plParticleCor
}
}
void inline IIPL_0UV_OFlo_NExp( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_0UV_OFlo_NExp( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -595,7 +595,7 @@ void inline IIPL_0UV_OFlo_NExp( const UInt32 &numParticles, const plParticleCore
}
}
void inline IIPL_0UV_OExp_NViewFace( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_0UV_OExp_NViewFace( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -606,7 +606,7 @@ void inline IIPL_0UV_OExp_NViewFace( const UInt32 &numParticles, const plParticl
}
}
void inline IIPL_0UV_OExp_NLite( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr,
void inline IIPL_0UV_OExp_NLite( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr,
const plOmniLightInfo *omniLight, const plDirectionalLightInfo *directionLight )
{
IIPL_PROLOG
@ -618,7 +618,7 @@ void inline IIPL_0UV_OExp_NLite( const UInt32 &numParticles, const plParticleCor
}
}
void inline IIPL_0UV_OExp_NExp( const UInt32 &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, UInt8 *&destPtr )
void inline IIPL_0UV_OExp_NExp( const uint32_t &numParticles, const plParticleCore *particles, const hsMatrix44& viewToWorld, uint8_t *&destPtr )
{
IIPL_PROLOG
{
@ -647,11 +647,11 @@ void plParticleFiller::FillParticles(plPipeline* pipe, plDrawableSpans* drawable
sInvDelSecs = 1.f / sInvDelSecs;
const plParticleCore* particles = span->fSource->GetParticleArray();
const UInt32 numParticles = span->fNumParticles;
const uint32_t numParticles = span->fNumParticles;
plGBufferGroup* group = drawable->GetBufferGroup(span->fGroupIdx);
UInt8* destPtr = group->GetVertBufferData(span->fVBufferIdx);
uint8_t* destPtr = group->GetVertBufferData(span->fVBufferIdx);
destPtr += span->fVStartIdx * group->GetVertexSize();
@ -798,14 +798,14 @@ void plParticleFiller::FillParticlePolys(plPipeline* pipe, plDrawInterface* di)
// Currently, the di always points to exactly 1 drawable with 1 span index. If
// that changes, this would just become a loop.
UInt32 diIndex = di->GetDrawableMeshIndex(0);
uint32_t diIndex = di->GetDrawableMeshIndex(0);
hsAssert(diIndex >= 0, "Bogus input to fill particles");
const plDISpanIndex& diSpans = drawable->GetDISpans(diIndex);
int i;
for( i = 0; i < diSpans.GetCount(); i++ )
{
UInt32 spanIdx = diSpans[i];
uint32_t spanIdx = diSpans[i];
hsAssert(drawable->GetSpan(spanIdx), "Bogus input to fill particles");
hsAssert(drawable->GetSpan(spanIdx)->fTypeMask & plSpan::kParticleSpan, "Bogus input to fill particles");

View File

@ -59,7 +59,7 @@ public:
GETINTERFACE_ANY( plPrintShape, plObjInterface );
virtual Int32 GetNumProperties() const { return 1; }
virtual int32_t GetNumProperties() const { return 1; }
virtual void SetTransform(const hsMatrix44& l2w, const hsMatrix44& w2l) {}
virtual void Read(hsStream* stream, hsResMgr* mgr);

View File

@ -56,7 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
static hsTArray<plDrawableSpans*> fProxyDrawables;
static hsTArray<hsGMaterial*> fProxyMaterials;
static UInt32 fProxyKeyCounter = 0;
static uint32_t fProxyKeyCounter = 0;
plProxyGen::plProxyGen(const hsColorRGBA& amb, const hsColorRGBA& dif, hsScalar opac)
: fProxyMsgType(0),
@ -100,7 +100,7 @@ void plProxyGen::Init(const hsKeyedObject* owner)
}
UInt32 plProxyGen::IGetDrawableType() const
uint32_t plProxyGen::IGetDrawableType() const
{
switch( fProxyMsgType & plProxyDrawMsg::kAllTypes )
{
@ -121,10 +121,10 @@ UInt32 plProxyGen::IGetDrawableType() const
return plDrawable::kGenericProxy;
}
UInt32 plProxyGen::IGetProxyIndex() const
uint32_t plProxyGen::IGetProxyIndex() const
{
plKey sceneNode = IGetNode();
UInt32 drawType = IGetDrawableType();
uint32_t drawType = IGetDrawableType();
int firstNil = -1;
int firstMatch = -1;
@ -220,7 +220,7 @@ void plProxyGen::IGenerateProxy()
if( !IGetNode() )
return;
UInt32 idx = IGetProxyIndex();
uint32_t idx = IGetProxyIndex();
hsGMaterial* mat = IGetProxyMaterial();
hsAssert(mat, "Failed to create proxy material");
@ -251,7 +251,7 @@ void plProxyGen::IGenerateProxy()
hsgResMgr::ResMgr()->AddViaNotify(mat->GetKey(), msg, plRefFlags::kActiveRef);
fProxyMat = mat;
plNodeRefMsg* refMsg = TRACKED_NEW plNodeRefMsg( GetKey(), plNodeRefMsg::kOnRequest, (Int8)idx, plNodeRefMsg::kDrawable );
plNodeRefMsg* refMsg = TRACKED_NEW plNodeRefMsg( GetKey(), plNodeRefMsg::kOnRequest, (int8_t)idx, plNodeRefMsg::kDrawable );
hsgResMgr::ResMgr()->AddViaNotify(fProxyDrawables[idx]->GetKey(), refMsg, plRefFlags::kActiveRef);
fProxyDraw = fProxyDrawables[idx];
}
@ -259,7 +259,7 @@ void plProxyGen::IGenerateProxy()
//// IApplyProxy
// Add our proxy to our scenenode for rendering.
void plProxyGen::IApplyProxy(UInt32 idx) const
void plProxyGen::IApplyProxy(uint32_t idx) const
{
if( fProxyDrawables[idx] && IGetNode() && (fProxyDrawables[idx]->GetSceneNode() != IGetNode()) )
{
@ -269,7 +269,7 @@ void plProxyGen::IApplyProxy(UInt32 idx) const
//// IRemoveProxy
// Remove our proxy from our scenenode.
void plProxyGen::IRemoveProxy(UInt32 idx) const
void plProxyGen::IRemoveProxy(uint32_t idx) const
{
if( fProxyDrawables[idx] )
{
@ -347,7 +347,7 @@ hsBool plProxyGen::MsgReceive(plMessage* msg)
void plProxyGen::SetTransform(const hsMatrix44& l2w, const hsMatrix44& w2l)
{
UInt32 idx = IGetProxyIndex();
uint32_t idx = IGetProxyIndex();
if( fProxyDrawables[idx] )
{
int i;
@ -358,7 +358,7 @@ void plProxyGen::SetTransform(const hsMatrix44& l2w, const hsMatrix44& w2l)
void plProxyGen::SetDisable(hsBool on)
{
UInt32 idx = IGetProxyIndex();
uint32_t idx = IGetProxyIndex();
if( fProxyDrawables[idx] )
{
int i;

View File

@ -92,28 +92,28 @@ protected:
plDrawableSpans* fProxyDraw;
hsGMaterial* fProxyMat;
UInt32 fProxyMsgType;
uint32_t fProxyMsgType;
hsTArray<UInt32> fProxyIndex;
hsTArray<uint32_t> fProxyIndex;
// These must be implemented by the specific type, so we know what to draw.
virtual plDrawableSpans* ICreateProxy(hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo=nil) = 0; // called by IGenerate
virtual plDrawableSpans* ICreateProxy(hsGMaterial* mat, hsTArray<uint32_t>& idx, plDrawableSpans* addTo=nil) = 0; // called by IGenerate
virtual plKey IGetNode() const = 0;
// Derived type should set fProxyMsgType as one of plProxyDrawMsg::types
UInt32 IGetProxyMsgType() const { return fProxyMsgType; }
uint32_t IGetProxyMsgType() const { return fProxyMsgType; }
// These are all fine by default.
UInt32 IGetProxyIndex() const;
UInt32 IGetDrawableType() const;
uint32_t IGetProxyIndex() const;
uint32_t IGetDrawableType() const;
virtual hsGMaterial* IMakeProxyMaterial() const;
virtual hsGMaterial* IGetProxyMaterial() const; // will make material if needed.
hsGMaterial* IFindProxyMaterial() const;
virtual void IGenerateProxy();
virtual void IApplyProxy(UInt32 drawIdx) const; // called by IGenerate
virtual void IRemoveProxy(UInt32 drawIdx) const;
virtual void IApplyProxy(uint32_t drawIdx) const; // called by IGenerate
virtual void IRemoveProxy(uint32_t drawIdx) const;
virtual void IDestroyProxy();
public:
plProxyGen(const hsColorRGBA& amb, const hsColorRGBA& dif, hsScalar opac);

View File

@ -59,7 +59,7 @@ plSharedMesh::~plSharedMesh()
delete fSpans.Pop();
}
/*
void plSharedMesh::CreateInstance(plSceneObject *so, UInt8 boneIndex)
void plSharedMesh::CreateInstance(plSceneObject *so, uint8_t boneIndex)
{
plDrawInterface *di = so->GetVolatileDrawInterface();

View File

@ -65,12 +65,12 @@ public:
hsTArray<plGeometrySpan *>fSpans;
hsTArray<const plSceneObject *> fActiveInstances;
plMorphDataSet *fMorphSet;
UInt8 fFlags;
uint8_t fFlags;
plSharedMesh();
~plSharedMesh();
void CreateInstance(plSceneObject *so, UInt8 boneIndex);
void CreateInstance(plSceneObject *so, uint8_t boneIndex);
void RemoveInstance(plSceneObject *so);
CLASSNAME_REGISTER( plSharedMesh );

View File

@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
static hsBitVector scratchTotVec;
static hsBitVector scratchBitVec;
static hsTArray<Int16> scratchList;
static hsTArray<int16_t> scratchList;
static hsTArray<hsRadixSort::Elem> scratchSort;
plProfile_CreateCounter("Harvest Leaves", "Draw", HarvestLeaves);
@ -92,7 +92,7 @@ plSpaceTree::~plSpaceTree()
{
}
void plSpaceTree::IRefreshRecur(Int16 which)
void plSpaceTree::IRefreshRecur(int16_t which)
{
plSpaceTreeNode& sub = fTree[which];
@ -123,7 +123,7 @@ void plSpaceTree::Refresh()
IRefreshRecur(fRoot);
}
void plSpaceTree::SetTreeFlag(UInt16 f, hsBool on)
void plSpaceTree::SetTreeFlag(uint16_t f, hsBool on)
{
if( IsEmpty() )
return;
@ -139,7 +139,7 @@ void plSpaceTree::SetTreeFlag(UInt16 f, hsBool on)
fTree[i].fFlags |= f;
}
void plSpaceTree::ClearTreeFlag(UInt16 f)
void plSpaceTree::ClearTreeFlag(uint16_t f)
{
if( IsEmpty() )
return;
@ -149,7 +149,7 @@ void plSpaceTree::ClearTreeFlag(UInt16 f)
fTree[i].fFlags &= ~f;
}
void plSpaceTree::SetLeafFlag(Int16 idx, UInt16 f, hsBool on)
void plSpaceTree::SetLeafFlag(int16_t idx, uint16_t f, hsBool on)
{
if( IsEmpty() )
return;
@ -181,7 +181,7 @@ void plSpaceTree::SetLeafFlag(Int16 idx, UInt16 f, hsBool on)
}
}
void plSpaceTree::ClearLeafFlag(Int16 idx, UInt16 f)
void plSpaceTree::ClearLeafFlag(int16_t idx, uint16_t f)
{
hsAssert(idx == fTree[idx].fLeafIndex, "Some scrambling of indices");
@ -200,7 +200,7 @@ void plSpaceTree::ClearLeafFlag(Int16 idx, UInt16 f)
}
inline void plSpaceTree::IEnableLeaf(Int16 idx, hsBitVector& cache) const
inline void plSpaceTree::IEnableLeaf(int16_t idx, hsBitVector& cache) const
{
cache.SetBit(idx);
@ -221,12 +221,12 @@ inline void plSpaceTree::IEnableLeaf(Int16 idx, hsBitVector& cache) const
}
}
void plSpaceTree::EnableLeaf(Int16 idx, hsBitVector& cache) const
void plSpaceTree::EnableLeaf(int16_t idx, hsBitVector& cache) const
{
IEnableLeaf(idx, cache);
}
void plSpaceTree::EnableLeaves(const hsTArray<Int16>& list, hsBitVector& cache) const
void plSpaceTree::EnableLeaves(const hsTArray<int16_t>& list, hsBitVector& cache) const
{
if( IsEmpty() )
return;
@ -237,7 +237,7 @@ void plSpaceTree::EnableLeaves(const hsTArray<Int16>& list, hsBitVector& cache)
}
}
void plSpaceTree::IHarvestAndCullEnabledLeaves(Int16 subIdx, const hsBitVector& cache, hsTArray<Int16>& list) const
void plSpaceTree::IHarvestAndCullEnabledLeaves(int16_t subIdx, const hsBitVector& cache, hsTArray<int16_t>& list) const
{
if( !cache.IsBitSet(subIdx) )
return;
@ -267,7 +267,7 @@ void plSpaceTree::IHarvestAndCullEnabledLeaves(Int16 subIdx, const hsBitVector&
}
}
void plSpaceTree::IHarvestEnabledLeaves(Int16 subIdx, const hsBitVector& cache, hsTArray<Int16>& list) const
void plSpaceTree::IHarvestEnabledLeaves(int16_t subIdx, const hsBitVector& cache, hsTArray<int16_t>& list) const
{
if( !cache.IsBitSet(subIdx) )
return;
@ -286,7 +286,7 @@ void plSpaceTree::IHarvestEnabledLeaves(Int16 subIdx, const hsBitVector& cache,
}
}
void plSpaceTree::HarvestEnabledLeaves(plVolumeIsect* cull, const hsBitVector& cache, hsTArray<Int16>& list) const
void plSpaceTree::HarvestEnabledLeaves(plVolumeIsect* cull, const hsBitVector& cache, hsTArray<int16_t>& list) const
{
if( IsEmpty() )
return;
@ -297,7 +297,7 @@ void plSpaceTree::HarvestEnabledLeaves(plVolumeIsect* cull, const hsBitVector& c
IHarvestEnabledLeaves(fRoot, cache, list);
}
void plSpaceTree::IHarvestEnabledLeaves(Int16 subIdx, const hsBitVector& cache, hsBitVector& totList, hsBitVector& list) const
void plSpaceTree::IHarvestEnabledLeaves(int16_t subIdx, const hsBitVector& cache, hsBitVector& totList, hsBitVector& list) const
{
if( IsDisabled(subIdx) )
return;
@ -320,7 +320,7 @@ void plSpaceTree::IHarvestEnabledLeaves(Int16 subIdx, const hsBitVector& cache,
}
}
void plSpaceTree::MoveLeaf(Int16 idx, const hsBounds3Ext& bnd)
void plSpaceTree::MoveLeaf(int16_t idx, const hsBounds3Ext& bnd)
{
hsAssert(idx == fTree[idx].fLeafIndex, "Some scrambling of indices");
@ -340,7 +340,7 @@ void plSpaceTree::MoveLeaf(Int16 idx, const hsBounds3Ext& bnd)
}
}
void plSpaceTree::HarvestLeaves(Int16 subRoot, hsBitVector& totList, hsBitVector& list) const
void plSpaceTree::HarvestLeaves(int16_t subRoot, hsBitVector& totList, hsBitVector& list) const
{
if( !IsEmpty() )
{
@ -380,13 +380,13 @@ void plSpaceTree::HarvestLeaves(plVolumeIsect* cull, hsBitVector& list) const
scratchTotVec.Clear();
}
void plSpaceTree::HarvestLeaves(Int16 subRoot, hsBitVector& list) const
void plSpaceTree::HarvestLeaves(int16_t subRoot, hsBitVector& list) const
{
IHarvestLeaves(GetNode(subRoot), scratchTotVec, list);
scratchTotVec.Clear();
}
void plSpaceTree::HarvestLeaves(plVolumeIsect* cull, hsTArray<Int16>& list) const
void plSpaceTree::HarvestLeaves(plVolumeIsect* cull, hsTArray<int16_t>& list) const
{
if( !IsEmpty() )
{
@ -397,7 +397,7 @@ void plSpaceTree::HarvestLeaves(plVolumeIsect* cull, hsTArray<Int16>& list) cons
}
}
void plSpaceTree::HarvestLeaves(hsTArray<Int16>& list) const
void plSpaceTree::HarvestLeaves(hsTArray<int16_t>& list) const
{
if( !IsEmpty() )
{
@ -408,7 +408,7 @@ void plSpaceTree::HarvestLeaves(hsTArray<Int16>& list) const
}
}
void plSpaceTree::HarvestLeaves(Int16 subRoot, hsTArray<Int16>& list) const
void plSpaceTree::HarvestLeaves(int16_t subRoot, hsTArray<int16_t>& list) const
{
if( !IsEmpty() )
{
@ -420,7 +420,7 @@ void plSpaceTree::HarvestLeaves(Int16 subRoot, hsTArray<Int16>& list) const
}
}
void plSpaceTree::BitVectorToList(hsTArray<Int16>& list, const hsBitVector& bitVec) const
void plSpaceTree::BitVectorToList(hsTArray<int16_t>& list, const hsBitVector& bitVec) const
{
#if 0 // added func to bitvector
int i;
@ -472,7 +472,7 @@ void plSpaceTree::IHarvestAndCullLeaves(const plSpaceTreeNode& subRoot, hsBitVec
}
}
void plSpaceTree::IHarvestAndCullLeaves(const plSpaceTreeNode& subRoot, hsTArray<Int16>& list) const
void plSpaceTree::IHarvestAndCullLeaves(const plSpaceTreeNode& subRoot, hsTArray<int16_t>& list) const
{
if( subRoot.fFlags & plSpaceTreeNode::kDisabled )
return;
@ -525,7 +525,7 @@ void plSpaceTree::IHarvestLeaves(const plSpaceTreeNode& subRoot, hsBitVector& to
}
}
void plSpaceTree::IHarvestLeaves(const plSpaceTreeNode& subRoot, hsTArray<Int16>& list) const
void plSpaceTree::IHarvestLeaves(const plSpaceTreeNode& subRoot, hsTArray<int16_t>& list) const
{
if( subRoot.fFlags & plSpaceTreeNode::kDisabled )
return;
@ -547,9 +547,9 @@ void plSpaceTree::Read(hsStream* s, hsResMgr* mgr)
fRoot = s->ReadLE16();
fNumLeaves = UInt16(s->ReadLE32());
fNumLeaves = uint16_t(s->ReadLE32());
UInt32 n = s->ReadLE32();
uint32_t n = s->ReadLE32();
fTree.SetCount(n);
int i;
for( i = 0; i < n; i++ )
@ -574,7 +574,7 @@ void plSpaceTree::Write(hsStream* s, hsResMgr* mgr)
// Some debug only stuff
void plSpaceTree::HarvestLevel(int level, hsTArray<Int16>& list) const
void plSpaceTree::HarvestLevel(int level, hsTArray<int16_t>& list) const
{
if( !IsEmpty() )
{
@ -582,7 +582,7 @@ void plSpaceTree::HarvestLevel(int level, hsTArray<Int16>& list) const
}
}
void plSpaceTree::IHarvestLevel(Int16 subRoot, int level, int currLevel, hsTArray<Int16>& list) const
void plSpaceTree::IHarvestLevel(int16_t subRoot, int level, int currLevel, hsTArray<int16_t>& list) const
{
if( level == currLevel )
{

View File

@ -66,16 +66,16 @@ public:
hsBounds3Ext fWorldBounds;
UInt16 fFlags; // mostly for alignment;
Int16 fParent;
uint16_t fFlags; // mostly for alignment;
int16_t fParent;
union {
Int16 fChildren[2]; // Children are actually in same array as parent
Int16 fLeafIndex;
int16_t fChildren[2]; // Children are actually in same array as parent
int16_t fLeafIndex;
};
Int16 GetChild(int w) const { hsAssert(!(fFlags & kIsLeaf), "Getting Child of leaf node"); return fChildren[w]; }
Int16 GetParent() const { return fParent; }
Int16 GetLeaf() const { hsAssert(fFlags & kIsLeaf, "Getting leaf idx off interior node"); return fLeafIndex; }
int16_t GetChild(int w) const { hsAssert(!(fFlags & kIsLeaf), "Getting Child of leaf node"); return fChildren[w]; }
int16_t GetParent() const { return fParent; }
int16_t GetLeaf() const { hsAssert(fFlags & kIsLeaf, "Getting leaf idx off interior node"); return fLeafIndex; }
hsBool IsLeaf() const { return 0 != (fFlags & kIsLeaf); }
const hsBounds3Ext& GetWorldBounds() const { return fWorldBounds; }
@ -101,30 +101,30 @@ private:
hsTArray<plSpaceTreeNode> fTree;
const hsBitVector* fCache;
Int16 fRoot;
Int16 fNumLeaves;
int16_t fRoot;
int16_t fNumLeaves;
UInt16 fHarvestFlags;
uint16_t fHarvestFlags;
mutable plVolumeIsect* fCullFunc;
hsPoint3 fViewPos;
void IRefreshRecur(Int16 which);
void IRefreshRecur(int16_t which);
void IHarvestAndCullLeaves(const plSpaceTreeNode& subRoot, hsTArray<Int16>& list) const;
void IHarvestLeaves(const plSpaceTreeNode& subRoot, hsTArray<Int16>& list) const;
void IHarvestAndCullLeaves(const plSpaceTreeNode& subRoot, hsTArray<int16_t>& list) const;
void IHarvestLeaves(const plSpaceTreeNode& subRoot, hsTArray<int16_t>& list) const;
void IHarvestAndCullLeaves(const plSpaceTreeNode& subRoot, hsBitVector& totList, hsBitVector& list) const;
void IHarvestLeaves(const plSpaceTreeNode& subRoot, hsBitVector& totList, hsBitVector& list) const;
void IHarvestLevel(Int16 subRoot, int level, int currLevel, hsTArray<Int16>& list) const;
void IHarvestLevel(int16_t subRoot, int level, int currLevel, hsTArray<int16_t>& list) const;
void IHarvestAndCullEnabledLeaves(Int16 subRoot, const hsBitVector& cache, hsTArray<Int16>& list) const;
void IHarvestEnabledLeaves(Int16 subRoot, const hsBitVector& cache, hsTArray<Int16>& list) const;
void IHarvestEnabledLeaves(Int16 subIdx, const hsBitVector& cache, hsBitVector& totList, hsBitVector& list) const;
void IHarvestAndCullEnabledLeaves(int16_t subRoot, const hsBitVector& cache, hsTArray<int16_t>& list) const;
void IHarvestEnabledLeaves(int16_t subRoot, const hsBitVector& cache, hsTArray<int16_t>& list) const;
void IHarvestEnabledLeaves(int16_t subIdx, const hsBitVector& cache, hsBitVector& totList, hsBitVector& list) const;
void IEnableLeaf(Int16 idx, hsBitVector& cache) const;
void IEnableLeaf(int16_t idx, hsBitVector& cache) const;
public:
plSpaceTree();
@ -136,54 +136,54 @@ public:
void SetViewPos(const hsPoint3& p) { fViewPos = p; }
const hsPoint3& GetViewPos() const { return fViewPos; }
const plSpaceTreeNode& GetNode(Int16 w) const { return fTree[w]; }
Int16 GetRoot() const { return fRoot; }
hsBool IsRoot(Int16 w) const { return fRoot == w; }
hsBool IsLeaf(Int16 w) const { return GetNode(w).IsLeaf(); }
const plSpaceTreeNode& GetNode(int16_t w) const { return fTree[w]; }
int16_t GetRoot() const { return fRoot; }
hsBool IsRoot(int16_t w) const { return fRoot == w; }
hsBool IsLeaf(int16_t w) const { return GetNode(w).IsLeaf(); }
void HarvestLeaves(hsBitVector& totList, hsBitVector& list) const;
void HarvestLeaves(hsBitVector& list) const;
void HarvestLeaves(plVolumeIsect* cullFunc, hsBitVector& list) const;
void HarvestLeaves(Int16 subRoot, hsBitVector& list) const;
void HarvestLeaves(Int16 subRoot, hsBitVector& totList, hsBitVector& list) const;
void HarvestLeaves(int16_t subRoot, hsBitVector& list) const;
void HarvestLeaves(int16_t subRoot, hsBitVector& totList, hsBitVector& list) const;
void HarvestLeaves(hsTArray<Int16>& list) const;
void HarvestLeaves(plVolumeIsect* cullFunc, hsTArray<Int16>& list) const;
void HarvestLeaves(Int16 subRoot, hsTArray<Int16>& list) const;
void HarvestLeaves(hsTArray<int16_t>& list) const;
void HarvestLeaves(plVolumeIsect* cullFunc, hsTArray<int16_t>& list) const;
void HarvestLeaves(int16_t subRoot, hsTArray<int16_t>& list) const;
void EnableLeaf(Int16 idx, hsBitVector& cache) const;
void EnableLeaves(const hsTArray<Int16>& list, hsBitVector& cache) const;
void HarvestEnabledLeaves(plVolumeIsect* cullFunc, const hsBitVector& cache, hsTArray<Int16>& list) const;
void EnableLeaf(int16_t idx, hsBitVector& cache) const;
void EnableLeaves(const hsTArray<int16_t>& list, hsBitVector& cache) const;
void HarvestEnabledLeaves(plVolumeIsect* cullFunc, const hsBitVector& cache, hsTArray<int16_t>& list) const;
void SetCache(const hsBitVector* cache) { fCache = cache; }
void BitVectorToList(hsTArray<Int16>& list, const hsBitVector& bitVec) const;
void BitVectorToList(hsTArray<int16_t>& list, const hsBitVector& bitVec) const;
void SetHarvestFlags(plHarvestFlags f) { fHarvestFlags = f; }
UInt16 GetHarvestFlags() const { return fHarvestFlags; }
uint16_t GetHarvestFlags() const { return fHarvestFlags; }
UInt16 HasLeafFlag(Int16 w, UInt16 f) const { return GetNode(w).fFlags & f; }
void SetLeafFlag(Int16 w, UInt16 f, hsBool on=true);
void ClearLeafFlag(Int16 w, UInt16 f);
void ClearTreeFlag(UInt16 f);
void SetTreeFlag(UInt16 f, hsBool on=true);
uint16_t HasLeafFlag(int16_t w, uint16_t f) const { return GetNode(w).fFlags & f; }
void SetLeafFlag(int16_t w, uint16_t f, hsBool on=true);
void ClearLeafFlag(int16_t w, uint16_t f);
void ClearTreeFlag(uint16_t f);
void SetTreeFlag(uint16_t f, hsBool on=true);
hsBool IsDisabled(UInt16 w) const { return (GetNode(w).fFlags & plSpaceTreeNode::kDisabled) || (fCache && !fCache->IsBitSet(w)); }
hsBool IsDisabled(uint16_t w) const { return (GetNode(w).fFlags & plSpaceTreeNode::kDisabled) || (fCache && !fCache->IsBitSet(w)); }
// Should GetWorldBounds check and refresh if needed?
const hsBounds3Ext& GetWorldBounds() const { return GetNode(GetRoot()).fWorldBounds; }
void MoveLeaf(Int16 idx, const hsBounds3Ext& newWorldBnd);
void MoveLeaf(int16_t idx, const hsBounds3Ext& newWorldBnd);
void Refresh();
hsBool IsEmpty() const { return 0 != (GetNode(GetRoot()).fFlags & plSpaceTreeNode::kEmpty); }
hsBool IsDirty() const { return 0 != (GetNode(GetRoot()).fFlags & plSpaceTreeNode::kDirty); }
void MakeDirty() { fTree[GetRoot()].fFlags |= plSpaceTreeNode::kDirty; }
Int16 GetNumLeaves() const { return fNumLeaves; }
int16_t GetNumLeaves() const { return fNumLeaves; }
virtual void Read(hsStream* s, hsResMgr* mgr);
virtual void Write(hsStream* s, hsResMgr* mgr);
void HarvestLevel(int level, hsTArray<Int16>& list) const;
void HarvestLevel(int level, hsTArray<int16_t>& list) const;
friend class plSpaceTreeMaker;
};

View File

@ -129,7 +129,7 @@ void plSpaceTreeMaker::ISortList(hsTArray<plSpacePrepNode*>& nodes, const hsVect
hsRadixSort::Elem* list = fSortScratch;
hsRadixSort::Elem* listTrav = list;
Int32 n = nodes.GetCount();
int32_t n = nodes.GetCount();
while( n-- )
{
listTrav->fKey.fFloat = axis.InnerProduct(nodes[n]->fWorldBounds.GetCenter());
@ -138,7 +138,7 @@ void plSpaceTreeMaker::ISortList(hsTArray<plSpacePrepNode*>& nodes, const hsVect
listTrav++;
}
list[nodes.GetCount()-1].fNext = nil;
UInt32 sortFlags = 0;
uint32_t sortFlags = 0;
hsRadixSort rad;
hsRadixSort::Elem* sortedList = rad.Sort(list, sortFlags);
listTrav = sortedList;
@ -311,7 +311,7 @@ void plSpaceTreeMaker::IFindBigList(hsTArray<plSpacePrepNode*>& nodes, hsScalar
plSpacePrepNode* plSpaceTreeMaker::INewSubRoot(const hsBounds3Ext& bnd)
{
plSpacePrepNode* subRoot = TRACKED_NEW plSpacePrepNode;
subRoot->fDataIndex = Int16(-1);
subRoot->fDataIndex = int16_t(-1);
fTreeSize++;
subRoot->fWorldBounds = bnd;
@ -411,7 +411,7 @@ void plSpaceTreeMaker::Cleanup()
fDisabled.Reset();
}
Int32 plSpaceTreeMaker::AddLeaf(const hsBounds3Ext& worldBnd, hsBool disable)
int32_t plSpaceTreeMaker::AddLeaf(const hsBounds3Ext& worldBnd, hsBool disable)
{
plSpacePrepNode* leaf = TRACKED_NEW plSpacePrepNode;
fLeaves.Append(leaf);
@ -631,11 +631,11 @@ plSpaceTree* plSpaceTreeMaker::IMakeSpaceTree()
// The following goofy cache-friendly tree set up slows down the tree build by 10%, but speeds up the runtime by 9%.
// Sounds fair.
#if 0 // Leaves first
Int16 plSpaceTreeMaker::IMakeSpaceTreeRecur(plSpacePrepNode* sub, plSpaceTree* tree, const int targetLevel, int currLevel)
int16_t plSpaceTreeMaker::IMakeSpaceTreeRecur(plSpacePrepNode* sub, plSpaceTree* tree, const int targetLevel, int currLevel)
{
if( currLevel == targetLevel )
{
Int16 nodeIdx = tree->fTree.GetCount();
int16_t nodeIdx = tree->fTree.GetCount();
tree->fTree.Push();
tree->fTree[nodeIdx].fWorldBounds = sub->fWorldBounds;
@ -659,7 +659,7 @@ Int16 plSpaceTreeMaker::IMakeSpaceTreeRecur(plSpacePrepNode* sub, plSpaceTree* t
return nodeIdx;
}
Int16 nodeIdx = sub->fIndex;
int16_t nodeIdx = sub->fIndex;
if( !sub->fChildren[0] )
{
@ -686,7 +686,7 @@ void plSpaceTreeMaker::IGatherLeavesRecur(plSpacePrepNode* sub, plSpaceTree* tre
hsAssert(!sub->fChildren[1], "Unsupported unbalance of tree");
plSpaceTreeNode& leaf = tree->fTree[sub->fDataIndex];
Int16 nodeIdx = sub->fDataIndex;
int16_t nodeIdx = sub->fDataIndex;
leaf.fWorldBounds = sub->fWorldBounds;
sub->fIndex = nodeIdx;
leaf.fFlags = plSpaceTreeNode::kIsLeaf;
@ -713,7 +713,7 @@ void plSpaceTreeMaker::IMakeSpaceTreeRecur(plSpacePrepNode* sub, plSpaceTree* tr
if( currLevel == targetLevel )
{
Int16 nodeIdx = tree->fTree.GetCount();
int16_t nodeIdx = tree->fTree.GetCount();
tree->fTree.Push();
tree->fTree[nodeIdx].fWorldBounds = sub->fWorldBounds;

View File

@ -55,8 +55,8 @@ class plSpacePrepNode
public:
hsBounds3Ext fWorldBounds;
Int16 fIndex;
Int16 fDataIndex;
int16_t fIndex;
int16_t fDataIndex;
plSpacePrepNode* fChildren[2];
};
@ -71,7 +71,7 @@ protected:
hsBitVector fDisabled;
plSpacePrepNode* fPrepTree;
Int16 fTreeSize;
int16_t fTreeSize;
plSpacePrepNode* INewSubRoot(const hsBounds3Ext& bnd);
void IFindBigList(hsTArray<plSpacePrepNode*>& nodes, hsScalar length, const hsVector3& axis, hsTArray<plSpacePrepNode*>& giants, hsTArray<plSpacePrepNode*>& strimp);
@ -98,7 +98,7 @@ public:
void Cleanup();
void Reset();
Int32 AddLeaf(const hsBounds3Ext& worldBnd, hsBool disable=false);
int32_t AddLeaf(const hsBounds3Ext& worldBnd, hsBool disable=false);
plSpaceTree* MakeTree();
void TestTree(); // development only - NUKE ME mf horse

View File

@ -54,7 +54,7 @@ void plSpanEncoding::Read(hsStream* s)
void plSpanEncoding::Write(hsStream* s) const
{
s->WriteByte((UInt8)fCode);
s->WriteByte((uint8_t)fCode);
s->WriteLEScalar(fPosScale);
}
@ -82,19 +82,19 @@ void plSpanInstance::DeAlloc()
fCol = nil;
}
void plSpanInstance::Alloc(const plSpanEncoding& encoding, UInt32 numVerts)
void plSpanInstance::Alloc(const plSpanEncoding& encoding, uint32_t numVerts)
{
DeAlloc();
UInt32 posStride = PosStrideFromEncoding(encoding);
uint32_t posStride = PosStrideFromEncoding(encoding);
if( posStride )
fPosDelta = TRACKED_NEW UInt8[numVerts * posStride];
fPosDelta = TRACKED_NEW uint8_t[numVerts * posStride];
UInt32 colStride = ColStrideFromEncoding(encoding);
uint32_t colStride = ColStrideFromEncoding(encoding);
if( colStride )
fCol = TRACKED_NEW UInt8[numVerts * colStride];
fCol = TRACKED_NEW uint8_t[numVerts * colStride];
}
void plSpanInstance::Read(hsStream* stream, const plSpanEncoding& encoding, UInt32 numVerts)
void plSpanInstance::Read(hsStream* stream, const plSpanEncoding& encoding, uint32_t numVerts)
{
Alloc(encoding, numVerts);
@ -110,7 +110,7 @@ void plSpanInstance::Read(hsStream* stream, const plSpanEncoding& encoding, UInt
}
}
void plSpanInstance::Write(hsStream* stream, const plSpanEncoding& encoding, UInt32 numVerts) const
void plSpanInstance::Write(hsStream* stream, const plSpanEncoding& encoding, uint32_t numVerts) const
{
stream->Write(12 * sizeof(hsScalar), fL2W[0]);
if( fPosDelta )
@ -165,7 +165,7 @@ void plSpanInstance::SetLocalToWorld(const hsMatrix44& l2w)
}
}
void plSpanInstance::Encode(const plSpanEncoding& encoding, UInt32 numVerts, const hsVector3* delPos, const UInt32* color)
void plSpanInstance::Encode(const plSpanEncoding& encoding, uint32_t numVerts, const hsVector3* delPos, const uint32_t* color)
{
Alloc(encoding, numVerts);
@ -176,42 +176,42 @@ void plSpanInstance::Encode(const plSpanEncoding& encoding, UInt32 numVerts, con
if( !(fPosDelta || fCol) )
return;
Int8* pos888 = (Int8*)fPosDelta;
Int16* pos161616 = (Int16*)fPosDelta;
UInt32* pos101010 = (UInt32*)fPosDelta;
int8_t* pos888 = (int8_t*)fPosDelta;
int16_t* pos161616 = (int16_t*)fPosDelta;
uint32_t* pos101010 = (uint32_t*)fPosDelta;
UInt8* col8 = (UInt8*)fCol;
UInt16* col16 = (UInt16*)fCol;
UInt32* col32 = (UInt32*)fCol;
uint8_t* col8 = (uint8_t*)fCol;
uint16_t* col16 = (uint16_t*)fCol;
uint32_t* col32 = (uint32_t*)fCol;
int i;
for( i = 0; i < numVerts; i++ )
{
switch(encoding.fCode & plSpanEncoding::kPosMask)
{
case plSpanEncoding::kPos888:
pos888[0] = Int8(delPos->fX / encoding.fPosScale);
pos888[1] = Int8(delPos->fY / encoding.fPosScale);
pos888[2] = Int8(delPos->fZ / encoding.fPosScale);
pos888[0] = int8_t(delPos->fX / encoding.fPosScale);
pos888[1] = int8_t(delPos->fY / encoding.fPosScale);
pos888[2] = int8_t(delPos->fZ / encoding.fPosScale);
pos888 += 3;
delPos++;
break;
case plSpanEncoding::kPos161616:
pos161616[0] = Int16(delPos->fX / encoding.fPosScale);
pos161616[1] = Int16(delPos->fY / encoding.fPosScale);
pos161616[2] = Int16(delPos->fZ / encoding.fPosScale);
pos161616[0] = int16_t(delPos->fX / encoding.fPosScale);
pos161616[1] = int16_t(delPos->fY / encoding.fPosScale);
pos161616[2] = int16_t(delPos->fZ / encoding.fPosScale);
pos161616 += 3;
delPos++;
break;
case plSpanEncoding::kPos101010:
*pos101010 =
((UInt32(delPos->fX / encoding.fPosScale) & 0x3f) << 0)
| ((UInt32(delPos->fY / encoding.fPosScale) & 0x3f) << 10)
| ((UInt32(delPos->fZ / encoding.fPosScale) & 0x3f) << 20);
((uint32_t(delPos->fX / encoding.fPosScale) & 0x3f) << 0)
| ((uint32_t(delPos->fY / encoding.fPosScale) & 0x3f) << 10)
| ((uint32_t(delPos->fZ / encoding.fPosScale) & 0x3f) << 20);
pos101010++;
delPos++;
break;
case plSpanEncoding::kPos008:
*pos888 = Int8(delPos->fZ / encoding.fPosScale);
*pos888 = int8_t(delPos->fZ / encoding.fPosScale);
pos888++;
delPos++;
break;
@ -222,24 +222,24 @@ void plSpanInstance::Encode(const plSpanEncoding& encoding, UInt32 numVerts, con
switch(encoding.fCode & plSpanEncoding::kColMask)
{
case plSpanEncoding::kColA8:
*col8 = (UInt8)((*color) >> 24);
*col8 = (uint8_t)((*color) >> 24);
col8++;
color++;
break;
case plSpanEncoding::kColI8:
*col8 = (UInt8)((*color) & 0xff);
*col8 = (uint8_t)((*color) & 0xff);
col8++;
color++;
break;
case plSpanEncoding::kColAI88:
*col16 = (UInt16)(((*color) >> 16) & 0xffff);
*col16 = (uint16_t)(((*color) >> 16) & 0xffff);
col16++;
color++;
break;
case plSpanEncoding::kColRGB888:
*col8++ = (UInt8)((*color >> 16) & 0xff);
*col8++ = (UInt8)((*color >> 8) & 0xff);
*col8++ = (UInt8)((*color >> 0) & 0xff);
*col8++ = (uint8_t)((*color >> 16) & 0xff);
*col8++ = (uint8_t)((*color >> 8) & 0xff);
*col8++ = (uint8_t)((*color >> 0) & 0xff);
color++;
break;
case plSpanEncoding::kColARGB8888:

View File

@ -112,13 +112,13 @@ public:
| kColARGB8888,
};
UInt32 fCode;
uint32_t fCode;
hsScalar fPosScale;
plSpanEncoding() : fCode(kPosNone|kColNone), fPosScale(0) {}
plSpanEncoding(UInt32 c, hsScalar s) : fCode(c), fPosScale(s) {}
plSpanEncoding(uint32_t c, hsScalar s) : fCode(c), fPosScale(s) {}
UInt32 Code() const { return fCode; }
uint32_t Code() const { return fCode; }
hsScalar Scale() const { return fPosScale; }
void Read(hsStream* s);
@ -128,8 +128,8 @@ public:
class plSpanInstance
{
protected:
UInt8* fPosDelta;
UInt8* fCol;
uint8_t* fPosDelta;
uint8_t* fCol;
hsScalar fL2W[3][4];
@ -138,12 +138,12 @@ public:
plSpanInstance();
~plSpanInstance();
void Read(hsStream* s, const plSpanEncoding& encoding, UInt32 numVerts);
void Write(hsStream* s, const plSpanEncoding& encoding, UInt32 numVerts) const;
void Read(hsStream* s, const plSpanEncoding& encoding, uint32_t numVerts);
void Write(hsStream* s, const plSpanEncoding& encoding, uint32_t numVerts) const;
void Encode(const plSpanEncoding& encoding, UInt32 numVerts, const hsVector3* delPos, const UInt32* color);
void Encode(const plSpanEncoding& encoding, uint32_t numVerts, const hsVector3* delPos, const uint32_t* color);
void Alloc(const plSpanEncoding& encoding, UInt32 numVerts);
void Alloc(const plSpanEncoding& encoding, uint32_t numVerts);
void DeAlloc();
hsMatrix44 LocalToWorld() const;
@ -154,7 +154,7 @@ public:
hsBool HasPosDelta() const { return fPosDelta != nil; }
hsBool HasColor() const { return fCol != nil; }
static UInt16 PosStrideFromEncoding(const plSpanEncoding& encoding)
static uint16_t PosStrideFromEncoding(const plSpanEncoding& encoding)
{
switch(encoding.fCode & plSpanEncoding::kPosMask)
{
@ -169,7 +169,7 @@ public:
}
return 0;
}
static UInt16 ColStrideFromEncoding(const plSpanEncoding& encoding)
static uint16_t ColStrideFromEncoding(const plSpanEncoding& encoding)
{
switch(encoding.fCode & plSpanEncoding::kPosMask)
{
@ -195,29 +195,29 @@ class plSpanInstanceIter
protected:
plSpanInstance* fInst;
plSpanEncoding fEncoding;
UInt32 fNumVerts;
Int32 fNumVertsLeft;
UInt16 fPosStride;
UInt16 fColStride;
uint32_t fNumVerts;
int32_t fNumVertsLeft;
uint16_t fPosStride;
uint16_t fColStride;
union {
Int8* fPos888;
Int16* fPos161616;
UInt32* fPos101010;
int8_t* fPos888;
int16_t* fPos161616;
uint32_t* fPos101010;
};
union {
UInt8* fA8;
UInt8* fI8;
UInt16* fAI88;
UInt8* fRGB888;
UInt32* fARGB8888;
uint8_t* fA8;
uint8_t* fI8;
uint16_t* fAI88;
uint8_t* fRGB888;
uint32_t* fARGB8888;
};
public:
plSpanInstanceIter();
plSpanInstanceIter(plSpanInstance* inst, const plSpanEncoding& encoding, UInt32 numVerts) { Init(inst, encoding, numVerts); }
plSpanInstanceIter(plSpanInstance* inst, const plSpanEncoding& encoding, uint32_t numVerts) { Init(inst, encoding, numVerts); }
void Init(plSpanInstance* inst, const plSpanEncoding& encoding, UInt32 numVerts)
void Init(plSpanInstance* inst, const plSpanEncoding& encoding, uint32_t numVerts)
{
fInst = inst;
fEncoding = encoding;
@ -229,7 +229,7 @@ public:
void Begin()
{
fPos888 = (Int8*)fInst->fPosDelta;
fPos888 = (int8_t*)fInst->fPosDelta;
fA8 = fInst->fCol;
fNumVertsLeft = fNumVerts;
@ -270,7 +270,7 @@ public:
pos += DelPos();
return pos;
};
UInt32 Color(UInt32 c) const
uint32_t Color(uint32_t c) const
{
switch(fEncoding.fCode & plSpanEncoding::kColMask)
{
@ -283,7 +283,7 @@ public:
| (*fI8 << 0);
case plSpanEncoding::kColAI88:
{
const UInt32 col = *fAI88 & 0xff;
const uint32_t col = *fAI88 & 0xff;
return ((*fAI88 & 0xff00) << 24)
| (col << 16)
| (col << 8)

View File

@ -58,7 +58,7 @@ plSpanTemplate::plSpanTemplate()
{
}
UInt32 plSpanTemplate::CalcStride()
uint32_t plSpanTemplate::CalcStride()
{
fStride = 0;
if( NumPos() )
@ -66,31 +66,31 @@ UInt32 plSpanTemplate::CalcStride()
if( NumNorm() )
fStride += sizeof(hsVector3);
if( NumColor() )
fStride += sizeof(UInt32);
fStride += sizeof(uint32_t);
if( NumColor2() )
fStride += sizeof(UInt32);
fStride += sizeof(uint32_t);
if( NumWgtIdx() )
fStride += sizeof(UInt32);
fStride += sizeof(uint32_t);
if( NumUVWs() )
fStride += (UInt8)(sizeof(hsPoint3) * NumUVWs());
fStride += (uint8_t)(sizeof(hsPoint3) * NumUVWs());
if( NumWeights() )
fStride += (UInt8)(sizeof(hsScalar) * NumWeights());
fStride += (uint8_t)(sizeof(hsScalar) * NumWeights());
return UInt32(fStride);
return uint32_t(fStride);
}
void plSpanTemplate::Alloc(UInt16 format, UInt32 numVerts, UInt32 numTris)
void plSpanTemplate::Alloc(uint16_t format, uint32_t numVerts, uint32_t numTris)
{
DeAlloc();
fNumVerts = (UInt16)numVerts;
fNumVerts = (uint16_t)numVerts;
fFormat = format;
CalcStride();
fNumTris = (UInt16)numTris;
fNumTris = (uint16_t)numTris;
fData = TRACKED_NEW UInt8[VertSize()];
fData = TRACKED_NEW uint8_t[VertSize()];
fIndices = TRACKED_NEW UInt16[NumIndices()];
fIndices = TRACKED_NEW uint16_t[NumIndices()];
}
void plSpanTemplate::DeAlloc()

View File

@ -58,7 +58,7 @@ class plSpanTemplate
public:
// 99% of the time, the defaults are fine. Just tell me
// how many UVWs, and whether you've got color.
static UInt16 MakeFormat(hsBool hasColor, int numUVWs,
static uint16_t MakeFormat(hsBool hasColor, int numUVWs,
hsBool hasWgtIdx = false,
int numWgts = 0,
hsBool hasNorm = true,
@ -101,10 +101,10 @@ public:
};
protected:
UInt16 fNumVerts;
UInt16 fFormat;
UInt8 fStride;
UInt16 fNumTris;
uint16_t fNumVerts;
uint16_t fFormat;
uint8_t fStride;
uint16_t fNumTris;
// Data stored interleaved. Any channels may be omitted, but
// existing channels are in exactly the following order:
@ -115,57 +115,57 @@ protected:
// Color
// Color2
// UVWs
UInt8* fData;
uint8_t* fData;
UInt16* fIndices;
uint16_t* fIndices;
friend class plClusterUtil;
public:
plSpanTemplate();
virtual ~plSpanTemplate() { DeAlloc(); }
const UInt8* VertData() const { return fData; }
const uint8_t* VertData() const { return fData; }
const UInt16* IndexData() const { return fIndices; }
const uint16_t* IndexData() const { return fIndices; }
UInt32 NumVerts() const { return fNumVerts; }
UInt32 Stride() const { return UInt32(fStride); }
UInt32 CalcStride();
UInt32 VertSize() const { return NumVerts() * Stride(); }
uint32_t NumVerts() const { return fNumVerts; }
uint32_t Stride() const { return uint32_t(fStride); }
uint32_t CalcStride();
uint32_t VertSize() const { return NumVerts() * Stride(); }
UInt32 NumTris() const { return fNumTris; }
UInt32 NumIndices() const { return NumTris() * 3; }
UInt32 IndexSize() const { return NumIndices() * sizeof(UInt16); }
uint32_t NumTris() const { return fNumTris; }
uint32_t NumIndices() const { return NumTris() * 3; }
uint32_t IndexSize() const { return NumIndices() * sizeof(uint16_t); }
UInt8 PositionOffset() const { return UInt8(0); }
UInt8 WgtIdxOffset() const { return UInt8(PositionOffset() + NumPos() * sizeof(hsPoint3)); }
UInt8 WeightOffset() const { return UInt8(WgtIdxOffset() + NumWgtIdx() * sizeof(UInt32)); }
UInt8 NormalOffset() const { return UInt8(WeightOffset() + NumWeights() * sizeof(hsScalar)); }
UInt8 ColorOffset() const { return UInt8(NormalOffset() + NumNorm() * sizeof(hsVector3)); }
UInt8 Color2Offset() const { return UInt8(ColorOffset() + NumColor() * sizeof(UInt32)); }
UInt8 UVWOffset() const { return UInt8(Color2Offset() + NumColor2() * sizeof(UInt32)); }
uint8_t PositionOffset() const { return uint8_t(0); }
uint8_t WgtIdxOffset() const { return uint8_t(PositionOffset() + NumPos() * sizeof(hsPoint3)); }
uint8_t WeightOffset() const { return uint8_t(WgtIdxOffset() + NumWgtIdx() * sizeof(uint32_t)); }
uint8_t NormalOffset() const { return uint8_t(WeightOffset() + NumWeights() * sizeof(hsScalar)); }
uint8_t ColorOffset() const { return uint8_t(NormalOffset() + NumNorm() * sizeof(hsVector3)); }
uint8_t Color2Offset() const { return uint8_t(ColorOffset() + NumColor() * sizeof(uint32_t)); }
uint8_t UVWOffset() const { return uint8_t(Color2Offset() + NumColor2() * sizeof(uint32_t)); }
UInt32 NumUVWs() const { return (fFormat & kUVWMask) >> 4; }
UInt32 NumWeights() const { return (fFormat & kWeightMask) >> 8; }
uint32_t NumUVWs() const { return (fFormat & kUVWMask) >> 4; }
uint32_t NumWeights() const { return (fFormat & kWeightMask) >> 8; }
UInt32 NumPos() const { return (fFormat & kPosMask) >> 0; }
UInt32 NumNorm() const { return (fFormat & kNormMask) >> 1; }
UInt32 NumColor() const { return (fFormat & kColorMask) >> 2; }
UInt32 NumColor2() const { return (fFormat & kColor2Mask) >> 10; }
UInt32 NumWgtIdx() const { return (fFormat & kWgtIdxMask) >> 3; }
uint32_t NumPos() const { return (fFormat & kPosMask) >> 0; }
uint32_t NumNorm() const { return (fFormat & kNormMask) >> 1; }
uint32_t NumColor() const { return (fFormat & kColorMask) >> 2; }
uint32_t NumColor2() const { return (fFormat & kColor2Mask) >> 10; }
uint32_t NumWgtIdx() const { return (fFormat & kWgtIdxMask) >> 3; }
hsPoint3* Position(int i) const { return (hsPoint3*)GetData(kPosition, i); }
hsVector3* Normal(int i) const { return (hsVector3*)GetData(kNormal, i); }
UInt32* Color(int i) const { return (UInt32*)GetData(kColor, i); }
UInt32* Color2(int i) const { return (UInt32*)GetData(kColor2, i); }
UInt32* WgtIdx(int i) const { return (UInt32*)GetData(kWgtIdx, i); }
uint32_t* Color(int i) const { return (uint32_t*)GetData(kColor, i); }
uint32_t* Color2(int i) const { return (uint32_t*)GetData(kColor2, i); }
uint32_t* WgtIdx(int i) const { return (uint32_t*)GetData(kWgtIdx, i); }
hsPoint3* UVWs(int iv, int iuv) const { return (hsPoint3*)GetData(kUVW, iv, iuv); }
hsScalar* Weight(int iv, int iw) const { return (hsScalar*)GetData(kWeight, iv, iw); }
UInt8* GetData(Channel chan, int i, int j=0) const
uint8_t* GetData(Channel chan, int i, int j=0) const
{
ValidateInput(chan, i, j);
UInt8* base = fData + i * fStride;
uint8_t* base = fData + i * fStride;
switch(chan)
{
case kPosition:
@ -182,28 +182,28 @@ public:
return base
+ NumPos() * sizeof(hsPoint3)
+ NumWeights() * sizeof(hsScalar)
+ NumWgtIdx() * sizeof(UInt32);
+ NumWgtIdx() * sizeof(uint32_t);
case kColor:
return base
+ NumPos() * sizeof(hsPoint3)
+ NumWeights() * sizeof(hsScalar)
+ NumWgtIdx() * sizeof(UInt32)
+ NumWgtIdx() * sizeof(uint32_t)
+ NumNorm() * sizeof(hsVector3);
case kColor2:
return base
+ NumPos() * sizeof(hsPoint3)
+ NumWeights() * sizeof(hsScalar)
+ NumWgtIdx() * sizeof(UInt32)
+ NumWgtIdx() * sizeof(uint32_t)
+ NumNorm() * sizeof(hsVector3)
+ NumColor() * sizeof(UInt32);
+ NumColor() * sizeof(uint32_t);
case kUVW:
return base
+ NumPos() * sizeof(hsPoint3)
+ NumWeights() * sizeof(hsScalar)
+ NumWgtIdx() * sizeof(UInt32)
+ NumWgtIdx() * sizeof(uint32_t)
+ NumNorm() * sizeof(hsVector3)
+ NumColor() * sizeof(UInt32)
+ NumColor2() * sizeof(UInt32)
+ NumColor() * sizeof(uint32_t)
+ NumColor2() * sizeof(uint32_t)
+ j * sizeof(hsPoint3);
}
hsAssert(false, "Unrecognized vertex channel");
@ -240,7 +240,7 @@ public:
return false;
}
void Alloc(UInt16 format, UInt32 numVerts, UInt32 numTris);
void Alloc(uint16_t format, uint32_t numVerts, uint32_t numTris);
void DeAlloc();
void Read(hsStream* s);

View File

@ -68,7 +68,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
void plSpan::Read( hsStream *stream )
{
fSubType = (UInt16)(stream->ReadLE32());
fSubType = (uint16_t)(stream->ReadLE32());
fFogEnvironment = nil;
fMaterialIdx = stream->ReadLE32();
@ -78,7 +78,7 @@ void plSpan::Read( hsStream *stream )
fLocalBounds.Read( stream );
fWorldBounds.Read( stream );
fNumMatrices = (UInt8)(stream->ReadLE32());
fNumMatrices = (uint8_t)(stream->ReadLE32());
fBaseMatrix = stream->ReadLE32();
fLocalUVWChans = stream->ReadLE16();
@ -187,7 +187,7 @@ void plSpan::AddLight( plLightInfo *li, hsScalar strength, hsScalar scale, hs
}
lights.Insert(i, li);
strengths.Insert(i, strength);
scales.Insert(i, hsScalar(UInt32(scale * 127.9f)) / 127.f);
scales.Insert(i, hsScalar(uint32_t(scale * 127.9f)) / 127.f);
}
void plSpan::ClearLights() const
@ -301,7 +301,7 @@ plSpan::plSpan()
{
fTypeMask = kSpan;
fSubType = plDrawable::kSubNormal;
fMaterialIdx = (UInt32)-1;
fMaterialIdx = (uint32_t)-1;
fFogEnvironment = nil;
fProps = 0;
@ -345,10 +345,10 @@ void plSpan::Destroy()
plVertexSpan::plVertexSpan()
{
fTypeMask |= kVertexSpan;
fGroupIdx = (UInt32)-1;
fVBufferIdx = (UInt32)-1;
fCellIdx = (UInt32)-1;
fCellOffset = (UInt32)-1;
fGroupIdx = (uint32_t)-1;
fVBufferIdx = (uint32_t)-1;
fCellIdx = (uint32_t)-1;
fCellOffset = (uint32_t)-1;
}
void plVertexSpan::Read( hsStream* stream )

View File

@ -121,17 +121,17 @@ class plSpan
kParticleSet = 0x10
};
UInt16 fTypeMask; // For safe casting. Or it with the type you want to cast to, don't check equality
UInt16 fSubType; // Or'ed from plDrawable::plDrawableSubType
UInt32 fMaterialIdx; // Index into drawable's material array
uint16_t fTypeMask; // For safe casting. Or it with the type you want to cast to, don't check equality
uint16_t fSubType; // Or'ed from plDrawable::plDrawableSubType
uint32_t fMaterialIdx; // Index into drawable's material array
hsMatrix44 fLocalToWorld;
hsMatrix44 fWorldToLocal;
UInt32 fBaseMatrix;
UInt8 fNumMatrices;
UInt16 fLocalUVWChans;
UInt16 fMaxBoneIdx;
UInt16 fPenBoneIdx;
UInt32 fProps;
uint32_t fBaseMatrix;
uint8_t fNumMatrices;
uint16_t fLocalUVWChans;
uint16_t fMaxBoneIdx;
uint16_t fPenBoneIdx;
uint32_t fProps;
hsBounds3Ext fLocalBounds;
hsBounds3Ext fWorldBounds;
plFogEnvironment *fFogEnvironment;
@ -172,16 +172,16 @@ class plSpan
const hsBitVector& GetShadowSlaves() const { return fShadowSlaveBits; }
void AddShadowSlave(int iSlave) const { fShadowSlaveBits.SetBit(iSlave); }
void SetShadowBit(UInt32 idx) const { fShadowBits.SetBit(idx); }
void SetShadowBit(uint32_t idx) const { fShadowBits.SetBit(idx); }
void ClearShadowBits() const { fShadowBits.Clear(); }
hsBool IsShadowBitSet(UInt32 idx) const { return fShadowBits.IsBitSet(idx); }
hsBool IsShadowBitSet(uint32_t idx) const { return fShadowBits.IsBitSet(idx); }
void ClearLights() const;
void AddLight( plLightInfo* li, hsScalar strength, hsScalar scale, hsBool proj ) const;
hsTArray<plLightInfo*>& GetLightList(hsBool proj) const { return proj ? fProjectors : fLights; }
UInt32 GetNumLights(hsBool proj) const { return proj ? fProjectors.GetCount() : fLights.GetCount(); }
uint32_t GetNumLights(hsBool proj) const { return proj ? fProjectors.GetCount() : fLights.GetCount(); }
plLightInfo* GetLight(int i, hsBool proj) const { return proj ? fProjectors[i] : fLights[i]; }
hsScalar GetLightStrength(int i, hsBool proj) const { return proj ? fProjStrengths[i] : fLightStrengths[i]; }
hsScalar GetLightScale(int i, hsBool proj) const { return proj ? fProjScales[i] : fLightScales[i]; }
@ -191,8 +191,8 @@ class plSpan
const hsBitVector& GetVisSet() const { return fVisSet; }
const hsBitVector& GetVisNot() const { return fVisNot; }
void SetVisBit(UInt32 w, hsBool on) { fVisSet.SetBit(w, on); }
void SetVisNot(UInt32 w, hsBool on) { fVisNot.SetBit(w, on); }
void SetVisBit(uint32_t w, hsBool on) { fVisSet.SetBit(w, on); }
void SetVisNot(uint32_t w, hsBool on) { fVisNot.SetBit(w, on); }
void RemoveAuxSpan(plAuxSpan* aux);
void AddAuxSpan(plAuxSpan* aux);
@ -220,13 +220,13 @@ class plVertexSpan : public plSpan
public:
// Stuff internal
UInt32 fGroupIdx; // Which buffer group, i.e. which vertex format
uint32_t fGroupIdx; // Which buffer group, i.e. which vertex format
UInt32 fVBufferIdx; // Which vertex buffer in group
UInt32 fCellIdx; // Cell index inside the vertex buffer
UInt32 fCellOffset; // Offset inside the cell
UInt32 fVStartIdx; // Start vertex # in the actual interlaced buffer
UInt32 fVLength; // Length of this span in the buffer
uint32_t fVBufferIdx; // Which vertex buffer in group
uint32_t fCellIdx; // Cell index inside the vertex buffer
uint32_t fCellOffset; // Offset inside the cell
uint32_t fVStartIdx; // Start vertex # in the actual interlaced buffer
uint32_t fVLength; // Length of this span in the buffer
plVertexSpan();
@ -244,13 +244,13 @@ class plIcicle : public plVertexSpan
{
public:
UInt32 fIBufferIdx; // Which index buffer in group
UInt32 fIStartIdx; // Redundant, since all spans are contiguous. Here for debugging
UInt32 fILength; // Length of this span in the buffer
uint32_t fIBufferIdx; // Which index buffer in group
uint32_t fIStartIdx; // Redundant, since all spans are contiguous. Here for debugging
uint32_t fILength; // Length of this span in the buffer
// The index into the indexbuffer ref. This can be different from fIStartIdx if spans get
// culled, then we pack the non-culled index spans into the beginning of the index buffer ref,
// so we can still put them all out with a single DIP call.
mutable UInt32 fIPackedIdx;
mutable uint32_t fIPackedIdx;
// Run-time-only stuff
plGBufferTriangle *fSortData; // Indices & center points for sorting tris in this span (optional)
@ -277,9 +277,9 @@ class plParticleSpan : public plIcicle
public:
plParticleEmitter* fSource; // Source emitter, used to get array of plParticleCores
UInt32 fNumParticles;
UInt32 fSortCount;
UInt32 fSrcSpanIdx;
uint32_t fNumParticles;
uint32_t fSortCount;
uint32_t fSrcSpanIdx;
plParticleSet* fParentSet;
@ -301,27 +301,27 @@ class plParticleSet
{
public:
UInt32 fRefCount; // Delete if this gets to 0
UInt32 fDIEntry; // Our false DIIndices entry index
uint32_t fRefCount; // Delete if this gets to 0
uint32_t fDIEntry; // Our false DIIndices entry index
UInt32 fGroupIdx; // Which buffer group, i.e. which vertex format
UInt8 fFormat;
uint32_t fGroupIdx; // Which buffer group, i.e. which vertex format
uint8_t fFormat;
UInt32 fVBufferIdx;
UInt32 fCellIdx;
UInt32 fCellOffset;
UInt32 fVStartIdx;
UInt32 fVLength; // Total v.b. length that all the icicles can take up UInt32 fIBufferIdx;
UInt32 fIBufferIdx;
UInt32 fIStartIdx; // Start index buffer position
UInt32 fILength; // Total i.b. length that all the icicles can take up
uint32_t fVBufferIdx;
uint32_t fCellIdx;
uint32_t fCellOffset;
uint32_t fVStartIdx;
uint32_t fVLength; // Total v.b. length that all the icicles can take up uint32_t fIBufferIdx;
uint32_t fIBufferIdx;
uint32_t fIStartIdx; // Start index buffer position
uint32_t fILength; // Total i.b. length that all the icicles can take up
UInt32 fNumSpans;
uint32_t fNumSpans;
hsGMaterial* fMaterial;
UInt32 fNextVStartIdx;
UInt32 fNextCellOffset;
UInt32 fNextIStartIdx;
uint32_t fNextVStartIdx;
uint32_t fNextCellOffset;
uint32_t fNextIStartIdx;
plParticleSet();
~plParticleSet();

View File

@ -245,7 +245,7 @@ hsBool plVisLOSMgr::ICheckDrawable(plDrawable* d, plVisHit& hit)
return retVal;
}
hsBool plVisLOSMgr::ICheckSpan(plDrawableSpans* dr, UInt32 spanIdx, plVisHit& hit)
hsBool plVisLOSMgr::ICheckSpan(plDrawableSpans* dr, uint32_t spanIdx, plVisHit& hit)
{
if( !(dr->GetSpan(spanIdx)->fTypeMask & plSpan::kIcicleSpan) )
return false;
@ -418,8 +418,8 @@ hsBool plVisLOSMgr::ICheckBound(const hsBounds3Ext& bnd, hsScalar& closest)
hsBool plVisLOSMgr::CursorCheck(plVisHit& hit)
{
Int32 sx= Int32(plMouseDevice::Instance()->GetCursorX() * fPipe->Width());
Int32 sy= Int32(plMouseDevice::Instance()->GetCursorY() * fPipe->Height());
int32_t sx= int32_t(plMouseDevice::Instance()->GetCursorX() * fPipe->Width());
int32_t sy= int32_t(plMouseDevice::Instance()->GetCursorY() * fPipe->Height());
hsPoint3 from = fPipe->GetViewPositionWorld();
plConst(hsScalar) dist(1.e5f);

View File

@ -85,7 +85,7 @@ protected:
hsBool ICheckSpaceTree(plSpaceTree* space, hsTArray<plSpaceHit>& hits);
hsBool ICheckSceneNode(plSceneNode* node, plVisHit& hit);
hsBool ICheckDrawable(plDrawable* d, plVisHit& hit);
hsBool ICheckSpan(plDrawableSpans* dr, UInt32 spanIdx, plVisHit& hit);
hsBool ICheckSpan(plDrawableSpans* dr, uint32_t spanIdx, plVisHit& hit);
public:
hsBool Check(const hsPoint3& pStart, const hsPoint3& pEnd, plVisHit& hit);

View File

@ -158,7 +158,7 @@ inline void plWaveSet7::GraphLen(hsScalar len) const
if( fStatusGraph )
{
hsScalar maxLen = TexState().fMaxLength * kCompositeSize / State().fRippleScale;
Int32 val = Int32(len / maxLen * 100.f);
int32_t val = int32_t(len / maxLen * 100.f);
fStatusGraph->AddData(val);
}
}
@ -196,7 +196,7 @@ inline void plWaveSet7::LogF(const char *format, ...) const
}
}
inline void plWaveSet7::LogF(UInt32 color, const char *format, ...) const
inline void plWaveSet7::LogF(uint32_t color, const char *format, ...) const
{
if( fStatusLog )
{
@ -246,7 +246,7 @@ inline void plWaveSet7::LogF(const char *format, ...) const
{
}
inline void plWaveSet7::LogF(UInt32 color, const char *format, ...) const
inline void plWaveSet7::LogF(uint32_t color, const char *format, ...) const
{
}
@ -1630,12 +1630,12 @@ plMipmap* plWaveSet7::ICreateBiasNoiseMap()
hsScalar x = fRand.RandMinusOneToOne();
hsScalar y = fRand.RandMinusOneToOne();
UInt8 r = UInt8((x * 0.5f + 0.5f) * 255.999f);
UInt8 g = UInt8((y * 0.5f + 0.5f) * 255.999f);
uint8_t r = uint8_t((x * 0.5f + 0.5f) * 255.999f);
uint8_t g = uint8_t((y * 0.5f + 0.5f) * 255.999f);
// r = g = 0xff; // SATURATE
UInt32* val = mipMap->GetAddr32(i, j);
uint32_t* val = mipMap->GetAddr32(i, j);
*val = (0xff << 24)
| (r << 16)
| (g << 8)
@ -1689,11 +1689,11 @@ plMipmap* plWaveSet7::ICreateBumpMipmapPS()
s += 0.5f;
s = hsScalar(pow(s, TexState().fChop));
c *= s;
UInt8 cosDist = UInt8((c * 0.5 + 0.5) * 255.999f);
uint8_t cosDist = uint8_t((c * 0.5 + 0.5) * 255.999f);
int j;
for( j = 0; j < sizeV; j++ )
{
UInt32* val = fCosineLUT->GetAddr32(i, j);
uint32_t* val = fCosineLUT->GetAddr32(i, j);
*val = (0xff << 24)
| (cosDist << 16)
| (cosDist << 8)
@ -2097,7 +2097,7 @@ plDrawableSpans* plWaveSet7::ICreateClearDrawable(plDrawableSpans* drawable, hsG
uvw[3] = uvw[0];
uvw[3].fX += 1.f;
UInt16 idx[6];
uint16_t idx[6];
idx[0] = 1;
idx[1] = 0;
idx[2] = 2;
@ -2148,10 +2148,10 @@ plRenderRequest* plWaveSet7::ICreateRenderRequest(plRenderTarget* rt, plDrawable
plRenderTarget* plWaveSet7::ICreateTransferRenderTarget(const char* name, int size)
{
UInt16 flags = plRenderTarget::kIsTexture | plRenderTarget::kIsOrtho;
UInt8 bitDepth = 32;
UInt8 zDepth = 0;
UInt8 stencilDepth = 0;
uint16_t flags = plRenderTarget::kIsTexture | plRenderTarget::kIsOrtho;
uint8_t bitDepth = 32;
uint8_t zDepth = 0;
uint8_t stencilDepth = 0;
plRenderTarget* rt = TRACKED_NEW plRenderTarget(flags, size, size, bitDepth, zDepth, stencilDepth);
@ -2281,7 +2281,7 @@ void plWaveSet7::ICreateFixedMat(hsGMaterial* mat, const int numUVWs)
if( !fEnvMap )
{
plDynamicEnvMap* env = TRACKED_NEW plDynamicEnvMap((UInt16)fEnvSize, (UInt16)fEnvSize, 32);
plDynamicEnvMap* env = TRACKED_NEW plDynamicEnvMap((uint16_t)fEnvSize, (uint16_t)fEnvSize, 32);
hsgResMgr::ResMgr()->NewKey(GetKey()->GetName(), env, GetKey()->GetUoid().GetLocation());
fEnvMap = env;
env->SetPosition(hsPoint3(0, 0, 50.f));
@ -2425,11 +2425,11 @@ void plWaveSet7::IAddFixedVertexShader(hsGMaterial* mat, const int numUVWs)
}
// type is either plLayRefMsg::kVertexShader or plLayRefMsg::kPixelShader.
void plWaveSet7::IAddShaderToLayers(hsGMaterial* mat, int iFirst, int iLast, UInt8 type, plShader* shader)
void plWaveSet7::IAddShaderToLayers(hsGMaterial* mat, int iFirst, int iLast, uint8_t type, plShader* shader)
{
if( iFirst < 0 )
iFirst = 0;
if( UInt32(iLast) >= mat->GetNumLayers() )
if( uint32_t(iLast) >= mat->GetNumLayers() )
iLast = mat->GetNumLayers()-1;
int i;
for( i = iFirst; i <= iLast; i++ )
@ -2850,7 +2850,7 @@ void plWaveSet7::IUpdateShaders(plPipeline* pipe, const hsMatrix44& l2w, const h
void plWaveSet7::IUpdateBumpPShader(plPipeline* pipe, const hsMatrix44& l2w, const hsMatrix44& w2l)
{
plCONST(Int32) skip(0);
plCONST(int32_t) skip(0);
int i;
for( i = 0; i < kNumBumpShaders; i++ )
{
@ -3660,10 +3660,10 @@ plDrawableSpans* plWaveSet7::ICreateGraphDrawable(plDrawableSpans* drawable, hsG
const int nTris = (nWid-1) * 2;
hsTArray<UInt16> idxArr;
hsTArray<uint16_t> idxArr;
idxArr.SetCount(nTris * 3);
UInt16* idx = idxArr.AcquireArray();
uint16_t* idx = idxArr.AcquireArray();
int iBase = 0;
for( i = 0; i < nTris; i += 2 )
@ -3695,19 +3695,19 @@ plDrawableSpans* plWaveSet7::ICreateGraphDrawable(plDrawableSpans* drawable, hsG
return drawable;
}
plDrawableSpans* plWaveSet7::ICreateEmptyGraphDrawable(const char* name, UInt32 ref, int which)
plDrawableSpans* plWaveSet7::ICreateEmptyGraphDrawable(const char* name, uint32_t ref, int which)
{
plDrawableSpans* drawable = TRACKED_NEW plDrawableSpans;
char buff[256];
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), name, which);
hsgResMgr::ResMgr()->NewKey(buff, drawable, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(drawable->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (Int8)ref), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(drawable->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (int8_t)ref), plRefFlags::kActiveRef);
return drawable;
}
hsGMaterial* plWaveSet7::ICreateEmptyMaterial(const char* name, UInt32 ref, int which)
hsGMaterial* plWaveSet7::ICreateEmptyMaterial(const char* name, uint32_t ref, int which)
{
hsGMaterial* mat = TRACKED_NEW hsGMaterial;
@ -3715,7 +3715,7 @@ hsGMaterial* plWaveSet7::ICreateEmptyMaterial(const char* name, UInt32 ref, int
sprintf(buff, "%s_%s_%d", GetKey()->GetName(), name, which);
hsgResMgr::ResMgr()->NewKey(buff, mat, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(mat->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (Int8)ref), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(mat->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, which, (int8_t)ref), plRefFlags::kActiveRef);
return mat;
}
@ -3730,7 +3730,7 @@ plLayer* plWaveSet7::ICreateBlankLayer(const char* name, int suff)
return lay;
}
plMipmap* plWaveSet7::ICreateBlankTex(const char* name, int width, int height, UInt32 ref)
plMipmap* plWaveSet7::ICreateBlankTex(const char* name, int width, int height, uint32_t ref)
{
plMipmap* mipMap = TRACKED_NEW plMipmap(
width, height,
@ -3743,7 +3743,7 @@ plMipmap* plWaveSet7::ICreateBlankTex(const char* name, int width, int height, U
sprintf(buff, "%s_%s", GetKey()->GetName(), name);
hsgResMgr::ResMgr()->NewKey(buff, mipMap, GetKey()->GetUoid().GetLocation());
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, (Int8)ref), plRefFlags::kActiveRef);
hsgResMgr::ResMgr()->SendRef(mipMap->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnRequest, 0, (int8_t)ref), plRefFlags::kActiveRef);
return mipMap;
}
@ -3771,7 +3771,7 @@ plMipmap* plWaveSet7::ICreateGraphShoreTex(int width, int height)
int j;
for( j = 0; j < height; j++ )
{
UInt32 alpha = 255;
uint32_t alpha = 255;
plConst(int) kRampStart(4);
if( j <= kRampStart )
{
@ -3786,7 +3786,7 @@ plMipmap* plWaveSet7::ICreateGraphShoreTex(int width, int height)
{
alpha = 0;
}
UInt32 color = (alpha << 24)
uint32_t color = (alpha << 24)
| (0xff << 16)
| (0xff << 8)
| 0xff;
@ -3794,7 +3794,7 @@ plMipmap* plWaveSet7::ICreateGraphShoreTex(int width, int height)
int i;
for( i = 0; i < width; i++ )
{
UInt32* val = mipMap->GetAddr32(i, j);
uint32_t* val = mipMap->GetAddr32(i, j);
*val = color;
}
}
@ -3812,7 +3812,7 @@ void plWaveSet7::IRefillBubbleShoreTex()
const int height = mipMap->GetHeight();
// Initialize to white opaque.
memset(mipMap->GetAddr32(0,0), 0xff, width*height*sizeof(UInt32));
memset(mipMap->GetAddr32(0,0), 0xff, width*height*sizeof(uint32_t));
plConst(int) kMinNumBub(1024);
plConst(int) kMaxNumBub(6000);
@ -3857,9 +3857,9 @@ void plWaveSet7::IRefillBubbleShoreTex()
f *= (kMaxAlpha - kMinAlpha);
f += kMinAlpha;
UInt32* val = mipMap->GetAddr32(ii, jj);
UInt32 alpha = (*val) >> 24;
alpha = UInt32(hsScalar(alpha) * f);
uint32_t* val = mipMap->GetAddr32(ii, jj);
uint32_t alpha = (*val) >> 24;
alpha = uint32_t(hsScalar(alpha) * f);
*val &= 0x00ffffff;
*val |= (alpha << 24);
}
@ -3874,7 +3874,7 @@ void plWaveSet7::IRefillBubbleShoreTex()
int i;
for( i = 0; i < width; i++ )
{
UInt32* val = mipMap->GetAddr32(i, j);
uint32_t* val = mipMap->GetAddr32(i, j);
hsColorRGBA col;
col.FromARGB32(*val);
hsScalar alpha = col.a;
@ -3932,7 +3932,7 @@ void plWaveSet7::IRefillEdgeShoreTex()
int j;
for( j = 0; j < height; j++ )
{
UInt32 alpha = 0;
uint32_t alpha = 0;
if( (j > bot)&&(j < top) )
{
#if 0 // like x^2
@ -3956,13 +3956,13 @@ void plWaveSet7::IRefillEdgeShoreTex()
a *= 0.5f;
#endif
alpha = UInt32(a * maxAlpha);
alpha = uint32_t(a * maxAlpha);
}
int i;
for( i = 0; i < width; i++ )
{
UInt32* val = mipMap->GetAddr32(i, j);
uint32_t* val = mipMap->GetAddr32(i, j);
*val = (alpha << 24)
| (alpha << 16)
| (alpha << 8)

View File

@ -180,7 +180,7 @@ protected:
plStatusLog* fStatusLog;
plGraphPlate* fStatusGraph;
UInt32 fTrialUpdate;
uint32_t fTrialUpdate;
plFixedWaterState7 fState;
@ -233,7 +233,7 @@ protected:
plShader* fBiasPShader;
plBitmap* fEnvMap;
UInt32 fEnvSize;
uint32_t fEnvSize;
hsScalar fEnvRefresh;
plLayer* fFixedLayers[4];
@ -413,10 +413,10 @@ protected:
void ICheckTargetMaterials();
plDrawableSpans* ICreateGraphDrawable(plDrawableSpans* drawable, hsGMaterial* mat, int nWid);
plDrawableSpans* ICreateEmptyGraphDrawable(const char* name, UInt32 ref, int wich);
hsGMaterial* ICreateEmptyMaterial(const char* name, UInt32 ref, int which);
plDrawableSpans* ICreateEmptyGraphDrawable(const char* name, uint32_t ref, int wich);
hsGMaterial* ICreateEmptyMaterial(const char* name, uint32_t ref, int which);
plLayer* ICreateBlankLayer(const char* name, int suff);
plMipmap* ICreateBlankTex(const char* name, int width, int height, UInt32 ref);
plMipmap* ICreateBlankTex(const char* name, int width, int height, uint32_t ref);
plMipmap* ICreateGraphShoreTex(int width, int height);
plMipmap* ICreateBubbleShoreTex(int width, int height);
void IRefillBubbleShoreTex();
@ -445,7 +445,7 @@ protected:
void IShuffleDownGraphs(int iPass);
// type is either plLayRefMsg::kVertexShader or plLayRefMsg::kPixelShader.
void IAddShaderToLayers(hsGMaterial* mat, int iFirst, int iLast, UInt8 type, plShader* shader);
void IAddShaderToLayers(hsGMaterial* mat, int iFirst, int iLast, uint8_t type, plShader* shader);
void IAddBumpPixelShader(hsGMaterial* mat, int iShader, int iFirst, int iLast);
void IAddBumpVertexShader(hsGMaterial* mat, int iShader, int iFirst, int iLast);
@ -482,7 +482,7 @@ protected:
virtual int IDecalRef() const { return kRefDecal; }
inline void LogF(const char *format, ...) const;
inline void LogF(UInt32 color, const char *format, ...) const;
inline void LogF(uint32_t color, const char *format, ...) const;
inline void IRestartLog() const;
inline void GraphLen(hsScalar len) const;
inline void IRestartGraph() const;
@ -496,9 +496,9 @@ public:
virtual hsBool MsgReceive(plMessage* msg);
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty) { return false; }
virtual hsBool IEval(double secs, hsScalar del, uint32_t dirty) { return false; }
Int32 GetNumProperties() const { return kNumProps; }
int32_t GetNumProperties() const { return kNumProps; }
virtual void Read(hsStream* stream, hsResMgr* mgr);
virtual void Write(hsStream* stream, hsResMgr* mgr);
@ -644,8 +644,8 @@ public:
const plFixedWaterState7& State() const { return fState; }
void SetState(const plFixedWaterState7& state, hsScalar dur);
void SetEnvSize(UInt32 s) { fEnvSize = s; }
UInt32 GetEnvSize() const { return fEnvSize; }
void SetEnvSize(uint32_t s) { fEnvSize = s; }
uint32_t GetEnvSize() const { return fEnvSize; }
void StopLog();
void StartLog();

View File

@ -61,9 +61,9 @@ public:
CLASSNAME_REGISTER( plWaveSetBase );
GETINTERFACE_ANY( plWaveSetBase, plMultiModifier );
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty) { return false; }
virtual hsBool IEval(double secs, hsScalar del, uint32_t dirty) { return false; }
Int32 GetNumProperties() const { return 0; }
int32_t GetNumProperties() const { return 0; }
virtual hsBool SetupRippleMat(hsGMaterial* mat, const plRipVSConsts& ripConsts) = 0;
virtual hsScalar GetHeight() const = 0;