diff --git a/Engine/source/T3D/fx/cameraFXMgr.h b/Engine/source/T3D/fx/cameraFXMgr.h index 5a560bfc6..b40411f3a 100644 --- a/Engine/source/T3D/fx/cameraFXMgr.h +++ b/Engine/source/T3D/fx/cameraFXMgr.h @@ -45,6 +45,7 @@ protected: public: CameraFX(); + virtual ~CameraFX() { } MatrixF & getTrans(){ return mCamFXTrans; } virtual bool isExpired(){ return mElapsedTime >= mDuration; } diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index 2acfa8487..40889a817 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -749,9 +749,9 @@ bool ExplosionData::preload(bool server, String &errorStr) if( !server ) { - String errorStr; - if( !sfxResolve( &soundProfile, errorStr ) ) - Con::errorf(ConsoleLogEntry::General, "Error, unable to load sound profile for explosion datablock: %s", errorStr.c_str()); + String sfxErrorStr; + if( !sfxResolve( &soundProfile, sfxErrorStr ) ) + Con::errorf(ConsoleLogEntry::General, "Error, unable to load sound profile for explosion datablock: %s", sfxErrorStr.c_str()); if (!particleEmitter && particleEmitterId != 0) if (Sim::findObject(particleEmitterId, particleEmitter) == false) Con::errorf(ConsoleLogEntry::General, "Error, unable to load particle emitter for explosion datablock"); diff --git a/Engine/source/T3D/fx/lightning.cpp b/Engine/source/T3D/fx/lightning.cpp index 154f84208..5c4c07bde 100644 --- a/Engine/source/T3D/fx/lightning.cpp +++ b/Engine/source/T3D/fx/lightning.cpp @@ -287,14 +287,14 @@ bool LightningData::preload(bool server, String &errorStr) if (server == false) { - String errorStr; + String sfxErrorStr; for (U32 i = 0; i < MaxThunders; i++) { - if( !sfxResolve( &thunderSounds[ i ], errorStr ) ) - Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", errorStr.c_str()); + if( !sfxResolve( &thunderSounds[ i ], sfxErrorStr ) ) + Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", sfxErrorStr.c_str()); } - if( !sfxResolve( &strikeSound, errorStr ) ) - Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", errorStr.c_str()); + if( !sfxResolve( &strikeSound, sfxErrorStr ) ) + Con::errorf(ConsoleLogEntry::General, "LightningData::preload: Invalid packet: %s", sfxErrorStr.c_str()); for (U32 i = 0; i < MaxTextures; i++) { diff --git a/Engine/source/T3D/missionArea.cpp b/Engine/source/T3D/missionArea.cpp index d11aa91ce..1e592b7b2 100644 --- a/Engine/source/T3D/missionArea.cpp +++ b/Engine/source/T3D/missionArea.cpp @@ -179,7 +179,7 @@ DefineEngineMethod( MissionArea, getArea, const char *, (),, char* returnBuffer = Con::getReturnBuffer(48); RectI area = object->getArea(); - dSprintf(returnBuffer, sizeof(returnBuffer), "%d %d %d %d", area.point.x, area.point.y, area.extent.x, area.extent.y); + dSprintf(returnBuffer, 48, "%d %d %d %d", area.point.x, area.point.y, area.extent.x, area.extent.y); return(returnBuffer); } diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 1440f2d71..e81238fb3 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -427,9 +427,9 @@ bool PlayerData::preload(bool server, String &errorStr) { for( U32 i = 0; i < MaxSounds; ++ i ) { - String errorStr; - if( !sfxResolve( &sound[ i ], errorStr ) ) - Con::errorf( "PlayerData::preload: %s", errorStr.c_str() ); + String sfxErrorStr; + if( !sfxResolve( &sound[ i ], sfxErrorStr ) ) + Con::errorf( "PlayerData::preload: %s", sfxErrorStr.c_str() ); } } @@ -586,7 +586,10 @@ bool PlayerData::preload(bool server, String &errorStr) Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(mShapeFP[i].getPath()); if (!fileRef) + { + errorStr = String::ToString("PlayerData: Mounted image %d loading failed, shape \"%s\" is not found.",i,mShapeFP[i].getPath().getFullPath().c_str()); return false; + } if(server) mCRCFP[i] = fileRef->getChecksum(); diff --git a/Engine/source/T3D/projectile.cpp b/Engine/source/T3D/projectile.cpp index f52102d2e..24d78f80a 100644 --- a/Engine/source/T3D/projectile.cpp +++ b/Engine/source/T3D/projectile.cpp @@ -320,9 +320,9 @@ bool ProjectileData::preload(bool server, String &errorStr) if (Sim::findObject(decalId, decal) == false) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId); - String errorStr; - if( !sfxResolve( &sound, errorStr ) ) - Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet: %s", errorStr.c_str()); + String sfxErrorStr; + if( !sfxResolve( &sound, sfxErrorStr ) ) + Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet: %s", sfxErrorStr.c_str()); if (!lightDesc && lightDescId != 0) if (Sim::findObject(lightDescId, lightDesc) == false) diff --git a/Engine/source/T3D/proximityMine.cpp b/Engine/source/T3D/proximityMine.cpp index 5d6a573a8..89ffe9577 100644 --- a/Engine/source/T3D/proximityMine.cpp +++ b/Engine/source/T3D/proximityMine.cpp @@ -136,11 +136,11 @@ bool ProximityMineData::preload( bool server, String& errorStr ) if ( !server ) { // Resolve sounds - String errorStr; - if( !sfxResolve( &armingSound, errorStr ) ) - Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", errorStr.c_str() ); - if( !sfxResolve( &triggerSound, errorStr ) ) - Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", errorStr.c_str() ); + String sfxErrorStr; + if( !sfxResolve( &armingSound, sfxErrorStr ) ) + Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", sfxErrorStr.c_str() ); + if( !sfxResolve( &triggerSound, sfxErrorStr ) ) + Con::errorf( ConsoleLogEntry::General, "ProximityMineData::preload: Invalid packet: %s", sfxErrorStr.c_str() ); } if ( mShape ) diff --git a/Engine/source/T3D/rigidShape.cpp b/Engine/source/T3D/rigidShape.cpp index 189119070..cb736ce8c 100644 --- a/Engine/source/T3D/rigidShape.cpp +++ b/Engine/source/T3D/rigidShape.cpp @@ -302,6 +302,7 @@ bool RigidShapeData::preload(bool server, String &errorStr) if (!collisionDetails.size() || collisionDetails[0] == -1) { Con::errorf("RigidShapeData::preload failed: Rigid shapes must define a collision-1 detail"); + errorStr = String::ToString("RigidShapeData: Couldn't load shape \"%s\"",shapeName); return false; } diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 6661eb74c..eff6bd855 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -306,7 +306,10 @@ bool ShapeBaseData::preload(bool server, String &errorStr) Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(mShape.getPath()); if (!fileRef) + { + errorStr = String::ToString("ShapeBaseData: Couldn't load shape \"%s\"",shapeName); return false; + } if(server) mCRC = fileRef->getChecksum(); diff --git a/Engine/source/T3D/shapeImage.cpp b/Engine/source/T3D/shapeImage.cpp index f49b44ba9..548984ca8 100644 --- a/Engine/source/T3D/shapeImage.cpp +++ b/Engine/source/T3D/shapeImage.cpp @@ -462,7 +462,10 @@ bool ShapeBaseImageData::preload(bool server, String &errorStr) Torque::FS::FileNodeRef fileRef = Torque::FS::GetFileNode(shape[i].getPath()); if (!fileRef) + { + errorStr = String::ToString("ShapeBaseImageData: Couldn't load shape \"%s\"",name); return false; + } if(server) { diff --git a/Engine/source/T3D/vehicles/vehicle.cpp b/Engine/source/T3D/vehicles/vehicle.cpp index 22b2b05a0..df10b2cdc 100644 --- a/Engine/source/T3D/vehicles/vehicle.cpp +++ b/Engine/source/T3D/vehicles/vehicle.cpp @@ -218,6 +218,7 @@ bool VehicleData::preload(bool server, String &errorStr) if (!collisionDetails.size() || collisionDetails[0] == -1) { Con::errorf("VehicleData::preload failed: Vehicle models must define a collision-1 detail"); + errorStr = String::ToString("VehicleData: Couldn't load shape \"%s\"",shapeName); return false; } diff --git a/Engine/source/cinterface/c_scripting.cpp b/Engine/source/cinterface/c_scripting.cpp index 20657deca..1f9aa2281 100644 --- a/Engine/source/cinterface/c_scripting.cpp +++ b/Engine/source/cinterface/c_scripting.cpp @@ -222,7 +222,7 @@ extern "C" { { // maxArgs improper on a number of console function/methods if (argc < entry->mMinArgs)// || argc > entry->mMaxArgs) - return ""; + return false; SimObject* o = NULL; @@ -230,7 +230,7 @@ extern "C" { { o = Sim::findObject(dAtoi(argv[1])); if (!o) - return ""; + return false; } return entry->cb.mBoolCallbackFunc(o, argc, argv); diff --git a/Engine/source/cinterface/cinterface.cpp b/Engine/source/cinterface/cinterface.cpp index 2bd79fe61..ecfdeaf97 100644 --- a/Engine/source/cinterface/cinterface.cpp +++ b/Engine/source/cinterface/cinterface.cpp @@ -303,7 +303,7 @@ extern "C" { Namespace::Entry* entry = GetEntry(nameSpace, name); if (!entry) - return ""; + return false; return entry->cb.mBoolCallbackFunc(NULL, argc, argv); } diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index fc3e3544f..c6efd9cf2 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -403,14 +403,14 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st) for(U32 i = 0; i < size; i++) st.read(&functionFloats[i]); } - U32 codeSize; - st.read(&codeSize); + U32 codeLength; + st.read(&codeLength); st.read(&lineBreakPairCount); - U32 totSize = codeSize + lineBreakPairCount * 2; + U32 totSize = codeLength + lineBreakPairCount * 2; code = new U32[totSize]; - for(i = 0; i < codeSize; i++) + for(i = 0; i < codeLength; i++) { U8 b; st.read(&b); @@ -420,10 +420,10 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st) code[i] = b; } - for(i = codeSize; i < totSize; i++) + for(i = codeLength; i < totSize; i++) st.read(&code[i]); - lineBreakPairs = code + codeSize; + lineBreakPairs = code + codeLength; // StringTable-ize our identifiers. U32 identCount; diff --git a/Engine/source/console/engineAPI.h b/Engine/source/console/engineAPI.h index ee54df7bb..d8b27ea82 100644 --- a/Engine/source/console/engineAPI.h +++ b/Engine/source/console/engineAPI.h @@ -76,6 +76,7 @@ // Disable some VC warnings that are irrelevant to us. +#pragma warning( push ) #pragma warning( disable : 4510 ) // default constructor could not be generated; all the Args structures are never constructed by us #pragma warning( disable : 4610 ) // can never be instantiated; again Args is never constructed by us @@ -2788,7 +2789,6 @@ struct _EngineConsoleCallbackHelper // Re-enable some VC warnings we disabled for this file. -#pragma warning( default : 4510 ) -#pragma warning( default : 4610 ) +#pragma warning( pop ) // 4510 and 4610 #endif // !_ENGINEAPI_H_ diff --git a/Engine/source/console/telnetDebugger.h b/Engine/source/console/telnetDebugger.h index 6916ae935..5a30c9cf7 100644 --- a/Engine/source/console/telnetDebugger.h +++ b/Engine/source/console/telnetDebugger.h @@ -127,7 +127,7 @@ public: void breakProcess(); - virtual void executionStopped(CodeBlock *code, U32 lineNumber); + void executionStopped(CodeBlock *code, U32 lineNumber); void send(const char *s); void setDebugParameters(S32 port, const char *password, bool waitForClient); void processConsoleLine(const char *consoleLine); diff --git a/Engine/source/core/threadStatic.h b/Engine/source/core/threadStatic.h index 716d590b9..2f5a16cbf 100644 --- a/Engine/source/core/threadStatic.h +++ b/Engine/source/core/threadStatic.h @@ -47,6 +47,7 @@ public: : mHitCount( 0 ) #endif { }; + virtual ~_TorqueThreadStatic() { } static const U32 getListIndex(){ return mListIndex; } diff --git a/Engine/source/core/util/md5.cpp b/Engine/source/core/util/md5.cpp index 8358d7655..41503cb86 100644 --- a/Engine/source/core/util/md5.cpp +++ b/Engine/source/core/util/md5.cpp @@ -154,7 +154,7 @@ void MD5Final( unsigned char digest[16], MD5Context* ctx) MD5Transform(ctx->buf, (int *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(MD5Context)); /* In case it's sensitive */ } diff --git a/Engine/source/core/util/tFixedSizeVector.h b/Engine/source/core/util/tFixedSizeVector.h index c6079b129..fedd12587 100644 --- a/Engine/source/core/util/tFixedSizeVector.h +++ b/Engine/source/core/util/tFixedSizeVector.h @@ -46,19 +46,19 @@ class FixedSizeVector FixedSizeVector( const T& a, const T& b, const T& c, const T& d, const T& e, const T& f ) { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; } FixedSizeVector( const T& a, const T& b, const T& c, const T& d, const T& e, const T& f, const T& g ) - { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ]; } + { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ] = g; } FixedSizeVector( const T& a, const T& b, const T& c, const T& d, const T& e, const T& f, const T& g, const T& h ) - { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ]; mArray[ 7 ] = h; } + { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ] = g; mArray[ 7 ] = h; } FixedSizeVector( const T& a, const T& b, const T& c, const T& d, const T& e, const T& f, const T& g, const T& h, const T& i ) - { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ]; mArray[ 7 ] = h; mArray[ 8 ] = i; } + { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ] = g; mArray[ 7 ] = h; mArray[ 8 ] = i; } FixedSizeVector( const T& a, const T& b, const T& c, const T& d, const T& e, const T& f, const T& g, const T& h, const T& i, const T& j ) - { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ]; mArray[ 7 ] = h; mArray[ 8 ] = i; mArray[ 9 ] = j; } + { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ] = g; mArray[ 7 ] = h; mArray[ 8 ] = i; mArray[ 9 ] = j; } FixedSizeVector( const T& a, const T& b, const T& c, const T& d, const T& e, const T& f, const T& g, const T& h, const T& i, const T& j, const T& k ) - { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ]; mArray[ 7 ] = h; mArray[ 8 ] = i; mArray[ 9 ] = j; mArray[ 10 ] = k; } + { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ] = g; mArray[ 7 ] = h; mArray[ 8 ] = i; mArray[ 9 ] = j; mArray[ 10 ] = k; } FixedSizeVector( const T& a, const T& b, const T& c, const T& d, const T& e, const T& f, const T& g, const T& h, const T& i, const T& j, const T& k, const T& l ) - { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ]; mArray[ 7 ] = h; mArray[ 8 ] = i; mArray[ 9 ] = j; mArray[ 10 ] = k; mArray[ 11 ] = l; } + { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ] = g; mArray[ 7 ] = h; mArray[ 8 ] = i; mArray[ 9 ] = j; mArray[ 10 ] = k; mArray[ 11 ] = l; } FixedSizeVector( const T& a, const T& b, const T& c, const T& d, const T& e, const T& f, const T& g, const T& h, const T& i, const T& j, const T& k, const T& l, const T& m ) - { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ]; mArray[ 7 ] = h; mArray[ 8 ] = i; mArray[ 9 ] = j; mArray[ 10 ] = k; mArray[ 11 ] = l; mArray[ 12 ] =m; } + { mArray[ 0 ] = a; mArray[ 1 ] = b; mArray[ 2 ] = c; mArray[ 3 ] = d; mArray[ 4 ] = e; mArray[ 5 ] = f; mArray[ 6 ] = g; mArray[ 7 ] = h; mArray[ 8 ] = i; mArray[ 9 ] = j; mArray[ 10 ] = k; mArray[ 11 ] = l; mArray[ 12 ] =m; } U32 size() const { return SIZE; } bool empty() const { return ( SIZE == 0 ); } diff --git a/Engine/source/gfx/D3D9/gfxD3D9Shader.cpp b/Engine/source/gfx/D3D9/gfxD3D9Shader.cpp index 34b9c47d2..a7ff68a78 100644 --- a/Engine/source/gfx/D3D9/gfxD3D9Shader.cpp +++ b/Engine/source/gfx/D3D9/gfxD3D9Shader.cpp @@ -444,7 +444,7 @@ const String GFXD3D9ShaderConstBuffer::describeSelf() const GenericConstBufferLayout::ParamDesc pd; mVertexConstBufferLayoutF->getDesc(i, pd); - ret += String::ToString(" Constant name: %s", pd.name); + ret += String::ToString(" Constant name: %s", pd.name.c_str()); } return ret; diff --git a/Engine/source/gfx/D3D9/gfxD3D9TextureManager.cpp b/Engine/source/gfx/D3D9/gfxD3D9TextureManager.cpp index 435b27dd3..41556630f 100644 --- a/Engine/source/gfx/D3D9/gfxD3D9TextureManager.cpp +++ b/Engine/source/gfx/D3D9/gfxD3D9TextureManager.cpp @@ -236,7 +236,7 @@ void GFXD3D9TextureManager::_innerCreateTexture( GFXD3D9TextureObject *retTex, // If this is a render target, and it wants AA or wants to match the backbuffer (for example, to share the z) // Check the caps though, if we can't stretchrect between textures, use the old RT method. (Which hopefully means // that they can't force AA on us as well.) - if (retTex->mProfile->isRenderTarget() && mslevel != 0 && (mDeviceCaps.Caps2 && D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES)) + if (retTex->mProfile->isRenderTarget() && mslevel != 0 && (mDeviceCaps.Caps2 & D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES)) { D3D9Assert(mD3DDevice->CreateRenderTarget(width, height, d3dTextureFormat, mstype, mslevel, false, retTex->getSurfacePtr(), NULL), diff --git a/Engine/source/gfx/screenshot.h b/Engine/source/gfx/screenshot.h index 63de45280..9de224f06 100644 --- a/Engine/source/gfx/screenshot.h +++ b/Engine/source/gfx/screenshot.h @@ -74,6 +74,7 @@ public: /// Constructor. ScreenShot(); + virtual ~ScreenShot() { } /// Used to start the screenshot capture. void setPending( const char *filename, bool writeJPG, S32 tiles, F32 overlap ); diff --git a/Engine/source/gfx/video/videoCapture.h b/Engine/source/gfx/video/videoCapture.h index 5ef80c836..7f46b133f 100644 --- a/Engine/source/gfx/video/videoCapture.h +++ b/Engine/source/gfx/video/videoCapture.h @@ -221,6 +221,8 @@ protected: // List with bitmaps which are done encoding ThreadSafeDeque< GBitmap* > mProcessedBitmaps; public: + virtual ~VideoEncoder() { } + // Stores an encoded bitmap to be dealt with later void pushProcessedBitmap( GBitmap* bitmap ); diff --git a/Engine/source/gui/controls/guiPopUpCtrl.cpp b/Engine/source/gui/controls/guiPopUpCtrl.cpp index e4b2903f7..b67776461 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrl.cpp @@ -1011,8 +1011,8 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) { // We're making use of a bitmap border, so take into account the // right cap of the border. - RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address(); - localStart.x = getWidth() - mBitmapBounds[2].extent.x - txt_w; + RectI* bitmapBounds = mProfile->mBitmapArrayRects.address(); + localStart.x = getWidth() - bitmapBounds[2].extent.x - txt_w; } else { @@ -1024,8 +1024,8 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) { // We're making use of a bitmap border, so take into account the // right cap of the border. - RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address(); - localStart.x = (getWidth() - mBitmapBounds[2].extent.x - txt_w) / 2; + RectI* bitmapBounds = mProfile->mBitmapArrayRects.address(); + localStart.x = (getWidth() - bitmapBounds[2].extent.x - txt_w) / 2; } else { @@ -1043,8 +1043,8 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) { // We're making use of a bitmap border, so take into account the // right cap of the border. - RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address(); - localStart.x = getWidth() - mBitmapBounds[2].extent.x - txt_w; + RectI* bitmapBounds = mProfile->mBitmapArrayRects.address(); + localStart.x = getWidth() - bitmapBounds[2].extent.x - txt_w; } else { @@ -1095,8 +1095,8 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) { // We're making use of a bitmap border, so take into account the // right cap of the border. - RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address(); - Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - mBitmapBounds[2].extent.x, localStart.y ) ); + RectI* bitmapBounds = mProfile->mBitmapArrayRects.address(); + Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - bitmapBounds[2].extent.x, localStart.y ) ); GFX->getDrawUtil()->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors ); } else diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp index 275faf75c..4db07ed33 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp @@ -1167,8 +1167,8 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect) { // We're making use of a bitmap border, so take into account the // right cap of the border. - RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address(); - localStart.x = getWidth() - mBitmapBounds[2].extent.x - txt_w; + RectI* bitmapBounds = mProfile->mBitmapArrayRects.address(); + localStart.x = getWidth() - bitmapBounds[2].extent.x - txt_w; } else { @@ -1180,8 +1180,8 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect) { // We're making use of a bitmap border, so take into account the // right cap of the border. - RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address(); - localStart.x = (getWidth() - mBitmapBounds[2].extent.x - txt_w) / 2; + RectI* bitmapBounds = mProfile->mBitmapArrayRects.address(); + localStart.x = (getWidth() - bitmapBounds[2].extent.x - txt_w) / 2; } else { @@ -1199,8 +1199,8 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect) { // We're making use of a bitmap border, so take into account the // right cap of the border. - RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address(); - localStart.x = getWidth() - mBitmapBounds[2].extent.x - txt_w; + RectI* bitmapBounds = mProfile->mBitmapArrayRects.address(); + localStart.x = getWidth() - bitmapBounds[2].extent.x - txt_w; } else { @@ -1251,8 +1251,8 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect) { // We're making use of a bitmap border, so take into account the // right cap of the border. - RectI* mBitmapBounds = mProfile->mBitmapArrayRects.address(); - Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - mBitmapBounds[2].extent.x, localStart.y ) ); + RectI* bitmapBounds = mProfile->mBitmapArrayRects.address(); + Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - bitmapBounds[2].extent.x, localStart.y ) ); GFX->getDrawUtil()->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors ); } else diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index 29d5fbaa7..bf55bf3a2 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -3583,7 +3583,7 @@ void GuiTreeViewCtrl::onMiddleMouseDown(const GuiEvent & event) for (S32 j = 0; j < mSelected.size(); j++) { Con::printf("%d", mSelected[j]); } - S32 mCurrentDragCell = mMouseOverCell.y; + mCurrentDragCell = mMouseOverCell.y; S32 midpCell = (mCurrentDragCell) * mItemHeight + (mItemHeight/2); S32 currentY = pt.y; S32 yDiff = currentY-midpCell; @@ -3648,7 +3648,7 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) break; } } - S32 mCurrentDragCell = mMouseOverCell.y; + mCurrentDragCell = mMouseOverCell.y; if (mVisibleItems[firstSelectedIndex] != firstItem ) { /* diff --git a/Engine/source/gui/editor/guiDebugger.cpp b/Engine/source/gui/editor/guiDebugger.cpp index 625704bee..dbebc4e83 100644 --- a/Engine/source/gui/editor/guiDebugger.cpp +++ b/Engine/source/gui/editor/guiDebugger.cpp @@ -79,7 +79,7 @@ ConsoleMethod(DbgFileView, getCurrentLine, const char *, 2, 2, "()" S32 lineNum; const char *file = object->getCurrentLine(lineNum); char* ret = Con::getReturnBuffer(256); - dSprintf(ret, sizeof(ret), "%s\t%d", file, lineNum); + dSprintf(ret, 256, "%s\t%d", file, lineNum); return ret; } diff --git a/Engine/source/lighting/advanced/hlsl/gBufferConditionerHLSL.cpp b/Engine/source/lighting/advanced/hlsl/gBufferConditionerHLSL.cpp index d4d30f9ad..ed946e944 100644 --- a/Engine/source/lighting/advanced/hlsl/gBufferConditionerHLSL.cpp +++ b/Engine/source/lighting/advanced/hlsl/gBufferConditionerHLSL.cpp @@ -333,7 +333,7 @@ Var* GBufferConditionerHLSL::_conditionOutput( Var *unconditionedOutput, MultiLi // Encode depth into two channels if(mNormalStorageType != CartesianXYZ) { - const U64 maxValPerChannel = 1 << mBitsPerChannel; + const U64 maxValPerChannel = (U64)1 << mBitsPerChannel; meta->addStatement( new GenOp( " \r\n // Encode depth into hi/lo\r\n" ) ); meta->addStatement( new GenOp( avar( " float2 _tempDepth = frac(@.a * float2(1.0, %llu.0));\r\n", maxValPerChannel - 1 ), unconditionedOutput ) ); @@ -391,7 +391,7 @@ Var* GBufferConditionerHLSL::_unconditionInput( Var *conditionedInput, MultiLine // Recover depth from encoding if(mNormalStorageType != CartesianXYZ) { - const U64 maxValPerChannel = 1 << mBitsPerChannel; + const U64 maxValPerChannel = (U64)1 << mBitsPerChannel; meta->addStatement( new GenOp( " \r\n // Decode depth\r\n" ) ); meta->addStatement( new GenOp( avar( " @.w = dot( @.zw, float2(1.0, 1.0/%llu.0));\r\n", maxValPerChannel - 1 ), retVar, conditionedInput ) ); diff --git a/Engine/source/shaderGen/shaderFeature.h b/Engine/source/shaderGen/shaderFeature.h index a5f0a7d89..f18fae7f9 100644 --- a/Engine/source/shaderGen/shaderFeature.h +++ b/Engine/source/shaderGen/shaderFeature.h @@ -48,6 +48,8 @@ class ShaderFeatureConstHandles { public: + virtual ~ShaderFeatureConstHandles() { } + virtual void init( GFXShader *shader ) = 0; virtual void setConsts( SceneRenderState *state, diff --git a/Engine/source/terrain/terrCell.cpp b/Engine/source/terrain/terrCell.cpp index dac6c910a..a0478ed77 100644 --- a/Engine/source/terrain/terrCell.cpp +++ b/Engine/source/terrain/terrCell.cpp @@ -849,7 +849,7 @@ void TerrCell::_updateMaterials() if ( index == U8_MAX || index > 63 ) continue; - mMaterials |= (U64)(1<& v_points, Vector& v_norms, Vector& v_colors, @@ -693,7 +693,7 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const if (appNode->invertMeshes) points_array[iVert].z = -points_array[iVert].z; - objectOffset.mulP(points_array[iVert]); + objOffset.mulP(points_array[iVert]); } if (appendValues || ((tuple.uv >= 0) && (tuple.uv < streams.uvs.size()))) { @@ -755,7 +755,7 @@ void ColladaAppMesh::getVertexData(const domGeometry* geometry, F32 time, const delete meshPrims[iPrim]; } -void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const MatrixF& objectOffset, +void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const MatrixF& objOffset, Vector& v_points, Vector& v_norms, Vector& v_colors, @@ -807,7 +807,7 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M return; getPrimitives(baseGeometry); - getVertexData(baseGeometry, time, objectOffset, v_points, v_norms, v_colors, v_uvs, v_uv2s, true); + getVertexData(baseGeometry, time, objOffset, v_points, v_norms, v_colors, v_uvs, v_uv2s, true); // Get pointers to the arrays of base geometry data Point3F* points_array = &v_points[v_points.size() - vertTuples.size()]; @@ -863,7 +863,7 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M if (uv2s_array) targetUv2s.set(uv2s_array, vertTuples.size()); - getVertexData(targetGeoms[iTarget], time, objectOffset, targetPoints, targetNorms, targetColors, targetUvs, targetUv2s, false); + getVertexData(targetGeoms[iTarget], time, objOffset, targetPoints, targetNorms, targetColors, targetUvs, targetUv2s, false); // Combine with base geometry for (S32 iVert = 0; iVert < vertTuples.size(); iVert++) { @@ -883,7 +883,7 @@ void ColladaAppMesh::getMorphVertexData(const domMorph* morph, F32 time, const M } } -void ColladaAppMesh::lockMesh(F32 t, const MatrixF& objectOffset) +void ColladaAppMesh::lockMesh(F32 t, const MatrixF& objOffset) { // Find the geometry element for this mesh. Could be one of 3 things: // 1) a simple static mesh (Collada element) @@ -923,10 +923,10 @@ void ColladaAppMesh::lockMesh(F32 t, const MatrixF& objectOffset) // Now get the vertex data at the specified time if (geometry->getElementType() == COLLADA_TYPE::GEOMETRY) { getPrimitives(daeSafeCast(geometry)); - getVertexData(daeSafeCast(geometry), t, objectOffset, points, normals, colors, uvs, uv2s, true); + getVertexData(daeSafeCast(geometry), t, objOffset, points, normals, colors, uvs, uv2s, true); } else if (geometry->getElementType() == COLLADA_TYPE::MORPH) { - getMorphVertexData(daeSafeCast(geometry), t, objectOffset, points, normals, colors, uvs, uv2s); + getMorphVertexData(daeSafeCast(geometry), t, objOffset, points, normals, colors, uvs, uv2s); } else { daeErrorHandler::get()->handleWarning(avar("Unsupported geometry type " diff --git a/Engine/source/ts/collada/colladaAppMesh.h b/Engine/source/ts/collada/colladaAppMesh.h index e7d07c376..17ac1cad1 100644 --- a/Engine/source/ts/collada/colladaAppMesh.h +++ b/Engine/source/ts/collada/colladaAppMesh.h @@ -109,11 +109,11 @@ protected: bool checkGeometryType(const daeElement* element); void getPrimitives(const domGeometry* geometry); - void getVertexData( const domGeometry* geometry, F32 time, const MatrixF& objectOffset, + void getVertexData( const domGeometry* geometry, F32 time, const MatrixF& objOffset, Vector& points, Vector& norms, Vector& colors, Vector& uvs, Vector& uv2s, bool appendValues); - void getMorphVertexData( const domMorph* morph, F32 time, const MatrixF& objectOffset, + void getMorphVertexData( const domMorph* morph, F32 time, const MatrixF& objOffset, Vector& points, Vector& norms, Vector& colors, Vector& uvs, Vector& uv2s ); @@ -211,8 +211,8 @@ public: /// Generate the vertex, normal and triangle data for the mesh. /// /// @param time Time at which to generate the mesh data - /// @param objectOffset Transform to apply to the generated data (bounds transform) - void lockMesh(F32 time, const MatrixF& objectOffset); + /// @param objOffset Transform to apply to the generated data (bounds transform) + void lockMesh(F32 time, const MatrixF& objOffset); /// Get the transform of this mesh at a certain time /// diff --git a/Engine/source/ts/collada/colladaUtils.h b/Engine/source/ts/collada/colladaUtils.h index 4cc4cf5da..04592126e 100644 --- a/Engine/source/ts/collada/colladaUtils.h +++ b/Engine/source/ts/collada/colladaUtils.h @@ -430,6 +430,8 @@ public: class BasePrimitive { public: + virtual ~BasePrimitive() { } + /// Return true if the element is a geometric primitive type static bool isPrimitive(const daeElement* element) { diff --git a/Engine/source/ts/tsShape.cpp b/Engine/source/ts/tsShape.cpp index 726efabff..d01a871c5 100644 --- a/Engine/source/ts/tsShape.cpp +++ b/Engine/source/ts/tsShape.cpp @@ -1225,7 +1225,7 @@ void TSShape::assembleShape() if (smReadVersion<23) { // get detail information about skins... - S32 * detailFirstSkin = tsalloc.getPointer32(numDetails); + S32 * detFirstSkin = tsalloc.getPointer32(numDetails); S32 * detailNumSkins = tsalloc.getPointer32(numDetails); tsalloc.checkGuard(); @@ -1257,7 +1257,7 @@ void TSShape::assembleShape() ptr32 = tsalloc.allocShape32(numSkins); for (i=0; i