mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 08:04:40 +00:00
More fixes
- check for an empty shapName, not just a NULL one twice - fix "&s" in printf - fix potential memory leak - GFXCopyPixels wasn't checking the height properly which could result in some meory corruption unpleasantness
This commit is contained in:
parent
65099897f4
commit
d63b820e35
4 changed files with 8 additions and 4 deletions
|
|
@ -527,7 +527,7 @@ bool PxMultiActorData::preload( bool server, String &errorBuffer )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!shapeName || shapeName == '\0')
|
if (!shapeName || shapeName[0] == '\0')
|
||||||
{
|
{
|
||||||
errorBuffer = "PxMultiActorDatas::preload: no shape name!";
|
errorBuffer = "PxMultiActorDatas::preload: no shape name!";
|
||||||
return false;
|
return false;
|
||||||
|
|
|
||||||
|
|
@ -1074,7 +1074,7 @@ void MeshRoad::unpackUpdate(NetConnection * con, BitStream * stream)
|
||||||
stream->read( &mMaterialName[i] );
|
stream->read( &mMaterialName[i] );
|
||||||
|
|
||||||
if ( !Sim::findObject( mMaterialName[i], pMat ) )
|
if ( !Sim::findObject( mMaterialName[i], pMat ) )
|
||||||
Con::printf( "DecalRoad::unpackUpdate, failed to find Material of name &s!", mMaterialName[i].c_str() );
|
Con::printf( "DecalRoad::unpackUpdate, failed to find Material of name %s", mMaterialName[i].c_str() );
|
||||||
else
|
else
|
||||||
mMaterial[i] = pMat;
|
mMaterial[i] = pMat;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -400,7 +400,11 @@ void SkyBox::_initRender()
|
||||||
}
|
}
|
||||||
|
|
||||||
GFXVertexPNTT *vertPtr = mVB.lock();
|
GFXVertexPNTT *vertPtr = mVB.lock();
|
||||||
if(!vertPtr) return;
|
if (!vertPtr)
|
||||||
|
{
|
||||||
|
delete[] tmpVerts;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dMemcpy( vertPtr, tmpVerts, sizeof ( GFXVertexPNTT ) * vertCount );
|
dMemcpy( vertPtr, tmpVerts, sizeof ( GFXVertexPNTT ) * vertCount );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,7 @@ void GFXCopyPixels( GFXFormat fromFormat, U32 fromWidth, U32 fromHeight, U8* fr
|
||||||
{
|
{
|
||||||
if( fromFormat == toFormat
|
if( fromFormat == toFormat
|
||||||
&& fromWidth == toWidth
|
&& fromWidth == toWidth
|
||||||
&& fromHeight == fromHeight )
|
&& fromHeight == toHeight )
|
||||||
dMemcpy( toData, fromData, fromWidth * fromHeight * GFXFormatInfo( fromFormat ).getBytesPerPixel() );
|
dMemcpy( toData, fromData, fromWidth * fromHeight * GFXFormatInfo( fromFormat ).getBytesPerPixel() );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue