mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 23:54:35 +00:00
Merge remote-tracking branch 'smally/platform_type_consistency' into platform-type-consistency
Conflicts: Engine/source/platform/platformCPUCount.cpp
This commit is contained in:
commit
87d9e245b7
210 changed files with 896 additions and 896 deletions
|
|
@ -63,7 +63,7 @@ AIClient::AIClient() {
|
||||||
mMoveTolerance = 0.25f;
|
mMoveTolerance = 0.25f;
|
||||||
|
|
||||||
// Clear the triggers
|
// Clear the triggers
|
||||||
for( int i = 0; i < MaxTriggerKeys; i++ )
|
for( S32 i = 0; i < MaxTriggerKeys; i++ )
|
||||||
mTriggers[i] = false;
|
mTriggers[i] = false;
|
||||||
|
|
||||||
mAimToDestination = true;
|
mAimToDestination = true;
|
||||||
|
|
@ -369,7 +369,7 @@ U32 AIClient::getMoveList( Move **movePtr,U32 *numMoves ) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Copy over the trigger status
|
// Copy over the trigger status
|
||||||
for( int i = 0; i < MaxTriggerKeys; i++ ) {
|
for( S32 i = 0; i < MaxTriggerKeys; i++ ) {
|
||||||
mMove.trigger[i] = mTriggers[i];
|
mMove.trigger[i] = mTriggers[i];
|
||||||
mTriggers[i] = false;
|
mTriggers[i] = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -443,7 +443,7 @@ bool AIPlayer::getAIMove(Move *movePtr)
|
||||||
|
|
||||||
// Replicate the trigger state into the move so that
|
// Replicate the trigger state into the move so that
|
||||||
// triggers can be controlled from scripts.
|
// triggers can be controlled from scripts.
|
||||||
for( int i = 0; i < MaxTriggerKeys; i++ )
|
for( S32 i = 0; i < MaxTriggerKeys; i++ )
|
||||||
movePtr->trigger[i] = getImageTriggerState(i);
|
movePtr->trigger[i] = getImageTriggerState(i);
|
||||||
|
|
||||||
mLastLocation = location;
|
mLastLocation = location;
|
||||||
|
|
|
||||||
|
|
@ -1546,7 +1546,7 @@ void Camera::_validateEyePoint(F32 pos, MatrixF *mat)
|
||||||
float dot = mDot(dir, collision.normal);
|
float dot = mDot(dir, collision.normal);
|
||||||
if (dot > 0.01f)
|
if (dot > 0.01f)
|
||||||
{
|
{
|
||||||
float colDist = mDot(startPos - collision.point, dir) - (1 / dot) * CameraRadius;
|
F32 colDist = mDot(startPos - collision.point, dir) - (1 / dot) * CameraRadius;
|
||||||
if (colDist > pos)
|
if (colDist > pos)
|
||||||
colDist = pos;
|
colDist = pos;
|
||||||
if (colDist < 0.0f)
|
if (colDist < 0.0f)
|
||||||
|
|
|
||||||
|
|
@ -194,7 +194,7 @@ void CameraSpline::renderTimeMap()
|
||||||
if(!ptr) return;
|
if(!ptr) return;
|
||||||
|
|
||||||
MRandomLCG random(1376312589 * (U32)this);
|
MRandomLCG random(1376312589 * (U32)this);
|
||||||
int index = 0;
|
S32 index = 0;
|
||||||
for(Vector<TimeMap>::iterator itr=mTimeMap.begin(); itr != mTimeMap.end(); itr++)
|
for(Vector<TimeMap>::iterator itr=mTimeMap.begin(); itr != mTimeMap.end(); itr++)
|
||||||
{
|
{
|
||||||
Knot a;
|
Knot a;
|
||||||
|
|
|
||||||
|
|
@ -122,7 +122,7 @@ bool DebrisData::onAdd()
|
||||||
if(!Parent::onAdd())
|
if(!Parent::onAdd())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for( int i=0; i<DDC_NUM_EMITTERS; i++ )
|
for( S32 i=0; i<DDC_NUM_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
if( !emitterList[i] && emitterIDList[i] != 0 )
|
if( !emitterList[i] && emitterIDList[i] != 0 )
|
||||||
{
|
{
|
||||||
|
|
@ -303,7 +303,7 @@ void DebrisData::packData(BitStream* stream)
|
||||||
stream->writeString( textureName );
|
stream->writeString( textureName );
|
||||||
stream->writeString( shapeName );
|
stream->writeString( shapeName );
|
||||||
|
|
||||||
for( int i=0; i<DDC_NUM_EMITTERS; i++ )
|
for( S32 i=0; i<DDC_NUM_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
if( stream->writeFlag( emitterList[i] != NULL ) )
|
if( stream->writeFlag( emitterList[i] != NULL ) )
|
||||||
{
|
{
|
||||||
|
|
@ -346,7 +346,7 @@ void DebrisData::unpackData(BitStream* stream)
|
||||||
textureName = stream->readSTString();
|
textureName = stream->readSTString();
|
||||||
shapeName = stream->readSTString();
|
shapeName = stream->readSTString();
|
||||||
|
|
||||||
for( int i=0; i<DDC_NUM_EMITTERS; i++ )
|
for( S32 i=0; i<DDC_NUM_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
if( stream->readFlag() )
|
if( stream->readFlag() )
|
||||||
{
|
{
|
||||||
|
|
@ -512,7 +512,7 @@ bool Debris::onAdd()
|
||||||
}
|
}
|
||||||
|
|
||||||
// create emitters
|
// create emitters
|
||||||
for( int i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
|
for( S32 i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
if( mDataBlock->emitterList[i] != NULL )
|
if( mDataBlock->emitterList[i] != NULL )
|
||||||
{
|
{
|
||||||
|
|
@ -631,7 +631,7 @@ bool Debris::onAdd()
|
||||||
|
|
||||||
void Debris::onRemove()
|
void Debris::onRemove()
|
||||||
{
|
{
|
||||||
for( int i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
|
for( S32 i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
if( mEmitterList[i] )
|
if( mEmitterList[i] )
|
||||||
{
|
{
|
||||||
|
|
@ -848,7 +848,7 @@ void Debris::updateEmitters( Point3F &pos, Point3F &vel, U32 ms )
|
||||||
|
|
||||||
Point3F lastPos = mLastPos;
|
Point3F lastPos = mLastPos;
|
||||||
|
|
||||||
for( int i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
|
for( S32 i=0; i<DebrisData::DDC_NUM_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
if( mEmitterList[i] )
|
if( mEmitterList[i] )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -117,7 +117,7 @@ ConsoleDocClass( DecalManager,
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
int QSORT_CALLBACK cmpDecalInstance(const void* p1, const void* p2)
|
S32 QSORT_CALLBACK cmpDecalInstance(const void* p1, const void* p2)
|
||||||
{
|
{
|
||||||
const DecalInstance** pd1 = (const DecalInstance**)p1;
|
const DecalInstance** pd1 = (const DecalInstance**)p1;
|
||||||
const DecalInstance** pd2 = (const DecalInstance**)p2;
|
const DecalInstance** pd2 = (const DecalInstance**)p2;
|
||||||
|
|
@ -125,7 +125,7 @@ int QSORT_CALLBACK cmpDecalInstance(const void* p1, const void* p2)
|
||||||
return int(((char *)(*pd1)->mDataBlock) - ((char *)(*pd2)->mDataBlock));
|
return int(((char *)(*pd1)->mDataBlock) - ((char *)(*pd2)->mDataBlock));
|
||||||
}
|
}
|
||||||
|
|
||||||
int QSORT_CALLBACK cmpPointsXY( const void *p1, const void *p2 )
|
S32 QSORT_CALLBACK cmpPointsXY( const void *p1, const void *p2 )
|
||||||
{
|
{
|
||||||
const Point3F *pnt1 = (const Point3F*)p1;
|
const Point3F *pnt1 = (const Point3F*)p1;
|
||||||
const Point3F *pnt2 = (const Point3F*)p2;
|
const Point3F *pnt2 = (const Point3F*)p2;
|
||||||
|
|
@ -142,7 +142,7 @@ int QSORT_CALLBACK cmpPointsXY( const void *p1, const void *p2 )
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int QSORT_CALLBACK cmpQuadPointTheta( const void *p1, const void *p2 )
|
S32 QSORT_CALLBACK cmpQuadPointTheta( const void *p1, const void *p2 )
|
||||||
{
|
{
|
||||||
const Point4F *pnt1 = (const Point4F*)p1;
|
const Point4F *pnt1 = (const Point4F*)p1;
|
||||||
const Point4F *pnt2 = (const Point4F*)p2;
|
const Point4F *pnt2 = (const Point4F*)p2;
|
||||||
|
|
@ -157,7 +157,7 @@ int QSORT_CALLBACK cmpQuadPointTheta( const void *p1, const void *p2 )
|
||||||
|
|
||||||
static Point3F gSortPoint;
|
static Point3F gSortPoint;
|
||||||
|
|
||||||
int QSORT_CALLBACK cmpDecalDistance( const void *p1, const void *p2 )
|
S32 QSORT_CALLBACK cmpDecalDistance( const void *p1, const void *p2 )
|
||||||
{
|
{
|
||||||
const DecalInstance** pd1 = (const DecalInstance**)p1;
|
const DecalInstance** pd1 = (const DecalInstance**)p1;
|
||||||
const DecalInstance** pd2 = (const DecalInstance**)p2;
|
const DecalInstance** pd2 = (const DecalInstance**)p2;
|
||||||
|
|
@ -168,7 +168,7 @@ int QSORT_CALLBACK cmpDecalDistance( const void *p1, const void *p2 )
|
||||||
return mSign( dist1 - dist2 );
|
return mSign( dist1 - dist2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
int QSORT_CALLBACK cmpDecalRenderOrder( const void *p1, const void *p2 )
|
S32 QSORT_CALLBACK cmpDecalRenderOrder( const void *p1, const void *p2 )
|
||||||
{
|
{
|
||||||
const DecalInstance** pd1 = (const DecalInstance**)p1;
|
const DecalInstance** pd1 = (const DecalInstance**)p1;
|
||||||
const DecalInstance** pd2 = (const DecalInstance**)p2;
|
const DecalInstance** pd2 = (const DecalInstance**)p2;
|
||||||
|
|
@ -179,14 +179,14 @@ int QSORT_CALLBACK cmpDecalRenderOrder( const void *p1, const void *p2 )
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int priority = (*pd1)->getRenderPriority() - (*pd2)->getRenderPriority();
|
S32 priority = (*pd1)->getRenderPriority() - (*pd2)->getRenderPriority();
|
||||||
|
|
||||||
if ( priority != 0 )
|
if ( priority != 0 )
|
||||||
return priority;
|
return priority;
|
||||||
|
|
||||||
if ( (*pd2)->mFlags & SaveDecal )
|
if ( (*pd2)->mFlags & SaveDecal )
|
||||||
{
|
{
|
||||||
int id = ( (*pd1)->mDataBlock->getMaterial()->getId() - (*pd2)->mDataBlock->getMaterial()->getId() );
|
S32 id = ( (*pd1)->mDataBlock->getMaterial()->getId() - (*pd2)->mDataBlock->getMaterial()->getId() );
|
||||||
if ( id != 0 )
|
if ( id != 0 )
|
||||||
return id;
|
return id;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -929,7 +929,7 @@ bool Explosion::onAdd()
|
||||||
|
|
||||||
void Explosion::onRemove()
|
void Explosion::onRemove()
|
||||||
{
|
{
|
||||||
for( int i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
|
for( S32 i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
if( mEmitterList[i] )
|
if( mEmitterList[i] )
|
||||||
{
|
{
|
||||||
|
|
@ -1114,7 +1114,7 @@ void Explosion::updateEmitters( F32 dt )
|
||||||
{
|
{
|
||||||
Point3F pos = getPosition();
|
Point3F pos = getPosition();
|
||||||
|
|
||||||
for( int i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
|
for( S32 i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
if( mEmitterList[i] )
|
if( mEmitterList[i] )
|
||||||
{
|
{
|
||||||
|
|
@ -1134,7 +1134,7 @@ void Explosion::launchDebris( Point3F &axis )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bool hasDebris = false;
|
bool hasDebris = false;
|
||||||
for( int j=0; j<ExplosionData::EC_NUM_DEBRIS_TYPES; j++ )
|
for( S32 j=0; j<ExplosionData::EC_NUM_DEBRIS_TYPES; j++ )
|
||||||
{
|
{
|
||||||
if( mDataBlock->debrisList[j] )
|
if( mDataBlock->debrisList[j] )
|
||||||
{
|
{
|
||||||
|
|
@ -1160,7 +1160,7 @@ void Explosion::launchDebris( Point3F &axis )
|
||||||
|
|
||||||
U32 numDebris = mDataBlock->debrisNum + sgRandom.randI( -mDataBlock->debrisNumVariance, mDataBlock->debrisNumVariance );
|
U32 numDebris = mDataBlock->debrisNum + sgRandom.randI( -mDataBlock->debrisNumVariance, mDataBlock->debrisNumVariance );
|
||||||
|
|
||||||
for( int i=0; i<numDebris; i++ )
|
for( S32 i=0; i<numDebris; i++ )
|
||||||
{
|
{
|
||||||
|
|
||||||
Point3F launchDir = MathUtils::randomDir( axis, mDataBlock->debrisThetaMin, mDataBlock->debrisThetaMax,
|
Point3F launchDir = MathUtils::randomDir( axis, mDataBlock->debrisThetaMin, mDataBlock->debrisThetaMax,
|
||||||
|
|
@ -1249,7 +1249,7 @@ bool Explosion::explode()
|
||||||
Point3F::Zero, U32(mDataBlock->particleDensity * mFade));
|
Point3F::Zero, U32(mDataBlock->particleDensity * mFade));
|
||||||
}
|
}
|
||||||
|
|
||||||
for( int i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
|
for( S32 i=0; i<ExplosionData::EC_NUM_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
if( mDataBlock->emitterList[i] != NULL )
|
if( mDataBlock->emitterList[i] != NULL )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1139,7 +1139,7 @@ void LightningBolt::generateMinorNodes()
|
||||||
{
|
{
|
||||||
mMinorNodes.clear();
|
mMinorNodes.clear();
|
||||||
|
|
||||||
for( int i=0; i<mMajorNodes.numNodes - 1; i++ )
|
for( S32 i=0; i<mMajorNodes.numNodes - 1; i++ )
|
||||||
{
|
{
|
||||||
NodeManager segment;
|
NodeManager segment;
|
||||||
segment.startPoint = mMajorNodes.nodeList[i].point;
|
segment.startPoint = mMajorNodes.nodeList[i].point;
|
||||||
|
|
|
||||||
|
|
@ -66,11 +66,11 @@ ConsoleDocClass( ParticleData,
|
||||||
"@see ParticleEmitterNode\n"
|
"@see ParticleEmitterNode\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
static const float sgDefaultWindCoefficient = 0.0f;
|
static const F32 sgDefaultWindCoefficient = 0.0f;
|
||||||
static const float sgDefaultConstantAcceleration = 0.f;
|
static const F32 sgDefaultConstantAcceleration = 0.f;
|
||||||
static const float sgDefaultSpinSpeed = 1.f;
|
static const F32 sgDefaultSpinSpeed = 1.f;
|
||||||
static const float sgDefaultSpinRandomMin = 0.f;
|
static const F32 sgDefaultSpinRandomMin = 0.f;
|
||||||
static const float sgDefaultSpinRandomMax = 0.f;
|
static const F32 sgDefaultSpinRandomMax = 0.f;
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
@ -622,7 +622,7 @@ bool ParticleData::reload(char errorBuffer[256])
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
numFrames = 0;
|
numFrames = 0;
|
||||||
for( int i=0; i<PDC_MAX_TEX; i++ )
|
for( S32 i=0; i<PDC_MAX_TEX; i++ )
|
||||||
{
|
{
|
||||||
if( textureNameList[i] && textureNameList[i][0] )
|
if( textureNameList[i] && textureNameList[i][0] )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -100,9 +100,9 @@ ConsoleDocClass( ParticleEmitterData,
|
||||||
"@see ParticleEmitterNode\n"
|
"@see ParticleEmitterNode\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
static const float sgDefaultEjectionOffset = 0.f;
|
static const F32 sgDefaultEjectionOffset = 0.f;
|
||||||
static const float sgDefaultPhiReferenceVel = 0.f;
|
static const F32 sgDefaultPhiReferenceVel = 0.f;
|
||||||
static const float sgDefaultPhiVariance = 360.f;
|
static const F32 sgDefaultPhiVariance = 360.f;
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
// ParticleEmitterData
|
// ParticleEmitterData
|
||||||
|
|
@ -929,7 +929,7 @@ void ParticleEmitter::prepRenderImage(SceneRenderState* state)
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void ParticleEmitter::setSizes( F32 *sizeList )
|
void ParticleEmitter::setSizes( F32 *sizeList )
|
||||||
{
|
{
|
||||||
for( int i=0; i<ParticleData::PDC_NUM_KEYS; i++ )
|
for( S32 i=0; i<ParticleData::PDC_NUM_KEYS; i++ )
|
||||||
{
|
{
|
||||||
sizes[i] = sizeList[i];
|
sizes[i] = sizeList[i];
|
||||||
}
|
}
|
||||||
|
|
@ -940,7 +940,7 @@ void ParticleEmitter::setSizes( F32 *sizeList )
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
void ParticleEmitter::setColors( ColorF *colorList )
|
void ParticleEmitter::setColors( ColorF *colorList )
|
||||||
{
|
{
|
||||||
for( int i=0; i<ParticleData::PDC_NUM_KEYS; i++ )
|
for( S32 i=0; i<ParticleData::PDC_NUM_KEYS; i++ )
|
||||||
{
|
{
|
||||||
colors[i] = colorList[i];
|
colors[i] = colorList[i];
|
||||||
}
|
}
|
||||||
|
|
@ -1455,7 +1455,7 @@ struct SortParticle
|
||||||
};
|
};
|
||||||
|
|
||||||
// qsort callback function for particle sorting
|
// qsort callback function for particle sorting
|
||||||
int QSORT_CALLBACK cmpSortParticles(const void* p1, const void* p2)
|
S32 QSORT_CALLBACK cmpSortParticles(const void* p1, const void* p2)
|
||||||
{
|
{
|
||||||
const SortParticle* sp1 = (const SortParticle*)p1;
|
const SortParticle* sp1 = (const SortParticle*)p1;
|
||||||
const SortParticle* sp2 = (const SortParticle*)p2;
|
const SortParticle* sp2 = (const SortParticle*)p2;
|
||||||
|
|
|
||||||
|
|
@ -92,7 +92,7 @@ void StdMoveList::clientWriteMovePacket(BitStream *bstream)
|
||||||
bstream->writeInt(start,32);
|
bstream->writeInt(start,32);
|
||||||
bstream->writeInt(count,MoveCountBits);
|
bstream->writeInt(count,MoveCountBits);
|
||||||
Move * prevMove = NULL;
|
Move * prevMove = NULL;
|
||||||
for (int i = 0; i < count; i++)
|
for (S32 i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
move[offset + i].sendCount++;
|
move[offset + i].sendCount++;
|
||||||
move[offset + i].pack(bstream,prevMove);
|
move[offset + i].pack(bstream,prevMove);
|
||||||
|
|
@ -112,7 +112,7 @@ void StdMoveList::serverReadMovePacket(BitStream *bstream)
|
||||||
|
|
||||||
// Skip forward (must be starting up), or over the moves
|
// Skip forward (must be starting up), or over the moves
|
||||||
// we already have.
|
// we already have.
|
||||||
int skip = mLastMoveAck - start;
|
S32 skip = mLastMoveAck - start;
|
||||||
if (skip < 0)
|
if (skip < 0)
|
||||||
{
|
{
|
||||||
mLastMoveAck = start;
|
mLastMoveAck = start;
|
||||||
|
|
@ -121,7 +121,7 @@ void StdMoveList::serverReadMovePacket(BitStream *bstream)
|
||||||
{
|
{
|
||||||
if (skip > count)
|
if (skip > count)
|
||||||
skip = count;
|
skip = count;
|
||||||
for (int i = 0; i < skip; i++)
|
for (S32 i = 0; i < skip; i++)
|
||||||
{
|
{
|
||||||
prevMoveHolder.unpack(bstream,prevMove);
|
prevMoveHolder.unpack(bstream,prevMove);
|
||||||
prevMoveHolder.checksum = bstream->readInt(Move::ChecksumBits);
|
prevMoveHolder.checksum = bstream->readInt(Move::ChecksumBits);
|
||||||
|
|
@ -141,7 +141,7 @@ void StdMoveList::serverReadMovePacket(BitStream *bstream)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Put the rest on the move list.
|
// Put the rest on the move list.
|
||||||
int index = mMoveVec.size();
|
S32 index = mMoveVec.size();
|
||||||
mMoveVec.increment(count);
|
mMoveVec.increment(count);
|
||||||
while (index < mMoveVec.size())
|
while (index < mMoveVec.size())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -893,7 +893,7 @@ void Item::updatePos(const U32 /*mask*/, const F32 dt)
|
||||||
// Pick the most resistant surface
|
// Pick the most resistant surface
|
||||||
F32 bd = 0;
|
F32 bd = 0;
|
||||||
const Collision* collision = 0;
|
const Collision* collision = 0;
|
||||||
for (int c = 0; c < collisionList.getCount(); c++) {
|
for (S32 c = 0; c < collisionList.getCount(); c++) {
|
||||||
const Collision &cp = collisionList[c];
|
const Collision &cp = collisionList[c];
|
||||||
F32 dot = -mDot(mVelocity,cp.normal);
|
F32 dot = -mDot(mVelocity,cp.normal);
|
||||||
if (dot > bd) {
|
if (dot > bd) {
|
||||||
|
|
@ -1204,7 +1204,7 @@ DefineEngineMethod( Item, isRotating, bool, (),,
|
||||||
return object->isRotating();
|
return object->isRotating();
|
||||||
}
|
}
|
||||||
|
|
||||||
DefineEngineMethod( Item, setCollisionTimeout, bool, (int ignoreColObj),(NULL),
|
DefineEngineMethod( Item, setCollisionTimeout, bool, (S32 ignoreColObj),(NULL),
|
||||||
"@brief Temporarily disable collisions against a specific ShapeBase object.\n\n"
|
"@brief Temporarily disable collisions against a specific ShapeBase object.\n\n"
|
||||||
|
|
||||||
"This is useful to prevent a player from immediately picking up an Item they have "
|
"This is useful to prevent a player from immediately picking up an Item they have "
|
||||||
|
|
|
||||||
|
|
@ -429,7 +429,7 @@ U32 PathCamera::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
|
||||||
if (stream->writeFlag(mask & WindowMask)) {
|
if (stream->writeFlag(mask & WindowMask)) {
|
||||||
stream->write(mNodeBase);
|
stream->write(mNodeBase);
|
||||||
stream->write(mNodeCount);
|
stream->write(mNodeCount);
|
||||||
for (int i = 0; i < mNodeCount; i++) {
|
for (S32 i = 0; i < mNodeCount; i++) {
|
||||||
CameraSpline::Knot *knot = mSpline.getKnot(i);
|
CameraSpline::Knot *knot = mSpline.getKnot(i);
|
||||||
mathWrite(*stream, knot->mPosition);
|
mathWrite(*stream, knot->mPosition);
|
||||||
mathWrite(*stream, knot->mRotation);
|
mathWrite(*stream, knot->mRotation);
|
||||||
|
|
@ -477,7 +477,7 @@ void PathCamera::unpackUpdate(NetConnection *con, BitStream *stream)
|
||||||
mSpline.removeAll();
|
mSpline.removeAll();
|
||||||
stream->read(&mNodeBase);
|
stream->read(&mNodeBase);
|
||||||
stream->read(&mNodeCount);
|
stream->read(&mNodeCount);
|
||||||
for (int i = 0; i < mNodeCount; i++)
|
for (S32 i = 0; i < mNodeCount; i++)
|
||||||
{
|
{
|
||||||
CameraSpline::Knot *knot = new CameraSpline::Knot();
|
CameraSpline::Knot *knot = new CameraSpline::Knot();
|
||||||
mathRead(*stream, &knot->mPosition);
|
mathRead(*stream, &knot->mPosition);
|
||||||
|
|
|
||||||
|
|
@ -83,7 +83,7 @@ private:
|
||||||
S32 mNodeBase;
|
S32 mNodeBase;
|
||||||
S32 mNodeCount;
|
S32 mNodeCount;
|
||||||
F32 mPosition;
|
F32 mPosition;
|
||||||
int mState;
|
S32 mState;
|
||||||
F32 mTarget;
|
F32 mTarget;
|
||||||
bool mTargetSet;
|
bool mTargetSet;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -467,7 +467,7 @@ bool PlayerData::preload(bool server, String &errorStr)
|
||||||
// Extract ground transform velocity from animations
|
// Extract ground transform velocity from animations
|
||||||
// Get the named ones first so they can be indexed directly.
|
// Get the named ones first so they can be indexed directly.
|
||||||
ActionAnimation *dp = &actionList[0];
|
ActionAnimation *dp = &actionList[0];
|
||||||
for (int i = 0; i < NumTableActionAnims; i++,dp++)
|
for (S32 i = 0; i < NumTableActionAnims; i++,dp++)
|
||||||
{
|
{
|
||||||
ActionAnimationDef *sp = &ActionAnimationList[i];
|
ActionAnimationDef *sp = &ActionAnimationList[i];
|
||||||
dp->name = sp->name;
|
dp->name = sp->name;
|
||||||
|
|
@ -492,7 +492,7 @@ bool PlayerData::preload(bool server, String &errorStr)
|
||||||
if (dStricmp(sp->name, "jet") != 0)
|
if (dStricmp(sp->name, "jet") != 0)
|
||||||
AssertWarn(dp->sequence != -1, avar("PlayerData::preload - Unable to find named animation sequence '%s'!", sp->name));
|
AssertWarn(dp->sequence != -1, avar("PlayerData::preload - Unable to find named animation sequence '%s'!", sp->name));
|
||||||
}
|
}
|
||||||
for (int b = 0; b < mShape->sequences.size(); b++)
|
for (S32 b = 0; b < mShape->sequences.size(); b++)
|
||||||
{
|
{
|
||||||
if (!isTableSequence(b))
|
if (!isTableSequence(b))
|
||||||
{
|
{
|
||||||
|
|
@ -509,7 +509,7 @@ bool PlayerData::preload(bool server, String &errorStr)
|
||||||
// Resolve lookAction index
|
// Resolve lookAction index
|
||||||
dp = &actionList[0];
|
dp = &actionList[0];
|
||||||
String lookName("look");
|
String lookName("look");
|
||||||
for (int c = 0; c < actionCount; c++,dp++)
|
for (S32 c = 0; c < actionCount; c++,dp++)
|
||||||
if( dStricmp( dp->name, lookName ) == 0 )
|
if( dStricmp( dp->name, lookName ) == 0 )
|
||||||
lookAction = c;
|
lookAction = c;
|
||||||
|
|
||||||
|
|
@ -557,7 +557,7 @@ bool PlayerData::preload(bool server, String &errorStr)
|
||||||
if (!Sim::findObject(dustID, dustEmitter))
|
if (!Sim::findObject(dustID, dustEmitter))
|
||||||
Con::errorf(ConsoleLogEntry::General, "PlayerData::preload - Invalid packet, bad datablockId(dustEmitter): 0x%x", dustID);
|
Con::errorf(ConsoleLogEntry::General, "PlayerData::preload - Invalid packet, bad datablockId(dustEmitter): 0x%x", dustID);
|
||||||
|
|
||||||
for (int i=0; i<NUM_SPLASH_EMITTERS; i++)
|
for (S32 i=0; i<NUM_SPLASH_EMITTERS; i++)
|
||||||
if( !splashEmitterList[i] && splashEmitterIDList[i] != 0 )
|
if( !splashEmitterList[i] && splashEmitterIDList[i] != 0 )
|
||||||
if( Sim::findObject( splashEmitterIDList[i], splashEmitterList[i] ) == false)
|
if( Sim::findObject( splashEmitterIDList[i], splashEmitterList[i] ) == false)
|
||||||
Con::errorf(ConsoleLogEntry::General, "PlayerData::onAdd - Invalid packet, bad datablockId(particle emitter): 0x%x", splashEmitterIDList[i]);
|
Con::errorf(ConsoleLogEntry::General, "PlayerData::onAdd - Invalid packet, bad datablockId(particle emitter): 0x%x", splashEmitterIDList[i]);
|
||||||
|
|
@ -647,7 +647,7 @@ bool PlayerData::isTableSequence(S32 seq)
|
||||||
{
|
{
|
||||||
// The sequences from the table must already have
|
// The sequences from the table must already have
|
||||||
// been loaded for this to work.
|
// been loaded for this to work.
|
||||||
for (int i = 0; i < NumTableActionAnims; i++)
|
for (S32 i = 0; i < NumTableActionAnims; i++)
|
||||||
if (actionList[i].sequence == seq)
|
if (actionList[i].sequence == seq)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -1944,7 +1944,7 @@ void Player::reSkin()
|
||||||
Vector<String> skins;
|
Vector<String> skins;
|
||||||
String(mSkinNameHandle.getString()).split( ";", skins );
|
String(mSkinNameHandle.getString()).split( ";", skins );
|
||||||
|
|
||||||
for ( int i = 0; i < skins.size(); i++ )
|
for ( S32 i = 0; i < skins.size(); i++ )
|
||||||
{
|
{
|
||||||
String oldSkin( mAppliedSkinName.c_str() );
|
String oldSkin( mAppliedSkinName.c_str() );
|
||||||
String newSkin( skins[i] );
|
String newSkin( skins[i] );
|
||||||
|
|
@ -1961,7 +1961,7 @@ void Player::reSkin()
|
||||||
|
|
||||||
// Apply skin to both 3rd person and 1st person shape instances
|
// Apply skin to both 3rd person and 1st person shape instances
|
||||||
mShapeInstance->reSkin( newSkin, oldSkin );
|
mShapeInstance->reSkin( newSkin, oldSkin );
|
||||||
for ( int j = 0; j < ShapeBase::MaxMountedImages; j++ )
|
for ( S32 j = 0; j < ShapeBase::MaxMountedImages; j++ )
|
||||||
{
|
{
|
||||||
if (mShapeFPInstance[j])
|
if (mShapeFPInstance[j])
|
||||||
mShapeFPInstance[j]->reSkin( newSkin, oldSkin );
|
mShapeFPInstance[j]->reSkin( newSkin, oldSkin );
|
||||||
|
|
@ -5822,7 +5822,7 @@ bool Player::castRay(const Point3F &start, const Point3F &end, RayInfo* info)
|
||||||
F32 const *si = &start.x;
|
F32 const *si = &start.x;
|
||||||
F32 const *ei = &end.x;
|
F32 const *ei = &end.x;
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++) {
|
for (S32 i = 0; i < 3; i++) {
|
||||||
if (*si < *ei) {
|
if (*si < *ei) {
|
||||||
if (*si > *bmax || *ei < *bmin)
|
if (*si > *bmax || *ei < *bmin)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -215,9 +215,9 @@ public:
|
||||||
|
|
||||||
void updateSound();
|
void updateSound();
|
||||||
|
|
||||||
virtual bool calculateImpact( float simTime,
|
virtual bool calculateImpact( F32 simTime,
|
||||||
Point3F &pointOfImpact,
|
Point3F &pointOfImpact,
|
||||||
float &impactTime );
|
F32 &impactTime );
|
||||||
|
|
||||||
void setInitialPosition( const Point3F& pos );
|
void setInitialPosition( const Point3F& pos );
|
||||||
void setInitialVelocity( const Point3F& vel );
|
void setInitialVelocity( const Point3F& vel );
|
||||||
|
|
|
||||||
|
|
@ -451,7 +451,7 @@ void ProximityMine::processTick( const Move* move )
|
||||||
SimpleQueryList sql;
|
SimpleQueryList sql;
|
||||||
getContainer()->findObjects( triggerBox, sTriggerCollisionMask,
|
getContainer()->findObjects( triggerBox, sTriggerCollisionMask,
|
||||||
SimpleQueryList::insertionCallback, &sql );
|
SimpleQueryList::insertionCallback, &sql );
|
||||||
for ( int i = 0; i < sql.mList.size(); i++ )
|
for ( S32 i = 0; i < sql.mList.size(); i++ )
|
||||||
{
|
{
|
||||||
// Detect movement in the trigger area
|
// Detect movement in the trigger area
|
||||||
if ( ( sql.mList[i] == mOwner && !mDataBlock->triggerOnOwner ) ||
|
if ( ( sql.mList[i] == mOwner && !mDataBlock->triggerOnOwner ) ||
|
||||||
|
|
|
||||||
|
|
@ -265,8 +265,8 @@ void Rigid::translateCenterOfMass(const Point3F &oldPos,const Point3F &newPos)
|
||||||
MatrixF oldx,newx;
|
MatrixF oldx,newx;
|
||||||
oldx.setCrossProduct(oldPos);
|
oldx.setCrossProduct(oldPos);
|
||||||
newx.setCrossProduct(newPos);
|
newx.setCrossProduct(newPos);
|
||||||
for (int row = 0; row < 3; row++)
|
for (S32 row = 0; row < 3; row++)
|
||||||
for (int col = 0; col < 3; col++) {
|
for (S32 col = 0; col < 3; col++) {
|
||||||
F32 n = newx(row,col), o = oldx(row,col);
|
F32 n = newx(row,col), o = oldx(row,col);
|
||||||
objectInertia(row,col) += mass * ((o * o) - (n * n));
|
objectInertia(row,col) += mass * ((o * o) - (n * n));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -196,7 +196,7 @@ namespace {
|
||||||
|
|
||||||
// Physics and collision constants
|
// Physics and collision constants
|
||||||
static F32 sRestTol = 0.5; // % of gravity energy to be at rest
|
static F32 sRestTol = 0.5; // % of gravity energy to be at rest
|
||||||
static int sRestCount = 10; // Consecutive ticks before comming to rest
|
static S32 sRestCount = 10; // Consecutive ticks before comming to rest
|
||||||
|
|
||||||
const U32 sCollisionMoveMask = ( TerrainObjectType | PlayerObjectType |
|
const U32 sCollisionMoveMask = ( TerrainObjectType | PlayerObjectType |
|
||||||
StaticShapeObjectType | VehicleObjectType |
|
StaticShapeObjectType | VehicleObjectType |
|
||||||
|
|
@ -1652,7 +1652,7 @@ void RigidShape::_renderMassAndContacts( ObjectRenderInst *ri, SceneRenderState
|
||||||
GFX->getDrawUtil()->drawCube( desc, Point3F(0.1f,0.1f,0.1f), mDataBlock->massCenter, ColorI(255, 255, 255), &mRenderObjToWorld );
|
GFX->getDrawUtil()->drawCube( desc, Point3F(0.1f,0.1f,0.1f), mDataBlock->massCenter, ColorI(255, 255, 255), &mRenderObjToWorld );
|
||||||
|
|
||||||
// Collision points...
|
// Collision points...
|
||||||
for (int i = 0; i < mCollisionList.getCount(); i++)
|
for (S32 i = 0; i < mCollisionList.getCount(); i++)
|
||||||
{
|
{
|
||||||
const Collision& collision = mCollisionList[i];
|
const Collision& collision = mCollisionList[i];
|
||||||
GFX->getDrawUtil()->drawCube( desc, Point3F(0.05f,0.05f,0.05f), collision.point, ColorI(0, 0, 255) );
|
GFX->getDrawUtil()->drawCube( desc, Point3F(0.05f,0.05f,0.05f), collision.point, ColorI(0, 0, 255) );
|
||||||
|
|
@ -1660,7 +1660,7 @@ void RigidShape::_renderMassAndContacts( ObjectRenderInst *ri, SceneRenderState
|
||||||
|
|
||||||
// Render the normals as one big batch...
|
// Render the normals as one big batch...
|
||||||
PrimBuild::begin(GFXLineList, mCollisionList.getCount() * 2);
|
PrimBuild::begin(GFXLineList, mCollisionList.getCount() * 2);
|
||||||
for (int i = 0; i < mCollisionList.getCount(); i++)
|
for (S32 i = 0; i < mCollisionList.getCount(); i++)
|
||||||
{
|
{
|
||||||
|
|
||||||
const Collision& collision = mCollisionList[i];
|
const Collision& collision = mCollisionList[i];
|
||||||
|
|
|
||||||
|
|
@ -195,7 +195,7 @@ class RigidShape: public ShapeBase
|
||||||
CollisionList mContacts;
|
CollisionList mContacts;
|
||||||
Rigid mRigid;
|
Rigid mRigid;
|
||||||
ShapeBaseConvex mConvex;
|
ShapeBaseConvex mConvex;
|
||||||
int restCount;
|
S32 restCount;
|
||||||
|
|
||||||
SimObjectPtr<ParticleEmitter> mDustEmitterList[RigidShapeData::VC_NUM_DUST_EMITTERS];
|
SimObjectPtr<ParticleEmitter> mDustEmitterList[RigidShapeData::VC_NUM_DUST_EMITTERS];
|
||||||
SimObjectPtr<ParticleEmitter> mSplashEmitterList[RigidShapeData::VC_NUM_SPLASH_EMITTERS];
|
SimObjectPtr<ParticleEmitter> mSplashEmitterList[RigidShapeData::VC_NUM_SPLASH_EMITTERS];
|
||||||
|
|
|
||||||
|
|
@ -1282,7 +1282,7 @@ void ShapeBase::processTick(const Move* move)
|
||||||
{
|
{
|
||||||
mMoveMotion = true;
|
mMoveMotion = true;
|
||||||
}
|
}
|
||||||
for (int i = 0; i < MaxMountedImages; i++)
|
for (S32 i = 0; i < MaxMountedImages; i++)
|
||||||
{
|
{
|
||||||
setImageMotionState(i, mMoveMotion);
|
setImageMotionState(i, mMoveMotion);
|
||||||
}
|
}
|
||||||
|
|
@ -1305,7 +1305,7 @@ void ShapeBase::processTick(const Move* move)
|
||||||
// Advance images
|
// Advance images
|
||||||
if (isServerObject())
|
if (isServerObject())
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MaxMountedImages; i++)
|
for (S32 i = 0; i < MaxMountedImages; i++)
|
||||||
{
|
{
|
||||||
if (mMountedImageList[i].dataBlock)
|
if (mMountedImageList[i].dataBlock)
|
||||||
updateImageState(i, TickSec);
|
updateImageState(i, TickSec);
|
||||||
|
|
@ -1347,7 +1347,7 @@ void ShapeBase::advanceTime(F32 dt)
|
||||||
// advanced at framerate.
|
// advanced at framerate.
|
||||||
advanceThreads(dt);
|
advanceThreads(dt);
|
||||||
updateAudioPos();
|
updateAudioPos();
|
||||||
for (int i = 0; i < MaxMountedImages; i++)
|
for (S32 i = 0; i < MaxMountedImages; i++)
|
||||||
if (mMountedImageList[i].dataBlock)
|
if (mMountedImageList[i].dataBlock)
|
||||||
{
|
{
|
||||||
updateImageState(i, dt);
|
updateImageState(i, dt);
|
||||||
|
|
@ -2240,7 +2240,7 @@ void ShapeBase::stopAudio(U32 slot)
|
||||||
void ShapeBase::updateServerAudio()
|
void ShapeBase::updateServerAudio()
|
||||||
{
|
{
|
||||||
// Timeout non-looping sounds
|
// Timeout non-looping sounds
|
||||||
for (int i = 0; i < MaxSoundThreads; i++) {
|
for (S32 i = 0; i < MaxSoundThreads; i++) {
|
||||||
Sound& st = mSoundThread[i];
|
Sound& st = mSoundThread[i];
|
||||||
if (st.play && st.timeout && st.timeout < Sim::getCurrentTime()) {
|
if (st.play && st.timeout && st.timeout < Sim::getCurrentTime()) {
|
||||||
clearMaskBits(SoundMaskN << i);
|
clearMaskBits(SoundMaskN << i);
|
||||||
|
|
@ -2280,7 +2280,7 @@ void ShapeBase::updateAudioState(Sound& st)
|
||||||
|
|
||||||
void ShapeBase::updateAudioPos()
|
void ShapeBase::updateAudioPos()
|
||||||
{
|
{
|
||||||
for (int i = 0; i < MaxSoundThreads; i++)
|
for (S32 i = 0; i < MaxSoundThreads; i++)
|
||||||
{
|
{
|
||||||
SFXSource* source = mSoundThread[i].sound;
|
SFXSource* source = mSoundThread[i].sound;
|
||||||
if ( source )
|
if ( source )
|
||||||
|
|
@ -3113,7 +3113,7 @@ U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stream->writeFlag(mask & ThreadMask)) {
|
if (stream->writeFlag(mask & ThreadMask)) {
|
||||||
for (int i = 0; i < MaxScriptThreads; i++) {
|
for (S32 i = 0; i < MaxScriptThreads; i++) {
|
||||||
Thread& st = mScriptThread[i];
|
Thread& st = mScriptThread[i];
|
||||||
if (stream->writeFlag( (st.sequence != -1 || st.state == Thread::Destroy) && (mask & (ThreadMaskN << i)) ) ) {
|
if (stream->writeFlag( (st.sequence != -1 || st.state == Thread::Destroy) && (mask & (ThreadMaskN << i)) ) ) {
|
||||||
stream->writeInt(st.sequence,ThreadSequenceBits);
|
stream->writeInt(st.sequence,ThreadSequenceBits);
|
||||||
|
|
@ -3126,7 +3126,7 @@ U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stream->writeFlag(mask & SoundMask)) {
|
if (stream->writeFlag(mask & SoundMask)) {
|
||||||
for (int i = 0; i < MaxSoundThreads; i++) {
|
for (S32 i = 0; i < MaxSoundThreads; i++) {
|
||||||
Sound& st = mSoundThread[i];
|
Sound& st = mSoundThread[i];
|
||||||
if (stream->writeFlag(mask & (SoundMaskN << i)))
|
if (stream->writeFlag(mask & (SoundMaskN << i)))
|
||||||
if (stream->writeFlag(st.play))
|
if (stream->writeFlag(st.play))
|
||||||
|
|
@ -3136,7 +3136,7 @@ U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stream->writeFlag(mask & ImageMask)) {
|
if (stream->writeFlag(mask & ImageMask)) {
|
||||||
for (int i = 0; i < MaxMountedImages; i++)
|
for (S32 i = 0; i < MaxMountedImages; i++)
|
||||||
if (stream->writeFlag(mask & (ImageMaskN << i))) {
|
if (stream->writeFlag(mask & (ImageMaskN << i))) {
|
||||||
MountedImage& image = mMountedImageList[i];
|
MountedImage& image = mMountedImageList[i];
|
||||||
if (stream->writeFlag(image.dataBlock))
|
if (stream->writeFlag(image.dataBlock))
|
||||||
|
|
@ -3271,7 +3271,7 @@ void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream)
|
||||||
|
|
||||||
// Mounted Images
|
// Mounted Images
|
||||||
if (stream->readFlag()) {
|
if (stream->readFlag()) {
|
||||||
for (int i = 0; i < MaxMountedImages; i++) {
|
for (S32 i = 0; i < MaxMountedImages; i++) {
|
||||||
if (stream->readFlag()) {
|
if (stream->readFlag()) {
|
||||||
MountedImage& image = mMountedImageList[i];
|
MountedImage& image = mMountedImageList[i];
|
||||||
ShapeBaseImageData* imageData = 0;
|
ShapeBaseImageData* imageData = 0;
|
||||||
|
|
@ -3308,9 +3308,9 @@ void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream)
|
||||||
image.genericTrigger[j] = stream->readFlag();
|
image.genericTrigger[j] = stream->readFlag();
|
||||||
}
|
}
|
||||||
|
|
||||||
int count = stream->readInt(3);
|
S32 count = stream->readInt(3);
|
||||||
int altCount = stream->readInt(3);
|
S32 altCount = stream->readInt(3);
|
||||||
int reloadCount = stream->readInt(3);
|
S32 reloadCount = stream->readInt(3);
|
||||||
|
|
||||||
bool datablockChange = image.dataBlock != imageData;
|
bool datablockChange = image.dataBlock != imageData;
|
||||||
if (datablockChange || (image.skinNameHandle != skinDesiredNameHandle))
|
if (datablockChange || (image.skinNameHandle != skinDesiredNameHandle))
|
||||||
|
|
@ -3742,7 +3742,7 @@ void ShapeBase::reSkin()
|
||||||
Vector<String> skins;
|
Vector<String> skins;
|
||||||
String(mSkinNameHandle.getString()).split( ";", skins );
|
String(mSkinNameHandle.getString()).split( ";", skins );
|
||||||
|
|
||||||
for (int i = 0; i < skins.size(); i++)
|
for (S32 i = 0; i < skins.size(); i++)
|
||||||
{
|
{
|
||||||
String oldSkin( mAppliedSkinName.c_str() );
|
String oldSkin( mAppliedSkinName.c_str() );
|
||||||
String newSkin( skins[i] );
|
String newSkin( skins[i] );
|
||||||
|
|
|
||||||
|
|
@ -203,7 +203,7 @@ ShapeBaseImageData::ShapeBaseImageData()
|
||||||
scriptAnimTransitionTime = 0.25f;
|
scriptAnimTransitionTime = 0.25f;
|
||||||
|
|
||||||
//
|
//
|
||||||
for (int i = 0; i < MaxStates; i++) {
|
for (S32 i = 0; i < MaxStates; i++) {
|
||||||
stateName[i] = 0;
|
stateName[i] = 0;
|
||||||
|
|
||||||
stateTransitionLoaded[i] = 0;
|
stateTransitionLoaded[i] = 0;
|
||||||
|
|
@ -3057,7 +3057,7 @@ TICKAGAIN:
|
||||||
|
|
||||||
if (image.spinThread[i])
|
if (image.spinThread[i])
|
||||||
{
|
{
|
||||||
float timeScale;
|
F32 timeScale;
|
||||||
|
|
||||||
switch (stateData.spin)
|
switch (stateData.spin)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -188,7 +188,7 @@ bool Trigger::castRay(const Point3F &start, const Point3F &end, RayInfo* info)
|
||||||
F32 const *si = &start.x;
|
F32 const *si = &start.x;
|
||||||
F32 const *ei = &end.x;
|
F32 const *ei = &end.x;
|
||||||
|
|
||||||
for (int i = 0; i < 3; i++)
|
for (S32 i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
if (*si < *ei)
|
if (*si < *ei)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -442,7 +442,7 @@ void TSStatic::reSkin()
|
||||||
Vector<String> skins;
|
Vector<String> skins;
|
||||||
String(mSkinNameHandle.getString()).split( ";", skins );
|
String(mSkinNameHandle.getString()).split( ";", skins );
|
||||||
|
|
||||||
for (int i = 0; i < skins.size(); i++)
|
for (S32 i = 0; i < skins.size(); i++)
|
||||||
{
|
{
|
||||||
String oldSkin( mAppliedSkinName.c_str() );
|
String oldSkin( mAppliedSkinName.c_str() );
|
||||||
String newSkin( skins[i] );
|
String newSkin( skins[i] );
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ AITurretShapeData::AITurretShapeData()
|
||||||
|
|
||||||
weaponLeadVelocity = 0;
|
weaponLeadVelocity = 0;
|
||||||
|
|
||||||
for (int i = 0; i < MaxStates; i++) {
|
for (S32 i = 0; i < MaxStates; i++) {
|
||||||
stateName[i] = 0;
|
stateName[i] = 0;
|
||||||
stateTransitionAtRest[i] = 0;
|
stateTransitionAtRest[i] = 0;
|
||||||
stateTransitionNotAtRest[i] = 0;
|
stateTransitionNotAtRest[i] = 0;
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@ const F32 sVehicleGravity = -20;
|
||||||
|
|
||||||
// Physics and collision constants
|
// Physics and collision constants
|
||||||
static F32 sRestTol = 0.5; // % of gravity energy to be at rest
|
static F32 sRestTol = 0.5; // % of gravity energy to be at rest
|
||||||
static int sRestCount = 10; // Consecutive ticks before comming to rest
|
static S32 sRestCount = 10; // Consecutive ticks before comming to rest
|
||||||
|
|
||||||
} // namespace {}
|
} // namespace {}
|
||||||
|
|
||||||
|
|
@ -341,14 +341,14 @@ void VehicleData::packData(BitStream* stream)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int j = 0; j < VC_NUM_DAMAGE_EMITTER_AREAS; j++)
|
for (S32 j = 0; j < VC_NUM_DAMAGE_EMITTER_AREAS; j++)
|
||||||
{
|
{
|
||||||
stream->write( damageEmitterOffset[j].x );
|
stream->write( damageEmitterOffset[j].x );
|
||||||
stream->write( damageEmitterOffset[j].y );
|
stream->write( damageEmitterOffset[j].y );
|
||||||
stream->write( damageEmitterOffset[j].z );
|
stream->write( damageEmitterOffset[j].z );
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int k = 0; k < VC_NUM_DAMAGE_LEVELS; k++)
|
for (S32 k = 0; k < VC_NUM_DAMAGE_LEVELS; k++)
|
||||||
{
|
{
|
||||||
stream->write( damageLevelTolerance[k] );
|
stream->write( damageLevelTolerance[k] );
|
||||||
}
|
}
|
||||||
|
|
@ -440,14 +440,14 @@ void VehicleData::unpackData(BitStream* stream)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for( int j=0; j<VC_NUM_DAMAGE_EMITTER_AREAS; j++ )
|
for( S32 j=0; j<VC_NUM_DAMAGE_EMITTER_AREAS; j++ )
|
||||||
{
|
{
|
||||||
stream->read( &damageEmitterOffset[j].x );
|
stream->read( &damageEmitterOffset[j].x );
|
||||||
stream->read( &damageEmitterOffset[j].y );
|
stream->read( &damageEmitterOffset[j].y );
|
||||||
stream->read( &damageEmitterOffset[j].z );
|
stream->read( &damageEmitterOffset[j].z );
|
||||||
}
|
}
|
||||||
|
|
||||||
for( int k=0; k<VC_NUM_DAMAGE_LEVELS; k++ )
|
for( S32 k=0; k<VC_NUM_DAMAGE_LEVELS; k++ )
|
||||||
{
|
{
|
||||||
stream->read( &damageLevelTolerance[k] );
|
stream->read( &damageLevelTolerance[k] );
|
||||||
}
|
}
|
||||||
|
|
@ -718,7 +718,7 @@ bool Vehicle::onAdd()
|
||||||
{
|
{
|
||||||
if( mDataBlock->dustEmitter )
|
if( mDataBlock->dustEmitter )
|
||||||
{
|
{
|
||||||
for( int i=0; i<VehicleData::VC_NUM_DUST_EMITTERS; i++ )
|
for( S32 i=0; i<VehicleData::VC_NUM_DUST_EMITTERS; i++ )
|
||||||
{
|
{
|
||||||
mDustEmitterList[i] = new ParticleEmitter;
|
mDustEmitterList[i] = new ParticleEmitter;
|
||||||
mDustEmitterList[i]->onNewDataBlock( mDataBlock->dustEmitter, false );
|
mDustEmitterList[i]->onNewDataBlock( mDataBlock->dustEmitter, false );
|
||||||
|
|
@ -1804,7 +1804,7 @@ void Vehicle::updateDamageSmoke( F32 dt )
|
||||||
F32 damagePercent = mDamage / mDataBlock->maxDamage;
|
F32 damagePercent = mDamage / mDataBlock->maxDamage;
|
||||||
if( damagePercent >= mDataBlock->damageLevelTolerance[j] )
|
if( damagePercent >= mDataBlock->damageLevelTolerance[j] )
|
||||||
{
|
{
|
||||||
for( int i=0; i<mDataBlock->numDmgEmitterAreas; i++ )
|
for( S32 i=0; i<mDataBlock->numDmgEmitterAreas; i++ )
|
||||||
{
|
{
|
||||||
MatrixF trans = getTransform();
|
MatrixF trans = getTransform();
|
||||||
Point3F offset = mDataBlock->damageEmitterOffset[i];
|
Point3F offset = mDataBlock->damageEmitterOffset[i];
|
||||||
|
|
@ -1935,7 +1935,7 @@ void Vehicle::_renderMassAndContacts( ObjectRenderInst *ri, SceneRenderState *st
|
||||||
GFX->getDrawUtil()->drawCube(desc, Point3F(0.1f,0.1f,0.1f),mDataBlock->massCenter, ColorI(255, 255, 255), &mRenderObjToWorld);
|
GFX->getDrawUtil()->drawCube(desc, Point3F(0.1f,0.1f,0.1f),mDataBlock->massCenter, ColorI(255, 255, 255), &mRenderObjToWorld);
|
||||||
|
|
||||||
// Now render all the contact points.
|
// Now render all the contact points.
|
||||||
for (int i = 0; i < mCollisionList.getCount(); i++)
|
for (S32 i = 0; i < mCollisionList.getCount(); i++)
|
||||||
{
|
{
|
||||||
const Collision& collision = mCollisionList[i];
|
const Collision& collision = mCollisionList[i];
|
||||||
GFX->getDrawUtil()->drawCube(desc, Point3F(0.05f,0.05f,0.05f),collision.point, ColorI(0, 0, 255));
|
GFX->getDrawUtil()->drawCube(desc, Point3F(0.05f,0.05f,0.05f),collision.point, ColorI(0, 0, 255));
|
||||||
|
|
@ -1943,7 +1943,7 @@ void Vehicle::_renderMassAndContacts( ObjectRenderInst *ri, SceneRenderState *st
|
||||||
|
|
||||||
// Finally render the normals as one big batch.
|
// Finally render the normals as one big batch.
|
||||||
PrimBuild::begin(GFXLineList, mCollisionList.getCount() * 2);
|
PrimBuild::begin(GFXLineList, mCollisionList.getCount() * 2);
|
||||||
for (int i = 0; i < mCollisionList.getCount(); i++)
|
for (S32 i = 0; i < mCollisionList.getCount(); i++)
|
||||||
{
|
{
|
||||||
const Collision& collision = mCollisionList[i];
|
const Collision& collision = mCollisionList[i];
|
||||||
PrimBuild::color3f(1, 1, 1);
|
PrimBuild::color3f(1, 1, 1);
|
||||||
|
|
|
||||||
|
|
@ -202,7 +202,7 @@ class Vehicle: public ShapeBase
|
||||||
CollisionList mContacts;
|
CollisionList mContacts;
|
||||||
Rigid mRigid;
|
Rigid mRigid;
|
||||||
ShapeBaseConvex mConvex;
|
ShapeBaseConvex mConvex;
|
||||||
int restCount;
|
S32 restCount;
|
||||||
|
|
||||||
SimObjectPtr<ParticleEmitter> mDustEmitterList[VehicleData::VC_NUM_DUST_EMITTERS];
|
SimObjectPtr<ParticleEmitter> mDustEmitterList[VehicleData::VC_NUM_DUST_EMITTERS];
|
||||||
SimObjectPtr<ParticleEmitter> mDamageEmitterList[VehicleData::VC_NUM_DAMAGE_EMITTERS];
|
SimObjectPtr<ParticleEmitter> mDamageEmitterList[VehicleData::VC_NUM_DAMAGE_EMITTERS];
|
||||||
|
|
|
||||||
|
|
@ -421,7 +421,7 @@ DefineEngineMethod(TCPObject, send, void, (const char *data),,
|
||||||
object->send( (const U8*)data, dStrlen(data) );
|
object->send( (const U8*)data, dStrlen(data) );
|
||||||
}
|
}
|
||||||
|
|
||||||
DefineEngineMethod(TCPObject, listen, void, (int port),,
|
DefineEngineMethod(TCPObject, listen, void, (U32 port),,
|
||||||
"@brief Start listening on the specified port for connections.\n\n"
|
"@brief Start listening on the specified port for connections.\n\n"
|
||||||
|
|
||||||
"This method starts a listener which looks for incoming TCP connections to a port. "
|
"This method starts a listener which looks for incoming TCP connections to a port. "
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ extern "C" {
|
||||||
return so->getClassName();
|
return so->getClassName();
|
||||||
}
|
}
|
||||||
|
|
||||||
void *SimObject_GetFieldList(SimObject *so, int &outNumFields)
|
void *SimObject_GetFieldList(SimObject *so, S32 &outNumFields)
|
||||||
{
|
{
|
||||||
const AbstractClassRep::FieldList &fl = so->getFieldList();
|
const AbstractClassRep::FieldList &fl = so->getFieldList();
|
||||||
outNumFields = fl.size();
|
outNumFields = fl.size();
|
||||||
|
|
|
||||||
|
|
@ -164,7 +164,7 @@ extern "C" {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void script_simobject_setfield_int(U32 objectId, const char* fieldName, int v)
|
void script_simobject_setfield_int(U32 objectId, const char* fieldName, S32 v)
|
||||||
{
|
{
|
||||||
SimObject *object = Sim::findObject( objectId );
|
SimObject *object = Sim::findObject( objectId );
|
||||||
if( object )
|
if( object )
|
||||||
|
|
@ -291,12 +291,12 @@ extern "C" {
|
||||||
entry->cb.mVoidCallbackFunc(o, argc, argv);
|
entry->cb.mVoidCallbackFunc(o, argc, argv);
|
||||||
}
|
}
|
||||||
|
|
||||||
int script_simobject_get_id(SimObject* so)
|
S32 script_simobject_get_id(SimObject* so)
|
||||||
{
|
{
|
||||||
return so->getId();
|
return so->getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
int script_simobject_find(const char* classname, const char* name)
|
S32 script_simobject_find(const char* classname, const char* name)
|
||||||
{
|
{
|
||||||
SimObject *object;
|
SimObject *object;
|
||||||
if( Sim::findObject( name, object ) )
|
if( Sim::findObject( name, object ) )
|
||||||
|
|
@ -385,7 +385,7 @@ extern "C" {
|
||||||
|
|
||||||
#ifdef TORQUE_OS_WIN
|
#ifdef TORQUE_OS_WIN
|
||||||
|
|
||||||
void script_input_event(int type, int value1, int value2)
|
void script_input_event(S32 type, S32 value1, S32 value2)
|
||||||
{
|
{
|
||||||
if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow())
|
if (PlatformWindowManager::get() && PlatformWindowManager::get()->getFirstWindow())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ extern void createFontShutdown(void);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
|
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
|
||||||
extern INT CreateMiniDump(LPEXCEPTION_POINTERS ExceptionInfo);
|
extern S32 CreateMiniDump(LPEXCEPTION_POINTERS ExceptionInfo);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static HashTable<StringTableEntry,StringTableEntry> gSecureScript;
|
static HashTable<StringTableEntry,StringTableEntry> gSecureScript;
|
||||||
|
|
@ -47,7 +47,7 @@ static HashTable<StringTableEntry,StringTableEntry> gSecureScript;
|
||||||
// ObjC hooks for shared library support
|
// ObjC hooks for shared library support
|
||||||
// See: macMain.mm
|
// See: macMain.mm
|
||||||
|
|
||||||
void torque_mac_engineinit(int argc, const char **argv);
|
void torque_mac_engineinit(S32 argc, const char **argv);
|
||||||
void torque_mac_enginetick();
|
void torque_mac_enginetick();
|
||||||
void torque_mac_engineshutdown();
|
void torque_mac_engineshutdown();
|
||||||
|
|
||||||
|
|
@ -64,7 +64,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize Torque 3D including argument handling
|
// initialize Torque 3D including argument handling
|
||||||
int torque_engineinit(S32 argc, const char **argv)
|
S32 torque_engineinit(S32 argc, const char **argv)
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
|
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
|
||||||
|
|
@ -105,7 +105,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
// tick Torque 3D's main loop
|
// tick Torque 3D's main loop
|
||||||
int torque_enginetick()
|
S32 torque_enginetick()
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
|
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
|
||||||
|
|
@ -139,7 +139,7 @@ extern "C" {
|
||||||
}
|
}
|
||||||
|
|
||||||
// shutdown the engine
|
// shutdown the engine
|
||||||
int torque_engineshutdown()
|
S32 torque_engineshutdown()
|
||||||
{
|
{
|
||||||
|
|
||||||
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
|
#if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE )
|
||||||
|
|
@ -181,7 +181,7 @@ extern "C" {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int torque_getconsolebool(const char* name)
|
S32 torque_getconsolebool(const char* name)
|
||||||
{
|
{
|
||||||
return Con::getBoolVariable(name);
|
return Con::getBoolVariable(name);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Accessors
|
// Accessors
|
||||||
int getCount() const { return mCount; }
|
S32 getCount() const { return mCount; }
|
||||||
F32 getTime() const { return mT; }
|
F32 getTime() const { return mT; }
|
||||||
F32 getMaxHeight() const { return mMaxHeight; }
|
F32 getMaxHeight() const { return mMaxHeight; }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,21 +69,21 @@ void GjkCollisionState::swap()
|
||||||
void GjkCollisionState::compute_det()
|
void GjkCollisionState::compute_det()
|
||||||
{
|
{
|
||||||
// Dot new point with current set
|
// Dot new point with current set
|
||||||
for (int i = 0, bit = 1; i < 4; ++i, bit <<=1)
|
for (S32 i = 0, bit = 1; i < 4; ++i, bit <<=1)
|
||||||
if (bits & bit)
|
if (bits & bit)
|
||||||
dp[i][last] = dp[last][i] = mDot(y[i], y[last]);
|
dp[i][last] = dp[last][i] = mDot(y[i], y[last]);
|
||||||
dp[last][last] = mDot(y[last], y[last]);
|
dp[last][last] = mDot(y[last], y[last]);
|
||||||
|
|
||||||
// Calulate the determinent
|
// Calulate the determinent
|
||||||
det[last_bit][last] = 1;
|
det[last_bit][last] = 1;
|
||||||
for (int j = 0, sj = 1; j < 4; ++j, sj <<= 1) {
|
for (S32 j = 0, sj = 1; j < 4; ++j, sj <<= 1) {
|
||||||
if (bits & sj) {
|
if (bits & sj) {
|
||||||
int s2 = sj | last_bit;
|
S32 s2 = sj | last_bit;
|
||||||
det[s2][j] = dp[last][last] - dp[last][j];
|
det[s2][j] = dp[last][last] - dp[last][j];
|
||||||
det[s2][last] = dp[j][j] - dp[j][last];
|
det[s2][last] = dp[j][j] - dp[j][last];
|
||||||
for (int k = 0, sk = 1; k < j; ++k, sk <<= 1) {
|
for (S32 k = 0, sk = 1; k < j; ++k, sk <<= 1) {
|
||||||
if (bits & sk) {
|
if (bits & sk) {
|
||||||
int s3 = sk | s2;
|
S32 s3 = sk | s2;
|
||||||
det[s3][k] = det[s2][j] * (dp[j][j] - dp[j][k]) +
|
det[s3][k] = det[s2][j] * (dp[j][j] - dp[j][k]) +
|
||||||
det[s2][last] * (dp[last][j] - dp[last][k]);
|
det[s2][last] * (dp[last][j] - dp[last][k]);
|
||||||
det[s3][j] = det[sk | last_bit][k] * (dp[k][k] - dp[k][j]) +
|
det[s3][j] = det[sk | last_bit][k] * (dp[k][k] - dp[k][j]) +
|
||||||
|
|
@ -114,11 +114,11 @@ void GjkCollisionState::compute_det()
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
inline void GjkCollisionState::compute_vector(int bits, VectorF& v)
|
inline void GjkCollisionState::compute_vector(S32 bits, VectorF& v)
|
||||||
{
|
{
|
||||||
F32 sum = 0;
|
F32 sum = 0;
|
||||||
v.set(0, 0, 0);
|
v.set(0, 0, 0);
|
||||||
for (int i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
|
for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
|
||||||
if (bits & bit) {
|
if (bits & bit) {
|
||||||
sum += det[bits][i];
|
sum += det[bits][i];
|
||||||
v += y[i] * det[bits][i];
|
v += y[i] * det[bits][i];
|
||||||
|
|
@ -130,9 +130,9 @@ inline void GjkCollisionState::compute_vector(int bits, VectorF& v)
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
inline bool GjkCollisionState::valid(int s)
|
inline bool GjkCollisionState::valid(S32 s)
|
||||||
{
|
{
|
||||||
for (int i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
|
for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
|
||||||
if (all_bits & bit) {
|
if (all_bits & bit) {
|
||||||
if (s & bit) {
|
if (s & bit) {
|
||||||
if (det[s][i] <= 0)
|
if (det[s][i] <= 0)
|
||||||
|
|
@ -152,7 +152,7 @@ inline bool GjkCollisionState::valid(int s)
|
||||||
inline bool GjkCollisionState::closest(VectorF& v)
|
inline bool GjkCollisionState::closest(VectorF& v)
|
||||||
{
|
{
|
||||||
compute_det();
|
compute_det();
|
||||||
for (int s = bits; s; --s) {
|
for (S32 s = bits; s; --s) {
|
||||||
if ((s & bits) == s) {
|
if ((s & bits) == s) {
|
||||||
if (valid(s | last_bit)) {
|
if (valid(s | last_bit)) {
|
||||||
bits = s | last_bit;
|
bits = s | last_bit;
|
||||||
|
|
@ -175,7 +175,7 @@ inline bool GjkCollisionState::closest(VectorF& v)
|
||||||
|
|
||||||
inline bool GjkCollisionState::degenerate(const VectorF& w)
|
inline bool GjkCollisionState::degenerate(const VectorF& w)
|
||||||
{
|
{
|
||||||
for (int i = 0, bit = 1; i < 4; ++i, bit <<= 1)
|
for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1)
|
||||||
if ((all_bits & bit) && y[i] == w)
|
if ((all_bits & bit) && y[i] == w)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -256,7 +256,7 @@ void GjkCollisionState::getClosestPoints(Point3F& p1, Point3F& p2)
|
||||||
F32 sum = 0;
|
F32 sum = 0;
|
||||||
p1.set(0, 0, 0);
|
p1.set(0, 0, 0);
|
||||||
p2.set(0, 0, 0);
|
p2.set(0, 0, 0);
|
||||||
for (int i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
|
for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1) {
|
||||||
if (bits & bit) {
|
if (bits & bit) {
|
||||||
sum += det[bits][i];
|
sum += det[bits][i];
|
||||||
p1 += p[i] * det[bits][i];
|
p1 += p[i] * det[bits][i];
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ struct GjkCollisionState: public CollisionState
|
||||||
|
|
||||||
///
|
///
|
||||||
void compute_det();
|
void compute_det();
|
||||||
bool valid(int s);
|
bool valid(S32 s);
|
||||||
void compute_vector(int bits, VectorF& v);
|
void compute_vector(S32 bits, VectorF& v);
|
||||||
bool closest(VectorF& v);
|
bool closest(VectorF& v);
|
||||||
bool degenerate(const VectorF& w);
|
bool degenerate(const VectorF& w);
|
||||||
void nextBit();
|
void nextBit();
|
||||||
|
|
|
||||||
|
|
@ -280,7 +280,7 @@ bool Polytope::intersect(const PlaneF& plane,const Point3F& sp,const Point3F& ep
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
void Polytope::extrudeFace(int faceIdx,const VectorF& vec,Polytope* out)
|
void Polytope::extrudeFace(S32 faceIdx,const VectorF& vec,Polytope* out)
|
||||||
{
|
{
|
||||||
// Assumes the face belongs to the first volume.
|
// Assumes the face belongs to the first volume.
|
||||||
out->mVertexList.clear();
|
out->mVertexList.clear();
|
||||||
|
|
@ -373,7 +373,7 @@ bool Polytope::findCollision(const VectorF& vec,Polytope::Collision *best)
|
||||||
return false;
|
return false;
|
||||||
if (!best->object)
|
if (!best->object)
|
||||||
best->distance = 1.0E30f;
|
best->distance = 1.0E30f;
|
||||||
int bestVertex = -1;
|
S32 bestVertex = -1;
|
||||||
Polytope::Volume* bestVolume = NULL;
|
Polytope::Volume* bestVolume = NULL;
|
||||||
sideCount++;
|
sideCount++;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -102,7 +102,7 @@ public:
|
||||||
void buildBox(const MatrixF& transform,const Box3F& box);
|
void buildBox(const MatrixF& transform,const Box3F& box);
|
||||||
void intersect(SimObject*, const BSPNode* node);
|
void intersect(SimObject*, const BSPNode* node);
|
||||||
inline bool didIntersect() { return mVolumeList.size() > 1; }
|
inline bool didIntersect() { return mVolumeList.size() > 1; }
|
||||||
void extrudeFace(int fi,const VectorF& vec,Polytope* out);
|
void extrudeFace(S32 fi,const VectorF& vec,Polytope* out);
|
||||||
bool findCollision(const VectorF& vec,Polytope::Collision *best);
|
bool findCollision(const VectorF& vec,Polytope::Collision *best);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,7 @@ const char *DynamicConsoleMethodComponent::_callMethod( U32 argc, const char *ar
|
||||||
if( getComponentCount() > 0 )
|
if( getComponentCount() > 0 )
|
||||||
{
|
{
|
||||||
lockComponentList();
|
lockComponentList();
|
||||||
for( int i = getComponentCount() - 1; i >= 0; i-- )
|
for( S32 i = getComponentCount() - 1; i >= 0; i-- )
|
||||||
//for( SimComponentIterator nItr = componentList.end(); nItr != componentList.begin(); nItr-- )
|
//for( SimComponentIterator nItr = componentList.end(); nItr != componentList.begin(); nItr-- )
|
||||||
{
|
{
|
||||||
argv[0] = cbName;
|
argv[0] = cbName;
|
||||||
|
|
|
||||||
|
|
@ -348,7 +348,7 @@ bool SimXMLDocument::pushFirstChildElement(const char* rName)
|
||||||
TiXmlElement* pElement;
|
TiXmlElement* pElement;
|
||||||
if(!m_paNode.empty())
|
if(!m_paNode.empty())
|
||||||
{
|
{
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iLastElement];
|
TiXmlElement* pNode = m_paNode[iLastElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
{
|
{
|
||||||
|
|
@ -412,7 +412,7 @@ bool SimXMLDocument::pushChildElement(S32 index)
|
||||||
TiXmlElement* pElement;
|
TiXmlElement* pElement;
|
||||||
if(!m_paNode.empty())
|
if(!m_paNode.empty())
|
||||||
{
|
{
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iLastElement];
|
TiXmlElement* pNode = m_paNode[iLastElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
{
|
{
|
||||||
|
|
@ -472,7 +472,7 @@ bool SimXMLDocument::nextSiblingElement(const char* rName)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement*& pElement = m_paNode[iLastElement];
|
TiXmlElement*& pElement = m_paNode[iLastElement];
|
||||||
if(!pElement)
|
if(!pElement)
|
||||||
{
|
{
|
||||||
|
|
@ -506,7 +506,7 @@ const char* SimXMLDocument::elementValue()
|
||||||
{
|
{
|
||||||
return StringTable->insert("");
|
return StringTable->insert("");
|
||||||
}
|
}
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iLastElement];
|
TiXmlElement* pNode = m_paNode[iLastElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
{
|
{
|
||||||
|
|
@ -547,7 +547,7 @@ const char* SimXMLDocument::attribute(const char* rAttribute)
|
||||||
{
|
{
|
||||||
return StringTable->insert("");
|
return StringTable->insert("");
|
||||||
}
|
}
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iLastElement];
|
TiXmlElement* pNode = m_paNode[iLastElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
{
|
{
|
||||||
|
|
@ -597,7 +597,7 @@ bool SimXMLDocument::attributeExists(const char* rAttribute)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iLastElement];
|
TiXmlElement* pNode = m_paNode[iLastElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
{
|
{
|
||||||
|
|
@ -630,7 +630,7 @@ const char* SimXMLDocument::firstAttribute()
|
||||||
{
|
{
|
||||||
return StringTable->insert("");
|
return StringTable->insert("");
|
||||||
}
|
}
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iLastElement];
|
TiXmlElement* pNode = m_paNode[iLastElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
{
|
{
|
||||||
|
|
@ -667,7 +667,7 @@ const char* SimXMLDocument::lastAttribute()
|
||||||
{
|
{
|
||||||
return StringTable->insert("");
|
return StringTable->insert("");
|
||||||
}
|
}
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iLastElement];
|
TiXmlElement* pNode = m_paNode[iLastElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
{
|
{
|
||||||
|
|
@ -766,7 +766,7 @@ void SimXMLDocument::setAttribute(const char* rAttribute, const char* rVal)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pElement = m_paNode[iLastElement];
|
TiXmlElement* pElement = m_paNode[iLastElement];
|
||||||
if(!pElement)
|
if(!pElement)
|
||||||
{
|
{
|
||||||
|
|
@ -798,7 +798,7 @@ void SimXMLDocument::setObjectAttributes(const char* objectID)
|
||||||
if( pObject == NULL )
|
if( pObject == NULL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pElement = m_paNode[iLastElement];
|
TiXmlElement* pElement = m_paNode[iLastElement];
|
||||||
if(!pElement)
|
if(!pElement)
|
||||||
return;
|
return;
|
||||||
|
|
@ -925,7 +925,7 @@ void SimXMLDocument::pushNewElement(const char* rName)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const int iFinalElement = m_paNode.size() - 1;
|
const S32 iFinalElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iFinalElement];
|
TiXmlElement* pNode = m_paNode[iFinalElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
{
|
{
|
||||||
|
|
@ -975,7 +975,7 @@ void SimXMLDocument::addNewElement(const char* rName)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const int iParentElement = m_paNode.size() - 2;
|
const S32 iParentElement = m_paNode.size() - 2;
|
||||||
if(iParentElement < 0)
|
if(iParentElement < 0)
|
||||||
{
|
{
|
||||||
pStackTop = dynamic_cast<TiXmlElement*>
|
pStackTop = dynamic_cast<TiXmlElement*>
|
||||||
|
|
@ -1002,7 +1002,7 @@ void SimXMLDocument::addNewElement(const char* rName)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Overwrite top stack position.
|
// Overwrite top stack position.
|
||||||
const int iFinalElement = m_paNode.size() - 1;
|
const S32 iFinalElement = m_paNode.size() - 1;
|
||||||
m_paNode[iFinalElement] = pStackTop;
|
m_paNode[iFinalElement] = pStackTop;
|
||||||
//pNode = pStackTop;
|
//pNode = pStackTop;
|
||||||
}
|
}
|
||||||
|
|
@ -1091,7 +1091,7 @@ const char* SimXMLDocument::readComment( S32 index )
|
||||||
// Push the first element found under the current element of the given name
|
// Push the first element found under the current element of the given name
|
||||||
if(!m_paNode.empty())
|
if(!m_paNode.empty())
|
||||||
{
|
{
|
||||||
const int iLastElement = m_paNode.size() - 1;
|
const S32 iLastElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iLastElement];
|
TiXmlElement* pNode = m_paNode[iLastElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
{
|
{
|
||||||
|
|
@ -1159,7 +1159,7 @@ void SimXMLDocument::addText(const char* text)
|
||||||
if(m_paNode.empty())
|
if(m_paNode.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int iFinalElement = m_paNode.size() - 1;
|
const S32 iFinalElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iFinalElement];
|
TiXmlElement* pNode = m_paNode[iFinalElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1204,7 +1204,7 @@ const char* SimXMLDocument::getText()
|
||||||
if(m_paNode.empty())
|
if(m_paNode.empty())
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
const int iFinalElement = m_paNode.size() - 1;
|
const S32 iFinalElement = m_paNode.size() - 1;
|
||||||
TiXmlNode* pNode = m_paNode[iFinalElement];
|
TiXmlNode* pNode = m_paNode[iFinalElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
return "";
|
return "";
|
||||||
|
|
@ -1264,7 +1264,7 @@ void SimXMLDocument::removeText()
|
||||||
if(m_paNode.empty())
|
if(m_paNode.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int iFinalElement = m_paNode.size() - 1;
|
const S32 iFinalElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iFinalElement];
|
TiXmlElement* pNode = m_paNode[iFinalElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1300,7 +1300,7 @@ void SimXMLDocument::addData(const char* text)
|
||||||
if(m_paNode.empty())
|
if(m_paNode.empty())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const int iFinalElement = m_paNode.size() - 1;
|
const S32 iFinalElement = m_paNode.size() - 1;
|
||||||
TiXmlElement* pNode = m_paNode[iFinalElement];
|
TiXmlElement* pNode = m_paNode[iFinalElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
return;
|
return;
|
||||||
|
|
@ -1346,7 +1346,7 @@ const char* SimXMLDocument::getData()
|
||||||
if(m_paNode.empty())
|
if(m_paNode.empty())
|
||||||
return "";
|
return "";
|
||||||
|
|
||||||
const int iFinalElement = m_paNode.size() - 1;
|
const S32 iFinalElement = m_paNode.size() - 1;
|
||||||
TiXmlNode* pNode = m_paNode[iFinalElement];
|
TiXmlNode* pNode = m_paNode[iFinalElement];
|
||||||
if(!pNode)
|
if(!pNode)
|
||||||
return "";
|
return "";
|
||||||
|
|
|
||||||
|
|
@ -250,8 +250,8 @@ struct StreqExprNode : BinaryExprNode
|
||||||
|
|
||||||
struct StrcatExprNode : BinaryExprNode
|
struct StrcatExprNode : BinaryExprNode
|
||||||
{
|
{
|
||||||
int appendChar;
|
S32 appendChar;
|
||||||
static StrcatExprNode *alloc( S32 lineNumber, ExprNode *left, ExprNode *right, int appendChar );
|
static StrcatExprNode *alloc( S32 lineNumber, ExprNode *left, ExprNode *right, S32 appendChar );
|
||||||
U32 precompile(TypeReq type);
|
U32 precompile(TypeReq type);
|
||||||
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
U32 compile(U32 *codeStream, U32 ip, TypeReq type);
|
||||||
TypeReq getPreferredType();
|
TypeReq getPreferredType();
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ StreqExprNode *StreqExprNode::alloc( S32 lineNumber, ExprNode *left, ExprNode *r
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
StrcatExprNode *StrcatExprNode::alloc( S32 lineNumber, ExprNode *left, ExprNode *right, int appendChar )
|
StrcatExprNode *StrcatExprNode::alloc( S32 lineNumber, ExprNode *left, ExprNode *right, S32 appendChar )
|
||||||
{
|
{
|
||||||
StrcatExprNode *ret = (StrcatExprNode *) consoleAlloc(sizeof(StrcatExprNode));
|
StrcatExprNode *ret = (StrcatExprNode *) consoleAlloc(sizeof(StrcatExprNode));
|
||||||
constructInPlace(ret);
|
constructInPlace(ret);
|
||||||
|
|
|
||||||
|
|
@ -559,7 +559,7 @@ bool CodeBlock::compile(const char *codeFileName, StringTableEntry fileName, con
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *CodeBlock::compileExec(StringTableEntry fileName, const char *inString, bool noCalls, int setFrame)
|
const char *CodeBlock::compileExec(StringTableEntry fileName, const char *inString, bool noCalls, S32 setFrame)
|
||||||
{
|
{
|
||||||
// Check for a UTF8 script file
|
// Check for a UTF8 script file
|
||||||
char *string;
|
char *string;
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@ public:
|
||||||
/// -1 a new frame is created. If the index is out of range the
|
/// -1 a new frame is created. If the index is out of range the
|
||||||
/// top stack frame is used.
|
/// top stack frame is used.
|
||||||
const char *compileExec(StringTableEntry fileName, const char *script,
|
const char *compileExec(StringTableEntry fileName, const char *script,
|
||||||
bool noCalls, int setFrame = -1 );
|
bool noCalls, S32 setFrame = -1 );
|
||||||
|
|
||||||
/// Executes the existing code in the CodeBlock. The return string is any
|
/// Executes the existing code in the CodeBlock. The return string is any
|
||||||
/// result of the code executed, if any, or an empty string.
|
/// result of the code executed, if any, or an empty string.
|
||||||
|
|
|
||||||
|
|
@ -248,7 +248,7 @@ static bool active = false;
|
||||||
static bool newLogFile;
|
static bool newLogFile;
|
||||||
static const char *logFileName;
|
static const char *logFileName;
|
||||||
|
|
||||||
static const int MaxCompletionBufferSize = 4096;
|
static const S32 MaxCompletionBufferSize = 4096;
|
||||||
static char completionBuffer[MaxCompletionBufferSize];
|
static char completionBuffer[MaxCompletionBufferSize];
|
||||||
static char tabBuffer[MaxCompletionBufferSize] = {0};
|
static char tabBuffer[MaxCompletionBufferSize] = {0};
|
||||||
static SimObjectPtr<SimObject> tabObject;
|
static SimObjectPtr<SimObject> tabObject;
|
||||||
|
|
|
||||||
|
|
@ -223,7 +223,7 @@ void Namespace::printNamespaceEntries(Namespace * g, bool dumpScript, bool dumpE
|
||||||
// Iterate through the methods of the namespace...
|
// Iterate through the methods of the namespace...
|
||||||
for(Entry *ewalk = g->mEntryList; ewalk; ewalk = ewalk->mNext)
|
for(Entry *ewalk = g->mEntryList; ewalk; ewalk = ewalk->mNext)
|
||||||
{
|
{
|
||||||
int eType = ewalk->mType;
|
S32 eType = ewalk->mType;
|
||||||
const char * funcName = ewalk->mFunctionName;
|
const char * funcName = ewalk->mFunctionName;
|
||||||
|
|
||||||
if( ( eType == Entry::ConsoleFunctionType ) && !dumpScript )
|
if( ( eType == Entry::ConsoleFunctionType ) && !dumpScript )
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ DefineConsoleFunction( strstr, S32, ( const char* string, const char* substring
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DefineConsoleFunction( strpos, S32, ( const char* haystack, const char* needle, int offset ), ( 0 ),
|
DefineConsoleFunction( strpos, S32, ( const char* haystack, const char* needle, S32 offset ), ( 0 ),
|
||||||
"Find the start of @a needle in @a haystack searching from left to right beginning at the given offset.\n"
|
"Find the start of @a needle in @a haystack searching from left to right beginning at the given offset.\n"
|
||||||
"@param haystack The string to search.\n"
|
"@param haystack The string to search.\n"
|
||||||
"@param needle The string to search for.\n"
|
"@param needle The string to search for.\n"
|
||||||
|
|
|
||||||
|
|
@ -175,7 +175,7 @@ bool ConsoleLogger::detach()
|
||||||
mStream.close();
|
mStream.close();
|
||||||
|
|
||||||
// Remove this object from the list of active loggers
|
// Remove this object from the list of active loggers
|
||||||
for( int i = 0; i < mActiveLoggers.size(); i++ )
|
for( S32 i = 0; i < mActiveLoggers.size(); i++ )
|
||||||
{
|
{
|
||||||
if( mActiveLoggers[i] == this )
|
if( mActiveLoggers[i] == this )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@ namespace Con {
|
||||||
mXML->pushNewElement("EnumTables");
|
mXML->pushNewElement("EnumTables");
|
||||||
|
|
||||||
// write out the used EnumTables
|
// write out the used EnumTables
|
||||||
for (int i = 0; i < enumTables.size(); i++)
|
for (S32 i = 0; i < enumTables.size(); i++)
|
||||||
{
|
{
|
||||||
mXML->pushNewElement("EnumTable");
|
mXML->pushNewElement("EnumTable");
|
||||||
|
|
||||||
|
|
@ -267,7 +267,7 @@ namespace Con {
|
||||||
|
|
||||||
mXML->pushNewElement("Enums");
|
mXML->pushNewElement("Enums");
|
||||||
|
|
||||||
for (int j = 0; j < table->size; j++)
|
for (S32 j = 0; j < table->size; j++)
|
||||||
{
|
{
|
||||||
mXML->pushNewElement("Enum");
|
mXML->pushNewElement("Enum");
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1383,14 +1383,14 @@ struct _EngineConsoleThunkCountArgs
|
||||||
|
|
||||||
// Encapsulation of a legacy console function invocation.
|
// Encapsulation of a legacy console function invocation.
|
||||||
|
|
||||||
template< int startArgc, typename T >
|
template< S32 startArgc, typename T >
|
||||||
struct _EngineConsoleThunk {};
|
struct _EngineConsoleThunk {};
|
||||||
|
|
||||||
template< int startArgc, typename R >
|
template< S32 startArgc, typename R >
|
||||||
struct _EngineConsoleThunk< startArgc, R() >
|
struct _EngineConsoleThunk< startArgc, R() >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 0;
|
static const S32 NUM_ARGS = 0;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )(), const _EngineFunctionDefaultArguments< void() >& )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )(), const _EngineFunctionDefaultArguments< void() >& )
|
||||||
{
|
{
|
||||||
return _EngineConsoleThunkReturnValue( fn() );
|
return _EngineConsoleThunkReturnValue( fn() );
|
||||||
|
|
@ -1401,11 +1401,11 @@ struct _EngineConsoleThunk< startArgc, R() >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )() );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )() );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc >
|
template< S32 startArgc >
|
||||||
struct _EngineConsoleThunk< startArgc, void() >
|
struct _EngineConsoleThunk< startArgc, void() >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 0;
|
static const S32 NUM_ARGS = 0;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )(), const _EngineFunctionDefaultArguments< void() >& )
|
static void thunk( S32 argc, const char** argv, void ( *fn )(), const _EngineFunctionDefaultArguments< void() >& )
|
||||||
{
|
{
|
||||||
fn();
|
fn();
|
||||||
|
|
@ -1417,11 +1417,11 @@ struct _EngineConsoleThunk< startArgc, void() >
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< int startArgc, typename R, typename A >
|
template< S32 startArgc, typename R, typename A >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A ) >
|
struct _EngineConsoleThunk< startArgc, R( A ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 1 + startArgc;
|
static const S32 NUM_ARGS = 1 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A ), const _EngineFunctionDefaultArguments< void( A ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A ), const _EngineFunctionDefaultArguments< void( A ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1434,11 +1434,11 @@ struct _EngineConsoleThunk< startArgc, R( A ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A >
|
template< S32 startArgc, typename A >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A ) >
|
struct _EngineConsoleThunk< startArgc, void( A ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 1 + startArgc;
|
static const S32 NUM_ARGS = 1 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A ), const _EngineFunctionDefaultArguments< void( A ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A ), const _EngineFunctionDefaultArguments< void( A ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1452,11 +1452,11 @@ struct _EngineConsoleThunk< startArgc, void( A ) >
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< int startArgc, typename R, typename A, typename B >
|
template< S32 startArgc, typename R, typename A, typename B >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A, B ) >
|
struct _EngineConsoleThunk< startArgc, R( A, B ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 2 + startArgc;
|
static const S32 NUM_ARGS = 2 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B ), const _EngineFunctionDefaultArguments< void( A, B ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B ), const _EngineFunctionDefaultArguments< void( A, B ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1471,11 +1471,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A, typename B >
|
template< S32 startArgc, typename A, typename B >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A, B ) >
|
struct _EngineConsoleThunk< startArgc, void( A, B ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 2 + startArgc;
|
static const S32 NUM_ARGS = 2 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B ), const _EngineFunctionDefaultArguments< void( A, B ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B ), const _EngineFunctionDefaultArguments< void( A, B ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1491,11 +1491,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B ) >
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< int startArgc, typename R, typename A, typename B, typename C >
|
template< S32 startArgc, typename R, typename A, typename B, typename C >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A, B, C ) >
|
struct _EngineConsoleThunk< startArgc, R( A, B, C ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 3 + startArgc;
|
static const S32 NUM_ARGS = 3 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C ), const _EngineFunctionDefaultArguments< void( A, B, C ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C ), const _EngineFunctionDefaultArguments< void( A, B, C ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1512,11 +1512,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A, typename B, typename C >
|
template< S32 startArgc, typename A, typename B, typename C >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A, B, C ) >
|
struct _EngineConsoleThunk< startArgc, void( A, B, C ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 3 + startArgc;
|
static const S32 NUM_ARGS = 3 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C ), const _EngineFunctionDefaultArguments< void( A, B, C ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C ), const _EngineFunctionDefaultArguments< void( A, B, C ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1534,11 +1534,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C ) >
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< int startArgc, typename R, typename A, typename B, typename C, typename D >
|
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A, B, C, D ) >
|
struct _EngineConsoleThunk< startArgc, R( A, B, C, D ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 4 + startArgc;
|
static const S32 NUM_ARGS = 4 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D ), const _EngineFunctionDefaultArguments< void( A, B, C, D ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D ), const _EngineFunctionDefaultArguments< void( A, B, C, D ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1557,11 +1557,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A, typename B, typename C, typename D >
|
template< S32 startArgc, typename A, typename B, typename C, typename D >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A, B, C, D ) >
|
struct _EngineConsoleThunk< startArgc, void( A, B, C, D ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 4 + startArgc;
|
static const S32 NUM_ARGS = 4 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D ), const _EngineFunctionDefaultArguments< void( A, B, C, D ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D ), const _EngineFunctionDefaultArguments< void( A, B, C, D ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1581,11 +1581,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D ) >
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E >
|
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E ) >
|
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 5 + startArgc;
|
static const S32 NUM_ARGS = 5 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1606,11 +1606,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A, typename B, typename C, typename D, typename E >
|
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E ) >
|
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 5 + startArgc;
|
static const S32 NUM_ARGS = 5 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1632,11 +1632,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E ) >
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F >
|
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F ) >
|
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 6 + startArgc;
|
static const S32 NUM_ARGS = 6 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1659,11 +1659,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F >
|
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F ) >
|
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 6 + startArgc;
|
static const S32 NUM_ARGS = 6 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1687,11 +1687,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F ) >
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G >
|
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G ) >
|
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 7 + startArgc;
|
static const S32 NUM_ARGS = 7 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1716,11 +1716,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G >
|
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G ) >
|
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 7 + startArgc;
|
static const S32 NUM_ARGS = 7 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1746,11 +1746,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G ) >
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H >
|
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H ) >
|
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 8 + startArgc;
|
static const S32 NUM_ARGS = 8 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1777,11 +1777,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H >
|
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H ) >
|
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 8 + startArgc;
|
static const S32 NUM_ARGS = 8 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1809,11 +1809,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H ) >
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I >
|
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I ) >
|
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 9 + startArgc;
|
static const S32 NUM_ARGS = 9 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H, I ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H, I ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1842,11 +1842,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h, i ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h, i ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I >
|
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I ) >
|
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 9 + startArgc;
|
static const S32 NUM_ARGS = 9 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H, I ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H, I ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1876,11 +1876,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I ) >
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J >
|
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I, J ) >
|
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I, J ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 10 + startArgc;
|
static const S32 NUM_ARGS = 10 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H, I, J ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H, I, J ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1911,11 +1911,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I, J ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h, i, j ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h, i, j ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J >
|
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I, J ) >
|
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I, J ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 10 + startArgc;
|
static const S32 NUM_ARGS = 10 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H, I, J ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H, I, J ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1946,11 +1946,11 @@ struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I, J ) >
|
||||||
( frame->*fn )( a, b, c, d, e, f, g, h, i, j );
|
( frame->*fn )( a, b, c, d, e, f, g, h, i, j );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J, typename K >
|
template< S32 startArgc, typename R, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J, typename K >
|
||||||
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I, J, K ) >
|
struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I, J, K ) >
|
||||||
{
|
{
|
||||||
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
typedef typename _EngineConsoleThunkType< R >::ReturnType ReturnType;
|
||||||
static const int NUM_ARGS = 11 + startArgc;
|
static const S32 NUM_ARGS = 11 + startArgc;
|
||||||
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H, I, J, K ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J, K ) >& defaultArgs )
|
static ReturnType thunk( S32 argc, const char** argv, R ( *fn )( A, B, C, D, E, F, G, H, I, J, K ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J, K ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
@ -1983,11 +1983,11 @@ struct _EngineConsoleThunk< startArgc, R( A, B, C, D, E, F, G, H, I, J, K ) >
|
||||||
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h, i, j, k ) );
|
return _EngineConsoleThunkReturnValue( ( frame->*fn )( a, b, c, d, e, f, g, h, i, j, k ) );
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
template< int startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J, typename K >
|
template< S32 startArgc, typename A, typename B, typename C, typename D, typename E, typename F, typename G, typename H, typename I, typename J, typename K >
|
||||||
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I, J, K ) >
|
struct _EngineConsoleThunk< startArgc, void( A, B, C, D, E, F, G, H, I, J, K ) >
|
||||||
{
|
{
|
||||||
typedef void ReturnType;
|
typedef void ReturnType;
|
||||||
static const int NUM_ARGS = 11 + startArgc;
|
static const S32 NUM_ARGS = 11 + startArgc;
|
||||||
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H, I, J, K ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J, K ) >& defaultArgs )
|
static void thunk( S32 argc, const char** argv, void ( *fn )( A, B, C, D, E, F, G, H, I, J, K ), const _EngineFunctionDefaultArguments< void( A, B, C, D, E, F, G, H, I, J, K ) >& defaultArgs )
|
||||||
{
|
{
|
||||||
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) );
|
||||||
|
|
|
||||||
|
|
@ -307,7 +307,7 @@ static void dumpNamespaceEntries( Stream &stream, Namespace *g, bool callbacks =
|
||||||
// Go through all the entries in the namespace.
|
// Go through all the entries in the namespace.
|
||||||
for ( Namespace::Entry *ewalk = g->mEntryList; ewalk; ewalk = ewalk->mNext )
|
for ( Namespace::Entry *ewalk = g->mEntryList; ewalk; ewalk = ewalk->mNext )
|
||||||
{
|
{
|
||||||
int eType = ewalk->mType;
|
S32 eType = ewalk->mType;
|
||||||
|
|
||||||
// We do not dump script defined functions... only engine exports.
|
// We do not dump script defined functions... only engine exports.
|
||||||
if( eType == Namespace::Entry::ConsoleFunctionType
|
if( eType == Namespace::Entry::ConsoleFunctionType
|
||||||
|
|
|
||||||
|
|
@ -2663,7 +2663,7 @@ DefineConsoleMethod( SimObject, getDynamicFieldCount, S32, (),,
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DefineConsoleMethod( SimObject, getDynamicField, const char*, ( int index ),,
|
DefineConsoleMethod( SimObject, getDynamicField, const char*, ( S32 index ),,
|
||||||
"Get a value of a dynamic field by index.\n"
|
"Get a value of a dynamic field by index.\n"
|
||||||
"@param index The index of the dynamic field.\n"
|
"@param index The index of the dynamic field.\n"
|
||||||
"@return The value of the dynamic field at the given index or \"\"." )
|
"@return The value of the dynamic field at the given index or \"\"." )
|
||||||
|
|
@ -2702,7 +2702,7 @@ DefineConsoleMethod( SimObject, getFieldCount, S32, (),,
|
||||||
const AbstractClassRep::Field* f;
|
const AbstractClassRep::Field* f;
|
||||||
U32 numDummyEntries = 0;
|
U32 numDummyEntries = 0;
|
||||||
|
|
||||||
for(int i = 0; i < list.size(); i++)
|
for(S32 i = 0; i < list.size(); i++)
|
||||||
{
|
{
|
||||||
f = &list[i];
|
f = &list[i];
|
||||||
|
|
||||||
|
|
@ -2716,7 +2716,7 @@ DefineConsoleMethod( SimObject, getFieldCount, S32, (),,
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
DefineConsoleMethod( SimObject, getField, const char*, ( int index ),,
|
DefineConsoleMethod( SimObject, getField, const char*, ( S32 index ),,
|
||||||
"Retrieve the value of a static field by index.\n"
|
"Retrieve the value of a static field by index.\n"
|
||||||
"@param index The index of the static field.\n"
|
"@param index The index of the static field.\n"
|
||||||
"@return The value of the static field with the given index or \"\"." )
|
"@return The value of the static field with the given index or \"\"." )
|
||||||
|
|
|
||||||
|
|
@ -799,7 +799,7 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim)
|
||||||
#if defined(TORQUE_BIG_ENDIAN)
|
#if defined(TORQUE_BIG_ENDIAN)
|
||||||
#define MAX_SHADOW_TEXELS (256 + 4) //256 seems big enough, +4 so we can run off end of buffer.
|
#define MAX_SHADOW_TEXELS (256 + 4) //256 seems big enough, +4 so we can run off end of buffer.
|
||||||
// slow fake gaussian
|
// slow fake gaussian
|
||||||
int i, j, c;
|
S32 i, j, c;
|
||||||
U8 tmpLine[3][MAX_SHADOW_TEXELS];
|
U8 tmpLine[3][MAX_SHADOW_TEXELS];
|
||||||
U8 *src0, *src1, *src2;
|
U8 *src0, *src1, *src2;
|
||||||
U8 *s0, *s1, *s2;
|
U8 *s0, *s1, *s2;
|
||||||
|
|
@ -809,7 +809,7 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim)
|
||||||
U32 currVal;
|
U32 currVal;
|
||||||
U32 sampleVal;
|
U32 sampleVal;
|
||||||
U8 c00, c01, c02, c10, c11, c12, c20, c21, c22;
|
U8 c00, c01, c02, c10, c11, c12, c20, c21, c22;
|
||||||
int openBuf;
|
S32 openBuf;
|
||||||
|
|
||||||
src0 = tmpLine[0];
|
src0 = tmpLine[0];
|
||||||
src1 = tmpLine[1];
|
src1 = tmpLine[1];
|
||||||
|
|
@ -902,9 +902,9 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim)
|
||||||
sampleVal = 0; //c12; // take end.
|
sampleVal = 0; //c12; // take end.
|
||||||
else // inner pixel
|
else // inner pixel
|
||||||
{
|
{
|
||||||
const int wXP = 3; // corners
|
const S32 wXP = 3; // corners
|
||||||
const int wPP = 4; // plus/NSEW
|
const S32 wPP = 4; // plus/NSEW
|
||||||
const int wCP = 4; // center
|
const S32 wCP = 4; // center
|
||||||
sampleVal = (c00+c02+c20+c22)*wXP + (c01+c10+c12+c21)*wPP + c11*wCP;
|
sampleVal = (c00+c02+c20+c22)*wXP + (c01+c10+c12+c21)*wPP + c11*wCP;
|
||||||
sampleVal >>= 5; // div by 32 subsamples
|
sampleVal >>= 5; // div by 32 subsamples
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -234,7 +234,7 @@ public:
|
||||||
mWaterMark = FrameAllocator::getWaterMark();
|
mWaterMark = FrameAllocator::getWaterMark();
|
||||||
mMemory = reinterpret_cast<T *>( FrameAllocator::alloc( sizeof( T ) * count ) );
|
mMemory = reinterpret_cast<T *>( FrameAllocator::alloc( sizeof( T ) * count ) );
|
||||||
|
|
||||||
for( int i = 0; i < mNumObjectsInMemory; i++ )
|
for( S32 i = 0; i < mNumObjectsInMemory; i++ )
|
||||||
constructInPlace<T>( &mMemory[i] );
|
constructInPlace<T>( &mMemory[i] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -242,7 +242,7 @@ public:
|
||||||
~FrameTemp()
|
~FrameTemp()
|
||||||
{
|
{
|
||||||
// Call destructor
|
// Call destructor
|
||||||
for( int i = 0; i < mNumObjectsInMemory; i++ )
|
for( S32 i = 0; i < mNumObjectsInMemory; i++ )
|
||||||
destructInPlace<T>( &mMemory[i] );
|
destructInPlace<T>( &mMemory[i] );
|
||||||
|
|
||||||
FrameAllocator::setWaterMark( mWaterMark );
|
FrameAllocator::setWaterMark( mWaterMark );
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ bool OggDecoder::_readNextPacket( ogg_packet* packet )
|
||||||
|
|
||||||
while( 1 )
|
while( 1 )
|
||||||
{
|
{
|
||||||
int result = ogg_stream_packetout( &mOggStreamState, packet );
|
S32 result = ogg_stream_packetout( &mOggStreamState, packet );
|
||||||
if( result == 0 )
|
if( result == 0 )
|
||||||
{
|
{
|
||||||
if( !mOggStream->_requestData() )
|
if( !mOggStream->_requestData() )
|
||||||
|
|
|
||||||
|
|
@ -169,7 +169,7 @@ bool OggTheoraDecoder::_init()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int result = th_decode_headerin( &mTheoraInfo, &mTheoraComment, &mTheoraSetup, &nextPacket );
|
S32 result = th_decode_headerin( &mTheoraInfo, &mTheoraComment, &mTheoraSetup, &nextPacket );
|
||||||
if( result < 0 )
|
if( result < 0 )
|
||||||
{
|
{
|
||||||
haveTheoraHeader = false;
|
haveTheoraHeader = false;
|
||||||
|
|
|
||||||
|
|
@ -89,7 +89,7 @@ bool OggVorbisDecoder::_init()
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
int result = vorbis_synthesis_headerin( &mVorbisInfo, &mVorbisComment, &nextPacket );
|
S32 result = vorbis_synthesis_headerin( &mVorbisInfo, &mVorbisComment, &nextPacket );
|
||||||
if( result != 0 )
|
if( result != 0 )
|
||||||
{
|
{
|
||||||
haveVorbisHeader = false;
|
haveVorbisHeader = false;
|
||||||
|
|
|
||||||
|
|
@ -438,7 +438,7 @@ void StringBufferManager::updateStats()
|
||||||
request8 = 0;
|
request8 = 0;
|
||||||
request16 = 0;
|
request16 = 0;
|
||||||
U32 nstrings = strings.size();
|
U32 nstrings = strings.size();
|
||||||
for(int i=0; i < nstrings; i++)
|
for(S32 i=0; i < nstrings; i++)
|
||||||
{
|
{
|
||||||
request8 += strings[i]->rc->requestCount8;
|
request8 += strings[i]->rc->requestCount8;
|
||||||
request16 += strings[i]->rc->requestCount16;
|
request16 += strings[i]->rc->requestCount16;
|
||||||
|
|
@ -459,7 +459,7 @@ void StringBufferManager::dumpAllStrings()
|
||||||
U32 nstrings = strings.size();
|
U32 nstrings = strings.size();
|
||||||
Con::printf("===== String Manager: All Strings =====");
|
Con::printf("===== String Manager: All Strings =====");
|
||||||
Con::printf(" utf8 | utf16 | string");
|
Con::printf(" utf8 | utf16 | string");
|
||||||
for(int i=0; i < nstrings; i++)
|
for(S32 i=0; i < nstrings; i++)
|
||||||
{
|
{
|
||||||
UTF8* tmp = strings[i]->createCopy8();
|
UTF8* tmp = strings[i]->createCopy8();
|
||||||
strings[i]->rc->requestCount8--;
|
strings[i]->rc->requestCount8--;
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ bool FindMatch::isMatch( const char *exp, const char *str, bool caseSensitive )
|
||||||
bool FindMatch::isMatchMultipleExprs( const char *exps, const char *str, bool caseSensitive )
|
bool FindMatch::isMatchMultipleExprs( const char *exps, const char *str, bool caseSensitive )
|
||||||
{
|
{
|
||||||
char *tok = 0;
|
char *tok = 0;
|
||||||
int len = dStrlen(exps);
|
S32 len = dStrlen(exps);
|
||||||
|
|
||||||
char *e = new char[len+1];
|
char *e = new char[len+1];
|
||||||
dStrcpy(e,exps);
|
dStrcpy(e,exps);
|
||||||
|
|
|
||||||
|
|
@ -97,10 +97,10 @@ nat_toupper( nat_char a )
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static S32
|
||||||
compare_right(const nat_char* a, const nat_char* b)
|
compare_right(const nat_char* a, const nat_char* b)
|
||||||
{
|
{
|
||||||
int bias = 0;
|
S32 bias = 0;
|
||||||
|
|
||||||
/* The longest run of digits wins. That aside, the greatest
|
/* The longest run of digits wins. That aside, the greatest
|
||||||
value wins, but we can't know that it will until we've scanned
|
value wins, but we can't know that it will until we've scanned
|
||||||
|
|
@ -149,11 +149,11 @@ compare_left(const nat_char* a, const nat_char* b)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int strnatcmp0(const nat_char* a, const nat_char* b, int fold_case)
|
static S32 strnatcmp0(const nat_char* a, const nat_char* b, S32 fold_case)
|
||||||
{
|
{
|
||||||
int ai, bi;
|
S32 ai, bi;
|
||||||
nat_char ca, cb;
|
nat_char ca, cb;
|
||||||
int fractional, result;
|
S32 fractional, result;
|
||||||
|
|
||||||
ai = bi = 0;
|
ai = bi = 0;
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
@ -200,13 +200,13 @@ static int strnatcmp0(const nat_char* a, const nat_char* b, int fold_case)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int dStrnatcmp(const nat_char* a, const nat_char* b) {
|
S32 dStrnatcmp(const nat_char* a, const nat_char* b) {
|
||||||
return strnatcmp0(a, b, 0);
|
return strnatcmp0(a, b, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* Compare, recognizing numeric string and ignoring case. */
|
/* Compare, recognizing numeric string and ignoring case. */
|
||||||
int dStrnatcasecmp(const nat_char* a, const nat_char* b) {
|
S32 dStrnatcasecmp(const nat_char* a, const nat_char* b) {
|
||||||
return strnatcmp0(a, b, 1);
|
return strnatcmp0(a, b, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -328,12 +328,12 @@ char* dStrcpyl(char *dst, dsize_t dstSize, ...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int dStrcmp( const UTF16 *str1, const UTF16 *str2)
|
S32 dStrcmp( const UTF16 *str1, const UTF16 *str2)
|
||||||
{
|
{
|
||||||
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
|
#if defined(TORQUE_OS_WIN) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON)
|
||||||
return wcscmp( reinterpret_cast<const wchar_t *>( str1 ), reinterpret_cast<const wchar_t *>( str2 ) );
|
return wcscmp( reinterpret_cast<const wchar_t *>( str1 ), reinterpret_cast<const wchar_t *>( str2 ) );
|
||||||
#else
|
#else
|
||||||
int ret;
|
S32 ret;
|
||||||
const UTF16 *a, *b;
|
const UTF16 *a, *b;
|
||||||
a = str1;
|
a = str1;
|
||||||
b = str2;
|
b = str2;
|
||||||
|
|
|
||||||
|
|
@ -52,22 +52,22 @@ inline char *dStrncat(char *dst, const char *src, dsize_t len)
|
||||||
return strncat(dst,src,len);
|
return strncat(dst,src,len);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int dStrcmp(const char *str1, const char *str2)
|
inline S32 dStrcmp(const char *str1, const char *str2)
|
||||||
{
|
{
|
||||||
return strcmp(str1, str2);
|
return strcmp(str1, str2);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int dStrncmp(const char *str1, const char *str2, dsize_t len)
|
inline S32 dStrncmp(const char *str1, const char *str2, dsize_t len)
|
||||||
{
|
{
|
||||||
return strncmp(str1, str2, len);
|
return strncmp(str1, str2, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int dStricmp(const char *str1, const char *str2)
|
inline S32 dStricmp(const char *str1, const char *str2)
|
||||||
{
|
{
|
||||||
return strcasecmp( str1, str2 );
|
return strcasecmp( str1, str2 );
|
||||||
}
|
}
|
||||||
|
|
||||||
inline int dStrnicmp(const char *str1, const char *str2, dsize_t len)
|
inline S32 dStrnicmp(const char *str1, const char *str2, dsize_t len)
|
||||||
{
|
{
|
||||||
return strncasecmp( str1, str2, len );
|
return strncasecmp( str1, str2, len );
|
||||||
}
|
}
|
||||||
|
|
@ -87,22 +87,22 @@ inline dsize_t dStrlen(const char *str)
|
||||||
return strlen(str);
|
return strlen(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char *dStrchr(char *str, int c)
|
inline char *dStrchr(char *str, S32 c)
|
||||||
{
|
{
|
||||||
return strchr(str,c);
|
return strchr(str,c);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const char *dStrchr(const char *str, int c)
|
inline const char *dStrchr(const char *str, S32 c)
|
||||||
{
|
{
|
||||||
return strchr(str,c);
|
return strchr(str,c);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline char *dStrrchr(char *str, int c)
|
inline char *dStrrchr(char *str, S32 c)
|
||||||
{
|
{
|
||||||
return strrchr(str,c);
|
return strrchr(str,c);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const char *dStrrchr(const char *str, int c)
|
inline const char *dStrrchr(const char *str, S32 c)
|
||||||
{
|
{
|
||||||
return strrchr(str,c);
|
return strrchr(str,c);
|
||||||
}
|
}
|
||||||
|
|
@ -198,9 +198,9 @@ extern char *dStrlwr(char *str);
|
||||||
extern char* dStrichr( char* str, char ch );
|
extern char* dStrichr( char* str, char ch );
|
||||||
extern const char* dStrichr( const char* str, char ch );
|
extern const char* dStrichr( const char* str, char ch );
|
||||||
|
|
||||||
extern int dStrcmp(const UTF16 *str1, const UTF16 *str2);
|
extern S32 dStrcmp(const UTF16 *str1, const UTF16 *str2);
|
||||||
extern int dStrnatcmp( const char* str1, const char* str2 );
|
extern S32 dStrnatcmp( const char* str1, const char* str2 );
|
||||||
extern int dStrnatcasecmp( const char* str1, const char* str2 );
|
extern S32 dStrnatcasecmp( const char* str1, const char* str2 );
|
||||||
|
|
||||||
inline bool dAtob(const char *str)
|
inline bool dAtob(const char *str)
|
||||||
{
|
{
|
||||||
|
|
@ -219,9 +219,9 @@ char* dStripPath(const char* filename);
|
||||||
// standard I/O functions [defined in platformString.cpp]
|
// standard I/O functions [defined in platformString.cpp]
|
||||||
|
|
||||||
extern void dPrintf(const char *format, ...);
|
extern void dPrintf(const char *format, ...);
|
||||||
extern int dVprintf(const char *format, void *arglist);
|
extern S32 dVprintf(const char *format, void *arglist);
|
||||||
extern int dSprintf(char *buffer, U32 bufferSize, const char *format, ...);
|
extern S32 dSprintf(char *buffer, U32 bufferSize, const char *format, ...);
|
||||||
extern int dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist);
|
extern S32 dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist);
|
||||||
extern int dSscanf(const char *buffer, const char *format, ...);
|
extern S32 dSscanf(const char *buffer, const char *format, ...);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ UTF32 oneUTF8toUTF32( const UTF8* codepoint, U32 *unitsWalked)
|
||||||
U8 codeunit;
|
U8 codeunit;
|
||||||
|
|
||||||
// check the first byte ( a.k.a. codeunit ) .
|
// check the first byte ( a.k.a. codeunit ) .
|
||||||
unsigned char c = codepoint[0];
|
U8 c = codepoint[0];
|
||||||
c = c >> 1;
|
c = c >> 1;
|
||||||
expectedByteCount = sgFirstByteLUT[c];
|
expectedByteCount = sgFirstByteLUT[c];
|
||||||
if(expectedByteCount > 0) // 0 or negative is illegal to start with
|
if(expectedByteCount > 0) // 0 or negative is illegal to start with
|
||||||
|
|
@ -469,7 +469,7 @@ U32 oneUTF32toUTF8(const UTF32 codepoint, UTF8 *threeByteCodeunitBuf)
|
||||||
U8 marker = ( ~mask << 1); // 1000 0000
|
U8 marker = ( ~mask << 1); // 1000 0000
|
||||||
|
|
||||||
// Process the low order bytes, shifting the codepoint down 6 each pass.
|
// Process the low order bytes, shifting the codepoint down 6 each pass.
|
||||||
for( int i = bytecount-1; i > 0; i--)
|
for( S32 i = bytecount-1; i > 0; i--)
|
||||||
{
|
{
|
||||||
threeByteCodeunitBuf[i] = marker | (working & mask);
|
threeByteCodeunitBuf[i] = marker | (working & mask);
|
||||||
working >>= 6;
|
working >>= 6;
|
||||||
|
|
|
||||||
|
|
@ -308,7 +308,7 @@ bool TagDictionary::match(const char* pattern, const char* str)
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
static int QSORT_CALLBACK idCompare(const void *in_p1, const void *in_p2)
|
static S32 QSORT_CALLBACK idCompare(const void *in_p1, const void *in_p2)
|
||||||
{
|
{
|
||||||
return *((S32 *) in_p1) - *((S32 *) in_p2);
|
return *((S32 *) in_p1) - *((S32 *) in_p2);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ TorqueThreadStaticListHandle _TorqueThreadStaticReg::spawnThreadStaticsInstance(
|
||||||
|
|
||||||
// Copy mThreadStaticInstances[0] (master copy) into new memory, and
|
// Copy mThreadStaticInstances[0] (master copy) into new memory, and
|
||||||
// pass it back.
|
// pass it back.
|
||||||
for( int i = 0; i < getThreadStaticListVector()[0].size(); i++ )
|
for( S32 i = 0; i < getThreadStaticListVector()[0].size(); i++ )
|
||||||
{
|
{
|
||||||
getThreadStaticListVector().last().push_back( getThreadStaticListVector()[0][i]->_createInstance() );
|
getThreadStaticListVector().last().push_back( getThreadStaticListVector()[0][i]->_createInstance() );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,7 +174,7 @@ inline OutputClass horrible_cast(const InputClass input){
|
||||||
// Cause a compile-time error if in, out and u are not the same size.
|
// Cause a compile-time error if in, out and u are not the same size.
|
||||||
// If the compile fails here, it means the compiler has peculiar
|
// If the compile fails here, it means the compiler has peculiar
|
||||||
// unions which would prevent the cast from working.
|
// unions which would prevent the cast from working.
|
||||||
typedef int ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
|
typedef S32 ERROR_CantUseHorrible_cast[sizeof(InputClass)==sizeof(u)
|
||||||
&& sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1];
|
&& sizeof(InputClass)==sizeof(OutputClass) ? 1 : -1];
|
||||||
u.in = input;
|
u.in = input;
|
||||||
return u.out;
|
return u.out;
|
||||||
|
|
@ -270,7 +270,7 @@ struct VoidToDefaultVoid<void> { typedef DefaultVoid type; };
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// The size of a single inheritance member function pointer.
|
// The size of a single inheritance member function pointer.
|
||||||
const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
|
const S32 SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
|
||||||
|
|
||||||
// SimplifyMemFunc< >::Convert()
|
// SimplifyMemFunc< >::Convert()
|
||||||
//
|
//
|
||||||
|
|
@ -284,7 +284,7 @@ const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)());
|
||||||
// template specialisation, I use full specialisation of a wrapper struct.
|
// template specialisation, I use full specialisation of a wrapper struct.
|
||||||
|
|
||||||
// general case -- don't know how to convert it. Force a compile failure
|
// general case -- don't know how to convert it. Force a compile failure
|
||||||
template <int N>
|
template <S32 N>
|
||||||
struct SimplifyMemFunc {
|
struct SimplifyMemFunc {
|
||||||
template <class X, class XFuncType, class GenericMemFuncType>
|
template <class X, class XFuncType, class GenericMemFuncType>
|
||||||
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind,
|
||||||
|
|
@ -344,11 +344,11 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
|
||||||
XFuncType func;
|
XFuncType func;
|
||||||
struct {
|
struct {
|
||||||
GenericMemFuncType funcaddress; // points to the actual member function
|
GenericMemFuncType funcaddress; // points to the actual member function
|
||||||
int delta; // #BYTES to be added to the 'this' pointer
|
S32 delta; // #BYTES to be added to the 'this' pointer
|
||||||
}s;
|
}s;
|
||||||
} u;
|
} u;
|
||||||
// Check that the horrible_cast will work
|
// Check that the horrible_cast will work
|
||||||
typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)? 1 : -1];
|
typedef S32 ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)? 1 : -1];
|
||||||
u.func = function_to_bind;
|
u.func = function_to_bind;
|
||||||
bound_func = u.s.funcaddress;
|
bound_func = u.s.funcaddress;
|
||||||
return reinterpret_cast<GenericClass *>(reinterpret_cast<char *>(pthis) + u.s.delta);
|
return reinterpret_cast<GenericClass *>(reinterpret_cast<char *>(pthis) + u.s.delta);
|
||||||
|
|
@ -367,8 +367,8 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > {
|
||||||
// is internally defined as:
|
// is internally defined as:
|
||||||
struct MicrosoftVirtualMFP {
|
struct MicrosoftVirtualMFP {
|
||||||
void (GenericClass::*codeptr)(); // points to the actual member function
|
void (GenericClass::*codeptr)(); // points to the actual member function
|
||||||
int delta; // #bytes to be added to the 'this' pointer
|
S32 delta; // #bytes to be added to the 'this' pointer
|
||||||
int vtable_index; // or 0 if no virtual inheritance
|
S32 vtable_index; // or 0 if no virtual inheritance
|
||||||
};
|
};
|
||||||
// The CRUCIAL feature of Microsoft/Intel MFPs which we exploit is that the
|
// The CRUCIAL feature of Microsoft/Intel MFPs which we exploit is that the
|
||||||
// m_codeptr member is *always* called, regardless of the values of the other
|
// m_codeptr member is *always* called, regardless of the values of the other
|
||||||
|
|
@ -405,7 +405,7 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 2*sizeof(int) >
|
||||||
MicrosoftVirtualMFP s;
|
MicrosoftVirtualMFP s;
|
||||||
} u2;
|
} u2;
|
||||||
// Check that the horrible_cast<>s will work
|
// Check that the horrible_cast<>s will work
|
||||||
typedef int ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)
|
typedef S32 ERROR_CantUsehorrible_cast[sizeof(function_to_bind)==sizeof(u.s)
|
||||||
&& sizeof(function_to_bind)==sizeof(u.ProbeFunc)
|
&& sizeof(function_to_bind)==sizeof(u.ProbeFunc)
|
||||||
&& sizeof(u2.virtfunc)==sizeof(u2.s) ? 1 : -1];
|
&& sizeof(u2.virtfunc)==sizeof(u2.s) ? 1 : -1];
|
||||||
// Unfortunately, taking the address of a MF prevents it from being inlined, so
|
// Unfortunately, taking the address of a MF prevents it from being inlined, so
|
||||||
|
|
@ -477,24 +477,24 @@ struct SimplifyMemFunc<SINGLE_MEMFUNCPTR_SIZE + 3*sizeof(int) >
|
||||||
// is internally defined as:
|
// is internally defined as:
|
||||||
struct {
|
struct {
|
||||||
GenericMemFuncType m_funcaddress; // points to the actual member function
|
GenericMemFuncType m_funcaddress; // points to the actual member function
|
||||||
int delta; // #bytes to be added to the 'this' pointer
|
S32 delta; // #bytes to be added to the 'this' pointer
|
||||||
int vtordisp; // #bytes to add to 'this' to find the vtable
|
S32 vtordisp; // #bytes to add to 'this' to find the vtable
|
||||||
int vtable_index; // or 0 if no virtual inheritance
|
S32 vtable_index; // or 0 if no virtual inheritance
|
||||||
} s;
|
} s;
|
||||||
} u;
|
} u;
|
||||||
// Check that the horrible_cast will work
|
// Check that the horrible_cast will work
|
||||||
typedef int ERROR_CantUsehorrible_cast[sizeof(XFuncType)==sizeof(u.s)? 1 : -1];
|
typedef S32 ERROR_CantUsehorrible_cast[sizeof(XFuncType)==sizeof(u.s)? 1 : -1];
|
||||||
u.func = function_to_bind;
|
u.func = function_to_bind;
|
||||||
bound_func = u.s.funcaddress;
|
bound_func = u.s.funcaddress;
|
||||||
int virtual_delta = 0;
|
S32 virtual_delta = 0;
|
||||||
if (u.s.vtable_index) { // Virtual inheritance is used
|
if (u.s.vtable_index) { // Virtual inheritance is used
|
||||||
// First, get to the vtable.
|
// First, get to the vtable.
|
||||||
// It is 'vtordisp' bytes from the start of the class.
|
// It is 'vtordisp' bytes from the start of the class.
|
||||||
const int * vtable = *reinterpret_cast<const int *const*>(
|
const S32 * vtable = *reinterpret_cast<const S32 *const*>(
|
||||||
reinterpret_cast<const char *>(pthis) + u.s.vtordisp );
|
reinterpret_cast<const char *>(pthis) + u.s.vtordisp );
|
||||||
|
|
||||||
// 'vtable_index' tells us where in the table we should be looking.
|
// 'vtable_index' tells us where in the table we should be looking.
|
||||||
virtual_delta = u.s.vtordisp + *reinterpret_cast<const int *>(
|
virtual_delta = u.s.vtordisp + *reinterpret_cast<const S32 *>(
|
||||||
reinterpret_cast<const char *>(vtable) + u.s.vtable_index);
|
reinterpret_cast<const char *>(vtable) + u.s.vtable_index);
|
||||||
}
|
}
|
||||||
// The int at 'virtual_delta' gives us the amount to add to 'this'.
|
// The int at 'virtual_delta' gives us the amount to add to 'this'.
|
||||||
|
|
@ -777,7 +777,7 @@ public:
|
||||||
// Ensure that there's a compilation failure if function pointers
|
// Ensure that there's a compilation failure if function pointers
|
||||||
// and data pointers have different sizes.
|
// and data pointers have different sizes.
|
||||||
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
|
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
|
||||||
typedef int ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1];
|
typedef S32 ERROR_CantUseEvilMethod[sizeof(GenericClass *)==sizeof(function_to_bind) ? 1 : -1];
|
||||||
m_pthis = horrible_cast<GenericClass *>(function_to_bind);
|
m_pthis = horrible_cast<GenericClass *>(function_to_bind);
|
||||||
// MSVC, SunC++ and DMC accept the following (non-standard) code:
|
// MSVC, SunC++ and DMC accept the following (non-standard) code:
|
||||||
// m_pthis = static_cast<GenericClass *>(static_cast<void *>(function_to_bind));
|
// m_pthis = static_cast<GenericClass *>(static_cast<void *>(function_to_bind));
|
||||||
|
|
@ -792,7 +792,7 @@ public:
|
||||||
// Ensure that there's a compilation failure if function pointers
|
// Ensure that there's a compilation failure if function pointers
|
||||||
// and data pointers have different sizes.
|
// and data pointers have different sizes.
|
||||||
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
|
// If you get this error, you need to #undef FASTDELEGATE_USESTATICFUNCTIONHACK.
|
||||||
typedef int ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1];
|
typedef S32 ERROR_CantUseEvilMethod[sizeof(UnvoidStaticFuncPtr)==sizeof(this) ? 1 : -1];
|
||||||
return horrible_cast<UnvoidStaticFuncPtr>(this);
|
return horrible_cast<UnvoidStaticFuncPtr>(this);
|
||||||
}
|
}
|
||||||
#endif // !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
|
#endif // !defined(FASTDELEGATE_USESTATICFUNCTIONHACK)
|
||||||
|
|
@ -906,7 +906,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -991,7 +991,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -1076,7 +1076,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -1161,7 +1161,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -1246,7 +1246,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -1331,7 +1331,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -1416,7 +1416,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -1501,7 +1501,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -1586,7 +1586,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -1671,7 +1671,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -1756,7 +1756,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
@ -1841,7 +1841,7 @@ public:
|
||||||
// Implicit conversion to "bool" using the safe_bool idiom
|
// Implicit conversion to "bool" using the safe_bool idiom
|
||||||
private:
|
private:
|
||||||
typedef struct SafeBoolStruct {
|
typedef struct SafeBoolStruct {
|
||||||
int a_data_pointer_to_this_is_0_on_buggy_compilers;
|
S32 a_data_pointer_to_this_is_0_on_buggy_compilers;
|
||||||
StaticFunctionPtr m_nonzero;
|
StaticFunctionPtr m_nonzero;
|
||||||
} UselessTypedef;
|
} UselessTypedef;
|
||||||
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type;
|
||||||
|
|
|
||||||
|
|
@ -55,7 +55,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int mOffset;
|
S32 mOffset;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _UTIL_DELEGATE_H_
|
#endif // _UTIL_DELEGATE_H_
|
||||||
|
|
@ -37,7 +37,7 @@ public:
|
||||||
|
|
||||||
volatile U8 *u8Mem = reinterpret_cast<U8 *>( memory );
|
volatile U8 *u8Mem = reinterpret_cast<U8 *>( memory );
|
||||||
|
|
||||||
for( int i = 0; i < size >> 2; i++ )
|
for( S32 i = 0; i < size >> 2; i++ )
|
||||||
{
|
{
|
||||||
// g = garbage byte
|
// g = garbage byte
|
||||||
// Input: [X|Y|Z|g] (rgba)
|
// Input: [X|Y|Z|g] (rgba)
|
||||||
|
|
@ -57,7 +57,7 @@ public:
|
||||||
volatile const U8 *srcU8 = reinterpret_cast<const U8 *>( source );
|
volatile const U8 *srcU8 = reinterpret_cast<const U8 *>( source );
|
||||||
volatile U8 *dstU8 = reinterpret_cast<U8 *>( destination );
|
volatile U8 *dstU8 = reinterpret_cast<U8 *>( destination );
|
||||||
|
|
||||||
for( int i = 0; i < size >> 2; i++ )
|
for( S32 i = 0; i < size >> 2; i++ )
|
||||||
{
|
{
|
||||||
// g = garbage byte
|
// g = garbage byte
|
||||||
// Input: [X|Y|Z|g] (rgba)
|
// Input: [X|Y|Z|g] (rgba)
|
||||||
|
|
@ -85,13 +85,13 @@ public:
|
||||||
virtual void ToBuffer( void *destination, const void *source, const dsize_t size ) const
|
virtual void ToBuffer( void *destination, const void *source, const dsize_t size ) const
|
||||||
{
|
{
|
||||||
AssertFatal( size % 3 == 0, "Bad buffer size for DXT5nm Swizzle" );
|
AssertFatal( size % 3 == 0, "Bad buffer size for DXT5nm Swizzle" );
|
||||||
const int pixels = size / 3;
|
const S32 pixels = size / 3;
|
||||||
|
|
||||||
volatile const U8 *srcU8 = reinterpret_cast<const U8 *>( source );
|
volatile const U8 *srcU8 = reinterpret_cast<const U8 *>( source );
|
||||||
volatile U8 *dstU8 = reinterpret_cast<U8 *>( destination );
|
volatile U8 *dstU8 = reinterpret_cast<U8 *>( destination );
|
||||||
|
|
||||||
// destination better damn well be the right size
|
// destination better damn well be the right size
|
||||||
for( int i = 0; i < pixels; i++ )
|
for( S32 i = 0; i < pixels; i++ )
|
||||||
{
|
{
|
||||||
// g = garbage byte
|
// g = garbage byte
|
||||||
// Input: [X|Y|Z|g] (rgba)
|
// Input: [X|Y|Z|g] (rgba)
|
||||||
|
|
|
||||||
|
|
@ -56,7 +56,7 @@ void Path::_split(String name)
|
||||||
idx = name.find('/', 0, String::Right);
|
idx = name.find('/', 0, String::Right);
|
||||||
if (idx >= pos)
|
if (idx >= pos)
|
||||||
{
|
{
|
||||||
int len = idx - pos;
|
S32 len = idx - pos;
|
||||||
mPath = name.substr(pos,len? len: 1);
|
mPath = name.substr(pos,len? len: 1);
|
||||||
mPath = Path::CleanSeparators(mPath);
|
mPath = Path::CleanSeparators(mPath);
|
||||||
pos = idx + 1;
|
pos = idx + 1;
|
||||||
|
|
|
||||||
|
|
@ -126,11 +126,11 @@ inline void Swizzle<T, mapLength>::ToBuffer( void *destination, const void *sour
|
||||||
T *dest = reinterpret_cast<T *>( destination );
|
T *dest = reinterpret_cast<T *>( destination );
|
||||||
const T *src = reinterpret_cast<const T *>( source );
|
const T *src = reinterpret_cast<const T *>( source );
|
||||||
|
|
||||||
for( int i = 0; i < size / ( mapLength * sizeof( T ) ); i++ )
|
for( S32 i = 0; i < size / ( mapLength * sizeof( T ) ); i++ )
|
||||||
{
|
{
|
||||||
dMemcpy( dest, src, mapLength * sizeof( T ) );
|
dMemcpy( dest, src, mapLength * sizeof( T ) );
|
||||||
|
|
||||||
for( int j = 0; j < mapLength; j++ )
|
for( S32 j = 0; j < mapLength; j++ )
|
||||||
*dest++ = src[mMap[j]];
|
*dest++ = src[mMap[j]];
|
||||||
|
|
||||||
src += mapLength;
|
src += mapLength;
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,7 @@ inline void Swizzle<U8, 4>::InPlace( void *memory, const dsize_t size ) const
|
||||||
U8 *src = reinterpret_cast<U8 *>( memory );
|
U8 *src = reinterpret_cast<U8 *>( memory );
|
||||||
|
|
||||||
// Fast divide by 4 since we are assured a proper size
|
// Fast divide by 4 since we are assured a proper size
|
||||||
for( int i = 0; i < size >> 2; i++ )
|
for( S32 i = 0; i < size >> 2; i++ )
|
||||||
{
|
{
|
||||||
BYTESWAP( *dest++, src[mMap[0]] );
|
BYTESWAP( *dest++, src[mMap[0]] );
|
||||||
BYTESWAP( *dest++, src[mMap[1]] );
|
BYTESWAP( *dest++, src[mMap[1]] );
|
||||||
|
|
@ -57,7 +57,7 @@ inline void Swizzle<U8, 4>::ToBuffer( void *destination, const void *source, con
|
||||||
const U8 *src = reinterpret_cast<const U8 *>( source );
|
const U8 *src = reinterpret_cast<const U8 *>( source );
|
||||||
|
|
||||||
// Fast divide by 4 since we are assured a proper size
|
// Fast divide by 4 since we are assured a proper size
|
||||||
for( int i = 0; i < size >> 2; i++ )
|
for( S32 i = 0; i < size >> 2; i++ )
|
||||||
{
|
{
|
||||||
*dest++ = src[mMap[0]];
|
*dest++ = src[mMap[0]];
|
||||||
*dest++ = src[mMap[1]];
|
*dest++ = src[mMap[1]];
|
||||||
|
|
@ -80,7 +80,7 @@ inline void Swizzle<U8, 3>::InPlace( void *memory, const dsize_t size ) const
|
||||||
U8 *dest = reinterpret_cast<U8 *>( memory );
|
U8 *dest = reinterpret_cast<U8 *>( memory );
|
||||||
U8 *src = reinterpret_cast<U8 *>( memory );
|
U8 *src = reinterpret_cast<U8 *>( memory );
|
||||||
|
|
||||||
for( int i = 0; i < size /3; i++ )
|
for( S32 i = 0; i < size /3; i++ )
|
||||||
{
|
{
|
||||||
BYTESWAP( *dest++, src[mMap[0]] );
|
BYTESWAP( *dest++, src[mMap[0]] );
|
||||||
BYTESWAP( *dest++, src[mMap[1]] );
|
BYTESWAP( *dest++, src[mMap[1]] );
|
||||||
|
|
@ -98,7 +98,7 @@ inline void Swizzle<U8, 3>::ToBuffer( void *destination, const void *source, con
|
||||||
U8 *dest = reinterpret_cast<U8 *>( destination );
|
U8 *dest = reinterpret_cast<U8 *>( destination );
|
||||||
const U8 *src = reinterpret_cast<const U8 *>( source );
|
const U8 *src = reinterpret_cast<const U8 *>( source );
|
||||||
|
|
||||||
for( int i = 0; i < size / 3; i++ )
|
for( S32 i = 0; i < size / 3; i++ )
|
||||||
{
|
{
|
||||||
*dest++ = src[mMap[0]];
|
*dest++ = src[mMap[0]];
|
||||||
*dest++ = src[mMap[1]];
|
*dest++ = src[mMap[1]];
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
|
|
||||||
|
|
||||||
/// A vector with a compile-time constant size.
|
/// A vector with a compile-time constant size.
|
||||||
template< typename T, int SIZE >
|
template< typename T, S32 SIZE >
|
||||||
class FixedSizeVector
|
class FixedSizeVector
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@
|
||||||
#include "core/util/tSignal.h"
|
#include "core/util/tSignal.h"
|
||||||
|
|
||||||
|
|
||||||
void SignalBase::DelegateLink::insert(DelegateLink* node, float order)
|
void SignalBase::DelegateLink::insert(DelegateLink* node, F32 order)
|
||||||
{
|
{
|
||||||
// Note: can only legitimately be called on list head
|
// Note: can only legitimately be called on list head
|
||||||
DelegateLink * walk = next;
|
DelegateLink * walk = next;
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@ public:
|
||||||
{
|
{
|
||||||
if( del->mDelegate == dlg )
|
if( del->mDelegate == dlg )
|
||||||
{
|
{
|
||||||
for ( int i = 0; i < mTriggerNext.size(); i++ )
|
for ( S32 i = 0; i < mTriggerNext.size(); i++ )
|
||||||
{
|
{
|
||||||
if( mTriggerNext[i] == ptr )
|
if( mTriggerNext[i] == ptr )
|
||||||
mTriggerNext[i] = ptr->next;
|
mTriggerNext[i] = ptr->next;
|
||||||
|
|
|
||||||
|
|
@ -508,7 +508,7 @@ template<class T> inline void Vector<T>::compact()
|
||||||
resize(mElementCount);
|
resize(mElementCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef int (QSORT_CALLBACK *qsort_compare_func)(const void *, const void *);
|
typedef S32 (QSORT_CALLBACK *qsort_compare_func)(const void *, const void *);
|
||||||
|
|
||||||
template<class T> inline void Vector<T>::sort(compare_func f)
|
template<class T> inline void Vector<T>::sort(compare_func f)
|
||||||
{
|
{
|
||||||
|
|
@ -800,7 +800,7 @@ class VectorPtr : public Vector<void *>
|
||||||
const_iterator end() const;
|
const_iterator end() const;
|
||||||
|
|
||||||
void insert(iterator,const T&);
|
void insert(iterator,const T&);
|
||||||
void insert(int idx) { Parent::insert(idx); }
|
void insert(S32 idx) { Parent::insert(idx); }
|
||||||
void erase(iterator);
|
void erase(iterator);
|
||||||
|
|
||||||
T& front();
|
T& front();
|
||||||
|
|
|
||||||
|
|
@ -72,10 +72,10 @@ CreateUnitTest( TestVector, "Util/Vector" )
|
||||||
TEST( dtorVals[ 9 ] );
|
TEST( dtorVals[ 9 ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
static S32 QSORT_CALLBACK sortInts( const int* a, const int* b )
|
static S32 QSORT_CALLBACK sortInts( const S32* a, const S32* b )
|
||||||
{
|
{
|
||||||
int av = *a;
|
S32 av = *a;
|
||||||
int bv = *b;
|
S32 bv = *b;
|
||||||
|
|
||||||
if( av < bv )
|
if( av < bv )
|
||||||
return -1;
|
return -1;
|
||||||
|
|
@ -87,7 +87,7 @@ CreateUnitTest( TestVector, "Util/Vector" )
|
||||||
|
|
||||||
void testSort()
|
void testSort()
|
||||||
{
|
{
|
||||||
Vector< int > v;
|
Vector< S32 > v;
|
||||||
|
|
||||||
v.push_back( 0 );
|
v.push_back( 0 );
|
||||||
v.push_back( 10 );
|
v.push_back( 10 );
|
||||||
|
|
|
||||||
|
|
@ -216,7 +216,7 @@ String ZipObject::getFileEntry(S32 idx)
|
||||||
|
|
||||||
const Zip::CentralDir &dir = (*mZipArchive)[idx];
|
const Zip::CentralDir &dir = (*mZipArchive)[idx];
|
||||||
char buffer[1024];
|
char buffer[1024];
|
||||||
int chars = dSprintf(buffer, sizeof(buffer), "%s\t%d\t%d\t%d\t%08x",
|
S32 chars = dSprintf(buffer, sizeof(buffer), "%s\t%d\t%d\t%d\t%08x",
|
||||||
dir.mFilename.c_str(), dir.mUncompressedSize, dir.mCompressedSize,
|
dir.mFilename.c_str(), dir.mUncompressedSize, dir.mCompressedSize,
|
||||||
dir.mCompressMethod, dir.mCRC32);
|
dir.mCompressMethod, dir.mCRC32);
|
||||||
if (chars < sizeof(buffer))
|
if (chars < sizeof(buffer))
|
||||||
|
|
|
||||||
|
|
@ -651,7 +651,7 @@ bool MountSystem::unmount(FileSystemRef fs)
|
||||||
// also check that fs is not null each time since its a strong ref
|
// also check that fs is not null each time since its a strong ref
|
||||||
// so it could be nulled during removal.
|
// so it could be nulled during removal.
|
||||||
bool unmounted = false;
|
bool unmounted = false;
|
||||||
for (int i = mMountList.size() - 1; !fs.isNull() && i >= 0; --i)
|
for (S32 i = mMountList.size() - 1; !fs.isNull() && i >= 0; --i)
|
||||||
{
|
{
|
||||||
if (mMountList[i].fileSystem.getPointer() == fs.getPointer())
|
if (mMountList[i].fileSystem.getPointer() == fs.getPointer())
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -1057,7 +1057,7 @@ void ScatterSky::_renderMoon( ObjectRenderInst *ri, SceneRenderState *state, Bas
|
||||||
const MatrixF &camView = state->getCameraTransform();
|
const MatrixF &camView = state->getCameraTransform();
|
||||||
|
|
||||||
// Finalize points
|
// Finalize points
|
||||||
for(int i = 0; i < 4; i++)
|
for(S32 i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
// align with camera
|
// align with camera
|
||||||
camView.mulV(points[i]);
|
camView.mulV(points[i]);
|
||||||
|
|
@ -1114,13 +1114,13 @@ void ScatterSky::_generateSkyPoints()
|
||||||
F32 deltaSegAngle = ( 2.0f * M_PI_F / (F32)segments );
|
F32 deltaSegAngle = ( 2.0f * M_PI_F / (F32)segments );
|
||||||
|
|
||||||
// Generate the group of rings for the sphere.
|
// Generate the group of rings for the sphere.
|
||||||
for( int ring = 0; ring < 2; ring++ )
|
for( S32 ring = 0; ring < 2; ring++ )
|
||||||
{
|
{
|
||||||
F32 r0 = mSin( ring * deltaRingAngle );
|
F32 r0 = mSin( ring * deltaRingAngle );
|
||||||
F32 y0 = mCos( ring * deltaRingAngle );
|
F32 y0 = mCos( ring * deltaRingAngle );
|
||||||
|
|
||||||
// Generate the group of segments for the current ring.
|
// Generate the group of segments for the current ring.
|
||||||
for( int seg = 0; seg < segments + 1 ; seg++ )
|
for( S32 seg = 0; seg < segments + 1 ; seg++ )
|
||||||
{
|
{
|
||||||
F32 x0 = r0 * sinf( seg * deltaSegAngle );
|
F32 x0 = r0 * sinf( seg * deltaSegAngle );
|
||||||
F32 z0 = r0 * cosf( seg * deltaSegAngle );
|
F32 z0 = r0 * cosf( seg * deltaSegAngle );
|
||||||
|
|
|
||||||
|
|
@ -470,7 +470,7 @@ void Sun::_renderCorona( ObjectRenderInst *ri, SceneRenderState *state, BaseMatI
|
||||||
const MatrixF &camView = state->getCameraTransform();
|
const MatrixF &camView = state->getCameraTransform();
|
||||||
|
|
||||||
// Finalize points
|
// Finalize points
|
||||||
for(int i = 0; i < 4; i++)
|
for(S32 i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
// align with camera
|
// align with camera
|
||||||
camView.mulV(points[i]);
|
camView.mulV(points[i]);
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ void WaterPlane::unpackUpdate(NetConnection* con, BitStream* stream)
|
||||||
|
|
||||||
if( stream->readFlag() ) // UpdateMask
|
if( stream->readFlag() ) // UpdateMask
|
||||||
{
|
{
|
||||||
float posZ;
|
F32 posZ;
|
||||||
stream->read( &posZ );
|
stream->read( &posZ );
|
||||||
Point3F newPos = getPosition();
|
Point3F newPos = getPosition();
|
||||||
newPos.z = posZ;
|
newPos.z = posZ;
|
||||||
|
|
|
||||||
|
|
@ -650,7 +650,7 @@ void ForestBrushTool::_collectElements()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ForestBrushTool::getGroundAt( const Point3F &worldPt, float *zValueOut, VectorF *normalOut )
|
bool ForestBrushTool::getGroundAt( const Point3F &worldPt, F32 *zValueOut, VectorF *normalOut )
|
||||||
{
|
{
|
||||||
const U32 mask = TerrainObjectType | StaticShapeObjectType;
|
const U32 mask = TerrainObjectType | StaticShapeObjectType;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -82,7 +82,7 @@ public:
|
||||||
void setPressure( F32 val );
|
void setPressure( F32 val );
|
||||||
void setHardness( F32 val );
|
void setHardness( F32 val );
|
||||||
void collectElements() { _collectElements(); }
|
void collectElements() { _collectElements(); }
|
||||||
bool getGroundAt( const Point3F &worldPt, float *zValueOut, VectorF *normalOut );
|
bool getGroundAt( const Point3F &worldPt, F32 *zValueOut, VectorF *normalOut );
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,8 +54,8 @@ extern _D3DTEXTUREOP GFXD3D9TextureOp[GFXTOP_COUNT];
|
||||||
extern _D3DDECLTYPE GFXD3D9DeclType[GFXDeclType_COUNT];
|
extern _D3DDECLTYPE GFXD3D9DeclType[GFXDeclType_COUNT];
|
||||||
|
|
||||||
#define GFXREVERSE_LOOKUP( tablearray, enumprefix, val ) \
|
#define GFXREVERSE_LOOKUP( tablearray, enumprefix, val ) \
|
||||||
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
||||||
if( (int)tablearray##[i] == val ) \
|
if( (S32)tablearray##[i] == val ) \
|
||||||
{ \
|
{ \
|
||||||
val = i; \
|
val = i; \
|
||||||
break; \
|
break; \
|
||||||
|
|
|
||||||
|
|
@ -259,7 +259,7 @@ void GFXD3D9TextureManager::_innerCreateTexture( GFXD3D9TextureObject *retTex,
|
||||||
|
|
||||||
retTex->mTextureSize.set(probeDesc.Width, probeDesc.Height, 0);
|
retTex->mTextureSize.set(probeDesc.Width, probeDesc.Height, 0);
|
||||||
|
|
||||||
int fmt = probeDesc.Format;
|
S32 fmt = probeDesc.Format;
|
||||||
|
|
||||||
#if !defined(TORQUE_OS_XENON)
|
#if !defined(TORQUE_OS_XENON)
|
||||||
GFXREVERSE_LOOKUP( GFXD3D9TextureFormat, GFXFormat, fmt );
|
GFXREVERSE_LOOKUP( GFXD3D9TextureFormat, GFXFormat, fmt );
|
||||||
|
|
@ -568,7 +568,7 @@ bool GFXD3D9TextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dd
|
||||||
GFXD3D9TextureObject *texture = static_cast<GFXD3D9TextureObject*>(aTexture);
|
GFXD3D9TextureObject *texture = static_cast<GFXD3D9TextureObject*>(aTexture);
|
||||||
|
|
||||||
// Fill the texture...
|
// Fill the texture...
|
||||||
for( int i = 0; i < aTexture->mMipLevels; i++ )
|
for( S32 i = 0; i < aTexture->mMipLevels; i++ )
|
||||||
{
|
{
|
||||||
PROFILE_SCOPE(GFXD3DTexMan_loadSurface);
|
PROFILE_SCOPE(GFXD3DTexMan_loadSurface);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -242,9 +242,9 @@ bool GFXD3D9TextureObject::copyToBmp(GBitmap* bmp)
|
||||||
|
|
||||||
PROFILE_START(GFXD3D9TextureObject_copyToBmp_pixCopy);
|
PROFILE_START(GFXD3D9TextureObject_copyToBmp_pixCopy);
|
||||||
// copy data into bitmap
|
// copy data into bitmap
|
||||||
for (int row = 0; row < height; ++row)
|
for (S32 row = 0; row < height; ++row)
|
||||||
{
|
{
|
||||||
for (int col = 0; col < width; ++col)
|
for (S32 col = 0; col < width; ++col)
|
||||||
{
|
{
|
||||||
destPtr[0] = srcPtr[2]; // red
|
destPtr[0] = srcPtr[2]; // red
|
||||||
destPtr[1] = srcPtr[1]; // green
|
destPtr[1] = srcPtr[1]; // green
|
||||||
|
|
|
||||||
|
|
@ -46,14 +46,14 @@ _D3DDECLTYPE GFXD3D9DeclType[GFXDeclType_COUNT];
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
#define INIT_LOOKUPTABLE( tablearray, enumprefix, type ) \
|
#define INIT_LOOKUPTABLE( tablearray, enumprefix, type ) \
|
||||||
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
||||||
tablearray##[i] = (##type##)GFX_UNINIT_VAL;
|
tablearray##[i] = (##type##)GFX_UNINIT_VAL;
|
||||||
|
|
||||||
#define VALIDATE_LOOKUPTABLE( tablearray, enumprefix ) \
|
#define VALIDATE_LOOKUPTABLE( tablearray, enumprefix ) \
|
||||||
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
||||||
if( (int)tablearray##[i] == GFX_UNINIT_VAL ) \
|
if( (S32)tablearray##[i] == GFX_UNINIT_VAL ) \
|
||||||
Con::warnf( "GFXD3D9EnumTranslate: Unassigned value in " #tablearray ": %i", i ); \
|
Con::warnf( "GFXD3D9EnumTranslate: Unassigned value in " #tablearray ": %i", i ); \
|
||||||
else if( (int)tablearray##[i] == GFX_UNSUPPORTED_VAL ) \
|
else if( (S32)tablearray##[i] == GFX_UNSUPPORTED_VAL ) \
|
||||||
Con::warnf( "GFXD3D9EnumTranslate: Unsupported value in " #tablearray ": %i", i );
|
Con::warnf( "GFXD3D9EnumTranslate: Unsupported value in " #tablearray ": %i", i );
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -330,7 +330,7 @@ void GFXPCD3D9TextureTarget::resolveTo( GFXTextureObject *tex )
|
||||||
|
|
||||||
void GFXPCD3D9TextureTarget::zombify()
|
void GFXPCD3D9TextureTarget::zombify()
|
||||||
{
|
{
|
||||||
for(int i = 0; i < MaxRenderSlotId; i++)
|
for(S32 i = 0; i < MaxRenderSlotId; i++)
|
||||||
attachTexture(RenderSlot(i), NULL);
|
attachTexture(RenderSlot(i), NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -883,7 +883,7 @@ DDSFile *DDSFile::createDDSFileFromGBitmap( const GBitmap *gbmp )
|
||||||
ret->mSurfaces.push_back( new SurfaceData() );
|
ret->mSurfaces.push_back( new SurfaceData() );
|
||||||
|
|
||||||
// Load the mips
|
// Load the mips
|
||||||
for( int i = 0; i < ret->mMipMapCount; i++ )
|
for( S32 i = 0; i < ret->mMipMapCount; i++ )
|
||||||
{
|
{
|
||||||
const U32 mipSz = ret->getSurfaceSize(i);
|
const U32 mipSz = ret->getSurfaceSize(i);
|
||||||
ret->mSurfaces.last()->mMips.push_back( new U8[mipSz] );
|
ret->mSurfaces.last()->mMips.push_back( new U8[mipSz] );
|
||||||
|
|
@ -898,7 +898,7 @@ DDSFile *DDSFile::createDDSFileFromGBitmap( const GBitmap *gbmp )
|
||||||
// Assumption:
|
// Assumption:
|
||||||
AssertFatal( gbmp->getBytesPerPixel() + 1 == ret->mBytesPerPixel, "Assumption failed, not 24->32 bit straight convert." );
|
AssertFatal( gbmp->getBytesPerPixel() + 1 == ret->mBytesPerPixel, "Assumption failed, not 24->32 bit straight convert." );
|
||||||
|
|
||||||
for( int pxl = 0; pxl < gbmp->getWidth(i) * gbmp->getHeight(i); pxl++ )
|
for( S32 pxl = 0; pxl < gbmp->getWidth(i) * gbmp->getHeight(i); pxl++ )
|
||||||
{
|
{
|
||||||
U8 *dst = &mipMem[pxl * ret->mBytesPerPixel];
|
U8 *dst = &mipMem[pxl * ret->mBytesPerPixel];
|
||||||
const U8 *src = &gbmp->getBits(i)[pxl * gbmp->getBytesPerPixel()];
|
const U8 *src = &gbmp->getBits(i)[pxl * gbmp->getBytesPerPixel()];
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@ bool DDSUtil::squishDDS( DDSFile *srcDDS, const GFXFormat dxtFormat )
|
||||||
// are done, we can discard the old surface, and replace it with this one.
|
// are done, we can discard the old surface, and replace it with this one.
|
||||||
DDSFile::SurfaceData *newSurface = new DDSFile::SurfaceData();
|
DDSFile::SurfaceData *newSurface = new DDSFile::SurfaceData();
|
||||||
|
|
||||||
for( int i = 0; i < srcDDS->mMipMapCount; i++ )
|
for( S32 i = 0; i < srcDDS->mMipMapCount; i++ )
|
||||||
{
|
{
|
||||||
const U8 *srcBits = srcSurface->mMips[i];
|
const U8 *srcBits = srcSurface->mMips[i];
|
||||||
|
|
||||||
|
|
@ -106,7 +106,7 @@ bool DDSUtil::squishDDS( DDSFile *srcDDS, const GFXFormat dxtFormat )
|
||||||
|
|
||||||
void DDSUtil::swizzleDDS( DDSFile *srcDDS, const Swizzle<U8, 4> &swizzle )
|
void DDSUtil::swizzleDDS( DDSFile *srcDDS, const Swizzle<U8, 4> &swizzle )
|
||||||
{
|
{
|
||||||
for( int i = 0; i < srcDDS->mMipMapCount; i++ )
|
for( S32 i = 0; i < srcDDS->mMipMapCount; i++ )
|
||||||
{
|
{
|
||||||
swizzle.InPlace( srcDDS->mSurfaces.last()->mMips[i], srcDDS->getSurfaceSize( i ) );
|
swizzle.InPlace( srcDDS->mSurfaces.last()->mMips[i], srcDDS->getSurfaceSize( i ) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -796,11 +796,11 @@ bool GBitmap::combine( const GBitmap *bitmapA, const GBitmap *bitmapB, const GFX
|
||||||
const U8 *aBits = bitmapA->getBits();
|
const U8 *aBits = bitmapA->getBits();
|
||||||
const U8 *bBits = bitmapB->getBits();
|
const U8 *bBits = bitmapB->getBits();
|
||||||
|
|
||||||
for( int y = 0; y < getHeight(); y++ )
|
for( S32 y = 0; y < getHeight(); y++ )
|
||||||
{
|
{
|
||||||
for( int x = 0; x < getWidth(); x++ )
|
for( S32 x = 0; x < getWidth(); x++ )
|
||||||
{
|
{
|
||||||
for( int _byte = 0; _byte < mBytesPerPixel; _byte++ )
|
for( S32 _byte = 0; _byte < mBytesPerPixel; _byte++ )
|
||||||
{
|
{
|
||||||
U8 pxA = 0;
|
U8 pxA = 0;
|
||||||
U8 pxB = 0;
|
U8 pxB = 0;
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ static bool sReadBMP(Stream &stream, GBitmap *bitmap)
|
||||||
if(bytesPerPixel == 3 && bi.biBitCount != 8) // do BGR swap
|
if(bytesPerPixel == 3 && bi.biBitCount != 8) // do BGR swap
|
||||||
{
|
{
|
||||||
U8 *ptr = bitmap->getAddress(0,0);
|
U8 *ptr = bitmap->getAddress(0,0);
|
||||||
for(int i = 0; i < width * height; i++)
|
for(S32 i = 0; i < width * height; i++)
|
||||||
{
|
{
|
||||||
U8 tmp = ptr[0];
|
U8 tmp = ptr[0];
|
||||||
ptr[0] = ptr[2];
|
ptr[0] = ptr[2];
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@ static struct _privateRegisterGIF
|
||||||
//-------------------------------------- Replacement I/O for standard LIBjpeg
|
//-------------------------------------- Replacement I/O for standard LIBjpeg
|
||||||
// functions. we don't wanna use
|
// functions. we don't wanna use
|
||||||
// FILE*'s...
|
// FILE*'s...
|
||||||
static int gifReadDataFn(GifFileType *gifinfo, GifByteType *data, int length)
|
static S32 gifReadDataFn(GifFileType *gifinfo, GifByteType *data, S32 length)
|
||||||
{
|
{
|
||||||
Stream *stream = (Stream*)gifinfo->UserData;
|
Stream *stream = (Stream*)gifinfo->UserData;
|
||||||
AssertFatal(stream != NULL, "gifReadDataFn::No stream.");
|
AssertFatal(stream != NULL, "gifReadDataFn::No stream.");
|
||||||
|
|
@ -72,7 +72,7 @@ static int gifReadDataFn(GifFileType *gifinfo, GifByteType *data, int length)
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
#if 0
|
#if 0
|
||||||
// CodeReview - until we can write these, get rid of warning by disabling method.
|
// CodeReview - until we can write these, get rid of warning by disabling method.
|
||||||
static int gifWriteDataFn(GifFileType *gifinfo, GifByteType *data, int length)
|
static S32 gifWriteDataFn(GifFileType *gifinfo, GifByteType *data, S32 length)
|
||||||
{
|
{
|
||||||
Stream *stream = (Stream*)gifinfo->UserData;
|
Stream *stream = (Stream*)gifinfo->UserData;
|
||||||
AssertFatal(stream != NULL, "gifWriteDataFn::No stream.");
|
AssertFatal(stream != NULL, "gifWriteDataFn::No stream.");
|
||||||
|
|
|
||||||
|
|
@ -50,11 +50,11 @@ static struct _privateRegisterJPG
|
||||||
//-------------------------------------- Replacement I/O for standard LIBjpeg
|
//-------------------------------------- Replacement I/O for standard LIBjpeg
|
||||||
// functions. we don't wanna use
|
// functions. we don't wanna use
|
||||||
// FILE*'s...
|
// FILE*'s...
|
||||||
static int jpegReadDataFn(void *client_data, unsigned char *data, int length)
|
static S32 jpegReadDataFn(void *client_data, U8 *data, S32 length)
|
||||||
{
|
{
|
||||||
Stream *stream = (Stream*)client_data;
|
Stream *stream = (Stream*)client_data;
|
||||||
AssertFatal(stream != NULL, "jpegReadDataFn::No stream.");
|
AssertFatal(stream != NULL, "jpegReadDataFn::No stream.");
|
||||||
int pos = stream->getPosition();
|
S32 pos = stream->getPosition();
|
||||||
if (stream->read(length, data))
|
if (stream->read(length, data))
|
||||||
return length;
|
return length;
|
||||||
|
|
||||||
|
|
@ -66,7 +66,7 @@ static int jpegReadDataFn(void *client_data, unsigned char *data, int length)
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
static int jpegWriteDataFn(void *client_data, unsigned char *data, int length)
|
static S32 jpegWriteDataFn(void *client_data, U8 *data, S32 length)
|
||||||
{
|
{
|
||||||
Stream *stream = (Stream*)client_data;
|
Stream *stream = (Stream*)client_data;
|
||||||
AssertFatal(stream != NULL, "jpegWriteDataFn::No stream.");
|
AssertFatal(stream != NULL, "jpegWriteDataFn::No stream.");
|
||||||
|
|
@ -78,7 +78,7 @@ static int jpegWriteDataFn(void *client_data, unsigned char *data, int length)
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
static int jpegFlushDataFn(void *)
|
static S32 jpegFlushDataFn(void *)
|
||||||
{
|
{
|
||||||
// do nothing since we can't flush the stream object
|
// do nothing since we can't flush the stream object
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -86,7 +86,7 @@ static int jpegFlushDataFn(void *)
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------
|
//--------------------------------------
|
||||||
static int jpegErrorFn(void *client_data)
|
static S32 jpegErrorFn(void *client_data)
|
||||||
{
|
{
|
||||||
Stream *stream = (Stream*)client_data;
|
Stream *stream = (Stream*)client_data;
|
||||||
AssertFatal(stream != NULL, "jpegErrorFn::No stream.");
|
AssertFatal(stream != NULL, "jpegErrorFn::No stream.");
|
||||||
|
|
|
||||||
|
|
@ -103,7 +103,7 @@ GFXDevice::GFXDevice()
|
||||||
mViewMatrix.identity();
|
mViewMatrix.identity();
|
||||||
mProjectionMatrix.identity();
|
mProjectionMatrix.identity();
|
||||||
|
|
||||||
for( int i = 0; i < WORLD_STACK_MAX; i++ )
|
for( S32 i = 0; i < WORLD_STACK_MAX; i++ )
|
||||||
mWorldMatrix[i].identity();
|
mWorldMatrix[i].identity();
|
||||||
|
|
||||||
AssertFatal(smGFXDevice == NULL, "Already a GFXDevice created! Bad!");
|
AssertFatal(smGFXDevice == NULL, "Already a GFXDevice created! Bad!");
|
||||||
|
|
@ -451,7 +451,7 @@ void GFXDevice::updateStates(bool forceSetAll /*=false*/)
|
||||||
|
|
||||||
if( mTextureMatrixCheckDirty )
|
if( mTextureMatrixCheckDirty )
|
||||||
{
|
{
|
||||||
for( int i = 0; i < getNumSamplers(); i++ )
|
for( S32 i = 0; i < getNumSamplers(); i++ )
|
||||||
{
|
{
|
||||||
if( mTextureMatrixDirty[i] )
|
if( mTextureMatrixDirty[i] )
|
||||||
{
|
{
|
||||||
|
|
@ -1279,7 +1279,7 @@ DefineEngineFunction( getPixelShaderVersion, F32, (),,
|
||||||
return GFX->getPixelShaderVersion();
|
return GFX->getPixelShaderVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
DefineEngineFunction( setPixelShaderVersion, void, ( float version ),,
|
DefineEngineFunction( setPixelShaderVersion, void, ( F32 version ),,
|
||||||
"@brief Sets the pixel shader version for the active device.\n"
|
"@brief Sets the pixel shader version for the active device.\n"
|
||||||
"This can be used to force a lower pixel shader version than is supported by "
|
"This can be used to force a lower pixel shader version than is supported by "
|
||||||
"the device for testing or performance optimization.\n"
|
"the device for testing or performance optimization.\n"
|
||||||
|
|
|
||||||
|
|
@ -474,7 +474,7 @@ void GFXDrawUtil::drawRect( const Point2F &upperLeft, const Point2F &lowerRight,
|
||||||
verts[8].point.set( upperLeft.x + ulOffset + nw.x, upperLeft.y + ulOffset + nw.y, 0.0f ); // same as 0
|
verts[8].point.set( upperLeft.x + ulOffset + nw.x, upperLeft.y + ulOffset + nw.y, 0.0f ); // same as 0
|
||||||
verts[9].point.set( upperLeft.x + ulOffset - nw.x, upperLeft.y + ulOffset - nw.y, 0.0f ); // same as 1
|
verts[9].point.set( upperLeft.x + ulOffset - nw.x, upperLeft.y + ulOffset - nw.y, 0.0f ); // same as 1
|
||||||
|
|
||||||
for (int i=0; i<10; i++)
|
for (S32 i=0; i<10; i++)
|
||||||
verts[i].color = color;
|
verts[i].color = color;
|
||||||
|
|
||||||
verts.unlock();
|
verts.unlock();
|
||||||
|
|
@ -531,7 +531,7 @@ void GFXDrawUtil::drawRectFill( const Point2F &upperLeft, const Point2F &lowerRi
|
||||||
verts[2].point.set( upperLeft.x-ne.x+ulOffset, lowerRight.y-ne.y, 0.0f );
|
verts[2].point.set( upperLeft.x-ne.x+ulOffset, lowerRight.y-ne.y, 0.0f );
|
||||||
verts[3].point.set( lowerRight.x-nw.x, lowerRight.y-nw.y, 0.0f );
|
verts[3].point.set( lowerRight.x-nw.x, lowerRight.y-nw.y, 0.0f );
|
||||||
|
|
||||||
for (int i=0; i<4; i++)
|
for (S32 i=0; i<4; i++)
|
||||||
verts[i].color = color;
|
verts[i].color = color;
|
||||||
|
|
||||||
verts.unlock();
|
verts.unlock();
|
||||||
|
|
@ -828,11 +828,11 @@ void GFXDrawUtil::_drawWireCube( const GFXStateBlockDesc &desc, const Point3F &s
|
||||||
|
|
||||||
// setup 6 line loops
|
// setup 6 line loops
|
||||||
U32 vertexIndex = 0;
|
U32 vertexIndex = 0;
|
||||||
for(int i = 0; i < 6; i++)
|
for(S32 i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
for(int j = 0; j < 5; j++)
|
for(S32 j = 0; j < 5; j++)
|
||||||
{
|
{
|
||||||
int idx = cubeFaces[i][j%4];
|
S32 idx = cubeFaces[i][j%4];
|
||||||
|
|
||||||
verts[vertexIndex].point = cubePoints[idx] * halfSize;
|
verts[vertexIndex].point = cubePoints[idx] * halfSize;
|
||||||
verts[vertexIndex].color = color;
|
verts[vertexIndex].color = color;
|
||||||
|
|
@ -872,7 +872,7 @@ void GFXDrawUtil::_drawSolidCube( const GFXStateBlockDesc &desc, const Point3F &
|
||||||
// setup 6 line loops
|
// setup 6 line loops
|
||||||
U32 vertexIndex = 0;
|
U32 vertexIndex = 0;
|
||||||
U32 idx;
|
U32 idx;
|
||||||
for(int i = 0; i < 6; i++)
|
for(S32 i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
idx = cubeFaces[i][0];
|
idx = cubeFaces[i][0];
|
||||||
verts[vertexIndex].point = cubePoints[idx] * halfSize;
|
verts[vertexIndex].point = cubePoints[idx] * halfSize;
|
||||||
|
|
|
||||||
|
|
@ -76,20 +76,20 @@ _STRING_VALUE_LOOKUP_FXN(GFXStringBlendOp);
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
#define INIT_LOOKUPTABLE( tablearray, enumprefix, type ) \
|
#define INIT_LOOKUPTABLE( tablearray, enumprefix, type ) \
|
||||||
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
||||||
tablearray[i] = (type)GFX_UNINIT_VAL;
|
tablearray[i] = (type)GFX_UNINIT_VAL;
|
||||||
#define INIT_LOOKUPTABLE_EX( tablearray, enumprefix, type, typeTable ) \
|
#define INIT_LOOKUPTABLE_EX( tablearray, enumprefix, type, typeTable ) \
|
||||||
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
||||||
{\
|
{\
|
||||||
tablearray[i] = (type)GFX_UNINIT_VAL;\
|
tablearray[i] = (type)GFX_UNINIT_VAL;\
|
||||||
typeTable[i] = &defaultStringValueLookup;\
|
typeTable[i] = &defaultStringValueLookup;\
|
||||||
}
|
}
|
||||||
|
|
||||||
#define VALIDATE_LOOKUPTABLE( tablearray, enumprefix ) \
|
#define VALIDATE_LOOKUPTABLE( tablearray, enumprefix ) \
|
||||||
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
||||||
if( (int)tablearray[i] == GFX_UNINIT_VAL ) \
|
if( (S32)tablearray[i] == GFX_UNINIT_VAL ) \
|
||||||
Con::warnf( "GFXStringEnumTranslate: Unassigned value in " #tablearray ": %i", i ); \
|
Con::warnf( "GFXStringEnumTranslate: Unassigned value in " #tablearray ": %i", i ); \
|
||||||
else if( (int)tablearray[i] == GFX_UNSUPPORTED_VAL ) \
|
else if( (S32)tablearray[i] == GFX_UNSUPPORTED_VAL ) \
|
||||||
Con::warnf( "GFXStringEnumTranslate: Unsupported value in " #tablearray ": %i", i );
|
Con::warnf( "GFXStringEnumTranslate: Unsupported value in " #tablearray ": %i", i );
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
|
@ -71,8 +71,8 @@ extern StringValueLookupFn GFXStringSamplerStateValueLookup[GFXSAMP_COUNT];
|
||||||
extern StringValueLookupFn GFXStringTextureStageStateValueLookup[GFXTSS_COUNT];
|
extern StringValueLookupFn GFXStringTextureStageStateValueLookup[GFXTSS_COUNT];
|
||||||
|
|
||||||
#define GFXREVERSE_LOOKUP( tablearray, enumprefix, val ) \
|
#define GFXREVERSE_LOOKUP( tablearray, enumprefix, val ) \
|
||||||
for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \
|
||||||
if( (int)tablearray##[i] == val ) \
|
if( (S32)tablearray##[i] == val ) \
|
||||||
{ \
|
{ \
|
||||||
val = i; \
|
val = i; \
|
||||||
break; \
|
break; \
|
||||||
|
|
|
||||||
|
|
@ -1033,7 +1033,7 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height,
|
||||||
GFXFormat testingFormat = inOutFormat;
|
GFXFormat testingFormat = inOutFormat;
|
||||||
if( profile->getCompression() != GFXTextureProfile::None )
|
if( profile->getCompression() != GFXTextureProfile::None )
|
||||||
{
|
{
|
||||||
const int offset = profile->getCompression() - GFXTextureProfile::DXT1;
|
const S32 offset = profile->getCompression() - GFXTextureProfile::DXT1;
|
||||||
testingFormat = GFXFormat( GFXFormatDXT1 + offset );
|
testingFormat = GFXFormat( GFXFormatDXT1 + offset );
|
||||||
|
|
||||||
// No auto-gen mips on compressed textures
|
// No auto-gen mips on compressed textures
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ struct GFXLockedRect
|
||||||
{
|
{
|
||||||
/// Pitch of the lock. This is the spacing in bytes of the start
|
/// Pitch of the lock. This is the spacing in bytes of the start
|
||||||
/// of each row of the locked region.
|
/// of each row of the locked region.
|
||||||
int pitch;
|
S32 pitch;
|
||||||
|
|
||||||
/// Pointer to the start of locked rectangle.
|
/// Pointer to the start of locked rectangle.
|
||||||
U8* bits;
|
U8* bits;
|
||||||
|
|
|
||||||
|
|
@ -13606,8 +13606,8 @@ void setupBunny(GFXVertexPCN* v)
|
||||||
{
|
{
|
||||||
for(j=0;j<3;j++)
|
for(j=0;j<3;j++)
|
||||||
{
|
{
|
||||||
int vi=face_indicies[i][j];
|
S32 vi=face_indicies[i][j];
|
||||||
int ni=face_indicies[i][j+3];//Normal index
|
S32 ni=face_indicies[i][j+3];//Normal index
|
||||||
Point3F point = Point3F(vertices[vi][0], vertices[vi][1], vertices[vi][2]);
|
Point3F point = Point3F(vertices[vi][0], vertices[vi][1], vertices[vi][2]);
|
||||||
v[vert].normal = Point3F(normals[ni][0], normals[ni][1], normals[ni][2]);
|
v[vert].normal = Point3F(normals[ni][0], normals[ni][1], normals[ni][2]);
|
||||||
v[vert].point = point;
|
v[vert].point = point;
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@ struct DistanceFieldSearchSpaceStruct
|
||||||
F32 distance;
|
F32 distance;
|
||||||
};
|
};
|
||||||
|
|
||||||
int QSORT_CALLBACK cmpSortDistanceFieldSearchSpaceStruct(const void* p1, const void* p2)
|
S32 QSORT_CALLBACK cmpSortDistanceFieldSearchSpaceStruct(const void* p1, const void* p2)
|
||||||
{
|
{
|
||||||
const DistanceFieldSearchSpaceStruct* sp1 = (const DistanceFieldSearchSpaceStruct*)p1;
|
const DistanceFieldSearchSpaceStruct* sp1 = (const DistanceFieldSearchSpaceStruct*)p1;
|
||||||
const DistanceFieldSearchSpaceStruct* sp2 = (const DistanceFieldSearchSpaceStruct*)p2;
|
const DistanceFieldSearchSpaceStruct* sp2 = (const DistanceFieldSearchSpaceStruct*)p2;
|
||||||
|
|
|
||||||
|
|
@ -48,11 +48,11 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
|
||||||
FrameTemp<TriData> triangleData(NumPrimitives);
|
FrameTemp<TriData> triangleData(NumPrimitives);
|
||||||
|
|
||||||
U32 curIdx = 0;
|
U32 curIdx = 0;
|
||||||
for(int tri = 0; tri < NumPrimitives; tri++)
|
for(S32 tri = 0; tri < NumPrimitives; tri++)
|
||||||
{
|
{
|
||||||
TriData &curTri = triangleData[tri];
|
TriData &curTri = triangleData[tri];
|
||||||
|
|
||||||
for(int c = 0; c < 3; c++)
|
for(S32 c = 0; c < 3; c++)
|
||||||
{
|
{
|
||||||
const U32 &curVIdx = indices[curIdx];
|
const U32 &curVIdx = indices[curIdx];
|
||||||
AssertFatal(curVIdx < numVerts, "Out of range index.");
|
AssertFatal(curVIdx < numVerts, "Out of range index.");
|
||||||
|
|
@ -71,7 +71,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
|
||||||
|
|
||||||
// Allocate per-vertex triangle lists, and calculate the starting score of
|
// Allocate per-vertex triangle lists, and calculate the starting score of
|
||||||
// each of the verts
|
// each of the verts
|
||||||
for(int v = 0; v < numVerts; v++)
|
for(S32 v = 0; v < numVerts; v++)
|
||||||
{
|
{
|
||||||
VertData &curVert = vertexData[v];
|
VertData &curVert = vertexData[v];
|
||||||
curVert.triIndex = new S32[curVert.numUnaddedReferences];
|
curVert.triIndex = new S32[curVert.numUnaddedReferences];
|
||||||
|
|
@ -89,11 +89,11 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
|
||||||
// Fill-in per-vertex triangle lists, and sum the scores of each vertex used
|
// Fill-in per-vertex triangle lists, and sum the scores of each vertex used
|
||||||
// per-triangle, to get the starting triangle score
|
// per-triangle, to get the starting triangle score
|
||||||
curIdx = 0;
|
curIdx = 0;
|
||||||
for(int tri = 0; tri < NumPrimitives; tri++)
|
for(S32 tri = 0; tri < NumPrimitives; tri++)
|
||||||
{
|
{
|
||||||
TriData &curTri = triangleData[tri];
|
TriData &curTri = triangleData[tri];
|
||||||
|
|
||||||
for(int c = 0; c < 3; c++)
|
for(S32 c = 0; c < 3; c++)
|
||||||
{
|
{
|
||||||
const U32 &curVIdx = indices[curIdx];
|
const U32 &curVIdx = indices[curIdx];
|
||||||
AssertFatal(curVIdx < numVerts, "Out of range index.");
|
AssertFatal(curVIdx < numVerts, "Out of range index.");
|
||||||
|
|
@ -117,7 +117,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
|
||||||
// Step 2: Start emitting triangles...this is the emit loop
|
// Step 2: Start emitting triangles...this is the emit loop
|
||||||
//
|
//
|
||||||
LRUCacheModel lruCache;
|
LRUCacheModel lruCache;
|
||||||
for(int outIdx = 0; outIdx < numIndices; /* this space intentionally left blank */ )
|
for(S32 outIdx = 0; outIdx < numIndices; /* this space intentionally left blank */ )
|
||||||
{
|
{
|
||||||
// If there is no next best triangle, than search for the next highest
|
// If there is no next best triangle, than search for the next highest
|
||||||
// scored triangle that isn't in the list already
|
// scored triangle that isn't in the list already
|
||||||
|
|
@ -127,7 +127,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
|
||||||
nextBestTriScore = nextNextBestTriScore = -1.0f;
|
nextBestTriScore = nextNextBestTriScore = -1.0f;
|
||||||
nextBestTriIdx = nextNextBestTriIdx = -1;
|
nextBestTriIdx = nextNextBestTriIdx = -1;
|
||||||
|
|
||||||
for(int tri = 0; tri < NumPrimitives; tri++)
|
for(S32 tri = 0; tri < NumPrimitives; tri++)
|
||||||
{
|
{
|
||||||
TriData &curTri = triangleData[tri];
|
TriData &curTri = triangleData[tri];
|
||||||
|
|
||||||
|
|
@ -143,7 +143,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
|
||||||
// Emit the next best triangle
|
// Emit the next best triangle
|
||||||
TriData &nextBestTri = triangleData[nextBestTriIdx];
|
TriData &nextBestTri = triangleData[nextBestTriIdx];
|
||||||
AssertFatal(!nextBestTri.isInList, "Next best triangle already in list, this is no good.");
|
AssertFatal(!nextBestTri.isInList, "Next best triangle already in list, this is no good.");
|
||||||
for(int i = 0; i < 3; i++)
|
for(S32 i = 0; i < 3; i++)
|
||||||
{
|
{
|
||||||
// Emit index
|
// Emit index
|
||||||
outIndices[outIdx++] = IndexType(nextBestTri.vertIdx[i]);
|
outIndices[outIdx++] = IndexType(nextBestTri.vertIdx[i]);
|
||||||
|
|
@ -151,7 +151,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
|
||||||
// Update the list of triangles on the vert
|
// Update the list of triangles on the vert
|
||||||
VertData &curVert = vertexData[nextBestTri.vertIdx[i]];
|
VertData &curVert = vertexData[nextBestTri.vertIdx[i]];
|
||||||
curVert.numUnaddedReferences--;
|
curVert.numUnaddedReferences--;
|
||||||
for(int t = 0; t < curVert.numReferences; t++)
|
for(S32 t = 0; t < curVert.numReferences; t++)
|
||||||
{
|
{
|
||||||
if(curVert.triIndex[t] == nextBestTriIdx)
|
if(curVert.triIndex[t] == nextBestTriIdx)
|
||||||
{
|
{
|
||||||
|
|
@ -184,7 +184,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices,
|
||||||
{
|
{
|
||||||
tri.score = 0.0f;
|
tri.score = 0.0f;
|
||||||
|
|
||||||
for(int i = 0; i < 3; i++)
|
for(S32 i = 0; i < 3; i++)
|
||||||
tri.score += vertexData[tri.vertIdx[i]].score;
|
tri.score += vertexData[tri.vertIdx[i]].score;
|
||||||
|
|
||||||
_CHECK_NEXT_BEST(tri.score, *itr);
|
_CHECK_NEXT_BEST(tri.score, *itr);
|
||||||
|
|
@ -288,12 +288,12 @@ void LRUCacheModel::enforceSize(const dsize_t maxSize, Vector<U32> &outTrisToUpd
|
||||||
// Update cache position on verts still in cache
|
// Update cache position on verts still in cache
|
||||||
vData.cachePosition = length++;
|
vData.cachePosition = length++;
|
||||||
|
|
||||||
for(int i = 0; i < vData.numReferences; i++)
|
for(S32 i = 0; i < vData.numReferences; i++)
|
||||||
{
|
{
|
||||||
const S32 &triIdx = vData.triIndex[i];
|
const S32 &triIdx = vData.triIndex[i];
|
||||||
if(triIdx > -1)
|
if(triIdx > -1)
|
||||||
{
|
{
|
||||||
int j = 0;
|
S32 j = 0;
|
||||||
for(; j < outTrisToUpdate.size(); j++)
|
for(; j < outTrisToUpdate.size(); j++)
|
||||||
if(outTrisToUpdate[j] == triIdx)
|
if(outTrisToUpdate[j] == triIdx)
|
||||||
break;
|
break;
|
||||||
|
|
@ -378,7 +378,7 @@ F32 score(const VertData &vertexData)
|
||||||
AssertFatal(vertexData.cachePosition < MaxSizeVertexCache, "Out of range cache position for vertex");
|
AssertFatal(vertexData.cachePosition < MaxSizeVertexCache, "Out of range cache position for vertex");
|
||||||
|
|
||||||
// Points for being high in the cache.
|
// Points for being high in the cache.
|
||||||
const float Scaler = 1.0f / (MaxSizeVertexCache - 3);
|
const F32 Scaler = 1.0f / (MaxSizeVertexCache - 3);
|
||||||
Score = 1.0f - (vertexData.cachePosition - 3) * Scaler;
|
Score = 1.0f - (vertexData.cachePosition - 3) * Scaler;
|
||||||
Score = mPow(Score, FindVertexScore::CacheDecayPower);
|
Score = mPow(Score, FindVertexScore::CacheDecayPower);
|
||||||
}
|
}
|
||||||
|
|
@ -387,7 +387,7 @@ F32 score(const VertData &vertexData)
|
||||||
|
|
||||||
// Bonus points for having a low number of tris still to
|
// Bonus points for having a low number of tris still to
|
||||||
// use the vert, so we get rid of lone verts quickly.
|
// use the vert, so we get rid of lone verts quickly.
|
||||||
float ValenceBoost = mPow(vertexData.numUnaddedReferences, -FindVertexScore::ValenceBoostPower);
|
F32 ValenceBoost = mPow(vertexData.numUnaddedReferences, -FindVertexScore::ValenceBoostPower);
|
||||||
Score += FindVertexScore::ValenceBoostScale * ValenceBoost;
|
Score += FindVertexScore::ValenceBoostScale * ValenceBoost;
|
||||||
|
|
||||||
return Score;
|
return Score;
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue