From 4c35fd37af80c8024990df40031af6a401304010 Mon Sep 17 00:00:00 2001 From: cpusci Date: Sun, 4 Aug 2013 16:26:01 -0500 Subject: [PATCH 1/2] Simple pass over the codebase to standardize the platform types. --- Engine/source/T3D/aiClient.cpp | 4 +- Engine/source/T3D/aiPlayer.cpp | 2 +- Engine/source/T3D/cameraSpline.cpp | 2 +- Engine/source/T3D/debris.cpp | 12 +-- Engine/source/T3D/decal/decalManager.cpp | 14 +-- Engine/source/T3D/fx/explosion.cpp | 10 +- Engine/source/T3D/fx/lightning.cpp | 2 +- Engine/source/T3D/fx/particle.cpp | 2 +- Engine/source/T3D/fx/particleEmitter.cpp | 6 +- .../source/T3D/gameBase/std/stdMoveList.cpp | 8 +- Engine/source/T3D/item.cpp | 4 +- Engine/source/T3D/pathCamera.cpp | 4 +- Engine/source/T3D/pathCamera.h | 2 +- Engine/source/T3D/player.cpp | 16 +-- Engine/source/T3D/proximityMine.cpp | 2 +- Engine/source/T3D/rigid.cpp | 4 +- Engine/source/T3D/rigidShape.cpp | 6 +- Engine/source/T3D/rigidShape.h | 2 +- Engine/source/T3D/shapeBase.cpp | 26 ++--- Engine/source/T3D/shapeImage.cpp | 2 +- Engine/source/T3D/trigger.cpp | 2 +- Engine/source/T3D/tsStatic.cpp | 2 +- Engine/source/T3D/turret/aiTurretShape.cpp | 2 +- Engine/source/T3D/vehicles/vehicle.cpp | 18 ++-- Engine/source/T3D/vehicles/vehicle.h | 2 +- Engine/source/app/net/tcpObject.cpp | 2 +- .../source/cinterface/c_consoleInterface.cpp | 2 +- Engine/source/cinterface/c_scripting.cpp | 8 +- Engine/source/cinterface/cinterface.cpp | 12 +-- Engine/source/collision/collision.h | 2 +- Engine/source/collision/gjk.cpp | 24 ++--- Engine/source/collision/gjk.h | 4 +- Engine/source/collision/polytope.cpp | 4 +- Engine/source/collision/polytope.h | 2 +- .../dynamicConsoleMethodComponent.cpp | 2 +- Engine/source/console/SimXMLDocument.cpp | 38 +++---- Engine/source/console/ast.h | 4 +- Engine/source/console/astAlloc.cpp | 2 +- Engine/source/console/codeBlock.cpp | 2 +- Engine/source/console/codeBlock.h | 2 +- Engine/source/console/console.cpp | 2 +- Engine/source/console/consoleDoc.cpp | 2 +- Engine/source/console/consoleFunctions.cpp | 2 +- Engine/source/console/consoleLogger.cpp | 2 +- Engine/source/console/consoleXMLExport.cpp | 4 +- Engine/source/console/engineAPI.h | 98 +++++++++---------- Engine/source/console/engineDoc.cpp | 2 +- Engine/source/console/simObject.cpp | 6 +- Engine/source/core/bitRender.cpp | 10 +- Engine/source/core/frameAllocator.h | 4 +- Engine/source/core/ogg/oggInputStream.cpp | 2 +- Engine/source/core/ogg/oggTheoraDecoder.cpp | 2 +- Engine/source/core/ogg/oggVorbisDecoder.cpp | 2 +- Engine/source/core/stringBuffer.cpp | 4 +- Engine/source/core/strings/findMatch.cpp | 2 +- .../source/core/strings/stringFunctions.cpp | 18 ++-- Engine/source/core/strings/stringFunctions.h | 30 +++--- Engine/source/core/strings/unicode.cpp | 4 +- Engine/source/core/tagDictionary.cpp | 2 +- Engine/source/core/threadStatic.cpp | 2 +- Engine/source/core/util/FastDelegate.h | 58 +++++------ Engine/source/core/util/delegate.h | 2 +- Engine/source/core/util/dxt5nmSwizzle.h | 8 +- Engine/source/core/util/path.cpp | 2 +- Engine/source/core/util/swizzle.h | 4 +- Engine/source/core/util/swizzleSpec.h | 8 +- Engine/source/core/util/tFixedSizeVector.h | 2 +- Engine/source/core/util/tSignal.h | 2 +- Engine/source/core/util/tVector.h | 4 +- Engine/source/core/util/test/testVector2.cpp | 8 +- Engine/source/core/util/zip/zipObject.cpp | 2 +- Engine/source/core/volume.cpp | 2 +- Engine/source/environment/scatterSky.cpp | 6 +- Engine/source/environment/sun.cpp | 2 +- Engine/source/gfx/D3D9/gfxD3D9EnumTranslate.h | 4 +- .../source/gfx/D3D9/gfxD3D9TextureManager.cpp | 4 +- .../source/gfx/D3D9/gfxD3D9TextureObject.cpp | 4 +- .../gfx/D3D9/pc/gfxD3D9EnumTranslate.pc.cpp | 8 +- Engine/source/gfx/D3D9/pc/gfxPCD3D9Target.cpp | 2 +- Engine/source/gfx/bitmap/ddsLoader.cpp | 4 +- Engine/source/gfx/bitmap/ddsUtils.cpp | 4 +- Engine/source/gfx/bitmap/gBitmap.cpp | 6 +- .../source/gfx/bitmap/loaders/bitmapBmp.cpp | 2 +- .../source/gfx/bitmap/loaders/bitmapGif.cpp | 4 +- .../source/gfx/bitmap/loaders/bitmapJpeg.cpp | 10 +- Engine/source/gfx/gfxDevice.cpp | 4 +- Engine/source/gfx/gfxDrawUtil.cpp | 12 +-- Engine/source/gfx/gfxStringEnumTranslate.cpp | 10 +- Engine/source/gfx/gfxStringEnumTranslate.h | 4 +- Engine/source/gfx/gfxTextureManager.cpp | 2 +- Engine/source/gfx/gfxTextureObject.h | 2 +- Engine/source/gfx/test/stanfordBunny.cpp | 4 +- Engine/source/gfx/util/distanceField.cpp | 2 +- Engine/source/gfx/util/triListOpt.cpp | 24 ++--- .../source/gfx/video/videoEncoderTheora.cpp | 10 +- .../source/gui/containers/guiWindowCtrl.cpp | 2 +- Engine/source/gui/controls/guiBitmapCtrl.cpp | 8 +- .../source/gui/controls/guiFileTreeCtrl.cpp | 2 +- .../gui/controls/guiGameListOptionsCtrl.cpp | 4 +- Engine/source/gui/controls/guiMLTextCtrl.cpp | 4 +- .../source/gui/controls/guiTextEditCtrl.cpp | 2 +- .../source/gui/controls/guiTextListCtrl.cpp | 34 +++---- .../source/gui/controls/guiTreeViewCtrl.cpp | 10 +- Engine/source/gui/core/guiCanvas.cpp | 2 +- Engine/source/gui/editor/guiEaseViewCtrl.cpp | 2 +- Engine/source/gui/editor/guiGraphCtrl.cpp | 2 +- Engine/source/gui/editor/guiImageList.cpp | 2 +- Engine/source/gui/editor/guiMenuBar.cpp | 6 +- .../gui/editor/guiParticleGraphCtrl.cpp | 4 +- .../source/gui/editor/guiShapeEdPreview.cpp | 2 +- .../gui/game/guiIdleCamFadeBitmapCtrl.cpp | 8 +- Engine/source/gui/worldEditor/editTSCtrl.cpp | 4 +- .../advanced/advancedLightManager.cpp | 4 +- .../source/lighting/common/sceneLighting.cpp | 10 +- .../lighting/shadowMap/pssmLightShadowMap.h | 2 +- Engine/source/math/mBox.cpp | 2 +- Engine/source/math/mPolyhedron.h | 4 +- Engine/source/math/mQuadPatch.cpp | 2 +- Engine/source/math/mQuadPatch.h | 2 +- Engine/source/math/mQuat.h | 6 +- Engine/source/math/mSplinePatch.cpp | 4 +- Engine/source/math/mSplinePatch.h | 2 +- Engine/source/math/mathUtils.cpp | 8 +- Engine/source/platform/platform.h | 12 +-- Engine/source/platform/platformCPUCount.cpp | 86 ++++++++-------- Engine/source/platform/platformMemory.cpp | 4 +- Engine/source/platform/platformNet.cpp | 22 ++--- Engine/source/platform/platformNet.h | 6 +- Engine/source/platform/platformNetAsync.cpp | 6 +- Engine/source/platform/platformNetAsync.h | 2 +- Engine/source/platform/test/testThreading.cpp | 4 +- .../platformWin32/minidump/winMiniDump.cpp | 8 +- .../platformWin32/minidump/winStackWalker.cpp | 8 +- .../platformWin32/minidump/winStackWalker.h | 2 +- .../source/platformWin32/threads/thread.cpp | 2 +- Engine/source/platformWin32/winConsole.cpp | 2 +- .../source/platformWin32/winDirectInput.cpp | 16 +-- Engine/source/platformWin32/winDirectInput.h | 10 +- Engine/source/platformWin32/winFileio.cpp | 2 +- Engine/source/platformWin32/winMemory.cpp | 2 +- Engine/source/platformWin32/winTime.cpp | 2 +- Engine/source/platformWin32/winWindow.cpp | 12 +-- Engine/source/postFx/postEffect.cpp | 2 +- .../renderInstance/renderFormatChanger.cpp | 2 +- .../renderInstance/renderOcclusionMgr.cpp | 2 +- .../renderInstance/renderParticleMgr.cpp | 4 +- Engine/source/scene/sceneContainer.cpp | 2 +- .../scene/zones/sceneZoneSpaceManager.h | 2 +- Engine/source/sfx/media/sfxVorbisStream.cpp | 8 +- Engine/source/sfx/media/sfxVorbisStream.h | 2 +- Engine/source/sfx/openal/aldlist.cpp | 20 ++-- Engine/source/sfx/openal/aldlist.h | 34 +++---- Engine/source/sfx/openal/sfxALProvider.cpp | 6 +- Engine/source/sfx/sfxCommon.h | 2 +- Engine/source/sfx/sfxSystem.cpp | 2 +- Engine/source/sfx/sfxWorld.h | 16 +-- Engine/source/shaderGen/shaderGen.cpp | 2 +- Engine/source/sim/netInterface.cpp | 2 +- Engine/source/terrain/terrCollision.cpp | 12 +-- .../source/ts/arch/tsMeshIntrinsics.sse.cpp | 8 +- .../source/ts/arch/tsMeshIntrinsics.sse4.cpp | 4 +- Engine/source/ts/collada/colladaAppMesh.cpp | 60 ++++++------ Engine/source/ts/collada/colladaAppNode.cpp | 10 +- .../source/ts/collada/colladaAppSequence.cpp | 6 +- Engine/source/ts/collada/colladaExtensions.h | 10 +- Engine/source/ts/collada/colladaImport.cpp | 8 +- Engine/source/ts/collada/colladaLights.cpp | 6 +- .../source/ts/collada/colladaShapeLoader.cpp | 30 +++--- Engine/source/ts/collada/colladaUtils.cpp | 56 +++++------ Engine/source/ts/collada/colladaUtils.h | 52 +++++----- Engine/source/ts/loader/tsShapeLoader.cpp | 90 ++++++++--------- Engine/source/ts/loader/tsShapeLoader.h | 2 +- Engine/source/ts/tsMesh.cpp | 14 +-- Engine/source/ts/tsMesh.h | 2 +- Engine/source/ts/tsMeshIntrinsics.cpp | 4 +- Engine/source/ts/tsShapeConstruct.h | 2 +- Engine/source/ts/tsShapeEdit.cpp | 14 +-- Engine/source/unit/test.cpp | 14 +-- Engine/source/unit/test.h | 24 ++--- Engine/source/unit/tests/testMatrixMul.cpp | 8 +- Engine/source/unit/tests/testThreadStatic.cpp | 2 +- .../tests/testThreadStaticPerformance.cpp | 4 +- Engine/source/util/noise2d.cpp | 2 +- Engine/source/util/scopeTracker.h | 28 +++--- Engine/source/util/settings.cpp | 4 +- .../windowManager/platformInterface.cpp | 2 +- .../windowManager/win32/win32Window.cpp | 2 +- .../windowManager/win32/win32WindowMgr.cpp | 2 +- .../windowManager/win32/winDispatch.cpp | 4 +- 189 files changed, 824 insertions(+), 824 deletions(-) diff --git a/Engine/source/T3D/aiClient.cpp b/Engine/source/T3D/aiClient.cpp index 3decd3462..cbcf78e1e 100644 --- a/Engine/source/T3D/aiClient.cpp +++ b/Engine/source/T3D/aiClient.cpp @@ -63,7 +63,7 @@ AIClient::AIClient() { mMoveTolerance = 0.25f; // Clear the triggers - for( int i = 0; i < MaxTriggerKeys; i++ ) + for( S32 i = 0; i < MaxTriggerKeys; i++ ) mTriggers[i] = false; mAimToDestination = true; @@ -369,7 +369,7 @@ U32 AIClient::getMoveList( Move **movePtr,U32 *numMoves ) { } // Copy over the trigger status - for( int i = 0; i < MaxTriggerKeys; i++ ) { + for( S32 i = 0; i < MaxTriggerKeys; i++ ) { mMove.trigger[i] = mTriggers[i]; mTriggers[i] = false; } diff --git a/Engine/source/T3D/aiPlayer.cpp b/Engine/source/T3D/aiPlayer.cpp index 725aaed29..6d54358be 100644 --- a/Engine/source/T3D/aiPlayer.cpp +++ b/Engine/source/T3D/aiPlayer.cpp @@ -443,7 +443,7 @@ bool AIPlayer::getAIMove(Move *movePtr) // Replicate the trigger state into the move so that // 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); mLastLocation = location; diff --git a/Engine/source/T3D/cameraSpline.cpp b/Engine/source/T3D/cameraSpline.cpp index ba4bec72e..3c66e77c0 100644 --- a/Engine/source/T3D/cameraSpline.cpp +++ b/Engine/source/T3D/cameraSpline.cpp @@ -193,7 +193,7 @@ void CameraSpline::renderTimeMap() vb.lock(); MRandomLCG random(1376312589 * (U32)this); - int index = 0; + S32 index = 0; for(Vector::iterator itr=mTimeMap.begin(); itr != mTimeMap.end(); itr++) { Knot a; diff --git a/Engine/source/T3D/debris.cpp b/Engine/source/T3D/debris.cpp index 78526b7ad..8b07154ec 100644 --- a/Engine/source/T3D/debris.cpp +++ b/Engine/source/T3D/debris.cpp @@ -122,7 +122,7 @@ bool DebrisData::onAdd() if(!Parent::onAdd()) return false; - for( int i=0; iwriteString( textureName ); stream->writeString( shapeName ); - for( int i=0; iwriteFlag( emitterList[i] != NULL ) ) { @@ -346,7 +346,7 @@ void DebrisData::unpackData(BitStream* stream) textureName = stream->readSTString(); shapeName = stream->readSTString(); - for( int i=0; ireadFlag() ) { @@ -512,7 +512,7 @@ bool Debris::onAdd() } // create emitters - for( int i=0; iemitterList[i] != NULL ) { @@ -631,7 +631,7 @@ bool Debris::onAdd() void Debris::onRemove() { - for( int i=0; imDataBlock) - ((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 *pnt2 = (const Point3F*)p2; @@ -142,7 +142,7 @@ int QSORT_CALLBACK cmpPointsXY( const void *p1, const void *p2 ) 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 *pnt2 = (const Point4F*)p2; @@ -157,7 +157,7 @@ int QSORT_CALLBACK cmpQuadPointTheta( const void *p1, const void *p2 ) 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** pd2 = (const DecalInstance**)p2; @@ -168,7 +168,7 @@ int QSORT_CALLBACK cmpDecalDistance( const void *p1, const void *p2 ) 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** pd2 = (const DecalInstance**)p2; @@ -179,14 +179,14 @@ int QSORT_CALLBACK cmpDecalRenderOrder( const void *p1, const void *p2 ) return 1; else { - int priority = (*pd1)->getRenderPriority() - (*pd2)->getRenderPriority(); + S32 priority = (*pd1)->getRenderPriority() - (*pd2)->getRenderPriority(); if ( priority != 0 ) return priority; 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 ) return id; diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index b84efad3f..c2e2e61ef 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -929,7 +929,7 @@ bool Explosion::onAdd() void Explosion::onRemove() { - for( int i=0; idebrisList[j] ) { @@ -1160,7 +1160,7 @@ void Explosion::launchDebris( Point3F &axis ) U32 numDebris = mDataBlock->debrisNum + sgRandom.randI( -mDataBlock->debrisNumVariance, mDataBlock->debrisNumVariance ); - for( int i=0; idebrisThetaMin, mDataBlock->debrisThetaMax, @@ -1249,7 +1249,7 @@ bool Explosion::explode() Point3F::Zero, U32(mDataBlock->particleDensity * mFade)); } - for( int i=0; iemitterList[i] != NULL ) { diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 338bd0a95..154f84208 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -1139,7 +1139,7 @@ void LightningBolt::generateMinorNodes() { mMinorNodes.clear(); - for( int i=0; iwriteInt(start,32); bstream->writeInt(count,MoveCountBits); Move * prevMove = NULL; - for (int i = 0; i < count; i++) + for (S32 i = 0; i < count; i++) { move[offset + i].sendCount++; 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 // we already have. - int skip = mLastMoveAck - start; + S32 skip = mLastMoveAck - start; if (skip < 0) { mLastMoveAck = start; @@ -121,7 +121,7 @@ void StdMoveList::serverReadMovePacket(BitStream *bstream) { if (skip > count) skip = count; - for (int i = 0; i < skip; i++) + for (S32 i = 0; i < skip; i++) { prevMoveHolder.unpack(bstream,prevMove); prevMoveHolder.checksum = bstream->readInt(Move::ChecksumBits); @@ -141,7 +141,7 @@ void StdMoveList::serverReadMovePacket(BitStream *bstream) } // Put the rest on the move list. - int index = mMoveVec.size(); + S32 index = mMoveVec.size(); mMoveVec.increment(count); while (index < mMoveVec.size()) { diff --git a/Engine/source/T3D/item.cpp b/Engine/source/T3D/item.cpp index 50a43c1e8..1cd78fbb8 100644 --- a/Engine/source/T3D/item.cpp +++ b/Engine/source/T3D/item.cpp @@ -893,7 +893,7 @@ void Item::updatePos(const U32 /*mask*/, const F32 dt) // Pick the most resistant surface F32 bd = 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]; F32 dot = -mDot(mVelocity,cp.normal); if (dot > bd) { @@ -1204,7 +1204,7 @@ DefineEngineMethod( Item, isRotating, bool, (),, 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" "This is useful to prevent a player from immediately picking up an Item they have " diff --git a/Engine/source/T3D/pathCamera.cpp b/Engine/source/T3D/pathCamera.cpp index 185e7a675..43e6f9273 100644 --- a/Engine/source/T3D/pathCamera.cpp +++ b/Engine/source/T3D/pathCamera.cpp @@ -429,7 +429,7 @@ U32 PathCamera::packUpdate(NetConnection *con, U32 mask, BitStream *stream) if (stream->writeFlag(mask & WindowMask)) { stream->write(mNodeBase); stream->write(mNodeCount); - for (int i = 0; i < mNodeCount; i++) { + for (S32 i = 0; i < mNodeCount; i++) { CameraSpline::Knot *knot = mSpline.getKnot(i); mathWrite(*stream, knot->mPosition); mathWrite(*stream, knot->mRotation); @@ -477,7 +477,7 @@ void PathCamera::unpackUpdate(NetConnection *con, BitStream *stream) mSpline.removeAll(); stream->read(&mNodeBase); stream->read(&mNodeCount); - for (int i = 0; i < mNodeCount; i++) + for (S32 i = 0; i < mNodeCount; i++) { CameraSpline::Knot *knot = new CameraSpline::Knot(); mathRead(*stream, &knot->mPosition); diff --git a/Engine/source/T3D/pathCamera.h b/Engine/source/T3D/pathCamera.h index c94e2ad57..685118e6e 100644 --- a/Engine/source/T3D/pathCamera.h +++ b/Engine/source/T3D/pathCamera.h @@ -83,7 +83,7 @@ private: S32 mNodeBase; S32 mNodeCount; F32 mPosition; - int mState; + S32 mState; F32 mTarget; bool mTargetSet; diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 18a4492ad..3eff4a2bd 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -475,7 +475,7 @@ bool PlayerData::preload(bool server, String &errorStr) // Extract ground transform velocity from animations // Get the named ones first so they can be indexed directly. ActionAnimation *dp = &actionList[0]; - for (int i = 0; i < NumTableActionAnims; i++,dp++) + for (S32 i = 0; i < NumTableActionAnims; i++,dp++) { ActionAnimationDef *sp = &ActionAnimationList[i]; dp->name = sp->name; @@ -500,7 +500,7 @@ bool PlayerData::preload(bool server, String &errorStr) if (dStricmp(sp->name, "jet") != 0) 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)) { @@ -517,7 +517,7 @@ bool PlayerData::preload(bool server, String &errorStr) // Resolve lookAction index dp = &actionList[0]; 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 ) lookAction = c; @@ -565,7 +565,7 @@ bool PlayerData::preload(bool server, String &errorStr) if (!Sim::findObject(dustID, dustEmitter)) Con::errorf(ConsoleLogEntry::General, "PlayerData::preload - Invalid packet, bad datablockId(dustEmitter): 0x%x", dustID); - for (int i=0; i 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 newSkin( skins[i] ); @@ -1969,7 +1969,7 @@ void Player::reSkin() // Apply skin to both 3rd person and 1st person shape instances mShapeInstance->reSkin( newSkin, oldSkin ); - for ( int j = 0; j < ShapeBase::MaxMountedImages; j++ ) + for ( S32 j = 0; j < ShapeBase::MaxMountedImages; j++ ) { if (mShapeFPInstance[j]) mShapeFPInstance[j]->reSkin( newSkin, oldSkin ); @@ -5820,7 +5820,7 @@ bool Player::castRay(const Point3F &start, const Point3F &end, RayInfo* info) F32 const *si = &start.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 > *bmax || *ei < *bmin) return false; diff --git a/Engine/source/T3D/proximityMine.cpp b/Engine/source/T3D/proximityMine.cpp index c37947a16..5d6a573a8 100644 --- a/Engine/source/T3D/proximityMine.cpp +++ b/Engine/source/T3D/proximityMine.cpp @@ -451,7 +451,7 @@ void ProximityMine::processTick( const Move* move ) SimpleQueryList sql; getContainer()->findObjects( triggerBox, sTriggerCollisionMask, 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 if ( ( sql.mList[i] == mOwner && !mDataBlock->triggerOnOwner ) || diff --git a/Engine/source/T3D/rigid.cpp b/Engine/source/T3D/rigid.cpp index 079f97caf..e2441441f 100644 --- a/Engine/source/T3D/rigid.cpp +++ b/Engine/source/T3D/rigid.cpp @@ -265,8 +265,8 @@ void Rigid::translateCenterOfMass(const Point3F &oldPos,const Point3F &newPos) MatrixF oldx,newx; oldx.setCrossProduct(oldPos); newx.setCrossProduct(newPos); - for (int row = 0; row < 3; row++) - for (int col = 0; col < 3; col++) { + for (S32 row = 0; row < 3; row++) + for (S32 col = 0; col < 3; col++) { F32 n = newx(row,col), o = oldx(row,col); objectInertia(row,col) += mass * ((o * o) - (n * n)); } diff --git a/Engine/source/T3D/rigidShape.cpp b/Engine/source/T3D/rigidShape.cpp index abd04937b..348e16767 100644 --- a/Engine/source/T3D/rigidShape.cpp +++ b/Engine/source/T3D/rigidShape.cpp @@ -196,7 +196,7 @@ namespace { // Physics and collision constants 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 | StaticShapeObjectType | VehicleObjectType | @@ -1651,7 +1651,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 ); // Collision points... - for (int i = 0; i < mCollisionList.getCount(); i++) + for (S32 i = 0; i < mCollisionList.getCount(); i++) { const Collision& collision = mCollisionList[i]; GFX->getDrawUtil()->drawCube( desc, Point3F(0.05f,0.05f,0.05f), collision.point, ColorI(0, 0, 255) ); @@ -1659,7 +1659,7 @@ void RigidShape::_renderMassAndContacts( ObjectRenderInst *ri, SceneRenderState // Render the normals as one big batch... 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]; diff --git a/Engine/source/T3D/rigidShape.h b/Engine/source/T3D/rigidShape.h index 180b0d0ad..ca846dd40 100644 --- a/Engine/source/T3D/rigidShape.h +++ b/Engine/source/T3D/rigidShape.h @@ -195,7 +195,7 @@ class RigidShape: public ShapeBase CollisionList mContacts; Rigid mRigid; ShapeBaseConvex mConvex; - int restCount; + S32 restCount; SimObjectPtr mDustEmitterList[RigidShapeData::VC_NUM_DUST_EMITTERS]; SimObjectPtr mSplashEmitterList[RigidShapeData::VC_NUM_SPLASH_EMITTERS]; diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index a81df8ece..2642f06c2 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -1282,7 +1282,7 @@ void ShapeBase::processTick(const Move* move) { mMoveMotion = true; } - for (int i = 0; i < MaxMountedImages; i++) + for (S32 i = 0; i < MaxMountedImages; i++) { setImageMotionState(i, mMoveMotion); } @@ -1305,7 +1305,7 @@ void ShapeBase::processTick(const Move* move) // Advance images if (isServerObject()) { - for (int i = 0; i < MaxMountedImages; i++) + for (S32 i = 0; i < MaxMountedImages; i++) { if (mMountedImageList[i].dataBlock) updateImageState(i, TickSec); @@ -1347,7 +1347,7 @@ void ShapeBase::advanceTime(F32 dt) // advanced at framerate. advanceThreads(dt); updateAudioPos(); - for (int i = 0; i < MaxMountedImages; i++) + for (S32 i = 0; i < MaxMountedImages; i++) if (mMountedImageList[i].dataBlock) { updateImageState(i, dt); @@ -2240,7 +2240,7 @@ void ShapeBase::stopAudio(U32 slot) void ShapeBase::updateServerAudio() { // Timeout non-looping sounds - for (int i = 0; i < MaxSoundThreads; i++) { + for (S32 i = 0; i < MaxSoundThreads; i++) { Sound& st = mSoundThread[i]; if (st.play && st.timeout && st.timeout < Sim::getCurrentTime()) { clearMaskBits(SoundMaskN << i); @@ -2280,7 +2280,7 @@ void ShapeBase::updateAudioState(Sound& st) void ShapeBase::updateAudioPos() { - for (int i = 0; i < MaxSoundThreads; i++) + for (S32 i = 0; i < MaxSoundThreads; i++) { SFXSource* source = mSoundThread[i].sound; if ( source ) @@ -3113,7 +3113,7 @@ U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream) } if (stream->writeFlag(mask & ThreadMask)) { - for (int i = 0; i < MaxScriptThreads; i++) { + for (S32 i = 0; i < MaxScriptThreads; i++) { Thread& st = mScriptThread[i]; if (stream->writeFlag( (st.sequence != -1 || st.state == Thread::Destroy) && (mask & (ThreadMaskN << i)) ) ) { stream->writeInt(st.sequence,ThreadSequenceBits); @@ -3126,7 +3126,7 @@ U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream) } if (stream->writeFlag(mask & SoundMask)) { - for (int i = 0; i < MaxSoundThreads; i++) { + for (S32 i = 0; i < MaxSoundThreads; i++) { Sound& st = mSoundThread[i]; if (stream->writeFlag(mask & (SoundMaskN << i))) if (stream->writeFlag(st.play)) @@ -3136,7 +3136,7 @@ U32 ShapeBase::packUpdate(NetConnection *con, U32 mask, BitStream *stream) } 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))) { MountedImage& image = mMountedImageList[i]; if (stream->writeFlag(image.dataBlock)) @@ -3271,7 +3271,7 @@ void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream) // Mounted Images if (stream->readFlag()) { - for (int i = 0; i < MaxMountedImages; i++) { + for (S32 i = 0; i < MaxMountedImages; i++) { if (stream->readFlag()) { MountedImage& image = mMountedImageList[i]; ShapeBaseImageData* imageData = 0; @@ -3308,9 +3308,9 @@ void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream) image.genericTrigger[i] = stream->readFlag(); } - int count = stream->readInt(3); - int altCount = stream->readInt(3); - int reloadCount = stream->readInt(3); + S32 count = stream->readInt(3); + S32 altCount = stream->readInt(3); + S32 reloadCount = stream->readInt(3); bool datablockChange = image.dataBlock != imageData; if (datablockChange || (image.skinNameHandle != skinDesiredNameHandle)) @@ -3742,7 +3742,7 @@ void ShapeBase::reSkin() Vector 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 newSkin( skins[i] ); diff --git a/Engine/source/T3D/shapeImage.cpp b/Engine/source/T3D/shapeImage.cpp index b20aa041f..ee9eae312 100644 --- a/Engine/source/T3D/shapeImage.cpp +++ b/Engine/source/T3D/shapeImage.cpp @@ -203,7 +203,7 @@ ShapeBaseImageData::ShapeBaseImageData() scriptAnimTransitionTime = 0.25f; // - for (int i = 0; i < MaxStates; i++) { + for (S32 i = 0; i < MaxStates; i++) { stateName[i] = 0; stateTransitionLoaded[i] = 0; diff --git a/Engine/source/T3D/trigger.cpp b/Engine/source/T3D/trigger.cpp index b47bcabbc..53f175a8c 100644 --- a/Engine/source/T3D/trigger.cpp +++ b/Engine/source/T3D/trigger.cpp @@ -188,7 +188,7 @@ bool Trigger::castRay(const Point3F &start, const Point3F &end, RayInfo* info) F32 const *si = &start.x; F32 const *ei = &end.x; - for (int i = 0; i < 3; i++) + for (S32 i = 0; i < 3; i++) { if (*si < *ei) { diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index 1910ad707..dc836bef9 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -440,7 +440,7 @@ void TSStatic::reSkin() Vector 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 newSkin( skins[i] ); diff --git a/Engine/source/T3D/turret/aiTurretShape.cpp b/Engine/source/T3D/turret/aiTurretShape.cpp index f4da6522d..068523e0f 100644 --- a/Engine/source/T3D/turret/aiTurretShape.cpp +++ b/Engine/source/T3D/turret/aiTurretShape.cpp @@ -99,7 +99,7 @@ AITurretShapeData::AITurretShapeData() weaponLeadVelocity = 0; - for (int i = 0; i < MaxStates; i++) { + for (S32 i = 0; i < MaxStates; i++) { stateName[i] = 0; stateTransitionAtRest[i] = 0; stateTransitionNotAtRest[i] = 0; diff --git a/Engine/source/T3D/vehicles/vehicle.cpp b/Engine/source/T3D/vehicles/vehicle.cpp index f4b58ac61..22b2b05a0 100644 --- a/Engine/source/T3D/vehicles/vehicle.cpp +++ b/Engine/source/T3D/vehicles/vehicle.cpp @@ -69,7 +69,7 @@ const F32 sVehicleGravity = -20; // Physics and collision constants 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 {} @@ -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].y ); 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] ); } @@ -440,14 +440,14 @@ void VehicleData::unpackData(BitStream* stream) } } - for( int j=0; jread( &damageEmitterOffset[j].x ); stream->read( &damageEmitterOffset[j].y ); stream->read( &damageEmitterOffset[j].z ); } - for( int k=0; kread( &damageLevelTolerance[k] ); } @@ -718,7 +718,7 @@ bool Vehicle::onAdd() { if( mDataBlock->dustEmitter ) { - for( int i=0; ionNewDataBlock( mDataBlock->dustEmitter, false ); @@ -1804,7 +1804,7 @@ void Vehicle::updateDamageSmoke( F32 dt ) F32 damagePercent = mDamage / mDataBlock->maxDamage; if( damagePercent >= mDataBlock->damageLevelTolerance[j] ) { - for( int i=0; inumDmgEmitterAreas; i++ ) + for( S32 i=0; inumDmgEmitterAreas; i++ ) { MatrixF trans = getTransform(); 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); // 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]; 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. 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]; PrimBuild::color3f(1, 1, 1); diff --git a/Engine/source/T3D/vehicles/vehicle.h b/Engine/source/T3D/vehicles/vehicle.h index da3b62eeb..695c16686 100644 --- a/Engine/source/T3D/vehicles/vehicle.h +++ b/Engine/source/T3D/vehicles/vehicle.h @@ -202,7 +202,7 @@ class Vehicle: public ShapeBase CollisionList mContacts; Rigid mRigid; ShapeBaseConvex mConvex; - int restCount; + S32 restCount; SimObjectPtr mDustEmitterList[VehicleData::VC_NUM_DUST_EMITTERS]; SimObjectPtr mDamageEmitterList[VehicleData::VC_NUM_DAMAGE_EMITTERS]; diff --git a/Engine/source/app/net/tcpObject.cpp b/Engine/source/app/net/tcpObject.cpp index 37ee3ccd4..92b67df1d 100644 --- a/Engine/source/app/net/tcpObject.cpp +++ b/Engine/source/app/net/tcpObject.cpp @@ -421,7 +421,7 @@ DefineEngineMethod(TCPObject, send, void, (const char *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" "This method starts a listener which looks for incoming TCP connections to a port. " diff --git a/Engine/source/cinterface/c_consoleInterface.cpp b/Engine/source/cinterface/c_consoleInterface.cpp index b23c0b56d..21a2e48fd 100644 --- a/Engine/source/cinterface/c_consoleInterface.cpp +++ b/Engine/source/cinterface/c_consoleInterface.cpp @@ -43,7 +43,7 @@ extern "C" { return so->getClassName(); } - void *SimObject_GetFieldList(SimObject *so, int &outNumFields) + void *SimObject_GetFieldList(SimObject *so, S32 &outNumFields) { const AbstractClassRep::FieldList &fl = so->getFieldList(); outNumFields = fl.size(); diff --git a/Engine/source/cinterface/c_scripting.cpp b/Engine/source/cinterface/c_scripting.cpp index e6448089b..1186aa528 100644 --- a/Engine/source/cinterface/c_scripting.cpp +++ b/Engine/source/cinterface/c_scripting.cpp @@ -164,7 +164,7 @@ extern "C" { 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 ); if( object ) @@ -291,12 +291,12 @@ extern "C" { entry->cb.mVoidCallbackFunc(o, argc, argv); } - int script_simobject_get_id(SimObject* so) + S32 script_simobject_get_id(SimObject* so) { 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; if( Sim::findObject( name, object ) ) @@ -385,7 +385,7 @@ extern "C" { #ifdef TORQUE_OS_WIN32 - 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()) { diff --git a/Engine/source/cinterface/cinterface.cpp b/Engine/source/cinterface/cinterface.cpp index f5b1c1412..49a097014 100644 --- a/Engine/source/cinterface/cinterface.cpp +++ b/Engine/source/cinterface/cinterface.cpp @@ -37,7 +37,7 @@ extern void createFontShutdown(void); #endif #if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) - extern INT CreateMiniDump(LPEXCEPTION_POINTERS ExceptionInfo); + extern S32 CreateMiniDump(LPEXCEPTION_POINTERS ExceptionInfo); #endif static HashTable gSecureScript; @@ -47,7 +47,7 @@ static HashTable gSecureScript; // ObjC hooks for shared library support // 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_engineshutdown(); @@ -64,7 +64,7 @@ extern "C" { } // 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 ) @@ -105,7 +105,7 @@ extern "C" { } // tick Torque 3D's main loop - int torque_enginetick() + S32 torque_enginetick() { #if defined( TORQUE_MINIDUMP ) && defined( TORQUE_RELEASE ) @@ -139,7 +139,7 @@ extern "C" { } // shutdown the engine - int torque_engineshutdown() + S32 torque_engineshutdown() { #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); } diff --git a/Engine/source/collision/collision.h b/Engine/source/collision/collision.h index a2a69df23..8dec9791c 100644 --- a/Engine/source/collision/collision.h +++ b/Engine/source/collision/collision.h @@ -96,7 +96,7 @@ public: } // Accessors - int getCount() const { return mCount; } + S32 getCount() const { return mCount; } F32 getTime() const { return mT; } F32 getMaxHeight() const { return mMaxHeight; } diff --git a/Engine/source/collision/gjk.cpp b/Engine/source/collision/gjk.cpp index bd84e6d4f..5dff5ec92 100644 --- a/Engine/source/collision/gjk.cpp +++ b/Engine/source/collision/gjk.cpp @@ -69,21 +69,21 @@ void GjkCollisionState::swap() void GjkCollisionState::compute_det() { // 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) dp[i][last] = dp[last][i] = mDot(y[i], y[last]); dp[last][last] = mDot(y[last], y[last]); // Calulate the determinent 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) { - int s2 = sj | last_bit; + S32 s2 = sj | last_bit; det[s2][j] = dp[last][last] - dp[last][j]; 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) { - int s3 = sk | s2; + S32 s3 = sk | s2; det[s3][k] = det[s2][j] * (dp[j][j] - dp[j][k]) + det[s2][last] * (dp[last][j] - dp[last][k]); 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; 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) { sum += 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 (s & bit) { if (det[s][i] <= 0) @@ -152,7 +152,7 @@ inline bool GjkCollisionState::valid(int s) inline bool GjkCollisionState::closest(VectorF& v) { compute_det(); - for (int s = bits; s; --s) { + for (S32 s = bits; s; --s) { if ((s & bits) == s) { if (valid(s | last_bit)) { bits = s | last_bit; @@ -175,7 +175,7 @@ inline bool GjkCollisionState::closest(VectorF& v) 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) return true; return false; @@ -256,7 +256,7 @@ void GjkCollisionState::getClosestPoints(Point3F& p1, Point3F& p2) F32 sum = 0; p1.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) { sum += det[bits][i]; p1 += p[i] * det[bits][i]; diff --git a/Engine/source/collision/gjk.h b/Engine/source/collision/gjk.h index d78555f72..b35f4570d 100644 --- a/Engine/source/collision/gjk.h +++ b/Engine/source/collision/gjk.h @@ -58,8 +58,8 @@ struct GjkCollisionState: public CollisionState /// void compute_det(); - bool valid(int s); - void compute_vector(int bits, VectorF& v); + bool valid(S32 s); + void compute_vector(S32 bits, VectorF& v); bool closest(VectorF& v); bool degenerate(const VectorF& w); void nextBit(); diff --git a/Engine/source/collision/polytope.cpp b/Engine/source/collision/polytope.cpp index 21d9d6a8e..f07116583 100644 --- a/Engine/source/collision/polytope.cpp +++ b/Engine/source/collision/polytope.cpp @@ -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. out->mVertexList.clear(); @@ -373,7 +373,7 @@ bool Polytope::findCollision(const VectorF& vec,Polytope::Collision *best) return false; if (!best->object) best->distance = 1.0E30f; - int bestVertex = -1; + S32 bestVertex = -1; Polytope::Volume* bestVolume = NULL; sideCount++; diff --git a/Engine/source/collision/polytope.h b/Engine/source/collision/polytope.h index a28f08854..c96a54979 100644 --- a/Engine/source/collision/polytope.h +++ b/Engine/source/collision/polytope.h @@ -102,7 +102,7 @@ public: void buildBox(const MatrixF& transform,const Box3F& box); void intersect(SimObject*, const BSPNode* node); 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); }; diff --git a/Engine/source/component/dynamicConsoleMethodComponent.cpp b/Engine/source/component/dynamicConsoleMethodComponent.cpp index c76cae60a..fa7adf896 100644 --- a/Engine/source/component/dynamicConsoleMethodComponent.cpp +++ b/Engine/source/component/dynamicConsoleMethodComponent.cpp @@ -139,7 +139,7 @@ const char *DynamicConsoleMethodComponent::_callMethod( U32 argc, const char *ar if( getComponentCount() > 0 ) { 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-- ) { argv[0] = cbName; diff --git a/Engine/source/console/SimXMLDocument.cpp b/Engine/source/console/SimXMLDocument.cpp index 6076b9711..31e2f9906 100644 --- a/Engine/source/console/SimXMLDocument.cpp +++ b/Engine/source/console/SimXMLDocument.cpp @@ -348,7 +348,7 @@ bool SimXMLDocument::pushFirstChildElement(const char* rName) TiXmlElement* pElement; if(!m_paNode.empty()) { - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { @@ -412,7 +412,7 @@ bool SimXMLDocument::pushChildElement(S32 index) TiXmlElement* pElement; if(!m_paNode.empty()) { - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { @@ -472,7 +472,7 @@ bool SimXMLDocument::nextSiblingElement(const char* rName) { return false; } - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement*& pElement = m_paNode[iLastElement]; if(!pElement) { @@ -506,7 +506,7 @@ const char* SimXMLDocument::elementValue() { return StringTable->insert(""); } - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { @@ -547,7 +547,7 @@ const char* SimXMLDocument::attribute(const char* rAttribute) { return StringTable->insert(""); } - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { @@ -597,7 +597,7 @@ bool SimXMLDocument::attributeExists(const char* rAttribute) { return false; } - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { @@ -630,7 +630,7 @@ const char* SimXMLDocument::firstAttribute() { return StringTable->insert(""); } - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { @@ -667,7 +667,7 @@ const char* SimXMLDocument::lastAttribute() { return StringTable->insert(""); } - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { @@ -766,7 +766,7 @@ void SimXMLDocument::setAttribute(const char* rAttribute, const char* rVal) return; } - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pElement = m_paNode[iLastElement]; if(!pElement) { @@ -798,7 +798,7 @@ void SimXMLDocument::setObjectAttributes(const char* objectID) if( pObject == NULL ) return; - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pElement = m_paNode[iLastElement]; if(!pElement) return; @@ -925,7 +925,7 @@ void SimXMLDocument::pushNewElement(const char* rName) } else { - const int iFinalElement = m_paNode.size() - 1; + const S32 iFinalElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iFinalElement]; if(!pNode) { @@ -975,7 +975,7 @@ void SimXMLDocument::addNewElement(const char* rName) return; } - const int iParentElement = m_paNode.size() - 2; + const S32 iParentElement = m_paNode.size() - 2; if(iParentElement < 0) { pStackTop = dynamic_cast @@ -1002,7 +1002,7 @@ void SimXMLDocument::addNewElement(const char* rName) } // Overwrite top stack position. - const int iFinalElement = m_paNode.size() - 1; + const S32 iFinalElement = m_paNode.size() - 1; m_paNode[iFinalElement] = 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 if(!m_paNode.empty()) { - const int iLastElement = m_paNode.size() - 1; + const S32 iLastElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iLastElement]; if(!pNode) { @@ -1159,7 +1159,7 @@ void SimXMLDocument::addText(const char* text) if(m_paNode.empty()) return; - const int iFinalElement = m_paNode.size() - 1; + const S32 iFinalElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iFinalElement]; if(!pNode) return; @@ -1204,7 +1204,7 @@ const char* SimXMLDocument::getText() if(m_paNode.empty()) return ""; - const int iFinalElement = m_paNode.size() - 1; + const S32 iFinalElement = m_paNode.size() - 1; TiXmlNode* pNode = m_paNode[iFinalElement]; if(!pNode) return ""; @@ -1264,7 +1264,7 @@ void SimXMLDocument::removeText() if(m_paNode.empty()) return; - const int iFinalElement = m_paNode.size() - 1; + const S32 iFinalElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iFinalElement]; if(!pNode) return; @@ -1300,7 +1300,7 @@ void SimXMLDocument::addData(const char* text) if(m_paNode.empty()) return; - const int iFinalElement = m_paNode.size() - 1; + const S32 iFinalElement = m_paNode.size() - 1; TiXmlElement* pNode = m_paNode[iFinalElement]; if(!pNode) return; @@ -1346,7 +1346,7 @@ const char* SimXMLDocument::getData() if(m_paNode.empty()) return ""; - const int iFinalElement = m_paNode.size() - 1; + const S32 iFinalElement = m_paNode.size() - 1; TiXmlNode* pNode = m_paNode[iFinalElement]; if(!pNode) return ""; diff --git a/Engine/source/console/ast.h b/Engine/source/console/ast.h index 71cfbeec0..4be4fef90 100644 --- a/Engine/source/console/ast.h +++ b/Engine/source/console/ast.h @@ -250,8 +250,8 @@ struct StreqExprNode : BinaryExprNode struct StrcatExprNode : BinaryExprNode { - int appendChar; - static StrcatExprNode *alloc( S32 lineNumber, ExprNode *left, ExprNode *right, int appendChar ); + S32 appendChar; + static StrcatExprNode *alloc( S32 lineNumber, ExprNode *left, ExprNode *right, S32 appendChar ); U32 precompile(TypeReq type); U32 compile(U32 *codeStream, U32 ip, TypeReq type); TypeReq getPreferredType(); diff --git a/Engine/source/console/astAlloc.cpp b/Engine/source/console/astAlloc.cpp index 842429822..19809a1e2 100644 --- a/Engine/source/console/astAlloc.cpp +++ b/Engine/source/console/astAlloc.cpp @@ -149,7 +149,7 @@ StreqExprNode *StreqExprNode::alloc( S32 lineNumber, ExprNode *left, ExprNode *r 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)); constructInPlace(ret); diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 896d2a4cf..fc3e3544f 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -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 char *string; diff --git a/Engine/source/console/codeBlock.h b/Engine/source/console/codeBlock.h index 98e581e46..bf09e79c7 100644 --- a/Engine/source/console/codeBlock.h +++ b/Engine/source/console/codeBlock.h @@ -129,7 +129,7 @@ public: /// -1 a new frame is created. If the index is out of range the /// top stack frame is used. 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 /// result of the code executed, if any, or an empty string. diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index 0e7099ff2..838b3ab14 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -248,7 +248,7 @@ static bool active = false; static bool newLogFile; static const char *logFileName; -static const int MaxCompletionBufferSize = 4096; +static const S32 MaxCompletionBufferSize = 4096; static char completionBuffer[MaxCompletionBufferSize]; static char tabBuffer[MaxCompletionBufferSize] = {0}; static SimObjectPtr tabObject; diff --git a/Engine/source/console/consoleDoc.cpp b/Engine/source/console/consoleDoc.cpp index 1170b256d..41c5e8027 100644 --- a/Engine/source/console/consoleDoc.cpp +++ b/Engine/source/console/consoleDoc.cpp @@ -223,7 +223,7 @@ void Namespace::printNamespaceEntries(Namespace * g, bool dumpScript, bool dumpE // Iterate through the methods of the namespace... for(Entry *ewalk = g->mEntryList; ewalk; ewalk = ewalk->mNext) { - int eType = ewalk->mType; + S32 eType = ewalk->mType; const char * funcName = ewalk->mFunctionName; if( ( eType == Entry::ConsoleFunctionType ) && !dumpScript ) diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index 537f583ba..70bb5fbfc 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -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" "@param haystack The string to search.\n" "@param needle The string to search for.\n" diff --git a/Engine/source/console/consoleLogger.cpp b/Engine/source/console/consoleLogger.cpp index aedc9baab..ec3408001 100644 --- a/Engine/source/console/consoleLogger.cpp +++ b/Engine/source/console/consoleLogger.cpp @@ -175,7 +175,7 @@ bool ConsoleLogger::detach() mStream.close(); // 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 ) { diff --git a/Engine/source/console/consoleXMLExport.cpp b/Engine/source/console/consoleXMLExport.cpp index f6764ac77..1b498a089 100644 --- a/Engine/source/console/consoleXMLExport.cpp +++ b/Engine/source/console/consoleXMLExport.cpp @@ -255,7 +255,7 @@ namespace Con { mXML->pushNewElement("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"); @@ -267,7 +267,7 @@ namespace Con { mXML->pushNewElement("Enums"); - for (int j = 0; j < table->size; j++) + for (S32 j = 0; j < table->size; j++) { mXML->pushNewElement("Enum"); diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index 4358844b4..ee54df7bb 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -1383,14 +1383,14 @@ struct _EngineConsoleThunkCountArgs // Encapsulation of a legacy console function invocation. -template< int startArgc, typename T > +template< S32 startArgc, typename T > struct _EngineConsoleThunk {}; -template< int startArgc, typename R > +template< S32 startArgc, typename R > struct _EngineConsoleThunk< startArgc, R() > { 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() >& ) { return _EngineConsoleThunkReturnValue( fn() ); @@ -1401,11 +1401,11 @@ struct _EngineConsoleThunk< startArgc, R() > return _EngineConsoleThunkReturnValue( ( frame->*fn )() ); } }; -template< int startArgc > +template< S32 startArgc > struct _EngineConsoleThunk< startArgc, void() > { 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() >& ) { 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 ) > { 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 ) { 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 ) ); } }; -template< int startArgc, typename A > +template< S32 startArgc, typename A > struct _EngineConsoleThunk< startArgc, void( A ) > { 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 ) { 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 ) > { 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 ) { 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 ) ); } }; -template< int startArgc, typename A, typename B > +template< S32 startArgc, typename A, typename B > struct _EngineConsoleThunk< startArgc, void( A, B ) > { 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 ) { 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 ) > { 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 ) { 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 ) ); } }; -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 ) > { 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 ) { 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 ) > { 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 ) { 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 ) ); } }; -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 ) > { 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 ) { 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 ) > { 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 ) { 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 ) ); } }; -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 ) > { 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 ) { 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 ) > { 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 ) { 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 ) ); } }; -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 ) > { 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 ) { 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 ) > { 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 ) { 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 ) ); } }; -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 ) > { 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 ) { 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 ) > { 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 ) { 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 ) ); } }; -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 ) > { 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 ) { 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 ) > { 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 ) { 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 ) ); } }; -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 ) > { 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 ) { 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 ) > { 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 ) { 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 ) ); } }; -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 ) > { 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 ) { 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 ); } }; -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 ) > { 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 ) { 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 ) ); } }; -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 ) > { 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 ) { A a = ( startArgc < argc ? EngineUnmarshallData< A >()( argv[ startArgc ] ) : A( defaultArgs.a ) ); diff --git a/Engine/source/console/engineDoc.cpp b/Engine/source/console/engineDoc.cpp index f049b6cc3..2bc03cbe3 100644 --- a/Engine/source/console/engineDoc.cpp +++ b/Engine/source/console/engineDoc.cpp @@ -307,7 +307,7 @@ static void dumpNamespaceEntries( Stream &stream, Namespace *g, bool callbacks = // Go through all the entries in the namespace. 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. if( eType == Namespace::Entry::ConsoleFunctionType diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index 3385f3a91..9ad66e627 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -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" "@param index The index of the dynamic field.\n" "@return The value of the dynamic field at the given index or \"\"." ) @@ -2702,7 +2702,7 @@ DefineConsoleMethod( SimObject, getFieldCount, S32, (),, const AbstractClassRep::Field* f; U32 numDummyEntries = 0; - for(int i = 0; i < list.size(); i++) + for(S32 i = 0; i < list.size(); 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" "@param index The index of the static field.\n" "@return The value of the static field with the given index or \"\"." ) diff --git a/Engine/source/core/bitRender.cpp b/Engine/source/core/bitRender.cpp index 39bbe127f..0365e6ac2 100644 --- a/Engine/source/core/bitRender.cpp +++ b/Engine/source/core/bitRender.cpp @@ -799,7 +799,7 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim) #if defined(TORQUE_BIG_ENDIAN) #define MAX_SHADOW_TEXELS (256 + 4) //256 seems big enough, +4 so we can run off end of buffer. // slow fake gaussian - int i, j, c; + S32 i, j, c; U8 tmpLine[3][MAX_SHADOW_TEXELS]; U8 *src0, *src1, *src2; U8 *s0, *s1, *s2; @@ -809,7 +809,7 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim) U32 currVal; U32 sampleVal; U8 c00, c01, c02, c10, c11, c12, c20, c21, c22; - int openBuf; + S32 openBuf; src0 = tmpLine[0]; src1 = tmpLine[1]; @@ -902,9 +902,9 @@ void BitRender::bitTo8Bit_3(U32 * bits, U32 * eightBits, S32 dim) sampleVal = 0; //c12; // take end. else // inner pixel { - const int wXP = 3; // corners - const int wPP = 4; // plus/NSEW - const int wCP = 4; // center + const S32 wXP = 3; // corners + const S32 wPP = 4; // plus/NSEW + const S32 wCP = 4; // center sampleVal = (c00+c02+c20+c22)*wXP + (c01+c10+c12+c21)*wPP + c11*wCP; sampleVal >>= 5; // div by 32 subsamples } diff --git a/Engine/source/core/frameAllocator.h b/Engine/source/core/frameAllocator.h index 6abdd13cf..86884085c 100644 --- a/Engine/source/core/frameAllocator.h +++ b/Engine/source/core/frameAllocator.h @@ -234,7 +234,7 @@ public: mWaterMark = FrameAllocator::getWaterMark(); mMemory = reinterpret_cast( FrameAllocator::alloc( sizeof( T ) * count ) ); - for( int i = 0; i < mNumObjectsInMemory; i++ ) + for( S32 i = 0; i < mNumObjectsInMemory; i++ ) constructInPlace( &mMemory[i] ); } @@ -242,7 +242,7 @@ public: ~FrameTemp() { // Call destructor - for( int i = 0; i < mNumObjectsInMemory; i++ ) + for( S32 i = 0; i < mNumObjectsInMemory; i++ ) destructInPlace( &mMemory[i] ); FrameAllocator::setWaterMark( mWaterMark ); diff --git a/Engine/source/core/ogg/oggInputStream.cpp b/Engine/source/core/ogg/oggInputStream.cpp index 7704f3152..e0777e6ad 100644 --- a/Engine/source/core/ogg/oggInputStream.cpp +++ b/Engine/source/core/ogg/oggInputStream.cpp @@ -55,7 +55,7 @@ bool OggDecoder::_readNextPacket( ogg_packet* packet ) while( 1 ) { - int result = ogg_stream_packetout( &mOggStreamState, packet ); + S32 result = ogg_stream_packetout( &mOggStreamState, packet ); if( result == 0 ) { if( !mOggStream->_requestData() ) diff --git a/Engine/source/core/ogg/oggTheoraDecoder.cpp b/Engine/source/core/ogg/oggTheoraDecoder.cpp index b0c62ea5f..1259c3afb 100644 --- a/Engine/source/core/ogg/oggTheoraDecoder.cpp +++ b/Engine/source/core/ogg/oggTheoraDecoder.cpp @@ -169,7 +169,7 @@ bool OggTheoraDecoder::_init() break; } - int result = th_decode_headerin( &mTheoraInfo, &mTheoraComment, &mTheoraSetup, &nextPacket ); + S32 result = th_decode_headerin( &mTheoraInfo, &mTheoraComment, &mTheoraSetup, &nextPacket ); if( result < 0 ) { haveTheoraHeader = false; diff --git a/Engine/source/core/ogg/oggVorbisDecoder.cpp b/Engine/source/core/ogg/oggVorbisDecoder.cpp index 3df624df3..885c3fd53 100644 --- a/Engine/source/core/ogg/oggVorbisDecoder.cpp +++ b/Engine/source/core/ogg/oggVorbisDecoder.cpp @@ -89,7 +89,7 @@ bool OggVorbisDecoder::_init() break; } - int result = vorbis_synthesis_headerin( &mVorbisInfo, &mVorbisComment, &nextPacket ); + S32 result = vorbis_synthesis_headerin( &mVorbisInfo, &mVorbisComment, &nextPacket ); if( result != 0 ) { haveVorbisHeader = false; diff --git a/Engine/source/core/stringBuffer.cpp b/Engine/source/core/stringBuffer.cpp index be2840153..fd16d159b 100644 --- a/Engine/source/core/stringBuffer.cpp +++ b/Engine/source/core/stringBuffer.cpp @@ -438,7 +438,7 @@ void StringBufferManager::updateStats() request8 = 0; request16 = 0; U32 nstrings = strings.size(); - for(int i=0; i < nstrings; i++) + for(S32 i=0; i < nstrings; i++) { request8 += strings[i]->rc->requestCount8; request16 += strings[i]->rc->requestCount16; @@ -459,7 +459,7 @@ void StringBufferManager::dumpAllStrings() U32 nstrings = strings.size(); Con::printf("===== String Manager: All Strings ====="); Con::printf(" utf8 | utf16 | string"); - for(int i=0; i < nstrings; i++) + for(S32 i=0; i < nstrings; i++) { UTF8* tmp = strings[i]->createCopy8(); strings[i]->rc->requestCount8--; diff --git a/Engine/source/core/strings/findMatch.cpp b/Engine/source/core/strings/findMatch.cpp index c41dd9230..1bb35128e 100644 --- a/Engine/source/core/strings/findMatch.cpp +++ b/Engine/source/core/strings/findMatch.cpp @@ -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 ) { char *tok = 0; - int len = dStrlen(exps); + S32 len = dStrlen(exps); char *e = new char[len+1]; dStrcpy(e,exps); diff --git a/Engine/source/core/strings/stringFunctions.cpp b/Engine/source/core/strings/stringFunctions.cpp index 25c7e22b1..a0e4db8e7 100644 --- a/Engine/source/core/strings/stringFunctions.cpp +++ b/Engine/source/core/strings/stringFunctions.cpp @@ -97,10 +97,10 @@ nat_toupper( nat_char a ) -static int +static S32 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 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; - int fractional, result; + S32 fractional, result; ai = bi = 0; 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); } /* 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); } @@ -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_WIN32) || defined(TORQUE_OS_XBOX) || defined(TORQUE_OS_XENON) return wcscmp( reinterpret_cast( str1 ), reinterpret_cast( str2 ) ); #else - int ret; + S32 ret; const UTF16 *a, *b; a = str1; b = str2; diff --git a/Engine/source/core/strings/stringFunctions.h b/Engine/source/core/strings/stringFunctions.h index 34af03b9b..736276de7 100644 --- a/Engine/source/core/strings/stringFunctions.h +++ b/Engine/source/core/strings/stringFunctions.h @@ -52,22 +52,22 @@ inline char *dStrncat(char *dst, const char *src, dsize_t 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); } -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); } -inline int dStricmp(const char *str1, const char *str2) +inline S32 dStricmp(const char *str1, const char *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 ); } @@ -87,22 +87,22 @@ inline dsize_t dStrlen(const char *str) return strlen(str); } -inline char *dStrchr(char *str, int c) +inline char *dStrchr(char *str, S32 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); } -inline char *dStrrchr(char *str, int c) +inline char *dStrrchr(char *str, S32 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); } @@ -198,9 +198,9 @@ extern char *dStrlwr(char *str); extern char* dStrichr( char* str, char ch ); extern const char* dStrichr( const char* str, char ch ); -extern int dStrcmp(const UTF16 *str1, const UTF16 *str2); -extern int dStrnatcmp( const char* str1, const char* str2 ); -extern int dStrnatcasecmp( const char* str1, const char* str2 ); +extern S32 dStrcmp(const UTF16 *str1, const UTF16 *str2); +extern S32 dStrnatcmp( const char* str1, const char* str2 ); +extern S32 dStrnatcasecmp( const char* str1, const char* str2 ); inline bool dAtob(const char *str) { @@ -219,9 +219,9 @@ char* dStripPath(const char* filename); // standard I/O functions [defined in platformString.cpp] extern void dPrintf(const char *format, ...); -extern int dVprintf(const char *format, void *arglist); -extern int dSprintf(char *buffer, U32 bufferSize, const char *format, ...); -extern int dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist); -extern int dSscanf(const char *buffer, const char *format, ...); +extern S32 dVprintf(const char *format, void *arglist); +extern S32 dSprintf(char *buffer, U32 bufferSize, const char *format, ...); +extern S32 dVsprintf(char *buffer, U32 bufferSize, const char *format, void *arglist); +extern S32 dSscanf(const char *buffer, const char *format, ...); #endif diff --git a/Engine/source/core/strings/unicode.cpp b/Engine/source/core/strings/unicode.cpp index 2edea59e8..b6c915e05 100644 --- a/Engine/source/core/strings/unicode.cpp +++ b/Engine/source/core/strings/unicode.cpp @@ -311,7 +311,7 @@ UTF32 oneUTF8toUTF32( const UTF8* codepoint, U32 *unitsWalked) U8 codeunit; // check the first byte ( a.k.a. codeunit ) . - unsigned char c = codepoint[0]; + U8 c = codepoint[0]; c = c >> 1; expectedByteCount = sgFirstByteLUT[c]; 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 // 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); working >>= 6; diff --git a/Engine/source/core/tagDictionary.cpp b/Engine/source/core/tagDictionary.cpp index e31bb5e29..a25ed4f5b 100644 --- a/Engine/source/core/tagDictionary.cpp +++ b/Engine/source/core/tagDictionary.cpp @@ -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); } diff --git a/Engine/source/core/threadStatic.cpp b/Engine/source/core/threadStatic.cpp index 511db4259..aff06730f 100644 --- a/Engine/source/core/threadStatic.cpp +++ b/Engine/source/core/threadStatic.cpp @@ -103,7 +103,7 @@ TorqueThreadStaticListHandle _TorqueThreadStaticReg::spawnThreadStaticsInstance( // Copy mThreadStaticInstances[0] (master copy) into new memory, and // 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() ); } diff --git a/Engine/source/core/util/FastDelegate.h b/Engine/source/core/util/FastDelegate.h index b977a6a12..f2494d475 100644 --- a/Engine/source/core/util/FastDelegate.h +++ b/Engine/source/core/util/FastDelegate.h @@ -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. // If the compile fails here, it means the compiler has peculiar // 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]; u.in = input; return u.out; @@ -270,7 +270,7 @@ struct VoidToDefaultVoid { typedef DefaultVoid type; }; #endif // 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() // @@ -284,7 +284,7 @@ const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (GenericClass::*)()); // template specialisation, I use full specialisation of a wrapper struct. // general case -- don't know how to convert it. Force a compile failure -template +template struct SimplifyMemFunc { template inline static GenericClass *Convert(X *pthis, XFuncType function_to_bind, @@ -344,11 +344,11 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > { XFuncType func; struct { 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; } u; // 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; bound_func = u.s.funcaddress; return reinterpret_cast(reinterpret_cast(pthis) + u.s.delta); @@ -367,8 +367,8 @@ struct SimplifyMemFunc< SINGLE_MEMFUNCPTR_SIZE + sizeof(int) > { // is internally defined as: struct MicrosoftVirtualMFP { void (GenericClass::*codeptr)(); // points to the actual member function - int delta; // #bytes to be added to the 'this' pointer - int vtable_index; // or 0 if no virtual inheritance + S32 delta; // #bytes to be added to the 'this' pointer + S32 vtable_index; // or 0 if no virtual inheritance }; // 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 @@ -405,7 +405,7 @@ struct SimplifyMemFunc MicrosoftVirtualMFP s; } u2; // 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(u2.virtfunc)==sizeof(u2.s) ? 1 : -1]; // Unfortunately, taking the address of a MF prevents it from being inlined, so @@ -477,24 +477,24 @@ struct SimplifyMemFunc // is internally defined as: struct { GenericMemFuncType m_funcaddress; // points to the actual member function - int delta; // #bytes to be added to the 'this' pointer - int vtordisp; // #bytes to add to 'this' to find the vtable - int vtable_index; // or 0 if no virtual inheritance + S32 delta; // #bytes to be added to the 'this' pointer + S32 vtordisp; // #bytes to add to 'this' to find the vtable + S32 vtable_index; // or 0 if no virtual inheritance } s; } u; // 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; bound_func = u.s.funcaddress; - int virtual_delta = 0; + S32 virtual_delta = 0; if (u.s.vtable_index) { // Virtual inheritance is used // First, get to the vtable. // It is 'vtordisp' bytes from the start of the class. - const int * vtable = *reinterpret_cast( + const S32 * vtable = *reinterpret_cast( reinterpret_cast(pthis) + u.s.vtordisp ); // 'vtable_index' tells us where in the table we should be looking. - virtual_delta = u.s.vtordisp + *reinterpret_cast( + virtual_delta = u.s.vtordisp + *reinterpret_cast( reinterpret_cast(vtable) + u.s.vtable_index); } // 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 // and data pointers have different sizes. // 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(function_to_bind); // MSVC, SunC++ and DMC accept the following (non-standard) code: // m_pthis = static_cast(static_cast(function_to_bind)); @@ -792,7 +792,7 @@ public: // Ensure that there's a compilation failure if function pointers // and data pointers have different sizes. // 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(this); } #endif // !defined(FASTDELEGATE_USESTATICFUNCTIONHACK) @@ -906,7 +906,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -991,7 +991,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -1076,7 +1076,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -1161,7 +1161,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -1246,7 +1246,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -1331,7 +1331,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -1416,7 +1416,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -1501,7 +1501,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -1586,7 +1586,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -1671,7 +1671,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -1756,7 +1756,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; @@ -1841,7 +1841,7 @@ public: // Implicit conversion to "bool" using the safe_bool idiom private: 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; } UselessTypedef; typedef StaticFunctionPtr SafeBoolStruct::*unspecified_bool_type; diff --git a/Engine/source/core/util/delegate.h b/Engine/source/core/util/delegate.h index 6dbf1f668..0b1e51ec5 100644 --- a/Engine/source/core/util/delegate.h +++ b/Engine/source/core/util/delegate.h @@ -55,7 +55,7 @@ public: } protected: - int mOffset; + S32 mOffset; }; #endif // _UTIL_DELEGATE_H_ \ No newline at end of file diff --git a/Engine/source/core/util/dxt5nmSwizzle.h b/Engine/source/core/util/dxt5nmSwizzle.h index 555a21eee..58acbac66 100644 --- a/Engine/source/core/util/dxt5nmSwizzle.h +++ b/Engine/source/core/util/dxt5nmSwizzle.h @@ -37,7 +37,7 @@ public: volatile U8 *u8Mem = reinterpret_cast( memory ); - for( int i = 0; i < size >> 2; i++ ) + for( S32 i = 0; i < size >> 2; i++ ) { // g = garbage byte // Input: [X|Y|Z|g] (rgba) @@ -57,7 +57,7 @@ public: volatile const U8 *srcU8 = reinterpret_cast( source ); volatile U8 *dstU8 = reinterpret_cast( destination ); - for( int i = 0; i < size >> 2; i++ ) + for( S32 i = 0; i < size >> 2; i++ ) { // g = garbage byte // Input: [X|Y|Z|g] (rgba) @@ -85,13 +85,13 @@ public: virtual void ToBuffer( void *destination, const void *source, const dsize_t size ) const { 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( source ); volatile U8 *dstU8 = reinterpret_cast( destination ); // 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 // Input: [X|Y|Z|g] (rgba) diff --git a/Engine/source/core/util/path.cpp b/Engine/source/core/util/path.cpp index 5bcea08fb..93dcd023f 100644 --- a/Engine/source/core/util/path.cpp +++ b/Engine/source/core/util/path.cpp @@ -56,7 +56,7 @@ void Path::_split(String name) idx = name.find('/', 0, String::Right); if (idx >= pos) { - int len = idx - pos; + S32 len = idx - pos; mPath = name.substr(pos,len? len: 1); mPath = Path::CleanSeparators(mPath); pos = idx + 1; diff --git a/Engine/source/core/util/swizzle.h b/Engine/source/core/util/swizzle.h index 4cf929fce..abbff288f 100644 --- a/Engine/source/core/util/swizzle.h +++ b/Engine/source/core/util/swizzle.h @@ -126,11 +126,11 @@ inline void Swizzle::ToBuffer( void *destination, const void *sour T *dest = reinterpret_cast( destination ); const T *src = reinterpret_cast( 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 ) ); - for( int j = 0; j < mapLength; j++ ) + for( S32 j = 0; j < mapLength; j++ ) *dest++ = src[mMap[j]]; src += mapLength; diff --git a/Engine/source/core/util/swizzleSpec.h b/Engine/source/core/util/swizzleSpec.h index d45273498..ee0259ac4 100644 --- a/Engine/source/core/util/swizzleSpec.h +++ b/Engine/source/core/util/swizzleSpec.h @@ -37,7 +37,7 @@ inline void Swizzle::InPlace( void *memory, const dsize_t size ) const U8 *src = reinterpret_cast( memory ); // 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[1]] ); @@ -57,7 +57,7 @@ inline void Swizzle::ToBuffer( void *destination, const void *source, con const U8 *src = reinterpret_cast( source ); // 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[1]]; @@ -80,7 +80,7 @@ inline void Swizzle::InPlace( void *memory, const dsize_t size ) const U8 *dest = reinterpret_cast( memory ); U8 *src = reinterpret_cast( 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[1]] ); @@ -98,7 +98,7 @@ inline void Swizzle::ToBuffer( void *destination, const void *source, con U8 *dest = reinterpret_cast( destination ); const U8 *src = reinterpret_cast( source ); - for( int i = 0; i < size / 3; i++ ) + for( S32 i = 0; i < size / 3; i++ ) { *dest++ = src[mMap[0]]; *dest++ = src[mMap[1]]; diff --git a/Engine/source/core/util/tFixedSizeVector.h b/Engine/source/core/util/tFixedSizeVector.h index cab8a2186..c6079b129 100644 --- a/Engine/source/core/util/tFixedSizeVector.h +++ b/Engine/source/core/util/tFixedSizeVector.h @@ -25,7 +25,7 @@ /// A vector with a compile-time constant size. -template< typename T, int SIZE > +template< typename T, S32 SIZE > class FixedSizeVector { protected: diff --git a/Engine/source/core/util/tSignal.h b/Engine/source/core/util/tSignal.h index ea2e67954..08e2f6646 100644 --- a/Engine/source/core/util/tSignal.h +++ b/Engine/source/core/util/tSignal.h @@ -135,7 +135,7 @@ public: { if( del->mDelegate == dlg ) { - for ( int i = 0; i < mTriggerNext.size(); i++ ) + for ( S32 i = 0; i < mTriggerNext.size(); i++ ) { if( mTriggerNext[i] == ptr ) mTriggerNext[i] = ptr->next; diff --git a/Engine/source/core/util/tVector.h b/Engine/source/core/util/tVector.h index 457ac5245..42ad87dd6 100644 --- a/Engine/source/core/util/tVector.h +++ b/Engine/source/core/util/tVector.h @@ -504,7 +504,7 @@ template inline void Vector::compact() 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 inline void Vector::sort(compare_func f) { @@ -790,7 +790,7 @@ class VectorPtr : public Vector const_iterator end() const; void insert(iterator,const T&); - void insert(int idx) { Parent::insert(idx); } + void insert(S32 idx) { Parent::insert(idx); } void erase(iterator); T& front(); diff --git a/Engine/source/core/util/test/testVector2.cpp b/Engine/source/core/util/test/testVector2.cpp index 7c0cf2189..cbdf45487 100644 --- a/Engine/source/core/util/test/testVector2.cpp +++ b/Engine/source/core/util/test/testVector2.cpp @@ -72,10 +72,10 @@ CreateUnitTest( TestVector, "Util/Vector" ) 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; - int bv = *b; + S32 av = *a; + S32 bv = *b; if( av < bv ) return -1; @@ -87,7 +87,7 @@ CreateUnitTest( TestVector, "Util/Vector" ) void testSort() { - Vector< int > v; + Vector< S32 > v; v.push_back( 0 ); v.push_back( 10 ); diff --git a/Engine/source/core/util/zip/zipObject.cpp b/Engine/source/core/util/zip/zipObject.cpp index 60c05c183..419733350 100644 --- a/Engine/source/core/util/zip/zipObject.cpp +++ b/Engine/source/core/util/zip/zipObject.cpp @@ -216,7 +216,7 @@ String ZipObject::getFileEntry(S32 idx) const Zip::CentralDir &dir = (*mZipArchive)[idx]; 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.mCompressMethod, dir.mCRC32); if (chars < sizeof(buffer)) diff --git a/Engine/source/core/volume.cpp b/Engine/source/core/volume.cpp index 1e0b6cda7..05a139eeb 100644 --- a/Engine/source/core/volume.cpp +++ b/Engine/source/core/volume.cpp @@ -651,7 +651,7 @@ bool MountSystem::unmount(FileSystemRef fs) // also check that fs is not null each time since its a strong ref // so it could be nulled during removal. 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()) { diff --git a/Engine/source/environment/scatterSky.cpp b/Engine/source/environment/scatterSky.cpp index b47258db4..ddc144c91 100644 --- a/Engine/source/environment/scatterSky.cpp +++ b/Engine/source/environment/scatterSky.cpp @@ -1056,7 +1056,7 @@ void ScatterSky::_renderMoon( ObjectRenderInst *ri, SceneRenderState *state, Bas const MatrixF &camView = state->getCameraTransform(); // Finalize points - for(int i = 0; i < 4; i++) + for(S32 i = 0; i < 4; i++) { // align with camera camView.mulV(points[i]); @@ -1112,13 +1112,13 @@ void ScatterSky::_generateSkyPoints() F32 deltaSegAngle = ( 2.0f * M_PI_F / (F32)segments ); // 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 y0 = mCos( ring * deltaRingAngle ); // 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 z0 = r0 * cosf( seg * deltaSegAngle ); diff --git a/Engine/source/environment/sun.cpp b/Engine/source/environment/sun.cpp index 00b6a0337..3596d466d 100644 --- a/Engine/source/environment/sun.cpp +++ b/Engine/source/environment/sun.cpp @@ -470,7 +470,7 @@ void Sun::_renderCorona( ObjectRenderInst *ri, SceneRenderState *state, BaseMatI const MatrixF &camView = state->getCameraTransform(); // Finalize points - for(int i = 0; i < 4; i++) + for(S32 i = 0; i < 4; i++) { // align with camera camView.mulV(points[i]); diff --git a/Engine/source/gfx/D3D9/gfxD3D9EnumTranslate.h b/Engine/source/gfx/D3D9/gfxD3D9EnumTranslate.h index 00448bad0..b0ec97eae 100644 --- a/Engine/source/gfx/D3D9/gfxD3D9EnumTranslate.h +++ b/Engine/source/gfx/D3D9/gfxD3D9EnumTranslate.h @@ -54,8 +54,8 @@ extern _D3DTEXTUREOP GFXD3D9TextureOp[GFXTOP_COUNT]; extern _D3DDECLTYPE GFXD3D9DeclType[GFXDeclType_COUNT]; #define GFXREVERSE_LOOKUP( tablearray, enumprefix, val ) \ - for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ - if( (int)tablearray##[i] == val ) \ + for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ + if( (S32)tablearray##[i] == val ) \ { \ val = i; \ break; \ diff --git a/Engine/source/gfx/D3D9/gfxD3D9TextureManager.cpp b/Engine/source/gfx/D3D9/gfxD3D9TextureManager.cpp index 417d7f803..435b27dd3 100644 --- a/Engine/source/gfx/D3D9/gfxD3D9TextureManager.cpp +++ b/Engine/source/gfx/D3D9/gfxD3D9TextureManager.cpp @@ -259,7 +259,7 @@ void GFXD3D9TextureManager::_innerCreateTexture( GFXD3D9TextureObject *retTex, retTex->mTextureSize.set(probeDesc.Width, probeDesc.Height, 0); - int fmt = probeDesc.Format; + S32 fmt = probeDesc.Format; #if !defined(TORQUE_OS_XENON) GFXREVERSE_LOOKUP( GFXD3D9TextureFormat, GFXFormat, fmt ); @@ -568,7 +568,7 @@ bool GFXD3D9TextureManager::_loadTexture(GFXTextureObject *aTexture, DDSFile *dd GFXD3D9TextureObject *texture = static_cast(aTexture); // Fill the texture... - for( int i = 0; i < aTexture->mMipLevels; i++ ) + for( S32 i = 0; i < aTexture->mMipLevels; i++ ) { PROFILE_SCOPE(GFXD3DTexMan_loadSurface); diff --git a/Engine/source/gfx/D3D9/gfxD3D9TextureObject.cpp b/Engine/source/gfx/D3D9/gfxD3D9TextureObject.cpp index be859b857..ff9c69096 100644 --- a/Engine/source/gfx/D3D9/gfxD3D9TextureObject.cpp +++ b/Engine/source/gfx/D3D9/gfxD3D9TextureObject.cpp @@ -242,9 +242,9 @@ bool GFXD3D9TextureObject::copyToBmp(GBitmap* bmp) PROFILE_START(GFXD3D9TextureObject_copyToBmp_pixCopy); // 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[1] = srcPtr[1]; // green diff --git a/Engine/source/gfx/D3D9/pc/gfxD3D9EnumTranslate.pc.cpp b/Engine/source/gfx/D3D9/pc/gfxD3D9EnumTranslate.pc.cpp index ae143cfc3..f4e4accff 100644 --- a/Engine/source/gfx/D3D9/pc/gfxD3D9EnumTranslate.pc.cpp +++ b/Engine/source/gfx/D3D9/pc/gfxD3D9EnumTranslate.pc.cpp @@ -46,14 +46,14 @@ _D3DDECLTYPE GFXD3D9DeclType[GFXDeclType_COUNT]; //------------------------------------------------------------------------------ #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; #define VALIDATE_LOOKUPTABLE( tablearray, enumprefix ) \ - for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ - if( (int)tablearray##[i] == GFX_UNINIT_VAL ) \ + for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ + if( (S32)tablearray##[i] == GFX_UNINIT_VAL ) \ 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 ); //------------------------------------------------------------------------------ diff --git a/Engine/source/gfx/D3D9/pc/gfxPCD3D9Target.cpp b/Engine/source/gfx/D3D9/pc/gfxPCD3D9Target.cpp index 194e304fd..0ac4114cf 100644 --- a/Engine/source/gfx/D3D9/pc/gfxPCD3D9Target.cpp +++ b/Engine/source/gfx/D3D9/pc/gfxPCD3D9Target.cpp @@ -330,7 +330,7 @@ void GFXPCD3D9TextureTarget::resolveTo( GFXTextureObject *tex ) void GFXPCD3D9TextureTarget::zombify() { - for(int i = 0; i < MaxRenderSlotId; i++) + for(S32 i = 0; i < MaxRenderSlotId; i++) attachTexture(RenderSlot(i), NULL); } diff --git a/Engine/source/gfx/bitmap/ddsLoader.cpp b/Engine/source/gfx/bitmap/ddsLoader.cpp index 3405547a9..4ad23ef39 100644 --- a/Engine/source/gfx/bitmap/ddsLoader.cpp +++ b/Engine/source/gfx/bitmap/ddsLoader.cpp @@ -883,7 +883,7 @@ DDSFile *DDSFile::createDDSFileFromGBitmap( const GBitmap *gbmp ) ret->mSurfaces.push_back( new SurfaceData() ); // 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); ret->mSurfaces.last()->mMips.push_back( new U8[mipSz] ); @@ -898,7 +898,7 @@ DDSFile *DDSFile::createDDSFileFromGBitmap( const GBitmap *gbmp ) // Assumption: 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]; const U8 *src = &gbmp->getBits(i)[pxl * gbmp->getBytesPerPixel()]; diff --git a/Engine/source/gfx/bitmap/ddsUtils.cpp b/Engine/source/gfx/bitmap/ddsUtils.cpp index 42971bfdc..b5e5fa4a8 100644 --- a/Engine/source/gfx/bitmap/ddsUtils.cpp +++ b/Engine/source/gfx/bitmap/ddsUtils.cpp @@ -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. 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]; @@ -106,7 +106,7 @@ bool DDSUtil::squishDDS( DDSFile *srcDDS, const GFXFormat dxtFormat ) void DDSUtil::swizzleDDS( DDSFile *srcDDS, const Swizzle &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 ) ); } diff --git a/Engine/source/gfx/bitmap/gBitmap.cpp b/Engine/source/gfx/bitmap/gBitmap.cpp index a2a64cf5f..2c3f30e7a 100644 --- a/Engine/source/gfx/bitmap/gBitmap.cpp +++ b/Engine/source/gfx/bitmap/gBitmap.cpp @@ -795,11 +795,11 @@ bool GBitmap::combine( const GBitmap *bitmapA, const GBitmap *bitmapB, const GFX const U8 *aBits = bitmapA->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 pxB = 0; diff --git a/Engine/source/gfx/bitmap/loaders/bitmapBmp.cpp b/Engine/source/gfx/bitmap/loaders/bitmapBmp.cpp index 925d676dd..a54c3997e 100644 --- a/Engine/source/gfx/bitmap/loaders/bitmapBmp.cpp +++ b/Engine/source/gfx/bitmap/loaders/bitmapBmp.cpp @@ -152,7 +152,7 @@ static bool sReadBMP(Stream &stream, GBitmap *bitmap) if(bytesPerPixel == 3 && bi.biBitCount != 8) // do BGR swap { 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]; ptr[0] = ptr[2]; diff --git a/Engine/source/gfx/bitmap/loaders/bitmapGif.cpp b/Engine/source/gfx/bitmap/loaders/bitmapGif.cpp index ef1bb783b..d4c031026 100644 --- a/Engine/source/gfx/bitmap/loaders/bitmapGif.cpp +++ b/Engine/source/gfx/bitmap/loaders/bitmapGif.cpp @@ -54,7 +54,7 @@ static struct _privateRegisterGIF //-------------------------------------- Replacement I/O for standard LIBjpeg // functions. we don't wanna use // 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; AssertFatal(stream != NULL, "gifReadDataFn::No stream."); @@ -72,7 +72,7 @@ static int gifReadDataFn(GifFileType *gifinfo, GifByteType *data, int length) //-------------------------------------- #if 0 // 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; AssertFatal(stream != NULL, "gifWriteDataFn::No stream."); diff --git a/Engine/source/gfx/bitmap/loaders/bitmapJpeg.cpp b/Engine/source/gfx/bitmap/loaders/bitmapJpeg.cpp index 790369f32..8a647afda 100644 --- a/Engine/source/gfx/bitmap/loaders/bitmapJpeg.cpp +++ b/Engine/source/gfx/bitmap/loaders/bitmapJpeg.cpp @@ -50,11 +50,11 @@ static struct _privateRegisterJPG //-------------------------------------- Replacement I/O for standard LIBjpeg // functions. we don't wanna use // 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; AssertFatal(stream != NULL, "jpegReadDataFn::No stream."); - int pos = stream->getPosition(); + S32 pos = stream->getPosition(); if (stream->read(length, data)) 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; 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 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; AssertFatal(stream != NULL, "jpegErrorFn::No stream."); diff --git a/Engine/source/gfx/gfxDevice.cpp b/Engine/source/gfx/gfxDevice.cpp index 9e57bcc81..d478da5cd 100644 --- a/Engine/source/gfx/gfxDevice.cpp +++ b/Engine/source/gfx/gfxDevice.cpp @@ -103,7 +103,7 @@ GFXDevice::GFXDevice() mViewMatrix.identity(); mProjectionMatrix.identity(); - for( int i = 0; i < WORLD_STACK_MAX; i++ ) + for( S32 i = 0; i < WORLD_STACK_MAX; i++ ) mWorldMatrix[i].identity(); AssertFatal(smGFXDevice == NULL, "Already a GFXDevice created! Bad!"); @@ -451,7 +451,7 @@ void GFXDevice::updateStates(bool forceSetAll /*=false*/) if( mTextureMatrixCheckDirty ) { - for( int i = 0; i < getNumSamplers(); i++ ) + for( S32 i = 0; i < getNumSamplers(); i++ ) { if( mTextureMatrixDirty[i] ) { diff --git a/Engine/source/gfx/gfxDrawUtil.cpp b/Engine/source/gfx/gfxDrawUtil.cpp index d7e4b921e..c87f1cbc3 100644 --- a/Engine/source/gfx/gfxDrawUtil.cpp +++ b/Engine/source/gfx/gfxDrawUtil.cpp @@ -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[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.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[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.unlock(); @@ -828,11 +828,11 @@ void GFXDrawUtil::_drawWireCube( const GFXStateBlockDesc &desc, const Point3F &s // setup 6 line loops 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].color = color; @@ -872,7 +872,7 @@ void GFXDrawUtil::_drawSolidCube( const GFXStateBlockDesc &desc, const Point3F & // setup 6 line loops U32 vertexIndex = 0; U32 idx; - for(int i = 0; i < 6; i++) + for(S32 i = 0; i < 6; i++) { idx = cubeFaces[i][0]; verts[vertexIndex].point = cubePoints[idx] * halfSize; diff --git a/Engine/source/gfx/gfxStringEnumTranslate.cpp b/Engine/source/gfx/gfxStringEnumTranslate.cpp index 108422aec..ff21e41ac 100644 --- a/Engine/source/gfx/gfxStringEnumTranslate.cpp +++ b/Engine/source/gfx/gfxStringEnumTranslate.cpp @@ -76,20 +76,20 @@ _STRING_VALUE_LOOKUP_FXN(GFXStringBlendOp); //------------------------------------------------------------------------------ #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; #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;\ typeTable[i] = &defaultStringValueLookup;\ } #define VALIDATE_LOOKUPTABLE( tablearray, enumprefix ) \ - for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ - if( (int)tablearray[i] == GFX_UNINIT_VAL ) \ + for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ + if( (S32)tablearray[i] == GFX_UNINIT_VAL ) \ 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 ); //------------------------------------------------------------------------------ diff --git a/Engine/source/gfx/gfxStringEnumTranslate.h b/Engine/source/gfx/gfxStringEnumTranslate.h index 2184ab18f..37aab7590 100644 --- a/Engine/source/gfx/gfxStringEnumTranslate.h +++ b/Engine/source/gfx/gfxStringEnumTranslate.h @@ -71,8 +71,8 @@ extern StringValueLookupFn GFXStringSamplerStateValueLookup[GFXSAMP_COUNT]; extern StringValueLookupFn GFXStringTextureStageStateValueLookup[GFXTSS_COUNT]; #define GFXREVERSE_LOOKUP( tablearray, enumprefix, val ) \ - for( int i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ - if( (int)tablearray##[i] == val ) \ + for( S32 i = enumprefix##_FIRST; i < enumprefix##_COUNT; i++ ) \ + if( (S32)tablearray##[i] == val ) \ { \ val = i; \ break; \ diff --git a/Engine/source/gfx/gfxTextureManager.cpp b/Engine/source/gfx/gfxTextureManager.cpp index 3f755b5e6..64727884e 100644 --- a/Engine/source/gfx/gfxTextureManager.cpp +++ b/Engine/source/gfx/gfxTextureManager.cpp @@ -1032,7 +1032,7 @@ void GFXTextureManager::_validateTexParams( const U32 width, const U32 height, GFXFormat testingFormat = inOutFormat; if( profile->getCompression() != GFXTextureProfile::None ) { - const int offset = profile->getCompression() - GFXTextureProfile::DXT1; + const S32 offset = profile->getCompression() - GFXTextureProfile::DXT1; testingFormat = GFXFormat( GFXFormatDXT1 + offset ); // No auto-gen mips on compressed textures diff --git a/Engine/source/gfx/gfxTextureObject.h b/Engine/source/gfx/gfxTextureObject.h index b9db600f1..bed37bdce 100644 --- a/Engine/source/gfx/gfxTextureObject.h +++ b/Engine/source/gfx/gfxTextureObject.h @@ -63,7 +63,7 @@ struct GFXLockedRect { /// Pitch of the lock. This is the spacing in bytes of the start /// of each row of the locked region. - int pitch; + S32 pitch; /// Pointer to the start of locked rectangle. U8* bits; diff --git a/Engine/source/gfx/test/stanfordBunny.cpp b/Engine/source/gfx/test/stanfordBunny.cpp index 90a79fae6..31a3c571b 100644 --- a/Engine/source/gfx/test/stanfordBunny.cpp +++ b/Engine/source/gfx/test/stanfordBunny.cpp @@ -13606,8 +13606,8 @@ void setupBunny(GFXVertexPCN* v) { for(j=0;j<3;j++) { - int vi=face_indicies[i][j]; - int ni=face_indicies[i][j+3];//Normal index + S32 vi=face_indicies[i][j]; + S32 ni=face_indicies[i][j+3];//Normal index 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].point = point; diff --git a/Engine/source/gfx/util/distanceField.cpp b/Engine/source/gfx/util/distanceField.cpp index 91069ee25..229a07eec 100644 --- a/Engine/source/gfx/util/distanceField.cpp +++ b/Engine/source/gfx/util/distanceField.cpp @@ -32,7 +32,7 @@ struct DistanceFieldSearchSpaceStruct 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* sp2 = (const DistanceFieldSearchSpaceStruct*)p2; diff --git a/Engine/source/gfx/util/triListOpt.cpp b/Engine/source/gfx/util/triListOpt.cpp index 8ed7e4d12..2628d2941 100644 --- a/Engine/source/gfx/util/triListOpt.cpp +++ b/Engine/source/gfx/util/triListOpt.cpp @@ -48,11 +48,11 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices, FrameTemp triangleData(NumPrimitives); U32 curIdx = 0; - for(int tri = 0; tri < NumPrimitives; tri++) + for(S32 tri = 0; tri < NumPrimitives; tri++) { TriData &curTri = triangleData[tri]; - for(int c = 0; c < 3; c++) + for(S32 c = 0; c < 3; c++) { const U32 &curVIdx = indices[curIdx]; 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 // each of the verts - for(int v = 0; v < numVerts; v++) + for(S32 v = 0; v < numVerts; v++) { VertData &curVert = vertexData[v]; 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 // per-triangle, to get the starting triangle score curIdx = 0; - for(int tri = 0; tri < NumPrimitives; tri++) + for(S32 tri = 0; tri < NumPrimitives; tri++) { TriData &curTri = triangleData[tri]; - for(int c = 0; c < 3; c++) + for(S32 c = 0; c < 3; c++) { const U32 &curVIdx = indices[curIdx]; 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 // 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 // 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; nextBestTriIdx = nextNextBestTriIdx = -1; - for(int tri = 0; tri < NumPrimitives; tri++) + for(S32 tri = 0; tri < NumPrimitives; tri++) { TriData &curTri = triangleData[tri]; @@ -143,7 +143,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices, // Emit the next best triangle TriData &nextBestTri = triangleData[nextBestTriIdx]; 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 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 VertData &curVert = vertexData[nextBestTri.vertIdx[i]]; curVert.numUnaddedReferences--; - for(int t = 0; t < curVert.numReferences; t++) + for(S32 t = 0; t < curVert.numReferences; t++) { if(curVert.triIndex[t] == nextBestTriIdx) { @@ -184,7 +184,7 @@ void OptimizeTriangleOrdering(const dsize_t numVerts, const dsize_t numIndices, { 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; _CHECK_NEXT_BEST(tri.score, *itr); @@ -288,12 +288,12 @@ void LRUCacheModel::enforceSize(const dsize_t maxSize, Vector &outTrisToUpd // Update cache position on verts still in cache 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]; if(triIdx > -1) { - int j = 0; + S32 j = 0; for(; j < outTrisToUpdate.size(); j++) if(outTrisToUpdate[j] == triIdx) break; diff --git a/Engine/source/gfx/video/videoEncoderTheora.cpp b/Engine/source/gfx/video/videoEncoderTheora.cpp index c0b094a52..3e6160a12 100644 --- a/Engine/source/gfx/video/videoEncoderTheora.cpp +++ b/Engine/source/gfx/video/videoEncoderTheora.cpp @@ -150,8 +150,8 @@ class VideoEncoderTheora : public VideoEncoder, public Thread F64 videotime = th_granule_time(td,ogg_page_granulepos(&videopage)); if (videotime > 0) { - int hundredths=(int)(videotime*100-(long)videotime*100); - int seconds=(long)videotime%60; + S32 hundredths=(int)(videotime*100-(long)videotime*100); + S32 seconds=(long)videotime%60; Platform::outputDebugString("Encoding time %g %02i.%02i", videotime, seconds, hundredths); } } @@ -254,12 +254,12 @@ public: th_info_clear(&ti); // This is needed for youtube compatibility - int vp3_compatible = 1; + S32 vp3_compatible = 1; th_encode_ctl(td, TH_ENCCTL_SET_VP3_COMPATIBLE, &vp3_compatible, sizeof(vp3_compatible)); // Set the encoder to max speed - int speed_max; - int ret; + S32 speed_max; + S32 ret; ret = th_encode_ctl(td, TH_ENCCTL_GET_SPLEVEL_MAX, &speed_max, sizeof(speed_max)); if(ret<0){ Platform::outputDebugString("VideoEncoderTheora::begin() - could not determine maximum speed level."); diff --git a/Engine/source/gui/containers/guiWindowCtrl.cpp b/Engine/source/gui/containers/guiWindowCtrl.cpp index 724154910..0132a75d6 100644 --- a/Engine/source/gui/containers/guiWindowCtrl.cpp +++ b/Engine/source/gui/containers/guiWindowCtrl.cpp @@ -1478,7 +1478,7 @@ void GuiWindowCtrl::positionButtons(void) // Until a pref, if alignment is LEFT, put buttons RIGHT justified. // ELSE, put buttons LEFT justified. - int closeLeft = mainOff.x, closeTop = mainOff.y, closeOff = buttonWidth + 2; + S32 closeLeft = mainOff.x, closeTop = mainOff.y, closeOff = buttonWidth + 2; if ( mProfile->mAlignment == GuiControlProfile::LeftJustify ) { closeOff = -closeOff; diff --git a/Engine/source/gui/controls/guiBitmapCtrl.cpp b/Engine/source/gui/controls/guiBitmapCtrl.cpp index 29766d197..e59b5e0e6 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.cpp +++ b/Engine/source/gui/controls/guiBitmapCtrl.cpp @@ -181,10 +181,10 @@ void GuiBitmapCtrl::onRender(Point2I offset, const RectI &updateRect) float xdone = ((float)getExtent().x/(float)texture->mBitmapSize.x)+1; float ydone = ((float)getExtent().y/(float)texture->mBitmapSize.y)+1; - int xshift = mStartPoint.x%texture->mBitmapSize.x; - int yshift = mStartPoint.y%texture->mBitmapSize.y; - for(int y = 0; y < ydone; ++y) - for(int x = 0; x < xdone; ++x) + S32 xshift = mStartPoint.x%texture->mBitmapSize.x; + S32 yshift = mStartPoint.y%texture->mBitmapSize.y; + for(S32 y = 0; y < ydone; ++y) + for(S32 x = 0; x < xdone; ++x) { srcRegion.set(0,0,texture->mBitmapSize.x,texture->mBitmapSize.y); dstRegion.set( ((texture->mBitmapSize.x*x)+offset.x)-xshift, diff --git a/Engine/source/gui/controls/guiFileTreeCtrl.cpp b/Engine/source/gui/controls/guiFileTreeCtrl.cpp index 7fe7e3ba4..60e0c3b86 100644 --- a/Engine/source/gui/controls/guiFileTreeCtrl.cpp +++ b/Engine/source/gui/controls/guiFileTreeCtrl.cpp @@ -260,7 +260,7 @@ bool GuiFileTreeCtrl::matchesFilters(const char* filename) if( !mFilters.size() ) return true; - for(int i = 0; i < mFilters.size(); i++) + for(S32 i = 0; i < mFilters.size(); i++) { if(FindMatch::isMatch( mFilters[i], filename)) return true; diff --git a/Engine/source/gui/controls/guiGameListOptionsCtrl.cpp b/Engine/source/gui/controls/guiGameListOptionsCtrl.cpp index 42eb38092..1c5bdba0f 100644 --- a/Engine/source/gui/controls/guiGameListOptionsCtrl.cpp +++ b/Engine/source/gui/controls/guiGameListOptionsCtrl.cpp @@ -213,7 +213,7 @@ void GuiGameListOptionsCtrl::addRow(const char* label, const char* optionsList, Row * row = new Row(); Vector options( __FILE__, __LINE__ ); S32 count = StringUnit::getUnitCount(optionsList, DELIM); - for (int i = 0; i < count; ++i) + for (S32 i = 0; i < count; ++i) { const char * option = StringUnit::getUnit(optionsList, i, DELIM); options.push_back(StringTable->insert(option, true)); @@ -238,7 +238,7 @@ void GuiGameListOptionsCtrl::setOptions(S32 rowIndex, const char * optionsList) S32 count = StringUnit::getUnitCount(optionsList, DELIM); row->mOptions.setSize(count); - for (int i = 0; i < count; ++i) + for (S32 i = 0; i < count; ++i) { const char * option = StringUnit::getUnit(optionsList, i, DELIM); row->mOptions[i] = StringTable->insert(option, true); diff --git a/Engine/source/gui/controls/guiMLTextCtrl.cpp b/Engine/source/gui/controls/guiMLTextCtrl.cpp index d026bfd92..e5d353426 100644 --- a/Engine/source/gui/controls/guiMLTextCtrl.cpp +++ b/Engine/source/gui/controls/guiMLTextCtrl.cpp @@ -138,7 +138,7 @@ DefineEngineMethod( GuiMLTextCtrl, addText, void, ( const char* text, bool refor object->addText(text, dStrlen(text), reformat); } -DefineEngineMethod( GuiMLTextCtrl, setCursorPosition, bool, (int newPos),, +DefineEngineMethod( GuiMLTextCtrl, setCursorPosition, bool, (S32 newPos),, "@brief Change the text cursor's position to a new defined offset within the text in the control.\n\n" "@param newPos Offset to place cursor.\n" "@tsexample\n" @@ -153,7 +153,7 @@ DefineEngineMethod( GuiMLTextCtrl, setCursorPosition, bool, (int newPos),, return object->setCursorPosition(newPos); } -DefineEngineMethod( GuiMLTextCtrl, scrollToTag, void, (int tagID),, +DefineEngineMethod( GuiMLTextCtrl, scrollToTag, void, (S32 tagID),, "@brief Scroll down to a specified tag.\n\n" "Detailed description\n\n" "@param tagID TagID to scroll the control to\n" diff --git a/Engine/source/gui/controls/guiTextEditCtrl.cpp b/Engine/source/gui/controls/guiTextEditCtrl.cpp index 1748d5ce7..c451400b7 100644 --- a/Engine/source/gui/controls/guiTextEditCtrl.cpp +++ b/Engine/source/gui/controls/guiTextEditCtrl.cpp @@ -1688,7 +1688,7 @@ DefineEngineMethod( GuiTextEditCtrl, getCursorPos, S32, (),, return( object->getCursorPos() ); } -DefineEngineMethod( GuiTextEditCtrl, setCursorPos, void, (int position),, +DefineEngineMethod( GuiTextEditCtrl, setCursorPos, void, (S32 position),, "@brief Sets the text cursor at the defined position within the control.\n\n" "@param position Text position to set the text cursor.\n" "@tsexample\n" diff --git a/Engine/source/gui/controls/guiTextListCtrl.cpp b/Engine/source/gui/controls/guiTextListCtrl.cpp index 7c6b9602a..dfd191795 100644 --- a/Engine/source/gui/controls/guiTextListCtrl.cpp +++ b/Engine/source/gui/controls/guiTextListCtrl.cpp @@ -79,12 +79,12 @@ IMPLEMENT_CALLBACK( GuiTextListCtrl, onDeleteKey, void, ( const char* id ),( id "@see GuiControl\n\n" ); -static int sortColumn; +static S32 sortColumn; static bool sIncreasing; static const char *getColumn(const char *text) { - int ct = sortColumn; + S32 ct = sortColumn; while(ct--) { text = dStrchr(text, '\t'); @@ -530,7 +530,7 @@ DefineEngineMethod( GuiTextListCtrl, getSelectedId, S32, (),, return object->getSelectedId(); } -DefineEngineMethod( GuiTextListCtrl, setSelectedById, void, (int id),, +DefineEngineMethod( GuiTextListCtrl, setSelectedById, void, (S32 id),, "@brief Finds the specified entry by id, then marks its row as selected.\n\n" "@param id Entry within the text list to make selected.\n" "@tsexample\n" @@ -548,7 +548,7 @@ DefineEngineMethod( GuiTextListCtrl, setSelectedById, void, (int id),, object->setSelectedCell(Point2I(0, index)); } -DefineEngineMethod( GuiTextListCtrl, setSelectedRow, void, (int rowNum),, +DefineEngineMethod( GuiTextListCtrl, setSelectedRow, void, (S32 rowNum),, "@briefSelects the specified row.\n\n" "@param rowNum Row number to set selected.\n" "@tsexample\n" @@ -584,7 +584,7 @@ DefineEngineMethod( GuiTextListCtrl, clearSelection, void, (),, object->setSelectedCell(Point2I(-1, -1)); } -DefineEngineMethod( GuiTextListCtrl, addRow, S32, (int id, const char* text, int index),(0,"",-1), +DefineEngineMethod( GuiTextListCtrl, addRow, S32, (S32 id, const char* text, S32 index),(0,"",-1), "@brief Adds a new row at end of the list with the defined id and text.\n" "If index is used, then the new row is inserted at the row location of 'index'.\n\n" "@param id Id of the new row.\n" @@ -612,7 +612,7 @@ DefineEngineMethod( GuiTextListCtrl, addRow, S32, (int id, const char* text, int return ret; } -DefineEngineMethod( GuiTextListCtrl, setRowById, void, (int id, const char* text),, +DefineEngineMethod( GuiTextListCtrl, setRowById, void, (S32 id, const char* text),, "@brief Sets the text at the defined id.\n\n" "@param id Id to change.\n" "@param text Text to use at the Id.\n" @@ -629,7 +629,7 @@ DefineEngineMethod( GuiTextListCtrl, setRowById, void, (int id, const char* text object->setEntry(id, text); } -DefineEngineMethod( GuiTextListCtrl, sort, void, ( int columnId, bool increasing ), ( true ), +DefineEngineMethod( GuiTextListCtrl, sort, void, ( S32 columnId, bool increasing ), ( true ), "@brief Performs a standard (alphabetical) sort on the values in the specified column.\n\n" "@param columnId Column ID to perform the sort on.\n" "@param increasing If false, sort will be performed in reverse.\n" @@ -646,7 +646,7 @@ DefineEngineMethod( GuiTextListCtrl, sort, void, ( int columnId, bool increasing object->sort( columnId, increasing ); } -DefineEngineMethod( GuiTextListCtrl, sortNumerical, void, (int columnID, bool increasing), ( true ), +DefineEngineMethod( GuiTextListCtrl, sortNumerical, void, (S32 columnID, bool increasing), ( true ), "@brief Perform a numerical sort on the values in the specified column.\n\n" "Detailed description\n\n" "@param columnId Column ID to perform the sort on.\n" @@ -687,7 +687,7 @@ DefineEngineMethod( GuiTextListCtrl, rowCount, S32, (),, return object->getNumEntries(); } -DefineEngineMethod( GuiTextListCtrl, getRowId, S32, (int index),, +DefineEngineMethod( GuiTextListCtrl, getRowId, S32, (S32 index),, "@brief Get the row ID for an index.\n\n" "@param index Index to get the RowID at\n" "@tsexample\n" @@ -705,7 +705,7 @@ DefineEngineMethod( GuiTextListCtrl, getRowId, S32, (int index),, return object->mList[index].id; } -DefineEngineMethod( GuiTextListCtrl, getRowTextById, const char*, (int id),, +DefineEngineMethod( GuiTextListCtrl, getRowTextById, const char*, (S32 id),, "@brief Get the text of a row with the specified id.\n\n" "@tsexample\n" "// Define the id\n" @@ -722,7 +722,7 @@ DefineEngineMethod( GuiTextListCtrl, getRowTextById, const char*, (int id),, return object->mList[index].text; } -DefineEngineMethod( GuiTextListCtrl, getRowNumById, S32, (int id),, +DefineEngineMethod( GuiTextListCtrl, getRowNumById, S32, (S32 id),, "@brief Get the row number for a specified id.\n\n" "@param id Id to get the row number at\n" "@tsexample\n" @@ -739,7 +739,7 @@ DefineEngineMethod( GuiTextListCtrl, getRowNumById, S32, (int id),, return index; } -DefineEngineMethod( GuiTextListCtrl, getRowText, const char*, (int index),, +DefineEngineMethod( GuiTextListCtrl, getRowText, const char*, (S32 index),, "@brief Get the text of the row with the specified index.\n\n" "@param index Row index to acquire the text at.\n" "@tsexample\n" @@ -756,7 +756,7 @@ DefineEngineMethod( GuiTextListCtrl, getRowText, const char*, (int index),, return object->mList[index].text; } -DefineEngineMethod( GuiTextListCtrl, removeRowById, void, (int id),, +DefineEngineMethod( GuiTextListCtrl, removeRowById, void, (S32 id),, "@brief Remove row with the specified id.\n\n" "@param id Id to remove the row entry at\n" "@tsexample\n" @@ -770,7 +770,7 @@ DefineEngineMethod( GuiTextListCtrl, removeRowById, void, (int id),, object->removeEntry(id); } -DefineEngineMethod( GuiTextListCtrl, removeRow, void, (int index),, +DefineEngineMethod( GuiTextListCtrl, removeRow, void, (S32 index),, "@brief Remove a row from the table, based on its index.\n\n" "@param index Row index to remove from the list.\n" "@tsexample\n" @@ -784,7 +784,7 @@ DefineEngineMethod( GuiTextListCtrl, removeRow, void, (int index),, object->removeEntryByIndex(index); } -DefineEngineMethod( GuiTextListCtrl, scrollVisible, void, (int rowNum),, +DefineEngineMethod( GuiTextListCtrl, scrollVisible, void, (S32 rowNum),, "@brief Scroll so the specified row is visible\n\n" "@param rowNum Row number to make visible\n" "@tsexample\n" @@ -813,7 +813,7 @@ DefineEngineMethod( GuiTextListCtrl, findTextIndex, S32, (const char* needle),, return( object->findEntryByText(needle) ); } -DefineEngineMethod( GuiTextListCtrl, setRowActive, void, (int rowNum, bool active),, +DefineEngineMethod( GuiTextListCtrl, setRowActive, void, (S32 rowNum, bool active),, "@brief Mark a specified row as active/not.\n\n" "@param rowNum Row number to change the active state.\n" "@param active Boolean active state to set the row number.\n" @@ -830,7 +830,7 @@ DefineEngineMethod( GuiTextListCtrl, setRowActive, void, (int rowNum, bool activ object->setEntryActive( U32( rowNum ), active ); } -DefineEngineMethod( GuiTextListCtrl, isRowActive, bool, (int rowNum),, +DefineEngineMethod( GuiTextListCtrl, isRowActive, bool, (S32 rowNum),, "@brief Check if the specified row is currently active or not.\n\n" "@param rowNum Row number to check the active state.\n" "@tsexample\n" diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index b6d2c99de..29d5fbaa7 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -4920,7 +4920,7 @@ ConsoleMethod( GuiTreeViewCtrl, open, void, 3, 4, "(SimSet obj, bool okToEdit=tr ConsoleMethod( GuiTreeViewCtrl, setItemTooltip, void, 4, 4, "( int id, string text ) - Set the tooltip to show for the given item." ) { - int id = dAtoi( argv[ 2 ] ); + S32 id = dAtoi( argv[ 2 ] ); GuiTreeViewCtrl::Item* item = object->getItem( id ); if( !item ) @@ -4934,7 +4934,7 @@ ConsoleMethod( GuiTreeViewCtrl, setItemTooltip, void, 4, 4, "( int id, string te ConsoleMethod( GuiTreeViewCtrl, setItemImages, void, 5, 5, "( int id, int normalImage, int expandedImage ) - Sets the normal and expanded images to show for the given item." ) { - int id = dAtoi( argv[ 2 ] ); + S32 id = dAtoi( argv[ 2 ] ); GuiTreeViewCtrl::Item* item = object->getItem( id ); if( !item ) @@ -4949,7 +4949,7 @@ ConsoleMethod( GuiTreeViewCtrl, setItemImages, void, 5, 5, "( int id, int normal ConsoleMethod( GuiTreeViewCtrl, isParentItem, bool, 3, 3, "( int id ) - Returns true if the given item contains child items." ) { - int id = dAtoi( argv[ 2 ] ); + S32 id = dAtoi( argv[ 2 ] ); if( !id && object->getItemCount() ) return true; @@ -5065,7 +5065,7 @@ ConsoleMethod(GuiTreeViewCtrl, getSelectedObjectList, const char*, 2, 2, dSprintf(buff,1024,""); const Vector< GuiTreeViewCtrl::Item* > selectedItems = object->getSelectedItems(); - for(int i = 0; i < selectedItems.size(); i++) + for(S32 i = 0; i < selectedItems.size(); i++) { GuiTreeViewCtrl::Item *item = selectedItems[i]; @@ -5130,7 +5130,7 @@ ConsoleMethod(GuiTreeViewCtrl, getSelectedItemList,const char*, 2,2,"returns a s dSprintf(buff,1024,""); const Vector< S32 >& selected = object->getSelected(); - for(int i = 0; i < selected.size(); i++) + for(S32 i = 0; i < selected.size(); i++) { S32 id = selected[i]; //get the current length of the buffer diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index 65792e81b..cbef4673c 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -1561,7 +1561,7 @@ void GuiCanvas::setupFences() mFences = new GFXFence*[mNumFences]; // Allocate the new fences - for( int i = 0; i < mNumFences; i++ ) + for( S32 i = 0; i < mNumFences; i++ ) mFences[i] = GFX->createFence(); } diff --git a/Engine/source/gui/editor/guiEaseViewCtrl.cpp b/Engine/source/gui/editor/guiEaseViewCtrl.cpp index 87dff9d5e..59713b682 100644 --- a/Engine/source/gui/editor/guiEaseViewCtrl.cpp +++ b/Engine/source/gui/editor/guiEaseViewCtrl.cpp @@ -97,7 +97,7 @@ void GuiEaseViewCtrl::onRender(Point2I offset, const RectI &updateRect) // Draw curve. - for( int i = 1; i <= numPoints; ++ i ) + for( S32 i = 1; i <= numPoints; ++ i ) { F32 x = ( F32 ) i / ( F32 ) numPoints; F32 y = mEase.getValue( x, 0, 1, 1 ); diff --git a/Engine/source/gui/editor/guiGraphCtrl.cpp b/Engine/source/gui/editor/guiGraphCtrl.cpp index f056bb44d..eccd6ed27 100644 --- a/Engine/source/gui/editor/guiGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiGraphCtrl.cpp @@ -274,7 +274,7 @@ void GuiGraphCtrl::addDatum(S32 plotID, F32 v) //----------------------------------------------------------------------------- -float GuiGraphCtrl::getDatum( int plotID, int sample) +float GuiGraphCtrl::getDatum( S32 plotID, S32 sample) { AssertFatal(plotID > -1 && plotID < MaxPlots, "Invalid plot specified!"); AssertFatal(sample > -1 && sample < MaxDataPoints, "Invalid sample specified!"); diff --git a/Engine/source/gui/editor/guiImageList.cpp b/Engine/source/gui/editor/guiImageList.cpp index 18cb973ed..c51f715b6 100644 --- a/Engine/source/gui/editor/guiImageList.cpp +++ b/Engine/source/gui/editor/guiImageList.cpp @@ -182,7 +182,7 @@ DefineEngineMethod( GuiImageList, count, S32, (),, return object->Count(); } -DefineEngineMethod( GuiImageList, remove, bool, (int index),, +DefineEngineMethod( GuiImageList, remove, bool, (S32 index),, "@brief Removes an image from the list by index.\n\n" "@param index Image index to remove.\n" "@tsexample\n" diff --git a/Engine/source/gui/editor/guiMenuBar.cpp b/Engine/source/gui/editor/guiMenuBar.cpp index c2bdbb6a7..c8abfe72f 100644 --- a/Engine/source/gui/editor/guiMenuBar.cpp +++ b/Engine/source/gui/editor/guiMenuBar.cpp @@ -193,7 +193,7 @@ DefineEngineMethod( GuiMenuBar, setMenuMargins, void, (S32 horizontalMargin, S32 object->mBitmapMargin = bitmapToTextSpacing; } -DefineEngineMethod(GuiMenuBar, addMenu, void, (const char* menuText, int menuId),, +DefineEngineMethod(GuiMenuBar, addMenu, void, (const char* menuText, S32 menuId),, "@brief Adds a new menu to the menu bar.\n\n" "@param menuText Text to display for the new menu item.\n" "@param menuId ID for the new menu item.\n" @@ -215,7 +215,7 @@ DefineEngineMethod(GuiMenuBar, addMenu, void, (const char* menuText, int menuId) object->addMenu(menuText, menuId); } -DefineEngineMethod(GuiMenuBar, addMenuItem, void, (const char* targetMenu, const char* menuItemText, int menuItemId, const char* accelerator, int checkGroup), +DefineEngineMethod(GuiMenuBar, addMenuItem, void, (const char* targetMenu, const char* menuItemText, S32 menuItemId, const char* accelerator, int checkGroup), ("","",0,NULL,-1), "@brief Adds a menu item to the specified menu. The menu argument can be either the text of a menu or its id.\n\n" "@param menu Menu name or menu Id to add the new item to.\n" @@ -496,7 +496,7 @@ DefineEngineMethod(GuiMenuBar, setMenuItemVisible, void, (const char* menuTarget menuItem->visible = isVisible; } -DefineEngineMethod(GuiMenuBar, setMenuItemBitmap, void, (const char* menuTarget, const char* menuItemTarget, int bitmapIndex),, +DefineEngineMethod(GuiMenuBar, setMenuItemBitmap, void, (const char* menuTarget, const char* menuItemTarget, S32 bitmapIndex),, "@brief Sets the specified menu item bitmap index in the bitmap array. Setting the item's index to -1 will remove any bitmap.\n\n" "@param menuTarget Menu to affect the menuItem in\n" "@param menuItem Menu item to affect\n" diff --git a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp index 37cc0365e..2bfbbf467 100644 --- a/Engine/source/gui/editor/guiParticleGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiParticleGraphCtrl.cpp @@ -40,7 +40,7 @@ ConsoleDocClass( GuiParticleGraphCtrl, GuiParticleGraphCtrl::GuiParticleGraphCtrl() { - for(int i = 0; i < MaxPlots; i++) + for(S32 i = 0; i < MaxPlots; i++) { mPlots[i].mGraphColor = ColorF(1.0, 1.0, 1.0); VECTOR_SET_ASSOCIATION(mPlots[i].mGraphData); @@ -140,7 +140,7 @@ void GuiParticleGraphCtrl::onRender(Point2I offset, const RectI &updateRect) ColorF color(1.0f, 1.0f, 1.0f, 0.5f); pDrawUtil->drawRectFill(updateRect, color); - for (int k = 0; k < MaxPlots; k++) + for (S32 k = 0; k < MaxPlots; k++) { // Nothing to graph if ((mPlots[k].mGraphData.size() == 0) || (mPlots[k].mHidden == true)) diff --git a/Engine/source/gui/editor/guiShapeEdPreview.cpp b/Engine/source/gui/editor/guiShapeEdPreview.cpp index 128266f6d..098ff38f3 100644 --- a/Engine/source/gui/editor/guiShapeEdPreview.cpp +++ b/Engine/source/gui/editor/guiShapeEdPreview.cpp @@ -42,7 +42,7 @@ static const F32 sMoveScaler = 50.0f; static const F32 sZoomScaler = 200.0f; -static const int sNodeRectSize = 16; +static const S32 sNodeRectSize = 16; IMPLEMENT_CONOBJECT( GuiShapeEdPreview ); diff --git a/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp b/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp index 641f629cb..899bc9d7d 100644 --- a/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp @@ -126,10 +126,10 @@ public: float xdone = ((float)getExtent().x/(float)texture->mBitmapSize.x)+1; float ydone = ((float)getExtent().y/(float)texture->mBitmapSize.y)+1; - int xshift = mStartPoint.x%texture->mBitmapSize.x; - int yshift = mStartPoint.y%texture->mBitmapSize.y; - for(int y = 0; y < ydone; ++y) - for(int x = 0; x < xdone; ++x) + S32 xshift = mStartPoint.x%texture->mBitmapSize.x; + S32 yshift = mStartPoint.y%texture->mBitmapSize.y; + for(S32 y = 0; y < ydone; ++y) + for(S32 x = 0; x < xdone; ++x) { srcRegion.set(0,0,texture->mBitmapSize.x,texture->mBitmapSize.y); dstRegion.set( ((texture->mBitmapSize.x*x)+offset.x)-xshift, diff --git a/Engine/source/gui/worldEditor/editTSCtrl.cpp b/Engine/source/gui/worldEditor/editTSCtrl.cpp index 123362123..7781525c6 100644 --- a/Engine/source/gui/worldEditor/editTSCtrl.cpp +++ b/Engine/source/gui/worldEditor/editTSCtrl.cpp @@ -1298,7 +1298,7 @@ DefineEngineMethod( EditTSCtrl, renderCircle, void, ( Point3F pos, Point3F norma PrimBuild::begin( GFXLineStrip, points.size() + 1 ); - for( int i = 0; i < points.size(); i++ ) + for( S32 i = 0; i < points.size(); i++ ) PrimBuild::vertex3fv( points[i] ); // GFX does not have a LineLoop primitive, so connect the last line @@ -1321,7 +1321,7 @@ DefineEngineMethod( EditTSCtrl, renderCircle, void, ( Point3F pos, Point3F norma PrimBuild::vertex3fv( pos ); // Edge verts - for( int i = 0; i < points.size(); i++ ) + for( S32 i = 0; i < points.size(); i++ ) PrimBuild::vertex3fv( points[i] ); PrimBuild::vertex3fv( points[0] ); diff --git a/Engine/source/lighting/advanced/advancedLightManager.cpp b/Engine/source/lighting/advanced/advancedLightManager.cpp index 9a911acfb..7034545d7 100644 --- a/Engine/source/lighting/advanced/advancedLightManager.cpp +++ b/Engine/source/lighting/advanced/advancedLightManager.cpp @@ -606,7 +606,7 @@ GFXVertexBufferHandle AdvancedLightManager::g mConeIndices.lock( &idx ); // Build the cone U32 idxIdx = 0; - for( int i = 1; i < numPoints + 1; i++ ) + for( U32 i = 1; i < numPoints + 1; i++ ) { idx[idxIdx++] = 0; // Triangles on cone start at top point idx[idxIdx++] = i; @@ -614,7 +614,7 @@ GFXVertexBufferHandle AdvancedLightManager::g } // Build the bottom of the cone (reverse winding order) - for( int i = 1; i < numPoints - 1; i++ ) + for( U32 i = 1; i < numPoints - 1; i++ ) { idx[idxIdx++] = 1; idx[idxIdx++] = i + 2; diff --git a/Engine/source/lighting/common/sceneLighting.cpp b/Engine/source/lighting/common/sceneLighting.cpp index f542753ab..aa62782f8 100644 --- a/Engine/source/lighting/common/sceneLighting.cpp +++ b/Engine/source/lighting/common/sceneLighting.cpp @@ -859,7 +859,7 @@ struct CacheEntry { }; // object list sort methods: want list in reverse -static int QSORT_CALLBACK minSizeSort(const void * p1, const void * p2) +static S32 QSORT_CALLBACK minSizeSort(const void * p1, const void * p2) { const CacheEntry * entry1 = (const CacheEntry *)p1; const CacheEntry * entry2 = (const CacheEntry *)p2; @@ -867,7 +867,7 @@ static int QSORT_CALLBACK minSizeSort(const void * p1, const void * p2) return(entry2->mFileObject->getSize() - entry1->mFileObject->getSize()); } -static int QSORT_CALLBACK maxSizeSort(const void * p1, const void * p2) +static S32 QSORT_CALLBACK maxSizeSort(const void * p1, const void * p2) { const CacheEntry * entry1 = (const CacheEntry *)p1; const CacheEntry * entry2 = (const CacheEntry *)p2; @@ -875,7 +875,7 @@ static int QSORT_CALLBACK maxSizeSort(const void * p1, const void * p2) return(entry1->mFileObject->getSize() - entry2->mFileObject->getSize()); } -static int QSORT_CALLBACK lastCreatedSort(const void * p1, const void * p2) +static S32 QSORT_CALLBACK lastCreatedSort(const void * p1, const void * p2) { const CacheEntry * entry1 = (const CacheEntry *)p1; const CacheEntry * entry2 = (const CacheEntry *)p2; @@ -899,7 +899,7 @@ static int QSORT_CALLBACK lastCreatedSort(const void * p1, const void * p2) return(Platform::compareFileTimes(create[1], create[0])); } -static int QSORT_CALLBACK lastModifiedSort(const void * p1, const void * p2) +static S32 QSORT_CALLBACK lastModifiedSort(const void * p1, const void * p2) { const CacheEntry * entry1 = (const CacheEntry *)p1; const CacheEntry * entry2 = (const CacheEntry *)p2; @@ -1051,7 +1051,7 @@ U32 SceneLighting::calcMissionCRC() // of U32's, and so the result will be different on big/little endian hardware. // To fix this, swap endians on the CRC's in the vector. This must be done // _after_ the qsort. - for( int i = 0; i < crc.size(); i++ ) + for( S32 i = 0; i < crc.size(); i++ ) crc[i] = endianSwap( crc[i] ); #endif diff --git a/Engine/source/lighting/shadowMap/pssmLightShadowMap.h b/Engine/source/lighting/shadowMap/pssmLightShadowMap.h index 8ced7b875..d2fffde8e 100644 --- a/Engine/source/lighting/shadowMap/pssmLightShadowMap.h +++ b/Engine/source/lighting/shadowMap/pssmLightShadowMap.h @@ -58,7 +58,7 @@ protected: Box3F _calcClipSpaceAABB(const Frustum& f, const MatrixF& transform, F32 farDist); void _roundProjection(const MatrixF& lightMat, const MatrixF& cropMatrix, Point3F &offset, U32 splitNum); - static const int MAX_SPLITS = 4; + static const S32 MAX_SPLITS = 4; U32 mNumSplits; F32 mSplitDist[MAX_SPLITS+1]; // +1 because we store a cap RectI mViewports[MAX_SPLITS]; diff --git a/Engine/source/math/mBox.cpp b/Engine/source/math/mBox.cpp index 2cdd730e3..c37e091c3 100644 --- a/Engine/source/math/mBox.cpp +++ b/Engine/source/math/mBox.cpp @@ -61,7 +61,7 @@ bool Box3F::collideLine(const Point3F& start, const Point3F& end, F32* t, Point3 static const Point3F na[3] = { Point3F(1.0f, 0.0f, 0.0f), Point3F(0.0f, 1.0f, 0.0f), Point3F(0.0f, 0.0f, 1.0f) }; Point3F finalNormal(0.0f, 0.0f, 0.0f); - for (int i = 0; i < 3; i++) { + for (S32 i = 0; i < 3; i++) { bool n_neg = false; if (si[i] < ei[i]) { if (si[i] > bmax[i] || ei[i] < bmin[i]) diff --git a/Engine/source/math/mPolyhedron.h b/Engine/source/math/mPolyhedron.h index 00723466f..dbb874817 100644 --- a/Engine/source/math/mPolyhedron.h +++ b/Engine/source/math/mPolyhedron.h @@ -229,7 +229,7 @@ struct PolyhedronUnmanagedVectorData : public PolyhedronData }; /// Polyhedron data stored in fixed size arrays. -template< int NUM_PLANES, int NUM_POINTS, int NUM_EDGES > +template< S32 NUM_PLANES, S32 NUM_POINTS, S32 NUM_EDGES > struct PolyhedronFixedVectorData : public PolyhedronData { typedef FixedSizeVector< PlaneF, NUM_PLANES > PlaneListType; @@ -479,7 +479,7 @@ inline PolyhedronVectorData::operator AnyPolyhedron() const //----------------------------------------------------------------------------- -template< int NUM_PLANES, int NUM_POINTS, int NUM_EDGES > +template< S32 NUM_PLANES, S32 NUM_POINTS, S32 NUM_EDGES > inline PolyhedronFixedVectorData< NUM_PLANES, NUM_POINTS, NUM_EDGES >::operator AnyPolyhedron() const { return AnyPolyhedron( diff --git a/Engine/source/math/mQuadPatch.cpp b/Engine/source/math/mQuadPatch.cpp index 24e67dd33..efb300e0b 100644 --- a/Engine/source/math/mQuadPatch.cpp +++ b/Engine/source/math/mQuadPatch.cpp @@ -52,7 +52,7 @@ void QuadPatch::submitControlPoints( SplCtrlPts &points ) //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ -void QuadPatch::setControlPoint( Point3F &point, int index ) +void QuadPatch::setControlPoint( Point3F &point, S32 index ) { ( (SplCtrlPts*) getControlPoints() )->setPoint( point, index ); calcABC( getControlPoint(0) ); diff --git a/Engine/source/math/mQuadPatch.h b/Engine/source/math/mQuadPatch.h index 22dcb1ffc..d579ca367 100644 --- a/Engine/source/math/mQuadPatch.h +++ b/Engine/source/math/mQuadPatch.h @@ -51,7 +51,7 @@ public: virtual void calc( F32 t, Point3F &result ); virtual void calc( Point3F *points, F32 t, Point3F &result ); - virtual void setControlPoint( Point3F &point, int index ); + virtual void setControlPoint( Point3F &point, S32 index ); virtual void submitControlPoints( SplCtrlPts &points ); diff --git a/Engine/source/math/mQuat.h b/Engine/source/math/mQuat.h index 34cae7e84..433b30155 100644 --- a/Engine/source/math/mQuat.h +++ b/Engine/source/math/mQuat.h @@ -55,8 +55,8 @@ public: QuatF& set( const AngAxisF & a ); QuatF& set( const EulerF & e ); - int operator ==( const QuatF & c ) const; - int operator !=( const QuatF & c ) const; + S32 operator ==( const QuatF & c ) const; + S32 operator !=( const QuatF & c ) const; QuatF& operator *=( const QuatF & c ); QuatF& operator /=( const QuatF & c ); QuatF& operator +=( const QuatF & c ); @@ -75,7 +75,7 @@ public: QuatF& normalize(); QuatF& inverse(); QuatF& identity(); - int isIdentity() const; + S32 isIdentity() const; QuatF& slerp( const QuatF & q, F32 t ); QuatF& extrapolate( const QuatF & q1, const QuatF & q2, F32 t ); QuatF& interpolate( const QuatF & q1, const QuatF & q2, F32 t ); diff --git a/Engine/source/math/mSplinePatch.cpp b/Engine/source/math/mSplinePatch.cpp index 467feb9df..9d52c5150 100644 --- a/Engine/source/math/mSplinePatch.cpp +++ b/Engine/source/math/mSplinePatch.cpp @@ -68,7 +68,7 @@ void SplCtrlPts::submitPoints( Point3F *pts, U32 num ) { mPoints.clear(); - for( int i=0; i void dCopyArray(T *dst, const S *src, dsize_t size) extern void* dMemcpy(void *dst, const void *src, dsize_t size); extern void* dMemmove(void *dst, const void *src, dsize_t size); -extern void* dMemset(void *dst, int c, dsize_t size); -extern int dMemcmp(const void *ptr1, const void *ptr2, dsize_t size); +extern void* dMemset(void *dst, S32 c, dsize_t size); +extern S32 dMemcmp(const void *ptr1, const void *ptr2, dsize_t size); // Special case of the above function when the arrays are the same type (use memcpy) template void dCopyArray(T *dst, const T *src, dsize_t size) @@ -565,8 +565,8 @@ enum DFILE_STATUS extern FILE_HANDLE dOpenFileRead(const char *name, DFILE_STATUS &error); extern FILE_HANDLE dOpenFileReadWrite(const char *name, bool append, DFILE_STATUS &error); -extern int dFileRead(FILE_HANDLE handle, U32 bytes, char *dst, DFILE_STATUS &error); -extern int dFileWrite(FILE_HANDLE handle, U32 bytes, const char *dst, DFILE_STATUS &error); +extern S32 dFileRead(FILE_HANDLE handle, U32 bytes, char *dst, DFILE_STATUS &error); +extern S32 dFileWrite(FILE_HANDLE handle, U32 bytes, const char *dst, DFILE_STATUS &error); extern void dFileClose(FILE_HANDLE handle); extern StringTableEntry osGetTemporaryDirectory(); diff --git a/Engine/source/platform/platformCPUCount.cpp b/Engine/source/platform/platformCPUCount.cpp index 116251e08..237c31551 100644 --- a/Engine/source/platform/platformCPUCount.cpp +++ b/Engine/source/platform/platformCPUCount.cpp @@ -80,13 +80,13 @@ namespace CPUInfo { #ifndef TORQUE_OS_MAC - static unsigned int CpuIDSupported(void); - static unsigned int find_maskwidth(unsigned int); - static unsigned int HWD_MTSupported(void); - static unsigned int MaxLogicalProcPerPhysicalProc(void); - static unsigned int MaxCorePerPhysicalProc(void); - static unsigned char GetAPIC_ID(void); - static unsigned char GetNzbSubID(unsigned char, unsigned char, unsigned char); + static U32 CpuIDSupported(void); + static U32 find_maskwidth(unsigned int); + static U32 HWD_MTSupported(void); + static U32 MaxLogicalProcPerPhysicalProc(void); + static U32 MaxCorePerPhysicalProc(void); + static U8 GetAPIC_ID(void); + static U8 GetNzbSubID(U8, U8, U8); #endif static char g_s3Levels[2048]; @@ -97,9 +97,9 @@ namespace CPUInfo { // CpuIDSupported will return 0 if CPUID instruction is unavailable. Otherwise, it will return // the maximum supported standard function. // - static unsigned int CpuIDSupported(void) + static U32 CpuIDSupported(void) { - unsigned int MaxInputValue; + U32 MaxInputValue; // If CPUID instruction is supported #ifdef TORQUE_COMPILER_GCC try @@ -153,12 +153,12 @@ namespace CPUInfo { // maximum value. // - static unsigned int MaxCorePerPhysicalProc(void) + static U32 MaxCorePerPhysicalProc(void) { - unsigned int Regeax = 0; + U32 Regeax = 0; - if (!HWD_MTSupported()) return (unsigned int) 1; // Single core + if (!HWD_MTSupported()) return (U32) 1; // Single core #ifdef TORQUE_COMPILER_GCC { asm @@ -209,7 +209,7 @@ multi_core: #else # error Not implemented. #endif - return (unsigned int)((Regeax & NUM_CORE_BITS) >> 26)+1; + return (U32)((Regeax & NUM_CORE_BITS) >> 26)+1; } @@ -218,11 +218,11 @@ multi_core: // // The function returns 0 when the hardware multi-threaded bit is not set. // - static unsigned int HWD_MTSupported(void) + static U32 HWD_MTSupported(void) { - unsigned int Regedx = 0; + U32 Regedx = 0; if ((CpuIDSupported() >= 1)) @@ -262,12 +262,12 @@ multi_core: // AVAILABLE logical processors per physical to be used by an application might be less than this // maximum value. // - static unsigned int MaxLogicalProcPerPhysicalProc(void) + static U32 MaxLogicalProcPerPhysicalProc(void) { - unsigned int Regebx = 0; + U32 Regebx = 0; - if (!HWD_MTSupported()) return (unsigned int) 1; + if (!HWD_MTSupported()) return (U32) 1; #ifdef TORQUE_COMPILER_GCC asm ( @@ -292,10 +292,10 @@ multi_core: } - static unsigned char GetAPIC_ID(void) + static U8 GetAPIC_ID(void) { - unsigned int Regebx = 0; + U32 Regebx = 0; #ifdef TORQUE_COMPILER_GCC asm ( @@ -324,9 +324,9 @@ multi_core: // // Determine the width of the bit field that can represent the value count_item. // - unsigned int find_maskwidth(unsigned int CountItem) + U32 find_maskwidth(U32 CountItem) { - unsigned int MaskWidth, + U32 MaskWidth, count = CountItem; #ifdef TORQUE_COMPILER_GCC asm @@ -392,16 +392,16 @@ next: // // Extract the subset of bit field from the 8-bit value FullID. It returns the 8-bit sub ID value // - static unsigned char GetNzbSubID(unsigned char FullID, - unsigned char MaxSubIDValue, - unsigned char ShiftCount) + static U8 GetNzbSubID(U8 FullID, + U8 MaxSubIDValue, + U8 ShiftCount) { - unsigned int MaskWidth; - unsigned char MaskBits; + U32 MaskWidth; + U8 MaskBits; - MaskWidth = find_maskwidth((unsigned int) MaxSubIDValue); + MaskWidth = find_maskwidth((U32) MaxSubIDValue); MaskBits = (0xff << ShiftCount) ^ - ((unsigned char) (0xff << (ShiftCount + MaskWidth))); + ((U8) (0xff << (ShiftCount + MaskWidth))); return (FullID & MaskBits); } @@ -420,8 +420,8 @@ next: TotAvailCore = 1; PhysicalNum = 1; - unsigned int numLPEnabled = 0; - int MaxLPPerCore = 1; + U32 numLPEnabled = 0; + S32 MaxLPPerCore = 1; #ifdef TORQUE_OS_MAC @@ -430,8 +430,8 @@ next: // like there isn't a way to do this that's working across all OSX incarnations // and machine configurations anyway. - int numCPUs; - int numPackages; + S32 numCPUs; + S32 numPackages; // Get the number of CPUs. @@ -450,9 +450,9 @@ next: #else U32 dwAffinityMask; - int j = 0; - unsigned char apicID, PackageIDMask; - unsigned char tblPkgID[256], tblCoreID[256], tblSMTID[256]; + S32 j = 0; + U8 apicID, PackageIDMask; + U8 tblPkgID[256], tblCoreID[256], tblSMTID[256]; char tmp[256]; #ifdef TORQUE_OS_LINUX @@ -464,14 +464,14 @@ next: // Linux doesn't easily allow us to look at the Affinity Bitmask directly, // but it does provide an API to test affinity maskbits of the current process // against each logical processor visible under OS. - int sysNumProcs = sysconf(_SC_NPROCESSORS_CONF); //This will tell us how many + S32 sysNumProcs = sysconf(_SC_NPROCESSORS_CONF); //This will tell us how many //CPUs are currently enabled. //this will tell us which processors this process can run on. cpu_set_t allowedCPUs; sched_getaffinity(0, sizeof(allowedCPUs), &allowedCPUs); - for (int i = 0; i < sysNumProcs; i++ ) + for (S32 i = 0; i < sysNumProcs; i++ ) { if ( CPU_ISSET(i, &allowedCPUs) == 0 ) return CONFIG_UserConfigIssue; @@ -522,8 +522,8 @@ next: // processors per core tblSMTID[j] = GetNzbSubID(apicID, MaxLPPerCore, 0); - unsigned char maxCorePPP = MaxCorePerPhysicalProc(); - unsigned char maskWidth = find_maskwidth(MaxLPPerCore); + U8 maxCorePPP = MaxCorePerPhysicalProc(); + U8 maskWidth = find_maskwidth(MaxLPPerCore); tblCoreID[j] = GetNzbSubID(apicID, maxCorePPP, maskWidth); // Extract package ID, assume single cluster. @@ -560,9 +560,9 @@ next: // // Count available cores (TotAvailCore) in the system // - unsigned char CoreIDBucket[256]; + U8 CoreIDBucket[256]; DWORD ProcessorMask, pCoreMask[256]; - unsigned int i, ProcessorNum; + U32 i, ProcessorNum; CoreIDBucket[0] = tblPkgID[0] | tblCoreID[0]; ProcessorMask = 1; @@ -598,7 +598,7 @@ next: // // Count physical processor (PhysicalNum) in the system // - unsigned char PackageIDBucket[256]; + U8 PackageIDBucket[256]; DWORD pPackageMask[256]; PackageIDBucket[0] = tblPkgID[0]; diff --git a/Engine/source/platform/platformMemory.cpp b/Engine/source/platform/platformMemory.cpp index 925a15422..1c2cbfcd1 100644 --- a/Engine/source/platform/platformMemory.cpp +++ b/Engine/source/platform/platformMemory.cpp @@ -367,7 +367,7 @@ static U32 validateTreeRecurse(TreeNode *tree) if(tree == NIL) return 1; // check my left tree - int lcount, rcount, nc = 0; + S32 lcount, rcount, nc = 0; if(tree->color == Red) { @@ -1588,7 +1588,7 @@ dsize_t getMemoryUsed() } #ifdef TORQUE_DEBUG_GUARD -DefineEngineFunction( dumpAlloc, void, ( int allocNum ),, +DefineEngineFunction( dumpAlloc, void, ( S32 allocNum ),, "@brief Dumps information about the given allocated memory block.\n\n" "@param allocNum Memory block to dump information about." "@note Available in debug builds only. " diff --git a/Engine/source/platform/platformNet.cpp b/Engine/source/platform/platformNet.cpp index 786fcf62d..f14f96596 100644 --- a/Engine/source/platform/platformNet.cpp +++ b/Engine/source/platform/platformNet.cpp @@ -30,7 +30,7 @@ #define EINPROGRESS WSAEINPROGRESS #define ioctl ioctlsocket -typedef int socklen_t; +typedef S32 socklen_t; #elif defined ( TORQUE_OS_MAC ) @@ -84,7 +84,7 @@ typedef in_addr IN_ADDR; #define TORQUE_USE_WINSOCK #define EINPROGRESS WSAEINPROGRESS #define ioctl ioctlsocket -typedef int socklen_t; +typedef S32 socklen_t; DWORD _getLastErrorAndClear() { @@ -99,7 +99,7 @@ DWORD _getLastErrorAndClear() #endif #if defined(TORQUE_USE_WINSOCK) -static const char* strerror_wsa( int code ) +static const char* strerror_wsa( S32 code ) { switch( code ) { @@ -137,7 +137,7 @@ static const char* strerror_wsa( int code ) static Net::Error getLastError(); static S32 defaultPort = 28000; static S32 netPort = 0; -static int udpSocket = InvalidSocket; +static S32 udpSocket = InvalidSocket; ConnectionNotifyEvent Net::smConnectionNotify; ConnectionAcceptedEvent Net::smConnectionAccept; @@ -441,7 +441,7 @@ void Net::closeConnectTo(NetSocket sock) return; // if this socket is in the list of polled sockets, remove it - for (int i = 0; i < gPolledSockets.size(); ++i) + for (S32 i = 0; i < gPolledSockets.size(); ++i) { if (gPolledSockets[i]->fd == sock) { @@ -454,7 +454,7 @@ void Net::closeConnectTo(NetSocket sock) closeSocket(sock); } -Net::Error Net::sendtoSocket(NetSocket socket, const U8 *buffer, int bufferSize) +Net::Error Net::sendtoSocket(NetSocket socket, const U8 *buffer, S32 bufferSize) { if(Journal::IsPlaying()) { @@ -480,7 +480,7 @@ bool Net::openPort(S32 port, bool doBind) // we turn off VDP in non-release builds because VDP does not support broadcast packets // which are required for LAN queries (PC->Xbox connectivity). The wire protocol still // uses the VDP packet structure, though. - int protocol = 0; + S32 protocol = 0; bool useVDP = false; #ifdef TORQUE_DISABLE_PC_CONNECTIVITY // Xbox uses a VDP (voice/data protocol) socket for networking @@ -617,7 +617,7 @@ void Net::process() sockaddr_in ipAddr; NetSocket incoming = InvalidSocket; char out_h_addr[1024]; - int out_h_length = 0; + S32 out_h_length = 0; RawData readBuff; for (S32 i = 0; i < gPolledSockets.size(); @@ -727,7 +727,7 @@ void Net::process() if(::connect(currentSock->fd, (struct sockaddr *)&ipAddr, sizeof(ipAddr)) == -1) { - int errorCode; + S32 errorCode; #if defined(TORQUE_USE_WINSOCK) errorCode = WSAGetLastError(); if( errorCode == WSAEINPROGRESS || errorCode == WSAEWOULDBLOCK ) @@ -786,7 +786,7 @@ void Net::process() NetSocket Net::openSocket() { - int retSocket; + S32 retSocket; retSocket = socket(AF_INET, SOCK_STREAM, 0); if(retSocket == InvalidSocket) @@ -831,7 +831,7 @@ NetSocket Net::accept(NetSocket acceptSocket, NetAddress *remoteAddress) sockaddr_in socketAddress; socklen_t addrLen = sizeof(socketAddress); - int retVal = ::accept(acceptSocket, (sockaddr *) &socketAddress, &addrLen); + S32 retVal = ::accept(acceptSocket, (sockaddr *) &socketAddress, &addrLen); if(retVal != InvalidSocket) { IPSocketToNetAddress(&socketAddress, remoteAddress); diff --git a/Engine/source/platform/platformNet.h b/Engine/source/platform/platformNet.h index b37558ebd..16a809927 100644 --- a/Engine/source/platform/platformNet.h +++ b/Engine/source/platform/platformNet.h @@ -31,14 +31,14 @@ #define MAXPACKETSIZE 1500 #endif -typedef int NetConnectionId; +typedef S32 NetConnectionId; /// Generic network address /// /// This is used to represent IP addresses. struct NetAddress { - int type; ///< Type of address (IPAddress currently) + S32 type; ///< Type of address (IPAddress currently) /// Acceptable NetAddress types. enum @@ -93,7 +93,7 @@ struct Net TCPProtocol }; - static const int MaxPacketDataSize = MAXPACKETSIZE; + static const S32 MaxPacketDataSize = MAXPACKETSIZE; static ConnectionNotifyEvent smConnectionNotify; static ConnectionAcceptedEvent smConnectionAccept; diff --git a/Engine/source/platform/platformNetAsync.cpp b/Engine/source/platform/platformNetAsync.cpp index 8f246d39f..e4f5923aa 100644 --- a/Engine/source/platform/platformNetAsync.cpp +++ b/Engine/source/platform/platformNetAsync.cpp @@ -48,7 +48,7 @@ struct NetAsync::NameLookupRequest NetSocket sock; char remoteAddr[4096]; char out_h_addr[4096]; - int out_h_length; + S32 out_h_length; bool complete; NameLookupRequest() @@ -140,7 +140,7 @@ void NetAsync::queueLookup(const char* remoteAddr, NetSocket socket) { // do we have it already? - unsigned int i = 0; + U32 i = 0; for (i = 0; i < mLookupRequests.size(); ++i) { if (mLookupRequests[i].sock == socket) @@ -160,7 +160,7 @@ void NetAsync::queueLookup(const char* remoteAddr, NetSocket socket) } bool NetAsync::checkLookup(NetSocket socket, char* out_h_addr, - int* out_h_length, int out_h_addr_size) + S32* out_h_length, S32 out_h_addr_size) { bool found = false; diff --git a/Engine/source/platform/platformNetAsync.h b/Engine/source/platform/platformNetAsync.h index ddeff56f3..dc59a1a87 100644 --- a/Engine/source/platform/platformNetAsync.h +++ b/Engine/source/platform/platformNetAsync.h @@ -54,7 +54,7 @@ class NetAsync // out_h_length will be set appropriately. if out_h_length is -1, then // name could not be resolved. otherwise, it provides the number of // address bytes copied into out_h_addr. - bool checkLookup(NetSocket socket, char* out_h_addr, int* out_h_length, int out_h_addr_size); + bool checkLookup(NetSocket socket, char* out_h_addr, int* out_h_length, S32 out_h_addr_size); }; // the global net async object diff --git a/Engine/source/platform/test/testThreading.cpp b/Engine/source/platform/test/testThreading.cpp index ede62a507..6eea80ee3 100644 --- a/Engine/source/platform/test/testThreading.cpp +++ b/Engine/source/platform/test/testThreading.cpp @@ -311,7 +311,7 @@ CreateUnitTest( SemaphoreWaitTest, "Platform/Threads/SemaphoreWaitTest") void *mMutex; U32 mDoneCount; - const static int csmThreadCount = 10; + const static S32 csmThreadCount = 10; void run() { @@ -381,7 +381,7 @@ CreateUnitTest( MutexWaitTest, "Platform/Threads/MutexWaitTest") void *mMutex; U32 mDoneCount; - const static int csmThreadCount = 10; + const static S32 csmThreadCount = 10; void run() { diff --git a/Engine/source/platformWin32/minidump/winMiniDump.cpp b/Engine/source/platformWin32/minidump/winMiniDump.cpp index fd1ad9ab2..fbe2b96f6 100644 --- a/Engine/source/platformWin32/minidump/winMiniDump.cpp +++ b/Engine/source/platformWin32/minidump/winMiniDump.cpp @@ -191,9 +191,9 @@ INT CreateMiniDump( LPEXCEPTION_POINTERS ExceptionInfo) //----------------------------------------------------------------------------------------------------------------------------------------- // MiniDumpDialogProc - Used By DisplayMiniDumpDialog //----------------------------------------------------------------------------------------------------------------------------------------- -const int ID_TEXT=200; -const int ID_USERTEXT=300; -const int ID_DONE=400; +const S32 ID_TEXT=200; +const S32 ID_USERTEXT=300; +const S32 ID_DONE=400; BOOL CALLBACK MiniDumpDialogProc(HWND hwndDlg, UINT message, WPARAM wParam, LPARAM lParam) { char text[128]= ""; @@ -259,7 +259,7 @@ LRESULT DisplayMiniDumpDialog(HINSTANCE hinst, HWND hwndOwner) *lpw++ = 0; // Predefined dialog box class (by default) LPWSTR lpwsz = (LPWSTR)lpw; - int nchar = 1 + MultiByteToWideChar(CP_ACP, 0, "MiniDump Crash Report", -1, lpwsz, 50); + S32 nchar = 1 + MultiByteToWideChar(CP_ACP, 0, "MiniDump Crash Report", -1, lpwsz, 50); lpw += nchar; //----------------------------------------------------------------- diff --git a/Engine/source/platformWin32/minidump/winStackWalker.cpp b/Engine/source/platformWin32/minidump/winStackWalker.cpp index a533aa97f..c4b72211d 100644 --- a/Engine/source/platformWin32/minidump/winStackWalker.cpp +++ b/Engine/source/platformWin32/minidump/winStackWalker.cpp @@ -48,7 +48,7 @@ #endif // Entry for each Callstack-Entry -const int STACKWALK_MAX_NAMELEN = 1024; // max name length for symbols +const S32 STACKWALK_MAX_NAMELEN = 1024; // max name length for symbols struct CallstackEntry { DWORD64 offset; // if 0, we have no valid entry @@ -393,7 +393,7 @@ bool StackWalker::ShowCallstack(HANDLE hThread, CONTEXT const & context, PReadPr IMAGEHLP_SYMBOL64 *pSym = NULL; IMAGEHLP_MODULE64 Module; IMAGEHLP_LINE64 Line; - int frameNum; + S32 frameNum; if (!m_modulesLoaded) LoadModules(); @@ -687,7 +687,7 @@ bool StackWalker::GetModuleListTH32(HANDLE hProcess, DWORD pid) return false; keepGoing = !!pM32F( hSnap, &me ); - int cnt = 0; + S32 cnt = 0; while (keepGoing) { this->LoadModule(hProcess, me.szExePath, me.szModule, (DWORD64) me.modBaseAddr, me.modBaseSize); @@ -715,7 +715,7 @@ bool StackWalker::GetModuleListPSAPI(HANDLE hProcess) char *tt = NULL; char *tt2 = NULL; const SIZE_T TTBUFLEN = 8096; - int cnt = 0; + S32 cnt = 0; hMods = (HMODULE*) malloc(sizeof(HMODULE) * (TTBUFLEN / sizeof HMODULE)); tt = (char*) malloc(sizeof(char) * TTBUFLEN); diff --git a/Engine/source/platformWin32/minidump/winStackWalker.h b/Engine/source/platformWin32/minidump/winStackWalker.h index d39219de4..a7341ace1 100644 --- a/Engine/source/platformWin32/minidump/winStackWalker.h +++ b/Engine/source/platformWin32/minidump/winStackWalker.h @@ -76,7 +76,7 @@ private: DWORD m_dwProcessId; bool m_modulesLoaded; LPSTR m_szSymPath; - int m_options; + S32 m_options; char * m_pOutputBuffer; static BOOL __stdcall myReadProcMem(HANDLE hProcess, DWORD64 qwBaseAddress, PVOID lpBuffer, DWORD nSize, LPDWORD lpNumberOfBytesRead); diff --git a/Engine/source/platformWin32/threads/thread.cpp b/Engine/source/platformWin32/threads/thread.cpp index 6e66ddc6d..acf060efd 100644 --- a/Engine/source/platformWin32/threads/thread.cpp +++ b/Engine/source/platformWin32/threads/thread.cpp @@ -68,7 +68,7 @@ public: // Neccesary because Thread::run() is provided as a non-threaded // way to execute the thread's run function. So we have to keep // track of the thread's lock here. -static unsigned int __stdcall ThreadRunHandler(void * arg) +static U32 __stdcall ThreadRunHandler(void * arg) { PlatformThreadData* mData = reinterpret_cast(arg); mData->mThreadID = GetCurrentThreadId(); diff --git a/Engine/source/platformWin32/winConsole.cpp b/Engine/source/platformWin32/winConsole.cpp index 339c41b2b..25f172abb 100644 --- a/Engine/source/platformWin32/winConsole.cpp +++ b/Engine/source/platformWin32/winConsole.cpp @@ -130,7 +130,7 @@ WinConsole::~WinConsole() void WinConsole::printf(const char *s, ...) { // Get the line into a buffer. - static const int BufSize = 4096; + static const S32 BufSize = 4096; static char buffer[4096]; DWORD bytes; va_list args; diff --git a/Engine/source/platformWin32/winDirectInput.cpp b/Engine/source/platformWin32/winDirectInput.cpp index 86bb52bd2..e2feef555 100644 --- a/Engine/source/platformWin32/winDirectInput.cpp +++ b/Engine/source/platformWin32/winDirectInput.cpp @@ -437,14 +437,14 @@ bool DInputManager::isXInputEnabled() } //------------------------------------------------------------------------------ -bool DInputManager::isXInputConnected(int controllerID) +bool DInputManager::isXInputConnected(S32 controllerID) { return( mXInputStateNew[controllerID].bConnected ); } -int DInputManager::getXInputState(int controllerID, int property, bool current) +int DInputManager::getXInputState(S32 controllerID, S32 property, bool current) { - int retVal; + S32 retVal; switch(property) { @@ -586,7 +586,7 @@ void DInputManager::buildXInputEvent( U32 deviceInst, InputEventType objType, In // "mXInputStateReset" is the exception and is true whenever DirectInput gets reset (because // the user ALT-TABBED away, for example). That means that after every context switch, // you will get a full set of updates on the "true" state of the controller. -inline void DInputManager::fireXInputConnectEvent( int controllerID, bool condition, bool connected ) +inline void DInputManager::fireXInputConnectEvent( S32 controllerID, bool condition, bool connected ) { if ( mXInputStateReset || condition ) { @@ -597,7 +597,7 @@ inline void DInputManager::fireXInputConnectEvent( int controllerID, bool condit } } -inline void DInputManager::fireXInputMoveEvent( int controllerID, bool condition, InputObjectInstances objInst, float fValue ) +inline void DInputManager::fireXInputMoveEvent( S32 controllerID, bool condition, InputObjectInstances objInst, float fValue ) { if ( mXInputStateReset || condition ) { @@ -620,7 +620,7 @@ inline void DInputManager::fireXInputMoveEvent( int controllerID, bool condition } } -inline void DInputManager::fireXInputButtonEvent( int controllerID, bool forceFire, int button, InputObjectInstances objInst ) +inline void DInputManager::fireXInputButtonEvent( S32 controllerID, bool forceFire, S32 button, InputObjectInstances objInst ) { if ( mXInputStateReset || forceFire || ((mXInputStateNew[controllerID].state.Gamepad.wButtons & button) != (mXInputStateOld[controllerID].state.Gamepad.wButtons & button)) ) { @@ -663,7 +663,7 @@ void DInputManager::processXInput( void ) if ( mfnXInputGetState ) { - for ( int i=0; i<4; i++ ) + for ( S32 i=0; i<4; i++ ) { // Calling XInputGetState on a disconnected controller takes a fair // amount of time (probably because it tries to locate it), so we @@ -855,7 +855,7 @@ ConsoleFunction( isXInputConnected, bool, 2, 2, "( int controllerID )" } //------------------------------------------------------------------------------ -ConsoleFunction( getXInputState, int, 3, 4, "( int controllerID, string property, bool current )" +ConsoleFunction( getXInputState, S32, 3, 4, "( int controllerID, string property, bool current )" "@brief Queries the current state of a connected Xbox 360 controller.\n\n" "XInput Properties:\n\n" " - XI_THUMBLX, XI_THUMBLY - X and Y axes of the left thumbstick. \n" diff --git a/Engine/source/platformWin32/winDirectInput.h b/Engine/source/platformWin32/winDirectInput.h index 378cbec03..7ce94ac78 100644 --- a/Engine/source/platformWin32/winDirectInput.h +++ b/Engine/source/platformWin32/winDirectInput.h @@ -86,9 +86,9 @@ class DInputManager : public InputManager // XInput worker functions void buildXInputEvent( U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, float fValue ); - void fireXInputConnectEvent( int controllerID, bool condition, bool connected ); - void fireXInputMoveEvent( int controllerID, bool condition, InputObjectInstances objInst, float fValue ); - void fireXInputButtonEvent( int controllerID, bool forceFire, int button, InputObjectInstances objInst ); + void fireXInputConnectEvent( S32 controllerID, bool condition, bool connected ); + void fireXInputMoveEvent( S32 controllerID, bool condition, InputObjectInstances objInst, float fValue ); + void fireXInputButtonEvent( S32 controllerID, bool forceFire, S32 button, InputObjectInstances objInst ); void processXInput(); public: @@ -120,8 +120,8 @@ class DInputManager : public InputManager void deactivateXInput(); bool isXInputActive() { return( mXInputActive ); } void resetXInput() { mXInputStateReset = true; } - bool isXInputConnected(int controllerID); - int getXInputState(int controllerID, int property, bool current); + bool isXInputConnected(S32 controllerID); + S32 getXInputState(S32 controllerID, S32 property, bool current); // Console interface: const char* getJoystickAxesString( U32 deviceID ); diff --git a/Engine/source/platformWin32/winFileio.cpp b/Engine/source/platformWin32/winFileio.cpp index 0d9c7c132..40556d17a 100644 --- a/Engine/source/platformWin32/winFileio.cpp +++ b/Engine/source/platformWin32/winFileio.cpp @@ -1140,7 +1140,7 @@ void Platform::getVolumeNamesList( Vector& out_rNameVector, bool bO out_rNameVector.clear(); - for(int i = 0; i < 32; i++ ) + for(S32 i = 0; i < 32; i++ ) { dMemset(driveLetter,0,12); if( dwDrives & dwMask ) diff --git a/Engine/source/platformWin32/winMemory.cpp b/Engine/source/platformWin32/winMemory.cpp index c4cb821bc..8cb593f48 100644 --- a/Engine/source/platformWin32/winMemory.cpp +++ b/Engine/source/platformWin32/winMemory.cpp @@ -63,7 +63,7 @@ void dRealFree(void* p) free(p); } -void *dMalloc_aligned(dsize_t in_size, int alignment) +void *dMalloc_aligned(dsize_t in_size, S32 alignment) { return _mm_malloc(in_size, alignment); } diff --git a/Engine/source/platformWin32/winTime.cpp b/Engine/source/platformWin32/winTime.cpp index e4174eb83..4c27f5ffd 100644 --- a/Engine/source/platformWin32/winTime.cpp +++ b/Engine/source/platformWin32/winTime.cpp @@ -66,7 +66,7 @@ String Platform::localTimeToString( const LocalTime < ) TCHAR buffer[1024] = {0}; - int result = 0; + S32 result = 0; String outStr; diff --git a/Engine/source/platformWin32/winWindow.cpp b/Engine/source/platformWin32/winWindow.cpp index 53b3a2b48..5c2bac019 100644 --- a/Engine/source/platformWin32/winWindow.cpp +++ b/Engine/source/platformWin32/winWindow.cpp @@ -350,7 +350,7 @@ S32 PASCAL WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR lpszCmdLine, S32) // Add the word to the argument list. if (*word) { - int len = ptr - word; + S32 len = ptr - word; char *arg = (char *) dMalloc(len + 1); dStrncpy(arg, word, len); arg[len] = 0; @@ -373,12 +373,12 @@ S32 PASCAL WinMain( HINSTANCE hInstance, HINSTANCE, LPSTR lpszCmdLine, S32) extern "C" { - bool torque_engineinit(int argc, const char **argv); - int torque_enginetick(); + bool torque_engineinit(S32 argc, const char **argv); + S32 torque_enginetick(); bool torque_engineshutdown(); }; -int TorqueMain(int argc, const char **argv) +S32 TorqueMain(int argc, const char **argv) { if (!torque_engineinit(argc, argv)) return 1; @@ -442,7 +442,7 @@ S32 torque_winmain( HINSTANCE hInstance, HINSTANCE, LPSTR lpszCmdLine, S32) // Add the word to the argument list. if (*word) { - int len = ptr - word; + S32 len = ptr - word; char *arg = (char *) dMalloc(len + 1); dStrncpy(arg, word, len); arg[len] = 0; @@ -499,7 +499,7 @@ bool Platform::openWebBrowser( const char* webAddress ) return( false ); } - if ( RegQueryValueEx( regKey, dT(""), NULL, NULL, (unsigned char *)sWebKey, &size ) != ERROR_SUCCESS ) + if ( RegQueryValueEx( regKey, dT(""), NULL, NULL, (U8 *)sWebKey, &size ) != ERROR_SUCCESS ) { Con::errorf( ConsoleLogEntry::General, "Platform::openWebBrowser - Failed to query the open command registry key!!!" ); return( false ); diff --git a/Engine/source/postFx/postEffect.cpp b/Engine/source/postFx/postEffect.cpp index 1dcfae1ed..9c0b541e1 100644 --- a/Engine/source/postFx/postEffect.cpp +++ b/Engine/source/postFx/postEffect.cpp @@ -358,7 +358,7 @@ bool PostEffect::onAdd() scriptPath.setExtension( String::EmptyString ); // Find additional textures - for( int i = 0; i < NumTextures; i++ ) + for( S32 i = 0; i < NumTextures; i++ ) { String texFilename = mTexFilename[i]; diff --git a/Engine/source/renderInstance/renderFormatChanger.cpp b/Engine/source/renderInstance/renderFormatChanger.cpp index bba53ed53..c9042c766 100644 --- a/Engine/source/renderInstance/renderFormatChanger.cpp +++ b/Engine/source/renderInstance/renderFormatChanger.cpp @@ -243,7 +243,7 @@ void RenderFormatToken::_teardownTargets() { mTarget.release(); - for(int i = 0; i < TargetChainLength; i++) + for(S32 i = 0; i < TargetChainLength; i++) { mTargetColorTexture[i] = NULL; mTargetDepthStencilTexture[i] = NULL; diff --git a/Engine/source/renderInstance/renderOcclusionMgr.cpp b/Engine/source/renderInstance/renderOcclusionMgr.cpp index 4e9839eb5..126d375a8 100644 --- a/Engine/source/renderInstance/renderOcclusionMgr.cpp +++ b/Engine/source/renderInstance/renderOcclusionMgr.cpp @@ -106,7 +106,7 @@ void RenderOcclusionMgr::init() U32 vertexIndex = 0; U32 idx; - for(int i = 0; i < 6; i++) + for(S32 i = 0; i < 6; i++) { idx = cubeFaces[i][0]; verts[vertexIndex].point = cubePoints[idx]; diff --git a/Engine/source/renderInstance/renderParticleMgr.cpp b/Engine/source/renderInstance/renderParticleMgr.cpp index 76c3ec2ff..d1d36f39e 100644 --- a/Engine/source/renderInstance/renderParticleMgr.cpp +++ b/Engine/source/renderInstance/renderParticleMgr.cpp @@ -157,7 +157,7 @@ void RenderParticleMgr::addElement( RenderInst *inst ) pri->bbModelViewProj->mul(tempPt); tempPt = tempPt / tempPt.w; - for(int i = 0; i < 1; i++) + for(S32 i = 0; i < 1; i++) { screenClipper.mPlaneList.push_back(planes[i]); screenClipper.mPlaneList.last() += tempPt.asPoint3F(); @@ -167,7 +167,7 @@ void RenderParticleMgr::addElement( RenderInst *inst ) screenSpaceBoundingBox.minExtents = Point3F::Zero; screenSpaceBoundingBox.maxExtents = Point3F::Zero; - for(int i = 0; i < 8; i++) + for(S32 i = 0; i < 8; i++) { tempPt = cubePoints[i]; pri->bbModelViewProj->mul(tempPt); diff --git a/Engine/source/scene/sceneContainer.cpp b/Engine/source/scene/sceneContainer.cpp index 27eabbe6c..6cfed5db3 100644 --- a/Engine/source/scene/sceneContainer.cpp +++ b/Engine/source/scene/sceneContainer.cpp @@ -1197,7 +1197,7 @@ void SceneContainer::cleanupSearchVectors() //----------------------------------------------------------------------------- static Point3F sgSortReferencePoint; -static int QSORT_CALLBACK cmpSearchPointers(const void* inP1, const void* inP2) +static S32 QSORT_CALLBACK cmpSearchPointers(const void* inP1, const void* inP2) { SimObjectPtr** p1 = (SimObjectPtr**)inP1; SimObjectPtr** p2 = (SimObjectPtr**)inP2; diff --git a/Engine/source/scene/zones/sceneZoneSpaceManager.h b/Engine/source/scene/zones/sceneZoneSpaceManager.h index 51b696326..1c7631949 100644 --- a/Engine/source/scene/zones/sceneZoneSpaceManager.h +++ b/Engine/source/scene/zones/sceneZoneSpaceManager.h @@ -79,7 +79,7 @@ class SceneZoneSpaceManager { public: - ZoneContentIterator( SceneZoneSpaceManager* manager, int zoneId, bool upToDate = true ) + ZoneContentIterator( SceneZoneSpaceManager* manager, S32 zoneId, bool upToDate = true ) { AssertFatal( zoneId < manager->getNumZones(), "SceneZoneSpaceManager::ZoneContentIterator - Zone ID out of range" ); diff --git a/Engine/source/sfx/media/sfxVorbisStream.cpp b/Engine/source/sfx/media/sfxVorbisStream.cpp index 7ed1c51ec..789f136e2 100644 --- a/Engine/source/sfx/media/sfxVorbisStream.cpp +++ b/Engine/source/sfx/media/sfxVorbisStream.cpp @@ -91,7 +91,7 @@ size_t SFXVorbisStream::_read_func( void *ptr, size_t size, size_t nmemb, void * return readItems; } -int SFXVorbisStream::_seek_func( void *datasource, ogg_int64_t offset, int whence ) +S32 SFXVorbisStream::_seek_func( void *datasource, ogg_int64_t offset, S32 whence ) { Stream *stream = reinterpret_cast( datasource ); @@ -133,7 +133,7 @@ bool SFXVorbisStream::_openVorbis() cb.tell_func = canSeek ? _tell_func : NULL; // Open it. - int ovResult = ov_open_callbacks( mStream, mVF, NULL, 0, cb ); + S32 ovResult = ov_open_callbacks( mStream, mVF, NULL, 0, cb ); if( ovResult != 0 ) return false; @@ -196,9 +196,9 @@ S32 SFXVorbisStream::read( U8 *buffer, mBitstream = *bitstream; #ifdef TORQUE_BIG_ENDIAN - static const int isBigEndian = 1; + static const S32 isBigEndian = 1; #else - static const int isBigEndian = 0; + static const S32 isBigEndian = 0; #endif // Vorbis doesn't seem to like reading diff --git a/Engine/source/sfx/media/sfxVorbisStream.h b/Engine/source/sfx/media/sfxVorbisStream.h index 680d550fa..74b9d0964 100644 --- a/Engine/source/sfx/media/sfxVorbisStream.h +++ b/Engine/source/sfx/media/sfxVorbisStream.h @@ -56,7 +56,7 @@ class SFXVorbisStream : public SFXFileStream, // The ov_callbacks. static size_t _read_func( void *ptr, size_t size, size_t nmemb, void *datasource ); - static int _seek_func( void *datasource, ogg_int64_t offset, int whence ); + static S32 _seek_func( void *datasource, ogg_int64_t offset, S32 whence ); static long _tell_func( void *datasource ); // SFXStream diff --git a/Engine/source/sfx/openal/aldlist.cpp b/Engine/source/sfx/openal/aldlist.cpp index e3991a7ee..8820c1824 100644 --- a/Engine/source/sfx/openal/aldlist.cpp +++ b/Engine/source/sfx/openal/aldlist.cpp @@ -172,7 +172,7 @@ void ALDeviceList::GetDeviceVersion(int index, int *major, int *minor) /* * Returns the maximum number of Sources that can be generate on the given device */ -unsigned int ALDeviceList::GetMaxNumSources(int index) +U32 ALDeviceList::GetMaxNumSources(S32 index) { if (index < GetNumDevices()) return vDeviceInfo[index].uiSourceCount; @@ -204,10 +204,10 @@ int ALDeviceList::GetDefaultDevice() /* * Deselects devices which don't have the specified minimum version */ -void ALDeviceList::FilterDevicesMinVer(int major, int minor) +void ALDeviceList::FilterDevicesMinVer(S32 major, S32 minor) { int dMajor, dMinor; - for (unsigned int i = 0; i < vDeviceInfo.size(); i++) { + for (U32 i = 0; i < vDeviceInfo.size(); i++) { GetDeviceVersion(i, &dMajor, &dMinor); if ((dMajor < major) || ((dMajor == major) && (dMinor < minor))) { vDeviceInfo[i].bSelected = false; @@ -218,10 +218,10 @@ void ALDeviceList::FilterDevicesMinVer(int major, int minor) /* * Deselects devices which don't have the specified maximum version */ -void ALDeviceList::FilterDevicesMaxVer(int major, int minor) +void ALDeviceList::FilterDevicesMaxVer(S32 major, S32 minor) { - int dMajor, dMinor; - for (unsigned int i = 0; i < vDeviceInfo.size(); i++) { + S32 dMajor, dMinor; + for (U32 i = 0; i < vDeviceInfo.size(); i++) { GetDeviceVersion(i, &dMajor, &dMinor); if ((dMajor > major) || ((dMajor == major) && (dMinor > minor))) { vDeviceInfo[i].bSelected = false; @@ -234,7 +234,7 @@ void ALDeviceList::FilterDevicesMaxVer(int major, int minor) */ void ALDeviceList::FilterDevicesExtension(SFXALCaps cap) { - for (unsigned int i = 0; i < vDeviceInfo.size(); i++) + for (U32 i = 0; i < vDeviceInfo.size(); i++) vDeviceInfo[i].bSelected = vDeviceInfo[i].iCapsFlags & cap; } @@ -243,7 +243,7 @@ void ALDeviceList::FilterDevicesExtension(SFXALCaps cap) */ void ALDeviceList::ResetFilters() { - for (int i = 0; i < GetNumDevices(); i++) { + for (S32 i = 0; i < GetNumDevices(); i++) { vDeviceInfo[i].bSelected = true; } filterIndex = 0; @@ -287,7 +287,7 @@ int ALDeviceList::GetNextFilteredDevice() unsigned int ALDeviceList::GetMaxNumSources() { ALuint uiSources[256]; - unsigned int iSourceCount = 0; + U32 iSourceCount = 0; // Clear AL Error Code ALFunction.alGetError(); @@ -304,7 +304,7 @@ unsigned int ALDeviceList::GetMaxNumSources() ALFunction.alDeleteSources(iSourceCount, uiSources); if (ALFunction.alGetError() != AL_NO_ERROR) { - for (unsigned int i = 0; i < 256; i++) + for (U32 i = 0; i < 256; i++) { ALFunction.alDeleteSources(1, &uiSources[i]); } diff --git a/Engine/source/sfx/openal/aldlist.h b/Engine/source/sfx/openal/aldlist.h index 00b0eaec3..3b2d7e948 100644 --- a/Engine/source/sfx/openal/aldlist.h +++ b/Engine/source/sfx/openal/aldlist.h @@ -32,10 +32,10 @@ typedef struct { char strDeviceName[256]; - int iMajorVersion; - int iMinorVersion; - unsigned int uiSourceCount; - int iCapsFlags; + S32 iMajorVersion; + S32 iMinorVersion; + U32 uiSourceCount; + S32 iCapsFlags; bool bSelected; } ALDEVICEINFO, *LPALDEVICEINFO; @@ -44,27 +44,27 @@ class ALDeviceList private: OPENALFNTABLE ALFunction; Vector vDeviceInfo; - int defaultDeviceIndex; - int filterIndex; + S32 defaultDeviceIndex; + S32 filterIndex; public: ALDeviceList ( const OPENALFNTABLE &oalft ); ~ALDeviceList (); - int GetNumDevices(); - const char *GetDeviceName(int index); - void GetDeviceVersion(int index, int *major, int *minor); - unsigned int GetMaxNumSources(int index); - bool IsExtensionSupported(int index, SFXALCaps caps); - int GetDefaultDevice(); - void FilterDevicesMinVer(int major, int minor); - void FilterDevicesMaxVer(int major, int minor); + S32 GetNumDevices(); + const char *GetDeviceName(S32 index); + void GetDeviceVersion(S32 index, S32 *major, S32 *minor); + U32 GetMaxNumSources(S32 index); + bool IsExtensionSupported(S32 index, SFXALCaps caps); + S32 GetDefaultDevice(); + void FilterDevicesMinVer(S32 major, S32 minor); + void FilterDevicesMaxVer(S32 major, S32 minor); void FilterDevicesExtension(SFXALCaps caps); void ResetFilters(); - int GetFirstFilteredDevice(); - int GetNextFilteredDevice(); + S32 GetFirstFilteredDevice(); + S32 GetNextFilteredDevice(); private: - unsigned int GetMaxNumSources(); + U32 GetMaxNumSources(); }; #endif // ALDEVICELIST_H diff --git a/Engine/source/sfx/openal/sfxALProvider.cpp b/Engine/source/sfx/openal/sfxALProvider.cpp index 7570500d6..bd4f8cfdd 100644 --- a/Engine/source/sfx/openal/sfxALProvider.cpp +++ b/Engine/source/sfx/openal/sfxALProvider.cpp @@ -93,18 +93,18 @@ void SFXALProvider::init() const char *deviceFormat = "OpenAL v%d.%d %s"; char temp[256]; - for( int i = 0; i < mALDL->GetNumDevices(); i++ ) + for( S32 i = 0; i < mALDL->GetNumDevices(); i++ ) { ALDeviceInfo* info = new ALDeviceInfo; info->name = String( mALDL->GetDeviceName( i ) ); - int major, minor, eax = 0; + S32 major, minor, eax = 0; mALDL->GetDeviceVersion( i, &major, &minor ); // Apologies for the blatent enum hack -patw - for( int j = SFXALEAX2; j < SFXALEAXRAM; j++ ) + for( S32 j = SFXALEAX2; j < SFXALEAXRAM; j++ ) eax += (int)mALDL->IsExtensionSupported( i, (SFXALCaps)j ); if( eax > 0 ) diff --git a/Engine/source/sfx/sfxCommon.h b/Engine/source/sfx/sfxCommon.h index 587672ca0..956f24055 100644 --- a/Engine/source/sfx/sfxCommon.h +++ b/Engine/source/sfx/sfxCommon.h @@ -561,7 +561,7 @@ class SFXMaterialProperties /// An array of float values with optional random variances. -template< int NUM_VALUES > +template< S32 NUM_VALUES > struct SFXVariantFloat { /// Base value. diff --git a/Engine/source/sfx/sfxSystem.cpp b/Engine/source/sfx/sfxSystem.cpp index c43a44b2f..9faa5dd4c 100644 --- a/Engine/source/sfx/sfxSystem.cpp +++ b/Engine/source/sfx/sfxSystem.cpp @@ -854,7 +854,7 @@ void SFXSystem::_updateSources() if( source->getLastStatus() == SFXStatusStopped && source->getSavedStatus() != SFXStatusPlaying ) { - int index = iter - mPlayOnceSources.begin(); + S32 index = iter - mPlayOnceSources.begin(); // Erase it from the vector first, so that onRemoveSource // doesn't do it during cleanup and screw up our loop here! diff --git a/Engine/source/sfx/sfxWorld.h b/Engine/source/sfx/sfxWorld.h index 2806cc4c8..289455b69 100644 --- a/Engine/source/sfx/sfxWorld.h +++ b/Engine/source/sfx/sfxWorld.h @@ -101,7 +101,7 @@ enum SFXObjectFlags /// 3D voices active on the device at any one point is defined as the set of /// current sound sources. /// -template< int NUM_DIMENSIONS > +template< S32 NUM_DIMENSIONS > class SFXObject : public ScopeTrackerObject< NUM_DIMENSIONS > { public: @@ -184,7 +184,7 @@ class SFXObject : public ScopeTrackerObject< NUM_DIMENSIONS > /// occlusion manager installed on the system and tracking the listener traveling through /// the ambient spaces is /// -template< int NUM_DIMENSIONS, typename Object > +template< S32 NUM_DIMENSIONS, typename Object > class SFXWorld : public ScopeTracker< NUM_DIMENSIONS, Object > { public: @@ -250,7 +250,7 @@ class SFXWorld : public ScopeTracker< NUM_DIMENSIONS, Object > //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > SFXWorld< NUM_DIMENSIONS, Object >::SFXWorld() { VECTOR_SET_ASSOCIATION( mScopeStack ); @@ -258,7 +258,7 @@ SFXWorld< NUM_DIMENSIONS, Object >::SFXWorld() //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void SFXWorld< NUM_DIMENSIONS, Object >::update() { if( !this->mReferenceObject ) @@ -320,7 +320,7 @@ void SFXWorld< NUM_DIMENSIONS, Object >::update() //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void SFXWorld< NUM_DIMENSIONS, Object >::notifyChanged( Object object ) { SFXAmbience* ambience = Deref( object ).getAmbience(); @@ -369,7 +369,7 @@ void SFXWorld< NUM_DIMENSIONS, Object >::_onScopeIn( Object object ) //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void SFXWorld< NUM_DIMENSIONS, Object >::_onScopeOut( Object object ) { #ifdef DEBUG_SPEW @@ -393,7 +393,7 @@ void SFXWorld< NUM_DIMENSIONS, Object >::_onScopeOut( Object object ) //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > F32 SFXWorld< NUM_DIMENSIONS, Object >::_getSortValue( Object object ) { //RDTODO: probably need to work with the overlap here instead of the full volumes @@ -414,7 +414,7 @@ F32 SFXWorld< NUM_DIMENSIONS, Object >::_getSortValue( Object object ) //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > S32 SFXWorld< NUM_DIMENSIONS, Object >::_findScope( Object object ) { for( U32 i = 0; i < mScopeStack.size(); ++ i ) diff --git a/Engine/source/shaderGen/shaderGen.cpp b/Engine/source/shaderGen/shaderGen.cpp index 6c7775353..5cd18f10c 100644 --- a/Engine/source/shaderGen/shaderGen.cpp +++ b/Engine/source/shaderGen/shaderGen.cpp @@ -389,7 +389,7 @@ void ShaderGen::_printDependencies(Stream &stream) { mPrinter->printLine(stream, "// Dependencies:"); - for( int i = 0; i < dependencies.size(); i++ ) + for( S32 i = 0; i < dependencies.size(); i++ ) dependencies[i]->print( stream ); mPrinter->printLine(stream, ""); diff --git a/Engine/source/sim/netInterface.cpp b/Engine/source/sim/netInterface.cpp index 226bd0ca3..e839d6e64 100644 --- a/Engine/source/sim/netInterface.cpp +++ b/Engine/source/sim/netInterface.cpp @@ -531,7 +531,7 @@ void NetInterface::checkTimeouts() #define F3(x, y, z) (x ^ y ^ z) #define F4(x, y, z) (y ^ (x | ~z)) -inline U32 rotlFixed(U32 x, unsigned int y) +inline U32 rotlFixed(U32 x, U32 y) { return (x >> y) | (x << (32 - y)); } diff --git a/Engine/source/terrain/terrCollision.cpp b/Engine/source/terrain/terrCollision.cpp index 0b148445d..c55fc9ff5 100644 --- a/Engine/source/terrain/terrCollision.cpp +++ b/Engine/source/terrain/terrCollision.cpp @@ -422,7 +422,7 @@ void TerrainBlock::buildConvex(const Box3F& box,Convex* convex) // Build points Point3F* pos = cp->point; - for (int i = 0; i < 4 ; i++,pos++) { + for (S32 i = 0; i < 4 ; i++,pos++) { S32 dx = i >> 1; S32 dy = dx ^ (i & 1); pos->x = (F32)((x + dx) * mSquareSize); @@ -562,7 +562,7 @@ bool TerrainBlock::buildPolyList(PolyListContext context, AbstractPolyList* poly // Add the missing points U32 vi[5]; - for (int i = 0; i < 4 ; i++) + for (S32 i = 0; i < 4 ; i++) { S32 dx = i >> 1; S32 dy = dx ^ (i & 1); @@ -669,10 +669,10 @@ bool TerrainBlock::castRayI(const Point3F &start, const Point3F &end, RayInfo *i Point3F pStart(start.x * invBlockWorldSize, start.y * invBlockWorldSize, start.z); Point3F pEnd(end.x * invBlockWorldSize, end.y * invBlockWorldSize, end.z); - int blockX = (S32)mFloor(pStart.x); - int blockY = (S32)mFloor(pStart.y); + S32 blockX = (S32)mFloor(pStart.x); + S32 blockY = (S32)mFloor(pStart.y); - int dx, dy; + S32 dx, dy; F32 invDeltaX; if(pEnd.x == pStart.x) @@ -904,7 +904,7 @@ bool TerrainBlock::castRayBlock( const Point3F &pStart, } continue; } - int subSqWidth = 1 << (level - 1); + S32 subSqWidth = 1 << (level - 1); F32 xIntercept = (blockPos.x + subSqWidth) * invBlockSize; F32 xInt = calcInterceptX(pStart.x, invDeltaX, xIntercept); F32 yIntercept = (blockPos.y + subSqWidth) * invBlockSize; diff --git a/Engine/source/ts/arch/tsMeshIntrinsics.sse.cpp b/Engine/source/ts/arch/tsMeshIntrinsics.sse.cpp index c83add0a1..1e343ac23 100644 --- a/Engine/source/ts/arch/tsMeshIntrinsics.sse.cpp +++ b/Engine/source/ts/arch/tsMeshIntrinsics.sse.cpp @@ -38,10 +38,10 @@ void zero_vert_normal_bulk_SSE(const dsize_t count, U8 * __restrict const outPtr vMask = _mm_load_ps((const F32*)&_point3f_zero_mask); // pre-populate cache - for(int i = 0; i < 8; i++) + for(S32 i = 0; i < 8; i++) _mm_prefetch(reinterpret_cast(outData + outStride * i), _MM_HINT_T0); - for(int i = 0; i < count; i++) + for(S32 i = 0; i < count; i++) { TSMesh::__TSMeshVertexBase *curElem = reinterpret_cast(outData); @@ -102,13 +102,13 @@ void m_matF_x_BatchedVertWeightList_SSE(const MatrixF &mat, // pre-populate cache const TSSkinMesh::BatchData::BatchedVertWeight &firstElem = batch[0]; - for(int i = 0; i < 8; i++) + for(S32 i = 0; i < 8; i++) { _mm_prefetch(reinterpret_cast(iPtr + inStride * i), _MM_HINT_T0); _mm_prefetch(reinterpret_cast(outPtr + outStride * (i + firstElem.vidx)), _MM_HINT_T0); } - for(register int i = 0; i < count; i++) + for(register S32 i = 0; i < count; i++) { const TSSkinMesh::BatchData::BatchedVertWeight &inElem = batch[i]; TSMesh::__TSMeshVertexBase *outElem = reinterpret_cast(outPtr + inElem.vidx * outStride); diff --git a/Engine/source/ts/arch/tsMeshIntrinsics.sse4.cpp b/Engine/source/ts/arch/tsMeshIntrinsics.sse4.cpp index 8dba501c5..9aba0f027 100644 --- a/Engine/source/ts/arch/tsMeshIntrinsics.sse4.cpp +++ b/Engine/source/ts/arch/tsMeshIntrinsics.sse4.cpp @@ -46,13 +46,13 @@ void m_matF_x_BatchedVertWeightList_SSE4(const MatrixF &mat, // pre-populate cache const TSSkinMesh::BatchData::BatchedVertWeight &firstElem = batch[0]; - for(int i = 0; i < 8; i++) + for(S32 i = 0; i < 8; i++) { _mm_prefetch(reinterpret_cast(iPtr + inStride * i), _MM_HINT_T0); _mm_prefetch(reinterpret_cast(outPtr + outStride * (i + firstElem.vidx)), _MM_HINT_T0); } - for(int i = 0; i < count; i++) + for(S32 i = 0; i < count; i++) { const TSSkinMesh::BatchData::BatchedVertWeight &inElem = batch[i]; TSMesh::__TSMeshVertexBase *outElem = reinterpret_cast(outPtr + inElem.vidx * outStride); diff --git a/Engine/source/ts/collada/colladaAppMesh.cpp b/Engine/source/ts/collada/colladaAppMesh.cpp index 1b58140e5..c4036fbe9 100644 --- a/Engine/source/ts/collada/colladaAppMesh.cpp +++ b/Engine/source/ts/collada/colladaAppMesh.cpp @@ -179,7 +179,7 @@ private: const domVertices* vertices = daeSafeCast(element); // Search for the input with the desired semantic const char* semantic = SourceTypeToSemantic( type ); - for (int iInput = 0; iInput < vertices->getInput_array().getCount(); iInput++) + for (S32 iInput = 0; iInput < vertices->getInput_array().getCount(); iInput++) { domInputLocal* input = vertices->getInput_array().get(iInput); if (dStrEqual(input->getSemantic(), semantic)) @@ -230,12 +230,12 @@ public: *maxOffset = 0; // Clear output array - for (int i = 0; i < NumStreams; i++) + for (S32 i = 0; i < NumStreams; i++) sortedInputs[i] = 0; // Separate inputs by type, and sort by set (ie. lowest TEXCOORD set becomes UV, // next TEXCOORD set becomes UV2 etc) - for (int iInput = 0; iInput < inputs.getCount(); iInput++) { + for (S32 iInput = 0; iInput < inputs.getCount(); iInput++) { const T& input = inputs[iInput]; const daeString semantic = input->getSemantic(); @@ -247,7 +247,7 @@ public: // The element may contain multiple inputs (eg. POSITION, NORMAL etc) domInputLocalRef verticesInputs[NumStreams]; classifyInputs(vertices->getInput_array(), verticesInputs); - for (int iStream = 0; iStream < NumStreams; iStream++) + for (S32 iStream = 0; iStream < NumStreams; iStream++) { if (verticesInputs[iStream] != 0) sortedInputs[iStream] = input; @@ -367,7 +367,7 @@ bool ColladaAppMesh::animatesMatFrame(const AppSequence* appSeq) // - by animating the morph weights for morph targets with different UVs // Check if the MAYA profile texture transform is animated - for (int iMat = 0; iMat < appMaterials.size(); iMat++) { + for (S32 iMat = 0; iMat < appMaterials.size(); iMat++) { ColladaAppMaterial* appMat = static_cast(appMaterials[iMat]); if (appMat->effectExt && appMat->effectExt->animatesTextureTransform(appSeq->getStart(), appSeq->getEnd())) @@ -379,7 +379,7 @@ bool ColladaAppMesh::animatesMatFrame(const AppSequence* appSeq) bool animated = false; bool differentUVs = false; if (const domMorph* morph = getMorph()) { - for (int iInput = 0; iInput < morph->getTargets()->getInput_array().getCount(); iInput++) { + for (S32 iInput = 0; iInput < morph->getTargets()->getInput_array().getCount(); iInput++) { const domInputLocal* input = morph->getTargets()->getInput_array()[iInput]; if (dStrEqual(input->getSemantic(), "MORPH_TARGET")) { // @todo: Check if morph targets have different UVs to base geometry @@ -402,7 +402,7 @@ bool ColladaAppMesh::animatesFrame(const AppSequence* appSeq) // the morph weights are animated within the sequence interval bool animated = false; if (const domMorph* morph = getMorph()) { - for (int iInput = 0; iInput < morph->getTargets()->getInput_array().getCount(); iInput++) { + for (S32 iInput = 0; iInput < morph->getTargets()->getInput_array().getCount(); iInput++) { const domInputLocal* input = morph->getTargets()->getInput_array()[iInput]; if (dStrEqual(input->getSemantic(), "MORPH_WEIGHT")) { const domSource* source = daeSafeCast(findInputSource(input)); @@ -441,7 +441,7 @@ S32 ColladaAppMesh::addMaterial(const char* symbol) instanceCtrl->getBind_material(); if (binds) { const domInstance_material_Array& matArray = binds->getTechnique_common()->getInstance_material_array(); - for (int iBind = 0; iBind < matArray.getCount(); iBind++) { + for (S32 iBind = 0; iBind < matArray.getCount(); iBind++) { if (dStrEqual(matArray[iBind]->getSymbol(), symbol)) { // Find the index of the bound material in the shape global list @@ -488,7 +488,7 @@ void ColladaAppMesh::getPrimitives(const domGeometry* geometry) // about unsupported elements Vector meshPrims; const daeElementRefArray& contents = geometry->getMesh()->getContents(); - for (int iElem = 0; iElem < contents.getCount(); iElem++) { + for (S32 iElem = 0; iElem < contents.getCount(); iElem++) { if (BasePrimitive::isPrimitive(contents[iElem])) { if (BasePrimitive::isSupportedPrimitive(contents[iElem])) @@ -505,7 +505,7 @@ void ColladaAppMesh::getPrimitives(const domGeometry* geometry) VertTupleMap tupleMap; // Create Torque primitives - for (int iPrim = 0; iPrim < meshPrims.size(); iPrim++) { + for (S32 iPrim = 0; iPrim < meshPrims.size(); iPrim++) { // Primitive element must have at least 1 triangle const domListOfUInts* pTriData = meshPrims[iPrim]->getTriangleData(); @@ -619,7 +619,7 @@ void ColladaAppMesh::getPrimitives(const domGeometry* geometry) } } - for (int iPrim = 0; iPrim < meshPrims.size(); iPrim++) + for (S32 iPrim = 0; iPrim < meshPrims.size(); iPrim++) delete meshPrims[iPrim]; } @@ -641,7 +641,7 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const // Get the supported primitive elements for this geometry Vector meshPrims; const daeElementRefArray& contents = geometry->getMesh()->getContents(); - for (int iElem = 0; iElem < contents.getCount(); iElem++) { + for (S32 iElem = 0; iElem < contents.getCount(); iElem++) { if (BasePrimitive::isSupportedPrimitive(contents[iElem])) meshPrims.push_back(BasePrimitive::get(contents[iElem])); } @@ -659,7 +659,7 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const ColorI* colors_array = NULL; Point2F* uv2s_array = NULL; - for (int iVert = 0; iVert < vertTuples.size(); iVert++) { + for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) { const VertTuple& tuple = vertTuples[iVert]; @@ -751,7 +751,7 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const } } - for (int iPrim = 0; iPrim < meshPrims.size(); iPrim++) + for (S32 iPrim = 0; iPrim < meshPrims.size(); iPrim++) delete meshPrims[iPrim]; } @@ -768,7 +768,7 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M Vector targetGeoms; domListOfFloats targetWeights; - for (int iInput = 0; iInput < morph->getTargets()->getInput_array().getCount(); iInput++) { + for (S32 iInput = 0; iInput < morph->getTargets()->getInput_array().getCount(); iInput++) { const domInputLocal* input = morph->getTargets()->getInput_array()[iInput]; const domSource* source = daeSafeCast(findInputSource(input)); @@ -777,7 +777,7 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M _SourceReader srcTargets; srcTargets.initFromSource(source); - for (int iTarget = 0; iTarget < srcTargets.size(); iTarget++) { + for (S32 iTarget = 0; iTarget < srcTargets.size(); iTarget++) { // Lookup the element and add to the targets list daeIDRef idref(srcTargets.getStringValue(iTarget)); idref.setContainer(morph->getDocument()->getDomRoot()); @@ -820,27 +820,27 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M if (morph->getMethod() == MORPHMETHODTYPE_NORMALIZED) { F32 weightSum = 0.0f; - for (int iWeight = 0; iWeight < targetWeights.getCount(); iWeight++) { + for (S32 iWeight = 0; iWeight < targetWeights.getCount(); iWeight++) { weightSum += targetWeights[iWeight]; } // Result = Base*(1.0-w1-w2 ... -wN) + w1*Target1 + w2*Target2 ... + wN*TargetN weightSum = mClampF(1.0f - weightSum, 0.0f, 1.0f); - for (int iVert = 0; iVert < vertTuples.size(); iVert++) { + for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) { points_array[iVert] *= weightSum; norms_array[iVert] *= weightSum; uvs_array[iVert] *= weightSum; } if (uv2s_array) { - for (int iVert = 0; iVert < vertTuples.size(); iVert++) + for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) uv2s_array[iVert] *= weightSum; } } // Interpolate using the target geometry and weights - for (int iTarget = 0; iTarget < targetGeoms.size(); iTarget++) { + for (S32 iTarget = 0; iTarget < targetGeoms.size(); iTarget++) { // Ignore empty weights if (targetWeights[iTarget] == 0.0f) @@ -866,18 +866,18 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M getVertexData(targetGeoms[iTarget], time, objectOffset, targetPoints, targetNorms, targetColors, targetUvs, targetUv2s, false); // Combine with base geometry - for (int iVert = 0; iVert < vertTuples.size(); iVert++) { + for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) { points_array[iVert] += targetPoints[iVert] * targetWeights[iTarget]; norms_array[iVert] += targetNorms[iVert] * targetWeights[iTarget]; uvs_array[iVert] += targetUvs[iVert] * targetWeights[iTarget]; } if (uv2s_array) { - for (int iVert = 0; iVert < vertTuples.size(); iVert++) + for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) uv2s_array[iVert] += targetUv2s[iVert] * targetWeights[iTarget]; } if (colors_array) { - for (int iVert = 0; iVert < vertTuples.size(); iVert++) + for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) colors_array[iVert] += targetColors[iVert] * (F32)targetWeights[iTarget]; } } @@ -963,7 +963,7 @@ void ColladaAppMesh::lookupSkinData() // vertex may have multiple [bone, weight] pairs in the array) Vector vindicesOffset; const domInt* vindices = (domInt*)weights_v.getRaw(0); - for (int iWeight = 0; iWeight < weights_vcount.getCount(); iWeight++) { + for (S32 iWeight = 0; iWeight < weights_vcount.getCount(); iWeight++) { // Store the offset into the vindices array for this vertex vindicesOffset.push_back(vindices - (domInt*)weights_v.getRaw(0)); vindices += (weights_vcount[iWeight]*2); // 2 indices [bone, weight] per vert @@ -971,14 +971,14 @@ void ColladaAppMesh::lookupSkinData() // Set vertex weights bool tooManyWeightsWarning = false; - for (int iVert = 0; iVert < vertsPerFrame; iVert++) { + for (S32 iVert = 0; iVert < vertsPerFrame; iVert++) { const domUint* vcount = (domUint*)weights_vcount.getRaw(0); const domInt* vindices = (domInt*)weights_v.getRaw(0); vindices += vindicesOffset[vertTuples[iVert].vertex]; S32 nonZeroWeightCount = 0; - for (int iWeight = 0; iWeight < vcount[vertTuples[iVert].vertex]; iWeight++) { + for (S32 iWeight = 0; iWeight < vcount[vertTuples[iVert].vertex]; iWeight++) { S32 bIndex = vindices[iWeight*2]; F32 bWeight = streams.weights.getFloatValue( vindices[iWeight*2 + 1] ); @@ -1027,12 +1027,12 @@ void ColladaAppMesh::lookupSkinData() } // Normalize vertex weights (force weights for each vert to sum to 1) - int iWeight = 0; + S32 iWeight = 0; while (iWeight < weight.size()) { // Find the last weight with the same vertex number, and sum all weights for // that vertex F32 invTotalWeight = 0; - int iLast; + S32 iLast; for (iLast = iWeight; iLast < weight.size(); iLast++) { if (vertexIndex[iLast] != vertexIndex[iWeight]) break; @@ -1048,7 +1048,7 @@ void ColladaAppMesh::lookupSkinData() // Add dummy AppNodes to allow Collada joints to be mapped to 3space nodes bones.setSize(streams.joints.size()); initialTransforms.setSize(streams.joints.size()); - for (int iJoint = 0; iJoint < streams.joints.size(); iJoint++) + for (S32 iJoint = 0; iJoint < streams.joints.size(); iJoint++) { const char* jointName = streams.joints.getStringValue(iJoint); @@ -1056,7 +1056,7 @@ void ColladaAppMesh::lookupSkinData() const domNode* joint = 0; if (instanceCtrl->getSkeleton_array().getCount()) { // Search for the node using the as the base element - for (int iSkel = 0; iSkel < instanceCtrl->getSkeleton_array().getCount(); iSkel++) { + for (S32 iSkel = 0; iSkel < instanceCtrl->getSkeleton_array().getCount(); iSkel++) { xsAnyURI skeleton = instanceCtrl->getSkeleton_array()[iSkel]->getValue(); daeSIDResolver resolver(skeleton.getElement(), jointName); joint = daeSafeCast(resolver.getElement()); diff --git a/Engine/source/ts/collada/colladaAppNode.cpp b/Engine/source/ts/collada/colladaAppNode.cpp index 8a0dcacab..fdf56c775 100644 --- a/Engine/source/ts/collada/colladaAppNode.cpp +++ b/Engine/source/ts/collada/colladaAppNode.cpp @@ -90,7 +90,7 @@ ColladaAppNode::ColladaAppNode(const domNode* node, ColladaAppNode* parent) dFree( properties ); // Create vector of transform elements - for (int iChild = 0; iChild < node->getContents().getCount(); iChild++) { + for (S32 iChild = 0; iChild < node->getContents().getCount(); iChild++) { switch (node->getContents()[iChild]->getElementType()) { case COLLADA_TYPE::TRANSLATE: case COLLADA_TYPE::ROTATE: @@ -109,7 +109,7 @@ ColladaAppNode::ColladaAppNode(const domNode* node, ColladaAppNode* parent) void ColladaAppNode::buildChildList() { // Process children: collect and elements - for (int iChild = 0; iChild < p_domNode->getContents().getCount(); iChild++) { + for (S32 iChild = 0; iChild < p_domNode->getContents().getCount(); iChild++) { daeElement* child = p_domNode->getContents()[iChild]; switch (child->getElementType()) { @@ -139,7 +139,7 @@ void ColladaAppNode::buildChildList() void ColladaAppNode::buildMeshList() { // Process children: collect and elements - for (int iChild = 0; iChild < p_domNode->getContents().getCount(); iChild++) { + for (S32 iChild = 0; iChild < p_domNode->getContents().getCount(); iChild++) { daeElement* child = p_domNode->getContents()[iChild]; switch (child->getElementType()) { @@ -167,7 +167,7 @@ bool ColladaAppNode::animatesTransform(const AppSequence* appSeq) { // Check if any of this node's transform elements are animated during the // sequence interval - for (int iTxfm = 0; iTxfm < nodeTransforms.size(); iTxfm++) { + for (S32 iTxfm = 0; iTxfm < nodeTransforms.size(); iTxfm++) { if (nodeTransforms[iTxfm].isAnimated(appSeq->getStart(), appSeq->getEnd())) return true; } @@ -227,7 +227,7 @@ MatrixF ColladaAppNode::getTransform(F32 time) } // Multiply by local node transform elements - for (int iTxfm = 0; iTxfm < nodeTransforms.size(); iTxfm++) { + for (S32 iTxfm = 0; iTxfm < nodeTransforms.size(); iTxfm++) { MatrixF mat(true); diff --git a/Engine/source/ts/collada/colladaAppSequence.cpp b/Engine/source/ts/collada/colladaAppSequence.cpp index 3422fe029..6f65a01bf 100644 --- a/Engine/source/ts/collada/colladaAppSequence.cpp +++ b/Engine/source/ts/collada/colladaAppSequence.cpp @@ -74,7 +74,7 @@ F32 ColladaAppSequence::getBlendRefTime() void ColladaAppSequence::setActive(bool active) { - for (int iAnim = 0; iAnim < getClip()->getInstance_animation_array().getCount(); iAnim++) { + for (S32 iAnim = 0; iAnim < getClip()->getInstance_animation_array().getCount(); iAnim++) { domAnimation* anim = daeSafeCast(getClip()->getInstance_animation_array()[iAnim]->getUrl().getElement()); if (anim) setAnimationActive(anim, active); @@ -84,7 +84,7 @@ void ColladaAppSequence::setActive(bool active) void ColladaAppSequence::setAnimationActive(const domAnimation* anim, bool active) { // Enabled/disable data channels for this animation - for (int iChannel = 0; iChannel < anim->getChannel_array().getCount(); iChannel++) { + for (S32 iChannel = 0; iChannel < anim->getChannel_array().getCount(); iChannel++) { domChannel* channel = anim->getChannel_array()[iChannel]; AnimData* animData = reinterpret_cast(channel->getUserData()); if (animData) @@ -92,6 +92,6 @@ void ColladaAppSequence::setAnimationActive(const domAnimation* anim, bool activ } // Recurse into child animations - for (int iAnim = 0; iAnim < anim->getAnimation_array().getCount(); iAnim++) + for (S32 iAnim = 0; iAnim < anim->getAnimation_array().getCount(); iAnim++) setAnimationActive(anim->getAnimation_array()[iAnim], active); } diff --git a/Engine/source/ts/collada/colladaExtensions.h b/Engine/source/ts/collada/colladaExtensions.h index ab6d69289..40e490267 100644 --- a/Engine/source/ts/collada/colladaExtensions.h +++ b/Engine/source/ts/collada/colladaExtensions.h @@ -59,8 +59,8 @@ protected: template const domTechnique* findExtraTechnique(const T* element, const char* name) const { if (element) { - for (int iExt = 0; iExt < element->getExtra_array().getCount(); iExt++) { - for (int iTech = 0; iTech < element->getExtra_array()[iExt]->getTechnique_array().getCount(); iTech++) { + for (S32 iExt = 0; iExt < element->getExtra_array().getCount(); iExt++) { + for (S32 iTech = 0; iTech < element->getExtra_array()[iExt]->getTechnique_array().getCount(); iTech++) { if (dStrEqual(element->getExtra_array()[iExt]->getTechnique_array()[iTech]->getProfile(), name)) return element->getExtra_array()[iExt]->getTechnique_array()[iTech]; } @@ -75,7 +75,7 @@ protected: const domCommon_color_or_texture_type_complexType::domTexture* element, const char* name) const { if (element && element->getExtra()) { - for (int iTech = 0; iTech < element->getExtra()->getTechnique_array().getCount(); iTech++) { + for (S32 iTech = 0; iTech < element->getExtra()->getTechnique_array().getCount(); iTech++) { if (dStrEqual(element->getExtra()->getTechnique_array()[iTech]->getProfile(), name)) return element->getExtra()->getTechnique_array()[iTech]; } @@ -88,7 +88,7 @@ protected: { if (pTechnique) { // search the technique contents for the desired parameter - for (int iParam = 0; iParam < pTechnique->getContents().getCount(); iParam++) { + for (S32 iParam = 0; iParam < pTechnique->getContents().getCount(); iParam++) { const domAny* param = daeSafeCast(pTechnique->getContents()[iParam]); if (param && !dStrcmp(param->getElementName(), name)) return param; @@ -290,7 +290,7 @@ public: // Torque profile pTechnique = findExtraTechnique(clip, "Torque"); GET_EXTRA_PARAM(num_triggers, 0); - for (int iTrigger = 0; iTrigger < num_triggers; iTrigger++) { + for (S32 iTrigger = 0; iTrigger < num_triggers; iTrigger++) { triggers.increment(); get(avar("trigger_time%d", iTrigger), triggers.last().time, 0.0f); get(avar("trigger_state%d", iTrigger), triggers.last().state, 0); diff --git a/Engine/source/ts/collada/colladaImport.cpp b/Engine/source/ts/collada/colladaImport.cpp index 7692dcc77..1657d22c4 100644 --- a/Engine/source/ts/collada/colladaImport.cpp +++ b/Engine/source/ts/collada/colladaImport.cpp @@ -50,7 +50,7 @@ static void processNode(GuiTreeViewCtrl* tree, domNode* node, S32 parentID, Scen S32 nodeID = tree->insertItem(parentID, _GetNameOrId(node), "node", "", 0, 0); // Update mesh and poly counts - for (int i = 0; i < node->getContents().getCount(); i++) + for (S32 i = 0; i < node->getContents().getCount(); i++) { domGeometry* geom = 0; const char* elemName = ""; @@ -178,13 +178,13 @@ ConsoleFunction( enumColladaForImport, bool, 3, 3, SceneStats stats; // Query DOM for shape summary details - for (int i = 0; i < root->getLibrary_visual_scenes_array().getCount(); i++) + for (S32 i = 0; i < root->getLibrary_visual_scenes_array().getCount(); i++) { const domLibrary_visual_scenes* libScenes = root->getLibrary_visual_scenes_array()[i]; - for (int j = 0; j < libScenes->getVisual_scene_array().getCount(); j++) + for (S32 j = 0; j < libScenes->getVisual_scene_array().getCount(); j++) { const domVisual_scene* visualScene = libScenes->getVisual_scene_array()[j]; - for (int k = 0; k < visualScene->getNode_array().getCount(); k++) + for (S32 k = 0; k < visualScene->getNode_array().getCount(); k++) processNode(tree, visualScene->getNode_array()[k], nodesID, stats); } } diff --git a/Engine/source/ts/collada/colladaLights.cpp b/Engine/source/ts/collada/colladaLights.cpp index 1388278d0..71d2c33df 100644 --- a/Engine/source/ts/collada/colladaLights.cpp +++ b/Engine/source/ts/collada/colladaLights.cpp @@ -215,11 +215,11 @@ ConsoleFunction( loadColladaLights, bool, 2, 4, // First grab all of the top-level nodes Vector sceneNodes; - for (int iSceneLib = 0; iSceneLib < root->getLibrary_visual_scenes_array().getCount(); iSceneLib++) { + for (S32 iSceneLib = 0; iSceneLib < root->getLibrary_visual_scenes_array().getCount(); iSceneLib++) { const domLibrary_visual_scenes* libScenes = root->getLibrary_visual_scenes_array()[iSceneLib]; - for (int iScene = 0; iScene < libScenes->getVisual_scene_array().getCount(); iScene++) { + for (S32 iScene = 0; iScene < libScenes->getVisual_scene_array().getCount(); iScene++) { const domVisual_scene* visualScene = libScenes->getVisual_scene_array()[iScene]; - for (int iNode = 0; iNode < visualScene->getNode_array().getCount(); iNode++) + for (S32 iNode = 0; iNode < visualScene->getNode_array().getCount(); iNode++) sceneNodes.push_back(new ColladaAppNode(visualScene->getNode_array()[iNode])); } } diff --git a/Engine/source/ts/collada/colladaShapeLoader.cpp b/Engine/source/ts/collada/colladaShapeLoader.cpp index 3822e9e01..219b07459 100644 --- a/Engine/source/ts/collada/colladaShapeLoader.cpp +++ b/Engine/source/ts/collada/colladaShapeLoader.cpp @@ -96,8 +96,8 @@ ColladaShapeLoader::ColladaShapeLoader(domCOLLADA* _root) ColladaShapeLoader::~ColladaShapeLoader() { // Delete all of the animation channels - for (int iAnim = 0; iAnim < animations.size(); iAnim++) { - for (int iChannel = 0; iChannel < animations[iAnim]->size(); iChannel++) + for (S32 iAnim = 0; iAnim < animations.size(); iAnim++) { + for (S32 iChannel = 0; iChannel < animations[iAnim]->size(); iChannel++) delete (*animations[iAnim])[iChannel]; delete animations[iAnim]; } @@ -113,7 +113,7 @@ void ColladaShapeLoader::processAnimation(const domAnimation* anim, F32& maxEndT const char* sSKEWNames[] = { ".ROTATEX", ".ROTATEY", ".ROTATEZ", ".AROUNDX", ".AROUNDY", ".AROUNDZ", ".ANGLE", "" }; const char* sNullNames[] = { "" }; - for (int iChannel = 0; iChannel < anim->getChannel_array().getCount(); iChannel++) { + for (S32 iChannel = 0; iChannel < anim->getChannel_array().getCount(); iChannel++) { // Get the animation elements: , domChannel* channel = anim->getChannel_array()[iChannel]; @@ -150,7 +150,7 @@ void ColladaShapeLoader::processAnimation(const domAnimation* anim, F32& maxEndT channel->setUserData(targetChannels->last()); AnimData& data = *targetChannels->last(); - for (int iInput = 0; iInput < sampler->getInput_array().getCount(); iInput++) { + for (S32 iInput = 0; iInput < sampler->getInput_array().getCount(); iInput++) { const domInputLocal* input = sampler->getInput_array()[iInput]; const domSource* source = daeSafeCast(input->getSource().getElement()); @@ -219,7 +219,7 @@ void ColladaShapeLoader::processAnimation(const domAnimation* anim, F32& maxEndT } // Process child animations - for (int iAnim = 0; iAnim < anim->getAnimation_array().getCount(); iAnim++) + for (S32 iAnim = 0; iAnim < anim->getAnimation_array().getCount(); iAnim++) processAnimation(anim->getAnimation_array()[iAnim], maxEndTime, minFrameTime); } @@ -227,20 +227,20 @@ void ColladaShapeLoader::enumerateScene() { // Get animation clips Vector animationClips; - for (int iClipLib = 0; iClipLib < root->getLibrary_animation_clips_array().getCount(); iClipLib++) { + for (S32 iClipLib = 0; iClipLib < root->getLibrary_animation_clips_array().getCount(); iClipLib++) { const domLibrary_animation_clips* libraryClips = root->getLibrary_animation_clips_array()[iClipLib]; - for (int iClip = 0; iClip < libraryClips->getAnimation_clip_array().getCount(); iClip++) + for (S32 iClip = 0; iClip < libraryClips->getAnimation_clip_array().getCount(); iClip++) appSequences.push_back(new ColladaAppSequence(libraryClips->getAnimation_clip_array()[iClip])); } // Process all animations => this attaches animation channels to the targeted // Collada elements, and determines the length of the sequence if it is not // already specified in the Collada element - for (int iSeq = 0; iSeq < appSequences.size(); iSeq++) { + for (S32 iSeq = 0; iSeq < appSequences.size(); iSeq++) { ColladaAppSequence* appSeq = dynamic_cast(appSequences[iSeq]); F32 maxEndTime = 0; F32 minFrameTime = 1000.0f; - for (int iAnim = 0; iAnim < appSeq->getClip()->getInstance_animation_array().getCount(); iAnim++) { + for (S32 iAnim = 0; iAnim < appSeq->getClip()->getInstance_animation_array().getCount(); iAnim++) { domAnimation* anim = daeSafeCast(appSeq->getClip()->getInstance_animation_array()[iAnim]->getUrl().getElement()); if (anim) processAnimation(anim, maxEndTime, minFrameTime); @@ -256,11 +256,11 @@ void ColladaShapeLoader::enumerateScene() // First grab all of the top-level nodes Vector sceneNodes; - for (int iSceneLib = 0; iSceneLib < root->getLibrary_visual_scenes_array().getCount(); iSceneLib++) { + for (S32 iSceneLib = 0; iSceneLib < root->getLibrary_visual_scenes_array().getCount(); iSceneLib++) { const domLibrary_visual_scenes* libScenes = root->getLibrary_visual_scenes_array()[iSceneLib]; - for (int iScene = 0; iScene < libScenes->getVisual_scene_array().getCount(); iScene++) { + for (S32 iScene = 0; iScene < libScenes->getVisual_scene_array().getCount(); iScene++) { const domVisual_scene* visualScene = libScenes->getVisual_scene_array()[iScene]; - for (int iNode = 0; iNode < visualScene->getNode_array().getCount(); iNode++) + for (S32 iNode = 0; iNode < visualScene->getNode_array().getCount(); iNode++) sceneNodes.push_back(visualScene->getNode_array()[iNode]); } } @@ -272,10 +272,10 @@ void ColladaShapeLoader::enumerateScene() case ColladaUtils::ImportOptions::DetectDTS: // Check for a baseXX->startXX hierarchy at the top-level, if we find // one, use trailing numbers for LOD, otherwise use a single size - for (int iNode = 0; singleDetail && (iNode < sceneNodes.size()); iNode++) { + for (S32 iNode = 0; singleDetail && (iNode < sceneNodes.size()); iNode++) { domNode* node = sceneNodes[iNode]; if (dStrStartsWith(_GetNameOrId(node), "base")) { - for (int iChild = 0; iChild < node->getNode_array().getCount(); iChild++) { + for (S32 iChild = 0; iChild < node->getNode_array().getCount(); iChild++) { domNode* child = node->getNode_array()[iChild]; if (dStrStartsWith(_GetNameOrId(child), "start")) { singleDetail = false; @@ -484,7 +484,7 @@ void updateMaterialsScript(const Torque::Path &path, bool copyTextures = false) // If importing a sketchup file, the paths will point inside the KMZ so we need to cache them. if (copyTextures) { - for (int iMat = 0; iMat < persistMgr.getDirtyList().size(); iMat++) + for (S32 iMat = 0; iMat < persistMgr.getDirtyList().size(); iMat++) { Material *mat = dynamic_cast( persistMgr.getDirtyList()[iMat].getObject() ); diff --git a/Engine/source/ts/collada/colladaUtils.cpp b/Engine/source/ts/collada/colladaUtils.cpp index 7bd5b2e9d..e3462daf9 100644 --- a/Engine/source/ts/collada/colladaUtils.cpp +++ b/Engine/source/ts/collada/colladaUtils.cpp @@ -84,7 +84,7 @@ const domProfile_COMMON* ColladaUtils::findEffectCommonProfile(const domEffect* if (effect) { // Find the COMMON profile const domFx_profile_abstract_Array& profiles = effect->getFx_profile_abstract_array(); - for (int iProfile = 0; iProfile < profiles.getCount(); iProfile++) { + for (S32 iProfile = 0; iProfile < profiles.getCount(); iProfile++) { if (profiles[iProfile]->getElementType() == COLLADA_TYPE::PROFILE_COMMON) return daeSafeCast(profiles[iProfile]); } @@ -245,7 +245,7 @@ BasePrimitive* BasePrimitive::get(const daeElement* element) // Collada animation curves /// Determine which elements are being targeted -void AnimData::parseTargetString(const char* target, int fullCount, const char* elements[]) +void AnimData::parseTargetString(const char* target, S32 fullCount, const char* elements[]) { // Assume targeting all elements at offset 0 targetValueCount = fullCount; @@ -253,7 +253,7 @@ void AnimData::parseTargetString(const char* target, int fullCount, const char* // Check for array syntax: (n) or (n)(m) if (const char* p = dStrchr(target, '(')) { - int indN, indM; + S32 indN, indM; if (dSscanf(p, "(%d)(%d)", &indN, &indM) == 2) { targetValueOffset = (indN * 4) + indM; // @todo: 4x4 matrix only targetValueCount = 1; @@ -265,7 +265,7 @@ void AnimData::parseTargetString(const char* target, int fullCount, const char* } else if (const char* p = dStrrchr(target, '.')) { // Check for named elements - for (int iElem = 0; elements[iElem][0] != 0; iElem++) { + for (S32 iElem = 0; elements[iElem][0] != 0; iElem++) { if (!dStrcmp(p, elements[iElem])) { targetValueOffset = iElem; targetValueCount = 1; @@ -344,7 +344,7 @@ void AnimData::interpValue(F32 t, U32 offset, double* value) const t = mClampF(t, curveStart, curveEnd); // find the index of the input keyframe BEFORE 't' - int index; + S32 index; for (index = 0; index < input.size()-2; index++) { if (input.getFloatValue(index + 1) > t) break; @@ -470,7 +470,7 @@ void AnimData::interpValue(F32 t, U32 offset, const char** value) const t = mClampF(t, curveStart, curveEnd); // find the index of the input keyframe BEFORE 't' - int index; + S32 index; for (index = 0; index < input.size()-2; index++) { if (input.getFloatValue(index + 1) > t) break; @@ -487,9 +487,9 @@ void AnimData::interpValue(F32 t, U32 offset, const char** value) const static void conditioner_fixupTextureSIDs(domCOLLADA* root) { - for (int iLib = 0; iLib < root->getLibrary_effects_array().getCount(); iLib++) { + for (S32 iLib = 0; iLib < root->getLibrary_effects_array().getCount(); iLib++) { domLibrary_effects* lib = root->getLibrary_effects_array()[iLib]; - for (int iEffect = 0; iEffect < lib->getEffect_array().getCount(); iEffect++) { + for (S32 iEffect = 0; iEffect < lib->getEffect_array().getCount(); iEffect++) { domEffect* effect = lib->getEffect_array()[iEffect]; const domCommon_color_or_texture_type_complexType* diffuse = findEffectDiffuse(effect); if (!diffuse || !diffuse->getTexture()) @@ -542,9 +542,9 @@ static void conditioner_fixupTextureSIDs(domCOLLADA* root) static void conditioner_fixupImageURIs(domCOLLADA* root) { - for (int iLib = 0; iLib < root->getLibrary_images_array().getCount(); iLib++) { + for (S32 iLib = 0; iLib < root->getLibrary_images_array().getCount(); iLib++) { domLibrary_images* lib = root->getLibrary_images_array()[iLib]; - for (int iImage = 0; iImage < lib->getImage_array().getCount(); iImage++) { + for (S32 iImage = 0; iImage < lib->getImage_array().getCount(); iImage++) { domImage* image = lib->getImage_array()[iImage]; if (image->getInit_from()) { xsAnyURI& uri = image->getInit_from()->getValue(); @@ -595,7 +595,7 @@ static void conditioner_fixupTransparency(domCOLLADA* root) // Get the string const char *authoringTool = ""; if (const domAsset* asset = root->getAsset()) { - for (int iContrib = 0; iContrib < asset->getContributor_array().getCount(); iContrib++) { + for (S32 iContrib = 0; iContrib < asset->getContributor_array().getCount(); iContrib++) { const domAsset::domContributor* contrib = asset->getContributor_array()[iContrib]; if (contrib->getAuthoring_tool()) { authoringTool = contrib->getAuthoring_tool()->getValue(); @@ -608,7 +608,7 @@ static void conditioner_fixupTransparency(domCOLLADA* root) bool invertTransparency = false; const char *toolNames[] = { "FBX COLLADA exporter", "Google SketchUp", "Illusoft Collada Exporter", "FCollada" }; - for (int iName = 0; iName < (sizeof(toolNames)/sizeof(toolNames[0])); iName++) { + for (S32 iName = 0; iName < (sizeof(toolNames)/sizeof(toolNames[0])); iName++) { if (dStrstr(authoringTool, toolNames[iName])) { invertTransparency = true; break; @@ -619,9 +619,9 @@ static void conditioner_fixupTransparency(domCOLLADA* root) return; // Invert transparency as required for each effect - for (int iLib = 0; iLib < root->getLibrary_effects_array().getCount(); iLib++) { + for (S32 iLib = 0; iLib < root->getLibrary_effects_array().getCount(); iLib++) { domLibrary_effects* lib = root->getLibrary_effects_array()[iLib]; - for (int iEffect = 0; iEffect < lib->getEffect_array().getCount(); iEffect++) { + for (S32 iEffect = 0; iEffect < lib->getEffect_array().getCount(); iEffect++) { domEffect* effect = lib->getEffect_array()[iEffect]; // Find the common profile @@ -658,9 +658,9 @@ static void conditioner_fixupTransparency(domCOLLADA* root) static void conditioner_checkBindShapeMatrix(domCOLLADA* root) { - for (int iLib = 0; iLib < root->getLibrary_controllers_array().getCount(); iLib++) { + for (S32 iLib = 0; iLib < root->getLibrary_controllers_array().getCount(); iLib++) { domLibrary_controllers* lib = root->getLibrary_controllers_array().get(iLib); - for (int iCon = 0; iCon < lib->getController_array().getCount(); iCon++) { + for (S32 iCon = 0; iCon < lib->getController_array().getCount(); iCon++) { domController* con = lib->getController_array().get(iCon); if (con->getSkin() && con->getSkin()->getBind_shape_matrix()) { @@ -677,14 +677,14 @@ static void conditioner_checkBindShapeMatrix(domCOLLADA* root) static void conditioner_fixupVertexWeightJoints(domCOLLADA* root) { - for (int iLib = 0; iLib < root->getLibrary_controllers_array().getCount(); iLib++) { + for (S32 iLib = 0; iLib < root->getLibrary_controllers_array().getCount(); iLib++) { domLibrary_controllers* lib = root->getLibrary_controllers_array().get(iLib); - for (int iCon = 0; iCon < lib->getController_array().getCount(); iCon++) { + for (S32 iCon = 0; iCon < lib->getController_array().getCount(); iCon++) { domController* con = lib->getController_array().get(iCon); if (con->getSkin() && con->getSkin()->getVertex_weights()) { domInputLocalOffset_Array& vw_inputs = con->getSkin()->getVertex_weights()->getInput_array(); - for (int vInput = 0; vInput < vw_inputs.getCount(); vInput++) { + for (S32 vInput = 0; vInput < vw_inputs.getCount(); vInput++) { domInputLocalOffset *vw_input = vw_inputs.get(vInput); if (dStrEqual(vw_input->getSemantic(), "JOINT")) { @@ -695,7 +695,7 @@ static void conditioner_fixupVertexWeightJoints(domCOLLADA* root) // Copy the value from the JOINTS input instead domInputLocal_Array& joint_inputs = con->getSkin()->getJoints()->getInput_array(); - for (int jInput = 0; jInput < joint_inputs.getCount(); jInput++) { + for (S32 jInput = 0; jInput < joint_inputs.getCount(); jInput++) { domInputLocal *joint_input = joint_inputs.get(jInput); if (dStrEqual(joint_input->getSemantic(), "JOINT")) { @@ -714,16 +714,16 @@ static void conditioner_fixupVertexWeightJoints(domCOLLADA* root) static void conditioner_createDefaultClip(domCOLLADA* root) { // Check if the document has any s - for (int iLib = 0; iLib < root->getLibrary_animation_clips_array().getCount(); iLib++) { + for (S32 iLib = 0; iLib < root->getLibrary_animation_clips_array().getCount(); iLib++) { if (root->getLibrary_animation_clips_array()[iLib]->getAnimation_clip_array().getCount()) return; } // Get all top-level s into an array domAnimation_Array animations; - for (int iAnimLib = 0; iAnimLib < root->getLibrary_animations_array().getCount(); iAnimLib++) { + for (S32 iAnimLib = 0; iAnimLib < root->getLibrary_animations_array().getCount(); iAnimLib++) { const domLibrary_animations* libraryAnims = root->getLibrary_animations_array()[iAnimLib]; - for (int iAnim = 0; iAnim < libraryAnims->getAnimation_array().getCount(); iAnim++) + for (S32 iAnim = 0; iAnim < libraryAnims->getAnimation_array().getCount(); iAnim++) animations.append(libraryAnims->getAnimation_array()[iAnim]); } @@ -748,7 +748,7 @@ static void conditioner_createDefaultClip(domCOLLADA* root) // Add all top_level animations to the clip (sub-animations will be included // when the clip is procesed) - for (int iAnim = 0; iAnim < animations.getCount(); iAnim++) { + for (S32 iAnim = 0; iAnim < animations.getCount(); iAnim++) { if (!animations[iAnim]->getId()) animations[iAnim]->setId(avar("dummy-animation-id%d", iAnim)); CREATE_ELEMENT(animation_clip, instance_animation, domInstanceWithExtra) @@ -767,7 +767,7 @@ static void conditioner_createDefaultClip(domCOLLADA* root) static void conditioner_fixupAnimation(domAnimation* anim) { - for (int iChannel = 0; iChannel < anim->getChannel_array().getCount(); iChannel++) { + for (S32 iChannel = 0; iChannel < anim->getChannel_array().getCount(); iChannel++) { // Get the animation elements: , domChannel* channel = anim->getChannel_array()[iChannel]; @@ -848,7 +848,7 @@ static void conditioner_fixupAnimation(domAnimation* anim) } // Process child animations - for (int iAnim = 0; iAnim < anim->getAnimation_array().getCount(); iAnim++) + for (S32 iAnim = 0; iAnim < anim->getAnimation_array().getCount(); iAnim++) conditioner_fixupAnimation(anim->getAnimation_array()[iAnim]); } @@ -893,9 +893,9 @@ void ColladaUtils::applyConditioners(domCOLLADA* root) // 2) Some exporters generate visibility animations but don't add the FCOLLADA // extension, so the target doesn't actually exist! Detect this situation // and add the extension manually so the animation still works. - for (int iLib = 0; iLib < root->getLibrary_animations_array().getCount(); iLib++) { + for (S32 iLib = 0; iLib < root->getLibrary_animations_array().getCount(); iLib++) { const domLibrary_animations* lib = root->getLibrary_animations_array()[iLib]; - for (int iAnim = 0; iAnim < lib->getAnimation_array().getCount(); iAnim++) + for (S32 iAnim = 0; iAnim < lib->getAnimation_array().getCount(); iAnim++) conditioner_fixupAnimation(lib->getAnimation_array()[iAnim]); } } diff --git a/Engine/source/ts/collada/colladaUtils.h b/Engine/source/ts/collada/colladaUtils.h index e2ee4b377..9e7870383 100644 --- a/Engine/source/ts/collada/colladaUtils.h +++ b/Engine/source/ts/collada/colladaUtils.h @@ -185,7 +185,7 @@ template<> inline MatrixF vecToMatrixF(const domListOfFloats& vec) template<> inline MatrixF vecToMatrixF(const domListOfFloats& vec) { MatrixF mat; - for (int i = 0; i < 16; i++) + for (S32 i = 0; i < 16; i++) mat[i] = vec[i]; return mat; } @@ -332,7 +332,7 @@ public: // If no input params were specified, just map the source params directly if (!offsets.size()) { - for (int iParam = 0; iParam < accessor->getParam_array().getCount(); iParam++) + for (S32 iParam = 0; iParam < accessor->getParam_array().getCount(); iParam++) offsets.push_back(iParam); } @@ -348,9 +348,9 @@ public: //------------------------------------------------------ // Get a pointer to the start of a group of values (index advances by stride) - //template T getArrayData(int index) const { return 0; } + //template T getArrayData(S32 index) const { return 0; } - const double* getStringArrayData(int index) const + const double* getStringArrayData(S32 index) const { if ((index >= 0) && (index < size())) { if (source->getFloat_array()) @@ -361,9 +361,9 @@ public: //------------------------------------------------------ // Read a single value from the source array - //template T getValue(int index) const { return T; } + //template T getValue(S32 index) const { return T; } - const char* getStringValue(int index) const + const char* getStringValue(S32 index) const { if ((index >= 0) && (index < size())) { // could be plain strings or IDREFs @@ -375,7 +375,7 @@ public: return ""; } - F32 getFloatValue(int index) const + F32 getFloatValue(S32 index) const { F32 value(0); if (const double* data = getStringArrayData(index)) @@ -383,7 +383,7 @@ public: return value; } - Point2F getPoint2FValue(int index) const + Point2F getPoint2FValue(S32 index) const { Point2F value(0, 0); if (const double* data = getStringArrayData(index)) @@ -391,7 +391,7 @@ public: return value; } - Point3F getPoint3FValue(int index) const + Point3F getPoint3FValue(S32 index) const { Point3F value(1, 0, 0); if (const double* data = getStringArrayData(index)) @@ -399,7 +399,7 @@ public: return value; } - ColorI getColorIValue(int index) const + ColorI getColorIValue(S32 index) const { ColorI value(255, 255, 255, 255); if (const double* data = getStringArrayData(index)) @@ -413,11 +413,11 @@ public: return value; } - MatrixF getMatrixFValue(int index) const + MatrixF getMatrixFValue(S32 index) const { MatrixF value(true); if (const double* data = getStringArrayData(index)) { - for (int i = 0; i < 16; i++) + for (S32 i = 0; i < 16; i++) value[i] = data[i]; } return value; @@ -486,7 +486,7 @@ public: // Determine stride stride = 0; - for (int iInput = 0; iInput < getInputs().getCount(); iInput++) { + for (S32 iInput = 0; iInput < getInputs().getCount(); iInput++) { if (getInputs()[iInput]->getOffset() >= stride) stride = getInputs()[iInput]->getOffset() + 1; } @@ -524,7 +524,7 @@ template<> inline const domListOfUInts *ColladaPrimitive::getTrian // Convert strips to triangles pTriangleData = new domListOfUInts(); - for (int iStrip = 0; iStrip < primitive->getCount(); iStrip++) { + for (S32 iStrip = 0; iStrip < primitive->getCount(); iStrip++) { domP* P = primitive->getP_array()[iStrip]; @@ -537,7 +537,7 @@ template<> inline const domListOfUInts *ColladaPrimitive::getTrian // Convert the strip back to a triangle list domUint* v0 = pSrcData; - for (int iTri = 0; iTri < numTriangles; iTri++, v0 += stride) { + for (S32 iTri = 0; iTri < numTriangles; iTri++, v0 += stride) { if (iTri & 0x1) { // CW triangle @@ -565,7 +565,7 @@ template<> inline const domListOfUInts *ColladaPrimitive::getTriangl // Convert strips to triangles pTriangleData = new domListOfUInts(); - for (int iStrip = 0; iStrip < primitive->getCount(); iStrip++) { + for (S32 iStrip = 0; iStrip < primitive->getCount(); iStrip++) { domP* P = primitive->getP_array()[iStrip]; @@ -578,7 +578,7 @@ template<> inline const domListOfUInts *ColladaPrimitive::getTriangl // Convert the fan back to a triangle list domUint* v0 = pSrcData + stride; - for (int iTri = 0; iTri < numTriangles; iTri++, v0 += stride) { + for (S32 iTri = 0; iTri < numTriangles; iTri++, v0 += stride) { pTriangleData->appendArray(stride, pSrcData); // shared vertex pTriangleData->appendArray(stride, v0); // previous vertex pTriangleData->appendArray(stride, v0+stride); // current vertex @@ -597,7 +597,7 @@ template<> inline const domListOfUInts *ColladaPrimitive::getTriang // Convert polygons to triangles pTriangleData = new domListOfUInts(); - for (int iPoly = 0; iPoly < primitive->getCount(); iPoly++) { + for (S32 iPoly = 0; iPoly < primitive->getCount(); iPoly++) { domP* P = primitive->getP_array()[iPoly]; @@ -612,7 +612,7 @@ template<> inline const domListOfUInts *ColladaPrimitive::getTriang // converting the polygon to triangles. domUint* v0 = pSrcData; pSrcData += stride; - for (int iTri = 0; iTri < numPoints-2; iTri++) { + for (S32 iTri = 0; iTri < numPoints-2; iTri++) { pTriangleData->appendArray(stride, v0); pTriangleData->appendArray(stride*2, pSrcData); pSrcData += stride; @@ -636,7 +636,7 @@ template<> inline const domListOfUInts *ColladaPrimitive::getTriang const domListOfUInts& vcount = primitive->getVcount()->getValue(); U32 expectedCount = 0; - for (int iPoly = 0; iPoly < vcount.getCount(); iPoly++) + for (S32 iPoly = 0; iPoly < vcount.getCount(); iPoly++) expectedCount += vcount[iPoly]; expectedCount *= stride; @@ -648,13 +648,13 @@ template<> inline const domListOfUInts *ColladaPrimitive::getTriang } domUint* pSrcData = &(primitive->getP()->getValue()[0]); - for (int iPoly = 0; iPoly < vcount.getCount(); iPoly++) { + for (S32 iPoly = 0; iPoly < vcount.getCount(); iPoly++) { // Use a simple tri-fan (centered at the first point) method of // converting the polygon to triangles. domUint* v0 = pSrcData; pSrcData += stride; - for (int iTri = 0; iTri < vcount[iPoly]-2; iTri++) { + for (S32 iTri = 0; iTri < vcount[iPoly]-2; iTri++) { pTriangleData->appendArray(stride, v0); pTriangleData->appendArray(stride*2, pSrcData); pSrcData += stride; @@ -713,7 +713,7 @@ struct AnimData AnimData() : enabled(false) { } - void parseTargetString(const char* target, int fullCount, const char* elements[]); + void parseTargetString(const char* target, S32 fullCount, const char* elements[]); F32 invertParamCubic(F32 param, F32 x0, F32 x1, F32 x2, F32 x3) const; void interpValue(F32 t, U32 offset, double* value) const; @@ -757,7 +757,7 @@ struct AnimatedElement // Animate the value const AnimChannels* channels = AnimData::getAnimChannels(element); if (channels && (time >= 0)) { - for (int iChannel = 0; iChannel < channels->size(); iChannel++) { + for (S32 iChannel = 0; iChannel < channels->size(); iChannel++) { const AnimData* animData = (*channels)[iChannel]; if (animData->enabled) animData->interpValue(time, 0, &value); @@ -787,10 +787,10 @@ template struct AnimatedElementList : public AnimatedElement // Animate the vector const AnimChannels* channels = AnimData::getAnimChannels(this->element); if (channels && (time >= 0)) { - for (int iChannel = 0; iChannel < channels->size(); iChannel++) { + for (S32 iChannel = 0; iChannel < channels->size(); iChannel++) { const AnimData* animData = (*channels)[iChannel]; if (animData->enabled) { - for (int iValue = 0; iValue < animData->targetValueCount; iValue++) + for (S32 iValue = 0; iValue < animData->targetValueCount; iValue++) animData->interpValue(time, iValue, &vec[animData->targetValueOffset + iValue]); } } diff --git a/Engine/source/ts/loader/tsShapeLoader.cpp b/Engine/source/ts/loader/tsShapeLoader.cpp index 5170867df..89e22350c 100644 --- a/Engine/source/ts/loader/tsShapeLoader.cpp +++ b/Engine/source/ts/loader/tsShapeLoader.cpp @@ -102,7 +102,7 @@ void TSShapeLoader::generateNodeTransform(AppNode* node, F32 t, bool blend, F32 //----------------------------------------------------------------------------- -void TSShapeLoader::updateProgress(int major, const char* msg, int numMinor, int minor) +void TSShapeLoader::updateProgress(S32 major, const char* msg, S32 numMinor, S32 minor) { // Calculate progress value F32 progress = (F32)major / NumLoadPhases; @@ -229,7 +229,7 @@ bool cmpShapeName(const String& key, const Vector& names, void* arg1, vo String getUniqueName(const char* name, NameCmpFunc isNameUnique, const Vector& names, void* arg1=0, void* arg2=0) { - const int MAX_ITERATIONS = 0x10000; // maximum of 4 characters (A-P) will be appended + const S32 MAX_ITERATIONS = 0x10000; // maximum of 4 characters (A-P) will be appended String suffix; for (S32 i = 0; i < MAX_ITERATIONS; i++) @@ -336,7 +336,7 @@ void TSShapeLoader::recurseSubshape(AppNode* appNode, S32 parentIndex, bool recu // Create children if (recurseChildren) { - for (int iChild = 0; iChild < appNode->getNumChildNodes(); iChild++) + for (S32 iChild = 0; iChild < appNode->getNumChildNodes(); iChild++) recurseSubshape(appNode->getChildNode(iChild), myIndex, true); } } @@ -500,9 +500,9 @@ void TSShapeLoader::generateObjects() void TSShapeLoader::generateSkins() { Vector skins; - for (int iObject = 0; iObject < shape->objects.size(); iObject++) + for (S32 iObject = 0; iObject < shape->objects.size(); iObject++) { - for (int iMesh = 0; iMesh < shape->objects[iObject].numMeshes; iMesh++) + for (S32 iMesh = 0; iMesh < shape->objects[iObject].numMeshes; iMesh++) { AppMesh* mesh = appMeshes[shape->objects[iObject].startMeshIndex + iMesh]; if (mesh->isSkin()) @@ -510,7 +510,7 @@ void TSShapeLoader::generateSkins() } } - for (int iSkin = 0; iSkin < skins.size(); iSkin++) + for (S32 iSkin = 0; iSkin < skins.size(); iSkin++) { updateProgress(Load_GenerateSkins, "Generating skins...", skins.size(), iSkin); @@ -524,11 +524,11 @@ void TSShapeLoader::generateSkins() // Map bones to nodes skin->nodeIndex.setSize(skin->bones.size()); - for (int iBone = 0; iBone < skin->bones.size(); iBone++) + for (S32 iBone = 0; iBone < skin->bones.size(); iBone++) { // Find the node that matches this bone skin->nodeIndex[iBone] = -1; - for (int iNode = 0; iNode < appNodes.size(); iNode++) + for (S32 iNode = 0; iNode < appNodes.size(); iNode++) { if (appNodes[iNode]->isEqual(skin->bones[iBone])) { @@ -551,7 +551,7 @@ void TSShapeLoader::generateSkins() void TSShapeLoader::generateDefaultStates() { // Generate default object states (includes initial geometry) - for (int iObject = 0; iObject < shape->objects.size(); iObject++) + for (S32 iObject = 0; iObject < shape->objects.size(); iObject++) { updateProgress(Load_GenerateDefaultStates, "Generating initial mesh and node states...", shape->objects.size(), iObject); @@ -559,7 +559,7 @@ void TSShapeLoader::generateDefaultStates() TSShape::Object& obj = shape->objects[iObject]; // Calculate the objectOffset for each mesh at T=0 - for (int iMesh = 0; iMesh < obj.numMeshes; iMesh++) + for (S32 iMesh = 0; iMesh < obj.numMeshes; iMesh++) { AppMesh* appMesh = appMeshes[obj.startMeshIndex + iMesh]; AppNode* appNode = obj.nodeIndex >= 0 ? appNodes[obj.nodeIndex] : boundsNode; @@ -576,7 +576,7 @@ void TSShapeLoader::generateDefaultStates() } // Generate default node transforms - for (int iNode = 0; iNode < appNodes.size(); iNode++) + for (S32 iNode = 0; iNode < appNodes.size(); iNode++) { // Determine the default translation and rotation for the node QuatF rot, srot; @@ -610,7 +610,7 @@ void TSShapeLoader::generateObjectState(TSShape::Object& obj, F32 t, bool addFra void TSShapeLoader::generateFrame(TSShape::Object& obj, F32 t, bool addFrame, bool addMatFrame) { - for (int iMesh = 0; iMesh < obj.numMeshes; iMesh++) + for (S32 iMesh = 0; iMesh < obj.numMeshes; iMesh++) { AppMesh* appMesh = appMeshes[obj.startMeshIndex + iMesh]; @@ -690,7 +690,7 @@ void TSShapeLoader::generateMaterialList() { // Install the materials into the material list shape->materialList = new TSMaterialList; - for (int iMat = 0; iMat < AppMesh::appMaterials.size(); iMat++) + for (S32 iMat = 0; iMat < AppMesh::appMaterials.size(); iMat++) { updateProgress(Load_GenerateMaterials, "Generating materials...", AppMesh::appMaterials.size(), iMat); @@ -705,7 +705,7 @@ void TSShapeLoader::generateMaterialList() void TSShapeLoader::generateSequences() { - for (int iSeq = 0; iSeq < appSequences.size(); iSeq++) + for (S32 iSeq = 0; iSeq < appSequences.size(); iSeq++) { updateProgress(Load_GenerateSequences, "Generating sequences...", appSequences.size(), iSeq); @@ -783,14 +783,14 @@ void TSShapeLoader::setNodeMembership(TSShape::Sequence& seq, const AppSequence* void TSShapeLoader::setRotationMembership(TSShape::Sequence& seq) { - for (int iNode = 0; iNode < appNodes.size(); iNode++) + for (S32 iNode = 0; iNode < appNodes.size(); iNode++) { // Check if any of the node rotations are different to // the default rotation QuatF defaultRot; shape->defaultRotations[iNode].getQuatF(&defaultRot); - for (int iFrame = 0; iFrame < seq.numKeyframes; iFrame++) + for (S32 iFrame = 0; iFrame < seq.numKeyframes; iFrame++) { if (nodeRotCache[iNode][iFrame] != defaultRot) { @@ -803,13 +803,13 @@ void TSShapeLoader::setRotationMembership(TSShape::Sequence& seq) void TSShapeLoader::setTranslationMembership(TSShape::Sequence& seq) { - for (int iNode = 0; iNode < appNodes.size(); iNode++) + for (S32 iNode = 0; iNode < appNodes.size(); iNode++) { // Check if any of the node translations are different to // the default translation Point3F& defaultTrans = shape->defaultTranslations[iNode]; - for (int iFrame = 0; iFrame < seq.numKeyframes; iFrame++) + for (S32 iFrame = 0; iFrame < seq.numKeyframes; iFrame++) { if (!nodeTransCache[iNode][iFrame].equal(defaultTrans)) { @@ -828,10 +828,10 @@ void TSShapeLoader::setScaleMembership(TSShape::Sequence& seq) U32 alignedScaleCount = 0; U32 uniformScaleCount = 0; - for (int iNode = 0; iNode < appNodes.size(); iNode++) + for (S32 iNode = 0; iNode < appNodes.size(); iNode++) { // Check if any of the node scales are not the unit scale - for (int iFrame = 0; iFrame < seq.numKeyframes; iFrame++) + for (S32 iFrame = 0; iFrame < seq.numKeyframes; iFrame++) { Point3F& scale = nodeScaleCache[iNode][iFrame]; if (!unitScale.equal(scale)) @@ -865,7 +865,7 @@ void TSShapeLoader::setObjectMembership(TSShape::Sequence& seq, const AppSequenc seq.frameMatters.clearAll(); // vert animation (morph) (size = objects.size()) seq.matFrameMatters.clearAll(); // UV animation (size = objects.size()) - for (int iObject = 0; iObject < shape->objects.size(); iObject++) + for (S32 iObject = 0; iObject < shape->objects.size(); iObject++) { if (!appMeshes[shape->objects[iObject].startMeshIndex]) continue; @@ -883,16 +883,16 @@ void TSShapeLoader::setObjectMembership(TSShape::Sequence& seq, const AppSequenc void TSShapeLoader::clearNodeTransformCache() { // clear out the transform caches - for (int i = 0; i < nodeRotCache.size(); i++) + for (S32 i = 0; i < nodeRotCache.size(); i++) delete [] nodeRotCache[i]; nodeRotCache.clear(); - for (int i = 0; i < nodeTransCache.size(); i++) + for (S32 i = 0; i < nodeTransCache.size(); i++) delete [] nodeTransCache[i]; nodeTransCache.clear(); - for (int i = 0; i < nodeScaleRotCache.size(); i++) + for (S32 i = 0; i < nodeScaleRotCache.size(); i++) delete [] nodeScaleRotCache[i]; nodeScaleRotCache.clear(); - for (int i = 0; i < nodeScaleCache.size(); i++) + for (S32 i = 0; i < nodeScaleCache.size(); i++) delete [] nodeScaleCache[i]; nodeScaleCache.clear(); } @@ -903,23 +903,23 @@ void TSShapeLoader::fillNodeTransformCache(TSShape::Sequence& seq, const AppSequ clearNodeTransformCache(); nodeRotCache.setSize(appNodes.size()); - for (int i = 0; i < nodeRotCache.size(); i++) + for (S32 i = 0; i < nodeRotCache.size(); i++) nodeRotCache[i] = new QuatF[seq.numKeyframes]; nodeTransCache.setSize(appNodes.size()); - for (int i = 0; i < nodeTransCache.size(); i++) + for (S32 i = 0; i < nodeTransCache.size(); i++) nodeTransCache[i] = new Point3F[seq.numKeyframes]; nodeScaleRotCache.setSize(appNodes.size()); - for (int i = 0; i < nodeScaleRotCache.size(); i++) + for (S32 i = 0; i < nodeScaleRotCache.size(); i++) nodeScaleRotCache[i] = new QuatF[seq.numKeyframes]; nodeScaleCache.setSize(appNodes.size()); - for (int i = 0; i < nodeScaleCache.size(); i++) + for (S32 i = 0; i < nodeScaleCache.size(); i++) nodeScaleCache[i] = new Point3F[seq.numKeyframes]; // get the node transforms for every frame - for (int iFrame = 0; iFrame < seq.numKeyframes; iFrame++) + for (S32 iFrame = 0; iFrame < seq.numKeyframes; iFrame++) { F32 time = appSeq->getStart() + seq.duration * iFrame / getMax(1, seq.numKeyframes - 1); - for (int iNode = 0; iNode < appNodes.size(); iNode++) + for (S32 iNode = 0; iNode < appNodes.size(); iNode++) { generateNodeTransform(appNodes[iNode], time, seq.isBlend(), appSeq->getBlendRefTime(), nodeRotCache[iNode][iFrame], nodeTransCache[iNode][iFrame], @@ -973,9 +973,9 @@ void TSShapeLoader::generateNodeAnimation(TSShape::Sequence& seq) (seq.flags & TSShape::AlignedScale) ? shape->nodeAlignedScales.size() : shape->nodeUniformScales.size(); - for (int iNode = 0; iNode < appNodes.size(); iNode++) + for (S32 iNode = 0; iNode < appNodes.size(); iNode++) { - for (int iFrame = 0; iFrame < seq.numKeyframes; iFrame++) + for (S32 iFrame = 0; iFrame < seq.numKeyframes; iFrame++) { if (seq.rotationMatters.test(iNode)) addNodeRotation(nodeRotCache[iNode][iFrame], false); @@ -1001,7 +1001,7 @@ void TSShapeLoader::generateObjectAnimation(TSShape::Sequence& seq, const AppSeq { seq.baseObjectState = shape->objectStates.size(); - for (int iObject = 0; iObject < shape->objects.size(); iObject++) + for (S32 iObject = 0; iObject < shape->objects.size(); iObject++) { bool visMatters = seq.visMatters.test(iObject); bool frameMatters = seq.frameMatters.test(iObject); @@ -1009,7 +1009,7 @@ void TSShapeLoader::generateObjectAnimation(TSShape::Sequence& seq, const AppSeq if (visMatters || frameMatters || matFrameMatters) { - for (int iFrame = 0; iFrame < seq.numKeyframes; iFrame++) + for (S32 iFrame = 0; iFrame < seq.numKeyframes; iFrame++) { F32 time = appSeq->getStart() + seq.duration * iFrame / getMax(1, seq.numKeyframes - 1); generateObjectState(shape->objects[iObject], time, frameMatters, matFrameMatters); @@ -1036,7 +1036,7 @@ void TSShapeLoader::generateGroundAnimation(TSShape::Sequence& seq, const AppSeq zapScale(invStartMat); invStartMat.inverse(); - for (int iFrame = 0; iFrame < seq.numGroundFrames; iFrame++) + for (S32 iFrame = 0; iFrame < seq.numGroundFrames; iFrame++) { F32 time = appSeq->getStart() + seq.duration * iFrame / getMax(1, seq.numGroundFrames - 1); @@ -1064,7 +1064,7 @@ void TSShapeLoader::generateFrameTriggers(TSShape::Sequence& seq, const AppSeque seq.flags |= TSShape::MakePath; // Add triggers - for (int iTrigger = 0; iTrigger < seq.numTriggers; iTrigger++) + for (S32 iTrigger = 0; iTrigger < seq.numTriggers; iTrigger++) { shape->triggers.increment(); appSeq->getTrigger(iTrigger, shape->triggers.last()); @@ -1075,7 +1075,7 @@ void TSShapeLoader::generateFrameTriggers(TSShape::Sequence& seq, const AppSeque // need to mark ourselves as such so that on/off can become off/on when sequence // is played in reverse... U32 offTriggers = 0; - for (int iTrigger = 0; iTrigger < seq.numTriggers; iTrigger++) + for (S32 iTrigger = 0; iTrigger < seq.numTriggers; iTrigger++) { U32 state = shape->triggers[seq.firstTrigger+iTrigger].state; if ((state & TSShape::Trigger::StateOn) == 0) @@ -1098,18 +1098,18 @@ void TSShapeLoader::sortDetails() // Insert NULL meshes where required - for (int iSub = 0; iSub < subshapes.size(); iSub++) + for (S32 iSub = 0; iSub < subshapes.size(); iSub++) { Vector validDetails; shape->getSubShapeDetails(iSub, validDetails); - for (int iDet = 0; iDet < validDetails.size(); iDet++) + for (S32 iDet = 0; iDet < validDetails.size(); iDet++) { TSShape::Detail &detail = shape->details[validDetails[iDet]]; if (detail.subShapeNum >= 0) detail.objectDetailNum = iDet; - for (int iObj = shape->subShapeFirstObject[iSub]; + for (S32 iObj = shape->subShapeFirstObject[iSub]; iObj < (shape->subShapeFirstObject[iSub] + shape->subShapeNumObjects[iSub]); iObj++) { @@ -1126,7 +1126,7 @@ void TSShapeLoader::sortDetails() object.numMeshes++; // Fixup the start index for the other objects - for (int k = iObj+1; k < shape->objects.size(); k++) + for (S32 k = iObj+1; k < shape->objects.size(); k++) shape->objects[k].startMeshIndex++; } } @@ -1256,17 +1256,17 @@ TSShapeLoader::~TSShapeLoader() clearNodeTransformCache(); // Clear shared AppMaterial list - for (int iMat = 0; iMat < AppMesh::appMaterials.size(); iMat++) + for (S32 iMat = 0; iMat < AppMesh::appMaterials.size(); iMat++) delete AppMesh::appMaterials[iMat]; AppMesh::appMaterials.clear(); // Delete Subshapes delete boundsNode; - for (int iSub = 0; iSub < subshapes.size(); iSub++) + for (S32 iSub = 0; iSub < subshapes.size(); iSub++) delete subshapes[iSub]; // Delete AppSequences - for (int iSeq = 0; iSeq < appSequences.size(); iSeq++) + for (S32 iSeq = 0; iSeq < appSequences.size(); iSeq++) delete appSequences[iSeq]; appSequences.clear(); } diff --git a/Engine/source/ts/loader/tsShapeLoader.h b/Engine/source/ts/loader/tsShapeLoader.h index 83e9db0ca..3741df31b 100644 --- a/Engine/source/ts/loader/tsShapeLoader.h +++ b/Engine/source/ts/loader/tsShapeLoader.h @@ -63,7 +63,7 @@ public: Load_Complete = NumLoadPhases }; - static void updateProgress(int major, const char* msg, int numMinor=0, int minor=0); + static void updateProgress(S32 major, const char* msg, S32 numMinor=0, S32 minor=0); protected: struct Subshape diff --git a/Engine/source/ts/tsMesh.cpp b/Engine/source/ts/tsMesh.cpp index aa430a557..a07bafcec 100644 --- a/Engine/source/ts/tsMesh.cpp +++ b/Engine/source/ts/tsMesh.cpp @@ -1188,7 +1188,7 @@ void TSSkinMesh::updateSkin( const Vector &transforms, TSVertexBufferHa // set up bone transforms PROFILE_START(TSSkinMesh_UpdateTransforms); - for( int i=0; i &transforms, TSVertexBufferHa skinnedVert.zero(); skinnedNorm.zero(); - for( int tOp = 0; tOp < curVert.transformCount; tOp++ ) + for( S32 tOp = 0; tOp < curVert.transformCount; tOp++ ) { const BatchData::TransformOp &transformOp = curVert.transform[tOp]; @@ -1402,7 +1402,7 @@ void TSSkinMesh::createBatchData() itr != batchOperations.end(); itr++ ) { const BatchData::BatchedVertex &curTransform = *itr; - for( int i = 0; i < curTransform.transformCount; i++ ) + for( S32 i = 0; i < curTransform.transformCount; i++ ) { const BatchData::TransformOp &transformOp = curTransform.transform[i]; @@ -1427,8 +1427,8 @@ void TSSkinMesh::createBatchData() // Now iterate the resulting operations and convert the vectors to aligned // memory locations - const int numBatchOps = batchData.transformKeys.size(); - for(int i = 0; i < numBatchOps; i++) + const S32 numBatchOps = batchData.transformKeys.size(); + for(S32 i = 0; i < numBatchOps; i++) { BatchData::BatchedTransform &curTransform = *batchData.transformBatchOperations.retreive(batchData.transformKeys[i]); const S32 numVerts = curTransform._tmpVec->size(); @@ -1446,7 +1446,7 @@ void TSSkinMesh::createBatchData() } // Now sort the batch data so that the skin function writes close to linear output - for(int i = 0; i < numBatchOps; i++) + for(S32 i = 0; i < numBatchOps; i++) { BatchData::BatchedTransform &curTransform = *batchData.transformBatchOperations.retreive(batchData.transformKeys[i]); dQsort(curTransform.alignedMem, curTransform.numElements, sizeof(BatchData::BatchedVertWeight), _sort_BatchedVertWeight); @@ -2541,7 +2541,7 @@ void TSMesh::assemble( bool skip ) // need to copy to temporary arrays deleteInputArrays = true; primIn = new TSDrawPrimitive[szPrimIn]; - for (int i = 0; i < szPrimIn; i++) + for (S32 i = 0; i < szPrimIn; i++) { primIn[i].start = prim16[i*2]; primIn[i].numElements = prim16[i*2+1]; diff --git a/Engine/source/ts/tsMesh.h b/Engine/source/ts/tsMesh.h index 0db76ecc8..d2ac79087 100644 --- a/Engine/source/ts/tsMesh.h +++ b/Engine/source/ts/tsMesh.h @@ -214,7 +214,7 @@ class TSMesh } // Vector-like interface - __TSMeshVertexBase &operator[](int idx) const { AssertFatal(idx < numElements, "Out of bounds access!"); return *reinterpret_cast<__TSMeshVertexBase *>(base + idx * vertSz); } + __TSMeshVertexBase &operator[](S32 idx) const { AssertFatal(idx < numElements, "Out of bounds access!"); return *reinterpret_cast<__TSMeshVertexBase *>(base + idx * vertSz); } __TSMeshVertexBase *address() const { return reinterpret_cast<__TSMeshVertexBase *>(base); } U32 size() const { return numElements; } dsize_t mem_size() const { return numElements * vertSz; } diff --git a/Engine/source/ts/tsMeshIntrinsics.cpp b/Engine/source/ts/tsMeshIntrinsics.cpp index fbc93fbe8..94b9abd22 100644 --- a/Engine/source/ts/tsMeshIntrinsics.cpp +++ b/Engine/source/ts/tsMeshIntrinsics.cpp @@ -38,7 +38,7 @@ void zero_vert_normal_bulk_C(const dsize_t count, U8 * __restrict const outPtr, // TODO: Try prefetch w/ ptr de-reference - for(register int i = 0; i < count; i++) + for(register S32 i = 0; i < count; i++) { TSMesh::__TSMeshVertexBase *outElem = reinterpret_cast(outData); outElem->_vert.zero(); @@ -60,7 +60,7 @@ void m_matF_x_BatchedVertWeightList_C(const MatrixF &mat, register Point3F tempPt; register Point3F tempNrm; - for(register int i = 0; i < count; i++) + for(register S32 i = 0; i < count; i++) { const TSSkinMesh::BatchData::BatchedVertWeight &inElem = batch[i]; diff --git a/Engine/source/ts/tsShapeConstruct.h b/Engine/source/ts/tsShapeConstruct.h index 52d129837..640c80c91 100644 --- a/Engine/source/ts/tsShapeConstruct.h +++ b/Engine/source/ts/tsShapeConstruct.h @@ -213,7 +213,7 @@ public: void write(TSShape* shape, Stream& stream, const String& savePath); }; - static const int MaxLegacySequences = 127; + static const S32 MaxLegacySequences = 127; protected: FileName mShapePath; diff --git a/Engine/source/ts/tsShapeEdit.cpp b/Engine/source/ts/tsShapeEdit.cpp index bcfb34367..8d585022f 100644 --- a/Engine/source/ts/tsShapeEdit.cpp +++ b/Engine/source/ts/tsShapeEdit.cpp @@ -155,7 +155,7 @@ S32 TSShape::addDetail(const String& dname, S32 size, S32 subShapeNum) alphaOut.increment(); // Fixup objectDetailNum in other detail levels - for (int i = index+1; i < details.size(); i++) + for (S32 i = index+1; i < details.size(); i++) { if ((details[i].subShapeNum >= 0) && ((subShapeNum == -1) || (details[i].subShapeNum == subShapeNum))) @@ -1521,7 +1521,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, // Check if visibility is animated within the frames to be copied const F32 defaultVis = srcShape->objectStates[i].vis; S32 objNum = srcSeq->visMatters.count(i); - for (int iFrame = startFrame; iFrame <= endFrame; iFrame++) + for (S32 iFrame = startFrame; iFrame <= endFrame; iFrame++) { if (srcShape->getObjectState(*srcSeq, iFrame, objNum).vis != defaultVis) { @@ -1600,7 +1600,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, // Check if node position is animated within the frames to be copied const Point3F& defaultTrans = srcShape->defaultTranslations[i]; S32 tranNum = srcSeq->translationMatters.count(i); - for (int iFrame = startFrame; iFrame <= endFrame; iFrame++) + for (S32 iFrame = startFrame; iFrame <= endFrame; iFrame++) { if (srcShape->getTranslation(*srcSeq, iFrame, tranNum) != defaultTrans) { @@ -1615,7 +1615,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, // Check if node rotation is animated within the frames to be copied const QuatF defaultRot = srcShape->defaultRotations[i].getQuatF(); S32 rotNum = srcSeq->rotationMatters.count(i); - for (int iFrame = startFrame; iFrame <= endFrame; iFrame++) + for (S32 iFrame = startFrame; iFrame <= endFrame; iFrame++) { QuatF temp; if (srcShape->getRotation(*srcSeq, iFrame, rotNum, &temp) != defaultRot) @@ -1634,7 +1634,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, { TSScale defaultScale; defaultScale.identity(); - for (int iFrame = startFrame; iFrame <= endFrame; iFrame++) + for (S32 iFrame = startFrame; iFrame <= endFrame; iFrame++) { TSScale temp; if (!(srcShape->getArbitraryScale(*srcSeq, iFrame, scaleNum, &temp) == defaultScale)) @@ -1647,7 +1647,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, else if (srcSeq->animatesAlignedScale()) { const Point3F defaultScale(Point3F::One); - for (int iFrame = startFrame; iFrame <= endFrame; iFrame++) + for (S32 iFrame = startFrame; iFrame <= endFrame; iFrame++) { if (srcShape->getAlignedScale(*srcSeq, iFrame, scaleNum) != defaultScale) { @@ -1659,7 +1659,7 @@ bool TSShape::addSequence(const Torque::Path& path, const String& fromSeq, else if (srcSeq->animatesUniformScale()) { const F32 defaultScale = 1.0f; - for (int iFrame = startFrame; iFrame <= endFrame; iFrame++) + for (S32 iFrame = startFrame; iFrame <= endFrame; iFrame++) { if (srcShape->getUniformScale(*srcSeq, iFrame, scaleNum) != defaultScale) { diff --git a/Engine/source/unit/test.cpp b/Engine/source/unit/test.cpp index 5e6438639..3bfbe44ae 100644 --- a/Engine/source/unit/test.cpp +++ b/Engine/source/unit/test.cpp @@ -40,10 +40,10 @@ TestRegistry *TestRegistry::_list = 0; //----------------------------------------------------------------------------- -static const int MaxMarginCount = 32; -static const int MaxMarginValue = 128; -static int _Margin[MaxMarginCount] = { 3 }; -static int* _MarginPtr = _Margin; +static const S32 MaxMarginCount = 32; +static const S32 MaxMarginValue = 128; +static S32 _Margin[MaxMarginCount] = { 3 }; +static S32* _MarginPtr = _Margin; static char _MarginString[MaxMarginValue]; static void _printMargin() @@ -52,7 +52,7 @@ static void _printMargin() ::fwrite(_MarginString,1,*_MarginPtr,stdout); } -void UnitMargin::Push(int margin) +void UnitMargin::Push(S32 margin) { if (_MarginPtr < _Margin + MaxMarginCount) { *++_MarginPtr = (margin < MaxMarginValue)? margin: MaxMarginValue; @@ -68,7 +68,7 @@ void UnitMargin::Pop() } } -int UnitMargin::Current() +S32 UnitMargin::Current() { return *_MarginPtr; } @@ -247,7 +247,7 @@ bool TestRun::test(const char* module, bool skipInteractive) { StringTableEntry cwdSave = Platform::getCurrentDirectory(); - int len = strlen(module); + S32 len = strlen(module); const char *skipMsg = skipInteractive ? "(skipping interactive tests)" : ""; diff --git a/Engine/source/unit/test.h b/Engine/source/unit/test.h index 3f3f4dc3d..df737d655 100644 --- a/Engine/source/unit/test.h +++ b/Engine/source/unit/test.h @@ -34,9 +34,9 @@ namespace UnitTesting { struct UnitMargin { -static void Push(int margin); +static void Push(S32 margin); static void Pop(); -static int Current(); +static S32 Current(); }; void UnitPrint(const char* msg); @@ -45,9 +45,9 @@ void UnitPrint(const char* msg); //----------------------------------------------------------------------------- class UnitTest { - int _testCount; - int _failureCount; - int _warningCount; + S32 _testCount; + S32 _failureCount; + S32 _warningCount; bool _lastTestResult; @@ -70,9 +70,9 @@ public: /// Report a warning void warn(const char* msg); - int getTestCount() const { return _testCount; } - int getFailureCount() const { return _failureCount; } - int getWarningCount() const { return _warningCount; } + S32 getTestCount() const { return _testCount; } + S32 getFailureCount() const { return _failureCount; } + S32 getWarningCount() const { return _warningCount; } bool lastTestPassed() const { return _lastTestResult; } /// Implement this with the specific test. @@ -139,10 +139,10 @@ public: //----------------------------------------------------------------------------- class TestRun { - int _testCount; - int _subCount; - int _failureCount; - int _warningCount; + S32 _testCount; + S32 _subCount; + S32 _failureCount; + S32 _warningCount; void test(TestRegistry* reg); public: TestRun(); diff --git a/Engine/source/unit/tests/testMatrixMul.cpp b/Engine/source/unit/tests/testMatrixMul.cpp index 7eb2cbc4f..939d35318 100644 --- a/Engine/source/unit/tests/testMatrixMul.cpp +++ b/Engine/source/unit/tests/testMatrixMul.cpp @@ -52,7 +52,7 @@ CreateUnitTest( TestMatrixMul, "Math/Matrix/Multiply" ) // I am not positive that the best way to do this is to use random numbers // but I think that using some kind of standard matrix may not always catch // all problems. - for( int i = 0; i < 16; i++ ) + for( S32 i = 0; i < 16; i++ ) { m1[i] = gRandGen.randF(); m2[i] = gRandGen.randF(); @@ -71,7 +71,7 @@ CreateUnitTest( TestMatrixMul, "Math/Matrix/Multiply" ) { Athlon_MatrixF_x_MatrixF( m1, m2, mrAMD ); - for( int i = 0; i < 16; i++ ) + for( S32 i = 0; i < 16; i++ ) same &= mIsEqual( mrC[i], mrAMD[i] ); test( same, "Matrix multiplication verification failed. (C vs. 3D NOW!)" ); @@ -87,7 +87,7 @@ CreateUnitTest( TestMatrixMul, "Math/Matrix/Multiply" ) { SSE_MatrixF_x_MatrixF( m1, m2, mrSSE ); - for( int i = 0; i < 16; i++ ) + for( S32 i = 0; i < 16; i++ ) same &= mIsEqual( mrC[i], mrSSE[i] ); test( same, "Matrix multiplication verification failed. (C vs. SSE)" ); @@ -105,7 +105,7 @@ CreateUnitTest( TestMatrixMul, "Math/Matrix/Multiply" ) vec_MatrixF_x_MatrixF( m1, m2, mrVEC ); - for( int i = 0; i < 16; i++ ) + for( S32 i = 0; i < 16; i++ ) same &= isEqual( mrC[i], mrVEC[i] ); test( same, "Matrix multiplication verification failed. (C vs. Altivec)" ); diff --git a/Engine/source/unit/tests/testThreadStatic.cpp b/Engine/source/unit/tests/testThreadStatic.cpp index 52cfa5bdc..2b51cd766 100644 --- a/Engine/source/unit/tests/testThreadStatic.cpp +++ b/Engine/source/unit/tests/testThreadStatic.cpp @@ -56,7 +56,7 @@ CreateUnitTest( TestThreadStatic, "Core/ThreadStatic" ) if( lastTestPassed() ) { // Traverse the list and compare it to the initial value copy (index 0) - for( int i = 0; i < _TorqueThreadStaticReg::getStaticList().size(); i++ ) + for( S32 i = 0; i < _TorqueThreadStaticReg::getStaticList().size(); i++ ) { _TorqueThreadStatic *master = _TorqueThreadStaticReg::getStaticList()[i]; _TorqueThreadStatic *cpy = (*testInstance)[i]; diff --git a/Engine/source/unit/tests/testThreadStaticPerformance.cpp b/Engine/source/unit/tests/testThreadStaticPerformance.cpp index 62eff7dac..550f0fb3c 100644 --- a/Engine/source/unit/tests/testThreadStaticPerformance.cpp +++ b/Engine/source/unit/tests/testThreadStaticPerformance.cpp @@ -54,7 +54,7 @@ CreateUnitTest( TestThreadStaticPerformance, "Core/ThreadStaticPerformance" ) // an array of values to standardize the tests on. U32 testValue[TEST_SIZE]; - for( int i = 0; i < TEST_SIZE; i++ ) + for( S32 i = 0; i < TEST_SIZE; i++ ) testValue[i] = gRandGen.randI(); // Reset the profiler, tell it to dump to console when done @@ -68,7 +68,7 @@ CreateUnitTest( TestThreadStaticPerformance, "Core/ThreadStaticPerformance" ) PROFILE_END(); PROFILE_START(ThreadStaticPerf_InstanceStaticAssign); - for( int i = 0; i < TEST_SIZE; i++ ) + for( S32 i = 0; i < TEST_SIZE; i++ ) ATTS_( gInstancedStaticFoo, 1 ) = testValue[i]; PROFILE_END(); diff --git a/Engine/source/util/noise2d.cpp b/Engine/source/util/noise2d.cpp index cee3b6fb6..6c51dfc19 100644 --- a/Engine/source/util/noise2d.cpp +++ b/Engine/source/util/noise2d.cpp @@ -267,7 +267,7 @@ bool Noise2D::erodeHydraulic( Vector *src, Vector *dst, U32 iterations for (S32 k=0; k < (size*size); k++) c[k] = 0.0f; - for (int i=0; i +template< S32 NUM_DIMENSIONS > class ScopeTrackerObject { public: @@ -264,7 +264,7 @@ class ScopeTrackerObject /// /// @param NUM_DIMENSIONS Number of dimensions to track; must be <=4. /// @param Object Value type for objects tracked by the ScopeTracker. Must have pointer behavior. -template< int NUM_DIMENSIONS, typename Object > +template< S32 NUM_DIMENSIONS, typename Object > class ScopeTracker { public: @@ -356,7 +356,7 @@ class ScopeTracker //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > ScopeTracker< NUM_DIMENSIONS, Object >::ScopeTracker() : mReferenceObject( NULL ) { @@ -385,7 +385,7 @@ ScopeTracker< NUM_DIMENSIONS, Object >::ScopeTracker() //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::setReferenceObject( Object object ) { AssertFatal( !object || !Deref( object ).isRegistered(), @@ -433,7 +433,7 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::setReferenceObject( Object object ) //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::registerObject( Object object ) { PROFILE_SCOPE( ScopeTracker_registerObject ); @@ -469,7 +469,7 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::registerObject( Object object ) //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::unregisterObject( Object object ) { PROFILE_SCOPE( ScopeTracker_unregisterObject ); @@ -494,7 +494,7 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::unregisterObject( Object object ) //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::updateObject( Object object ) { PROFILE_SCOPE( ScopeTracker_updateObject ); @@ -554,7 +554,7 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::updateObject( Object object ) //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::_insertTrackingNode( U32 dimension, NodeType* node ) { //RDTODO: substitute brute-force search with some smarter insertion algorithm @@ -579,7 +579,7 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::_insertTrackingNode( U32 dimension, //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::_removeTrackingNode( U32 dimension, NodeType* node ) { NodeType* next = node->getNext(); @@ -597,7 +597,7 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::_removeTrackingNode( U32 dimension, //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::_moveTrackingNode( U32 dimension, NodeType* node, F32 newPosition ) { PROFILE_SCOPE( ScopeTracker_moveTrackingNode ); @@ -713,7 +713,7 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::_moveTrackingNode( U32 dimension, N //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::_setScope( Object object ) { // If there's no reference object, all objects are out of scope. @@ -756,7 +756,7 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::_setScope( Object object ) //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::_initTracking() { PROFILE_SCOPE( ScopeTracker_initTracking ); @@ -813,7 +813,7 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::_initTracking() //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::_uninitTracking() { PROFILE_SCOPE( ScopeTracker_uninitTracking ); @@ -842,7 +842,7 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::_uninitTracking() //----------------------------------------------------------------------------- -template< int NUM_DIMENSIONS, class Object > +template< S32 NUM_DIMENSIONS, class Object > void ScopeTracker< NUM_DIMENSIONS, Object >::debugDump() { for( U32 n = 0; n < NUM_DIMENSIONS; ++ n ) diff --git a/Engine/source/util/settings.cpp b/Engine/source/util/settings.cpp index 19de55673..998a6a3ab 100644 --- a/Engine/source/util/settings.cpp +++ b/Engine/source/util/settings.cpp @@ -635,13 +635,13 @@ void SettingSaveNode::buildDocument(SimXMLDocument *document, bool skipWrite) document->addText(mValue); } else { - for(int i=0; ibuildDocument(document); } - for(int i=0; ibuildDocument(document); diff --git a/Engine/source/windowManager/platformInterface.cpp b/Engine/source/windowManager/platformInterface.cpp index ff34d37db..bb8e277d5 100644 --- a/Engine/source/windowManager/platformInterface.cpp +++ b/Engine/source/windowManager/platformInterface.cpp @@ -70,7 +70,7 @@ static struct ModifierBitMap { { IM_LOPT, SI_MAC_LOPT }, { IM_ROPT, SI_MAC_ROPT }, }; -static int _ModifierBitMapCount = sizeof(_ModifierBitMap) / sizeof(ModifierBitMap); +static S32 _ModifierBitMapCount = sizeof(_ModifierBitMap) / sizeof(ModifierBitMap); InputModifiers convertModifierBits(const U32 in) { diff --git a/Engine/source/windowManager/win32/win32Window.cpp b/Engine/source/windowManager/win32/win32Window.cpp index 2094bc663..0cbb59433 100644 --- a/Engine/source/windowManager/win32/win32Window.cpp +++ b/Engine/source/windowManager/win32/win32Window.cpp @@ -1068,7 +1068,7 @@ bool Win32Window::translateMessage(MSG &msg) if(mAccelHandle == NULL || mWindowHandle == NULL || !mEnableAccelerators) return false; - int ret = TranslateAccelerator(mWindowHandle, mAccelHandle, &msg); + S32 ret = TranslateAccelerator(mWindowHandle, mAccelHandle, &msg); return ret != 0; } diff --git a/Engine/source/windowManager/win32/win32WindowMgr.cpp b/Engine/source/windowManager/win32/win32WindowMgr.cpp index 05e889c9a..f92d40027 100644 --- a/Engine/source/windowManager/win32/win32WindowMgr.cpp +++ b/Engine/source/windowManager/win32/win32WindowMgr.cpp @@ -452,7 +452,7 @@ void Win32WindowManager::_processCmdLineArgs( const S32 argc, const char **argv { if (argc > 1) { - for (int i = 1; i < argc; i++) + for (S32 i = 1; i < argc; i++) { if ( dStrnicmp( argv[i], "-window", 7 ) == 0 ) { diff --git a/Engine/source/windowManager/win32/winDispatch.cpp b/Engine/source/windowManager/win32/winDispatch.cpp index f49010f0e..7038d0a29 100644 --- a/Engine/source/windowManager/win32/winDispatch.cpp +++ b/Engine/source/windowManager/win32/winDispatch.cpp @@ -283,7 +283,7 @@ static bool _dispatch(HWND hWnd,UINT message,WPARAM wParam,WPARAM lParam) case WM_LBUTTONDOWN: case WM_MBUTTONDOWN: case WM_RBUTTONDOWN: { - int index = (message - WM_LBUTTONDOWN) / 3; + S32 index = (message - WM_LBUTTONDOWN) / 3; button[index] = true; // Capture the mouse on button down to allow dragging outside @@ -299,7 +299,7 @@ static bool _dispatch(HWND hWnd,UINT message,WPARAM wParam,WPARAM lParam) case WM_LBUTTONUP: case WM_MBUTTONUP: case WM_RBUTTONUP: { - int index = (message - WM_LBUTTONUP) / 3; + S32 index = (message - WM_LBUTTONUP) / 3; button[index] = false; // Release mouse capture from button down. From 7a8f46b19f6bd89506fb1bb2858e499177c1cb82 Mon Sep 17 00:00:00 2001 From: cpusci Date: Sun, 4 Aug 2013 16:58:59 -0500 Subject: [PATCH 2/2] Update for float, double and unsigned char, unsigned short, short, etc. char was left alone: read why here http://msdn.microsoft.com/en-us/library/cc953fe1.aspx --- Engine/source/T3D/camera.cpp | 2 +- Engine/source/T3D/fx/particle.cpp | 10 +++++----- Engine/source/T3D/fx/particleEmitter.cpp | 6 +++--- Engine/source/T3D/projectile.h | 4 ++-- Engine/source/T3D/shapeImage.cpp | 2 +- Engine/source/core/util/tSignal.cpp | 2 +- Engine/source/environment/waterPlane.cpp | 2 +- .../source/forest/editor/forestBrushTool.cpp | 2 +- Engine/source/forest/editor/forestBrushTool.h | 2 +- Engine/source/gfx/gfxDevice.cpp | 2 +- Engine/source/gfx/util/triListOpt.cpp | 4 ++-- Engine/source/gui/3d/guiTSControl.cpp | 2 +- Engine/source/gui/controls/guiBitmapCtrl.cpp | 4 ++-- Engine/source/gui/editor/guiGraphCtrl.cpp | 2 +- .../gui/game/guiIdleCamFadeBitmapCtrl.cpp | 4 ++-- .../source/lighting/common/projectedShadow.cpp | 4 ++-- .../source/lighting/common/projectedShadow.h | 4 ++-- .../materials/processedShaderMaterial.cpp | 2 +- Engine/source/math/mMathAltivec.cpp | 6 +++--- Engine/source/math/mMathFn.h | 2 +- Engine/source/math/mQuat.cpp | 6 +++--- Engine/source/platform/input/event.cpp | 2 +- Engine/source/platform/input/event.h | 2 +- Engine/source/platform/platform.h | 2 +- Engine/source/platform/types.h | 8 ++++---- .../source/platformWin32/winDInputDevice.cpp | 6 +++--- Engine/source/platformWin32/winDInputDevice.h | 2 +- Engine/source/platformWin32/winDirectInput.cpp | 6 +++--- Engine/source/platformWin32/winDirectInput.h | 6 +++--- Engine/source/scene/reflector.cpp | 2 +- Engine/source/ts/collada/colladaUtils.cpp | 18 +++++++++--------- Engine/source/ts/collada/colladaUtils.h | 2 +- Engine/source/ts/loader/tsShapeLoader.cpp | 6 +++--- Engine/source/ts/loader/tsShapeLoader.h | 6 +++--- Engine/source/ts/tsLastDetail.h | 6 +++--- Engine/source/util/fpsTracker.cpp | 2 +- 36 files changed, 75 insertions(+), 75 deletions(-) diff --git a/Engine/source/T3D/camera.cpp b/Engine/source/T3D/camera.cpp index 0ba19ea29..a4ea95aa0 100644 --- a/Engine/source/T3D/camera.cpp +++ b/Engine/source/T3D/camera.cpp @@ -1546,7 +1546,7 @@ void Camera::_validateEyePoint(F32 pos, MatrixF *mat) float dot = mDot(dir, collision.normal); 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) colDist = pos; if (colDist < 0.0f) diff --git a/Engine/source/T3D/fx/particle.cpp b/Engine/source/T3D/fx/particle.cpp index 0f4d36cff..5b794748e 100644 --- a/Engine/source/T3D/fx/particle.cpp +++ b/Engine/source/T3D/fx/particle.cpp @@ -66,11 +66,11 @@ ConsoleDocClass( ParticleData, "@see ParticleEmitterNode\n" ); -static const float sgDefaultWindCoefficient = 0.0f; -static const float sgDefaultConstantAcceleration = 0.f; -static const float sgDefaultSpinSpeed = 1.f; -static const float sgDefaultSpinRandomMin = 0.f; -static const float sgDefaultSpinRandomMax = 0.f; +static const F32 sgDefaultWindCoefficient = 0.0f; +static const F32 sgDefaultConstantAcceleration = 0.f; +static const F32 sgDefaultSpinSpeed = 1.f; +static const F32 sgDefaultSpinRandomMin = 0.f; +static const F32 sgDefaultSpinRandomMax = 0.f; //----------------------------------------------------------------------------- diff --git a/Engine/source/T3D/fx/particleEmitter.cpp b/Engine/source/T3D/fx/particleEmitter.cpp index 598037233..642f80a1e 100644 --- a/Engine/source/T3D/fx/particleEmitter.cpp +++ b/Engine/source/T3D/fx/particleEmitter.cpp @@ -100,9 +100,9 @@ ConsoleDocClass( ParticleEmitterData, "@see ParticleEmitterNode\n" ); -static const float sgDefaultEjectionOffset = 0.f; -static const float sgDefaultPhiReferenceVel = 0.f; -static const float sgDefaultPhiVariance = 360.f; +static const F32 sgDefaultEjectionOffset = 0.f; +static const F32 sgDefaultPhiReferenceVel = 0.f; +static const F32 sgDefaultPhiVariance = 360.f; //----------------------------------------------------------------------------- // ParticleEmitterData diff --git a/Engine/source/T3D/projectile.h b/Engine/source/T3D/projectile.h index fa7c9ffbf..17c90cfbc 100644 --- a/Engine/source/T3D/projectile.h +++ b/Engine/source/T3D/projectile.h @@ -215,9 +215,9 @@ public: void updateSound(); - virtual bool calculateImpact( float simTime, + virtual bool calculateImpact( F32 simTime, Point3F &pointOfImpact, - float &impactTime ); + F32 &impactTime ); void setInitialPosition( const Point3F& pos ); void setInitialVelocity( const Point3F& vel ); diff --git a/Engine/source/T3D/shapeImage.cpp b/Engine/source/T3D/shapeImage.cpp index ee9eae312..509b31f0f 100644 --- a/Engine/source/T3D/shapeImage.cpp +++ b/Engine/source/T3D/shapeImage.cpp @@ -3061,7 +3061,7 @@ TICKAGAIN: if (image.spinThread[i]) { - float timeScale; + F32 timeScale; switch (stateData.spin) { diff --git a/Engine/source/core/util/tSignal.cpp b/Engine/source/core/util/tSignal.cpp index 8bc5e8164..30980a715 100644 --- a/Engine/source/core/util/tSignal.cpp +++ b/Engine/source/core/util/tSignal.cpp @@ -24,7 +24,7 @@ #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 DelegateLink * walk = next; diff --git a/Engine/source/environment/waterPlane.cpp b/Engine/source/environment/waterPlane.cpp index c0158a61f..2b66f4f73 100644 --- a/Engine/source/environment/waterPlane.cpp +++ b/Engine/source/environment/waterPlane.cpp @@ -163,7 +163,7 @@ void WaterPlane::unpackUpdate(NetConnection* con, BitStream* stream) if( stream->readFlag() ) // UpdateMask { - float posZ; + F32 posZ; stream->read( &posZ ); Point3F newPos = getPosition(); newPos.z = posZ; diff --git a/Engine/source/forest/editor/forestBrushTool.cpp b/Engine/source/forest/editor/forestBrushTool.cpp index a32e28ed7..4dd1734df 100644 --- a/Engine/source/forest/editor/forestBrushTool.cpp +++ b/Engine/source/forest/editor/forestBrushTool.cpp @@ -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; diff --git a/Engine/source/forest/editor/forestBrushTool.h b/Engine/source/forest/editor/forestBrushTool.h index 510146ff4..0debad616 100644 --- a/Engine/source/forest/editor/forestBrushTool.h +++ b/Engine/source/forest/editor/forestBrushTool.h @@ -82,7 +82,7 @@ public: void setPressure( F32 val ); void setHardness( F32 val ); void collectElements() { _collectElements(); } - bool getGroundAt( const Point3F &worldPt, float *zValueOut, VectorF *normalOut ); + bool getGroundAt( const Point3F &worldPt, F32 *zValueOut, VectorF *normalOut ); protected: diff --git a/Engine/source/gfx/gfxDevice.cpp b/Engine/source/gfx/gfxDevice.cpp index d478da5cd..5d7d6f8c7 100644 --- a/Engine/source/gfx/gfxDevice.cpp +++ b/Engine/source/gfx/gfxDevice.cpp @@ -1260,7 +1260,7 @@ DefineEngineFunction( getPixelShaderVersion, F32, (),, return GFX->getPixelShaderVersion(); } -DefineEngineFunction( setPixelShaderVersion, void, ( float version ),, +DefineEngineFunction( setPixelShaderVersion, void, ( F32 version ),, "@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 " "the device for testing or performance optimization.\n" diff --git a/Engine/source/gfx/util/triListOpt.cpp b/Engine/source/gfx/util/triListOpt.cpp index 2628d2941..95c8fd65e 100644 --- a/Engine/source/gfx/util/triListOpt.cpp +++ b/Engine/source/gfx/util/triListOpt.cpp @@ -378,7 +378,7 @@ F32 score(const VertData &vertexData) AssertFatal(vertexData.cachePosition < MaxSizeVertexCache, "Out of range cache position for vertex"); // 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 = mPow(Score, FindVertexScore::CacheDecayPower); } @@ -387,7 +387,7 @@ F32 score(const VertData &vertexData) // Bonus points for having a low number of tris still to // 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; return Score; diff --git a/Engine/source/gui/3d/guiTSControl.cpp b/Engine/source/gui/3d/guiTSControl.cpp index 95dc960c3..e7db0d30a 100644 --- a/Engine/source/gui/3d/guiTSControl.cpp +++ b/Engine/source/gui/3d/guiTSControl.cpp @@ -539,7 +539,7 @@ DefineEngineMethod( GuiTSCtrl, getWorldToScreenScale, Point2F, (),, //----------------------------------------------------------------------------- -DefineEngineMethod( GuiTSCtrl, calculateViewDistance, float, ( float radius ),, +DefineEngineMethod( GuiTSCtrl, calculateViewDistance, F32, ( F32 radius ),, "Given the camera's current FOV, get the distance from the camera's viewpoint at which the given radius will fit in the render area.\n" "@param radius Radius in world-space units which should fit in the view.\n" "@return The distance from the viewpoint at which the given radius would be fully visible." ) diff --git a/Engine/source/gui/controls/guiBitmapCtrl.cpp b/Engine/source/gui/controls/guiBitmapCtrl.cpp index e59b5e0e6..e95263701 100644 --- a/Engine/source/gui/controls/guiBitmapCtrl.cpp +++ b/Engine/source/gui/controls/guiBitmapCtrl.cpp @@ -178,8 +178,8 @@ void GuiBitmapCtrl::onRender(Point2I offset, const RectI &updateRect) GFXTextureObject* texture = mTextureObject; RectI srcRegion; RectI dstRegion; - float xdone = ((float)getExtent().x/(float)texture->mBitmapSize.x)+1; - float ydone = ((float)getExtent().y/(float)texture->mBitmapSize.y)+1; + F32 xdone = ((F32)getExtent().x/(F32)texture->mBitmapSize.x)+1; + F32 ydone = ((F32)getExtent().y/(F32)texture->mBitmapSize.y)+1; S32 xshift = mStartPoint.x%texture->mBitmapSize.x; S32 yshift = mStartPoint.y%texture->mBitmapSize.y; diff --git a/Engine/source/gui/editor/guiGraphCtrl.cpp b/Engine/source/gui/editor/guiGraphCtrl.cpp index eccd6ed27..e00998b0b 100644 --- a/Engine/source/gui/editor/guiGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiGraphCtrl.cpp @@ -274,7 +274,7 @@ void GuiGraphCtrl::addDatum(S32 plotID, F32 v) //----------------------------------------------------------------------------- -float GuiGraphCtrl::getDatum( S32 plotID, S32 sample) +F32 GuiGraphCtrl::getDatum( S32 plotID, S32 sample) { AssertFatal(plotID > -1 && plotID < MaxPlots, "Invalid plot specified!"); AssertFatal(sample > -1 && sample < MaxDataPoints, "Invalid sample specified!"); diff --git a/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp b/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp index 899bc9d7d..d648a4177 100644 --- a/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp +++ b/Engine/source/gui/game/guiIdleCamFadeBitmapCtrl.cpp @@ -123,8 +123,8 @@ public: GFXTextureObject* texture = mTextureObject; RectI srcRegion; RectI dstRegion; - float xdone = ((float)getExtent().x/(float)texture->mBitmapSize.x)+1; - float ydone = ((float)getExtent().y/(float)texture->mBitmapSize.y)+1; + F32 xdone = ((F32)getExtent().x/(F32)texture->mBitmapSize.x)+1; + F32 ydone = ((F32)getExtent().y/(F32)texture->mBitmapSize.y)+1; S32 xshift = mStartPoint.x%texture->mBitmapSize.x; S32 yshift = mStartPoint.y%texture->mBitmapSize.y; diff --git a/Engine/source/lighting/common/projectedShadow.cpp b/Engine/source/lighting/common/projectedShadow.cpp index de3a31f8f..73da76b1c 100644 --- a/Engine/source/lighting/common/projectedShadow.cpp +++ b/Engine/source/lighting/common/projectedShadow.cpp @@ -53,8 +53,8 @@ SimObjectPtr ProjectedShadow::smRenderPass = NULL; SimObjectPtr ProjectedShadow::smShadowFilter = NULL; F32 ProjectedShadow::smDepthAdjust = 10.0f; -float ProjectedShadow::smFadeStartPixelSize = 200.0f; -float ProjectedShadow::smFadeEndPixelSize = 35.0f; +F32 ProjectedShadow::smFadeStartPixelSize = 200.0f; +F32 ProjectedShadow::smFadeEndPixelSize = 35.0f; GFX_ImplementTextureProfile( BLProjectedShadowProfile, diff --git a/Engine/source/lighting/common/projectedShadow.h b/Engine/source/lighting/common/projectedShadow.h index 7b519f3ab..e43501a8d 100644 --- a/Engine/source/lighting/common/projectedShadow.h +++ b/Engine/source/lighting/common/projectedShadow.h @@ -109,8 +109,8 @@ protected: public: /// @see DecalData - static float smFadeStartPixelSize; - static float smFadeEndPixelSize; + static F32 smFadeStartPixelSize; + static F32 smFadeEndPixelSize; ProjectedShadow( SceneObject *object ); virtual ~ProjectedShadow(); diff --git a/Engine/source/materials/processedShaderMaterial.cpp b/Engine/source/materials/processedShaderMaterial.cpp index db6e70803..acde6c949 100644 --- a/Engine/source/materials/processedShaderMaterial.cpp +++ b/Engine/source/materials/processedShaderMaterial.cpp @@ -284,7 +284,7 @@ void ProcessedShaderMaterial::_determineFeatures( U32 stageNum, { PROFILE_SCOPE( ProcessedShaderMaterial_DetermineFeatures ); - const float shaderVersion = GFX->getPixelShaderVersion(); + const F32 shaderVersion = GFX->getPixelShaderVersion(); AssertFatal(shaderVersion > 0.0 , "Cannot create a shader material if we don't support shaders"); bool lastStage = stageNum == (mMaxStages-1); diff --git a/Engine/source/math/mMathAltivec.cpp b/Engine/source/math/mMathAltivec.cpp index 6bdc9d752..c056a6449 100644 --- a/Engine/source/math/mMathAltivec.cpp +++ b/Engine/source/math/mMathAltivec.cpp @@ -38,9 +38,9 @@ /// because we get a much better speed gain if we can assume the data is aligned. void vec_MatrixF_x_MatrixF(const F32 *matA, const F32 *matB, F32 *result) { - vector float A[4][1]; - vector float B[4][1]; - vector float C[4][1]; + vector F32 A[4][1]; + vector F32 B[4][1]; + vector F32 C[4][1]; /// If the incoming pointers are not 16-byte aligned, we have to load & store the slow way. if((int)matA & 0xF || (int)matB & 0xF || (int)result & 0xF) diff --git a/Engine/source/math/mMathFn.h b/Engine/source/math/mMathFn.h index cdeb4b4f5..6b41cfa89 100644 --- a/Engine/source/math/mMathFn.h +++ b/Engine/source/math/mMathFn.h @@ -442,7 +442,7 @@ inline bool mIsNaN_F( const F32 x ) inline bool mIsInf_F( const F32 x ) { - return ( x == std::numeric_limits< float >::infinity() ); + return ( x == std::numeric_limits< F32 >::infinity() ); } inline F32 mSign( const F32 n ) diff --git a/Engine/source/math/mQuat.cpp b/Engine/source/math/mQuat.cpp index 78c9fb100..c78252bc2 100644 --- a/Engine/source/math/mQuat.cpp +++ b/Engine/source/math/mQuat.cpp @@ -262,12 +262,12 @@ QuatF & QuatF::interpolate( const QuatF & q1, const QuatF & q2, F32 t ) //----------------------------------- // calculate interpolating coeffs: - double scale1, scale2; + F64 scale1, scale2; if ( (1.0 - cosOmega) > 0.00001 ) { // standard case - double omega = mAcos(cosOmega); - double sinOmega = mSin(omega); + F64 omega = mAcos(cosOmega); + F64 sinOmega = mSin(omega); scale1 = mSin((1.0 - t) * omega) / sinOmega; scale2 = sign2 * mSin(t * omega) / sinOmega; } diff --git a/Engine/source/platform/input/event.cpp b/Engine/source/platform/input/event.cpp index 254aca29d..f5bc04dbb 100644 --- a/Engine/source/platform/input/event.cpp +++ b/Engine/source/platform/input/event.cpp @@ -500,7 +500,7 @@ void InputEventManager::buildInputEvent(U32 deviceType, U32 deviceInst, InputEve newEvent.postToSignal(Input::smInputEvent); } -void InputEventManager::buildInputEvent(U32 deviceType, U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, float fValue) +void InputEventManager::buildInputEvent(U32 deviceType, U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, F32 fValue) { InputEventInfo newEvent; diff --git a/Engine/source/platform/input/event.h b/Engine/source/platform/input/event.h index 965dc0ac6..916d1910f 100644 --- a/Engine/source/platform/input/event.h +++ b/Engine/source/platform/input/event.h @@ -496,7 +496,7 @@ public: void buildInputEvent(U32 deviceType, U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, S32 iValue); /// Build an input event based on a single fValue - void buildInputEvent(U32 deviceType, U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, float fValue); + void buildInputEvent(U32 deviceType, U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, F32 fValue); /// Build an input event based on a Point3F void buildInputEvent(U32 deviceType, U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, Point3F& pValue); diff --git a/Engine/source/platform/platform.h b/Engine/source/platform/platform.h index 17cf828f2..3b5a57358 100644 --- a/Engine/source/platform/platform.h +++ b/Engine/source/platform/platform.h @@ -212,7 +212,7 @@ namespace Platform void debugBreak(); // Random - float getRandom(); + F32 getRandom(); // Window state void setWindowLocked(bool locked); diff --git a/Engine/source/platform/types.h b/Engine/source/platform/types.h index c53bd87fc..48fb561fb 100644 --- a/Engine/source/platform/types.h +++ b/Engine/source/platform/types.h @@ -218,13 +218,13 @@ inline S8 getMin(S8 a, S8 b) } /// Returns the lesser of the two parameters: a & b. -inline float getMin(float a, float b) +inline F32 getMin(F32 a, F32 b) { return a>b ? b : a; } /// Returns the lesser of the two parameters: a & b. -inline double getMin(double a, double b) +inline F64 getMin(F64 a, F64 b) { return a>b ? b : a; } @@ -266,13 +266,13 @@ inline S8 getMax(S8 a, S8 b) } /// Returns the greater of the two parameters: a & b. -inline float getMax(float a, float b) +inline F32 getMax(F32 a, F32 b) { return a>b ? a : b; } /// Returns the greater of the two parameters: a & b. -inline double getMax(double a, double b) +inline F64 getMax(F64 a, F64 b) { return a>b ? a : b; } diff --git a/Engine/source/platformWin32/winDInputDevice.cpp b/Engine/source/platformWin32/winDInputDevice.cpp index 759a34643..8d036352f 100644 --- a/Engine/source/platformWin32/winDInputDevice.cpp +++ b/Engine/source/platformWin32/winDInputDevice.cpp @@ -896,8 +896,8 @@ bool DInputDevice::buildEvent( DWORD offset, S32 newData, S32 oldData ) // Scale to the range -1.0 to 1.0: if ( objInfo.mMin != DIPROPRANGE_NOMIN && objInfo.mMax != DIPROPRANGE_NOMAX ) { - float range = float( objInfo.mMax - objInfo.mMin ); - newEvent.fValue = float( ( 2 * newData ) - objInfo.mMax - objInfo.mMin ) / range; + F32 range = F32( objInfo.mMax - objInfo.mMin ); + newEvent.fValue = F32( ( 2 * newData ) - objInfo.mMax - objInfo.mMin ) / range; } else newEvent.fValue = (F32)newData; @@ -1041,7 +1041,7 @@ bool DInputDevice::buildEvent( DWORD offset, S32 newData, S32 oldData ) return true; } -void DInputDevice::rumble(float x, float y) +void DInputDevice::rumble(F32 x, F32 y) { LONG rglDirection[2] = { 0, 0 }; DICONSTANTFORCE cf = { 0 }; diff --git a/Engine/source/platformWin32/winDInputDevice.h b/Engine/source/platformWin32/winDInputDevice.h index e8cd13e66..b242df789 100644 --- a/Engine/source/platformWin32/winDInputDevice.h +++ b/Engine/source/platformWin32/winDInputDevice.h @@ -117,7 +117,7 @@ class DInputDevice : public InputDevice const char* getProductName(); // Constant Effect Force Feedback - void rumble( float x, float y ); + void rumble( F32 x, F32 y ); // Console interface functions: const char* getJoystickAxesString(); diff --git a/Engine/source/platformWin32/winDirectInput.cpp b/Engine/source/platformWin32/winDirectInput.cpp index e2feef555..fa02285b0 100644 --- a/Engine/source/platformWin32/winDirectInput.cpp +++ b/Engine/source/platformWin32/winDirectInput.cpp @@ -511,7 +511,7 @@ void DInputManager::deactivateXInput() } //------------------------------------------------------------------------------ -bool DInputManager::rumble( const char *pDeviceName, float x, float y ) +bool DInputManager::rumble( const char *pDeviceName, F32 x, F32 y ) { // Determine the device U32 deviceType; @@ -566,7 +566,7 @@ bool DInputManager::rumble( const char *pDeviceName, float x, float y ) } } -void DInputManager::buildXInputEvent( U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, float fValue ) +void DInputManager::buildXInputEvent( U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, F32 fValue ) { InputEventInfo newEvent; @@ -597,7 +597,7 @@ inline void DInputManager::fireXInputConnectEvent( S32 controllerID, bool condit } } -inline void DInputManager::fireXInputMoveEvent( S32 controllerID, bool condition, InputObjectInstances objInst, float fValue ) +inline void DInputManager::fireXInputMoveEvent( S32 controllerID, bool condition, InputObjectInstances objInst, F32 fValue ) { if ( mXInputStateReset || condition ) { diff --git a/Engine/source/platformWin32/winDirectInput.h b/Engine/source/platformWin32/winDirectInput.h index 7ce94ac78..d7ebd1b70 100644 --- a/Engine/source/platformWin32/winDirectInput.h +++ b/Engine/source/platformWin32/winDirectInput.h @@ -85,9 +85,9 @@ class DInputManager : public InputManager void unacquire( U8 deviceType, U8 deviceID ); // XInput worker functions - void buildXInputEvent( U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, float fValue ); + void buildXInputEvent( U32 deviceInst, InputEventType objType, InputObjectInstances objInst, InputActionType action, F32 fValue ); void fireXInputConnectEvent( S32 controllerID, bool condition, bool connected ); - void fireXInputMoveEvent( S32 controllerID, bool condition, InputObjectInstances objInst, float fValue ); + void fireXInputMoveEvent( S32 controllerID, bool condition, InputObjectInstances objInst, F32 fValue ); void fireXInputButtonEvent( S32 controllerID, bool forceFire, S32 button, InputObjectInstances objInst ); void processXInput(); @@ -126,7 +126,7 @@ class DInputManager : public InputManager // Console interface: const char* getJoystickAxesString( U32 deviceID ); - bool rumble( const char *pDeviceName, float x, float y ); + bool rumble( const char *pDeviceName, F32 x, F32 y ); }; #endif // _H_WINDIRECTINPUT_ diff --git a/Engine/source/scene/reflector.cpp b/Engine/source/scene/reflector.cpp index df2e7f580..d9ddeeaa2 100644 --- a/Engine/source/scene/reflector.cpp +++ b/Engine/source/scene/reflector.cpp @@ -682,7 +682,7 @@ MatrixF PlaneReflector::getCameraReflection( MatrixF &camTrans ) return newTrans; } -inline float sgn(float a) +inline F32 sgn(F32 a) { if (a > 0.0F) return (1.0F); if (a < 0.0F) return (-1.0F); diff --git a/Engine/source/ts/collada/colladaUtils.cpp b/Engine/source/ts/collada/colladaUtils.cpp index e3462daf9..0c409fc95 100644 --- a/Engine/source/ts/collada/colladaUtils.cpp +++ b/Engine/source/ts/collada/colladaUtils.cpp @@ -278,9 +278,9 @@ void AnimData::parseTargetString(const char* target, S32 fullCount, const char* /// Solve the cubic spline B(s) = param for s F32 AnimData::invertParamCubic(F32 param, F32 x0, F32 x1, F32 x2, F32 x3) const { - const double INVERTPARAMCUBIC_TOL = 1.0e-09; - const double INVERTPARAMCUBIC_SMALLERTOL = 1.0e-20; - const double INVERTPARAMCUBIC_MAXIT = 100; + const F64 INVERTPARAMCUBIC_TOL = 1.0e-09; + const F64 INVERTPARAMCUBIC_SMALLERTOL = 1.0e-20; + const F64 INVERTPARAMCUBIC_MAXIT = 100; // check input value for outside range if ((param - x0) < INVERTPARAMCUBIC_SMALLERTOL) @@ -295,12 +295,12 @@ F32 AnimData::invertParamCubic(F32 param, F32 x0, F32 x1, F32 x2, F32 x3) const F32 v = 1.0f; while (iterations < INVERTPARAMCUBIC_MAXIT) { - double a = (x0 + x1)*0.5f; - double b = (x1 + x2)*0.5f; - double c = (x2 + x3)*0.5f; - double d = (a + b)*0.5f; - double e = (b + c)*0.5f; - double f = (d + e)*0.5f; + F64 a = (x0 + x1)*0.5f; + F64 b = (x1 + x2)*0.5f; + F64 c = (x2 + x3)*0.5f; + F64 d = (a + b)*0.5f; + F64 e = (b + c)*0.5f; + F64 f = (d + e)*0.5f; if (mFabs(f - param) < INVERTPARAMCUBIC_TOL) break; diff --git a/Engine/source/ts/collada/colladaUtils.h b/Engine/source/ts/collada/colladaUtils.h index 9e7870383..4cc4cf5da 100644 --- a/Engine/source/ts/collada/colladaUtils.h +++ b/Engine/source/ts/collada/colladaUtils.h @@ -671,7 +671,7 @@ template<> inline const domListOfUInts *ColladaPrimitive::getTriang template inline T convert(const char* value) { return value; } template<> inline bool convert(const char* value) { return dAtob(value); } template<> inline S32 convert(const char* value) { return dAtoi(value); } -template<> inline double convert(const char* value) { return dAtof(value); } +template<> inline F64 convert(const char* value) { return dAtof(value); } template<> inline F32 convert(const char* value) { return convert(value); } //----------------------------------------------------------------------------- diff --git a/Engine/source/ts/loader/tsShapeLoader.cpp b/Engine/source/ts/loader/tsShapeLoader.cpp index 89e22350c..a1b1b4ac4 100644 --- a/Engine/source/ts/loader/tsShapeLoader.cpp +++ b/Engine/source/ts/loader/tsShapeLoader.cpp @@ -32,9 +32,9 @@ const F32 TSShapeLoader::DefaultTime = -1.0f; -const double TSShapeLoader::MinFrameRate = 15.0f; -const double TSShapeLoader::MaxFrameRate = 60.0f; -const double TSShapeLoader::AppGroundFrameRate = 10.0f; +const F64 TSShapeLoader::MinFrameRate = 15.0f; +const F64 TSShapeLoader::MaxFrameRate = 60.0f; +const F64 TSShapeLoader::AppGroundFrameRate = 10.0f; Torque::Path TSShapeLoader::shapePath; //------------------------------------------------------------------------------ diff --git a/Engine/source/ts/loader/tsShapeLoader.h b/Engine/source/ts/loader/tsShapeLoader.h index 3741df31b..2c76ffbb2 100644 --- a/Engine/source/ts/loader/tsShapeLoader.h +++ b/Engine/source/ts/loader/tsShapeLoader.h @@ -82,9 +82,9 @@ protected: public: static const F32 DefaultTime; - static const double MinFrameRate; - static const double MaxFrameRate; - static const double AppGroundFrameRate; + static const F64 MinFrameRate; + static const F64 MaxFrameRate; + static const F64 AppGroundFrameRate; protected: // Variables used during loading that must be held until the shape is deleted diff --git a/Engine/source/ts/tsLastDetail.h b/Engine/source/ts/tsLastDetail.h index adfd6b5ac..abfb3bac1 100644 --- a/Engine/source/ts/tsLastDetail.h +++ b/Engine/source/ts/tsLastDetail.h @@ -62,12 +62,12 @@ GFXDeclareVertexFormat( ImposterState ) /// .xyz = imposter center /// .w = billboard corner... damn SM 2.0 Point3F center; - float corner; + F32 corner; /// .x = scaled half size /// .y = alpha fade out - float halfSize; - float alpha; + F32 halfSize; + F32 alpha; /// The rotation encoded as the up /// and right vectors... cross FTW. diff --git a/Engine/source/util/fpsTracker.cpp b/Engine/source/util/fpsTracker.cpp index d30c812f5..c62c3fd95 100644 --- a/Engine/source/util/fpsTracker.cpp +++ b/Engine/source/util/fpsTracker.cpp @@ -46,7 +46,7 @@ void FPSTracker::reset() void FPSTracker::update() { - const float alpha = 0.07f; + const F32 alpha = 0.07f; F32 realSeconds = (F32)Platform::getRealMilliseconds()/1000.0f; F32 virtualSeconds = (F32)Platform::getVirtualMilliseconds()/1000.0f;