mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-21 12:49:10 +00:00
Convert custom HeadSpin integer types to standard types from stdint.h
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user