mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-22 21:05:39 +00:00
Revert "revert #1148 as prematurely incorporated"
This reverts commit f946088214.
This commit is contained in:
parent
bd2121b674
commit
7216ba8530
22 changed files with 20385 additions and 1813 deletions
|
|
@ -67,14 +67,7 @@ bool TerrainBlock::exportHeightMap( const UTF8 *filePath, const String &format )
|
|||
}
|
||||
}
|
||||
|
||||
FileStream stream;
|
||||
if ( !stream.open( filePath, Torque::FS::File::Write ) )
|
||||
{
|
||||
Con::errorf( "TerrainBlock::exportHeightMap() - Error opening file for writing: %s !", filePath );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !output.writeBitmap( format, stream ) )
|
||||
if ( !output.writeBitmap( format, filePath) )
|
||||
{
|
||||
Con::errorf( "TerrainBlock::exportHeightMap() - Error writing %s: %s !", format.c_str(), filePath );
|
||||
return false;
|
||||
|
|
@ -120,14 +113,7 @@ bool TerrainBlock::exportLayerMaps( const UTF8 *filePrefix, const String &format
|
|||
UTF8 filePath[1024];
|
||||
dSprintf( filePath, 1024, "%s_%d_%s.%s", filePrefix, i, mFile->mMaterials[i]->getInternalName(), format.c_str() );
|
||||
|
||||
FileStream stream;
|
||||
if ( !stream.open( filePath, Torque::FS::File::Write ) )
|
||||
{
|
||||
Con::errorf( "TerrainBlock::exportLayerMaps() - Error opening file for writing: %s !", filePath );
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( !output.writeBitmap( format, stream ) )
|
||||
if ( !output.writeBitmap( format, filePath) )
|
||||
{
|
||||
Con::errorf( "TerrainBlock::exportLayerMaps() - Error writing %s: %s !", format.c_str(), filePath );
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -477,16 +477,9 @@ void TerrainBlock::_updateBaseTexture(bool writeToCache)
|
|||
}
|
||||
else
|
||||
{
|
||||
FileStream stream;
|
||||
if (!stream.open(_getBaseTexCacheFileName(), Torque::FS::File::Write))
|
||||
{
|
||||
mBaseTex = blendTex;
|
||||
return;
|
||||
}
|
||||
|
||||
GBitmap bitmap(blendTex->getWidth(), blendTex->getHeight(), false, GFXFormatR8G8B8A8);
|
||||
blendTex->copyToBmp(&bitmap);
|
||||
bitmap.writeBitmap(formatToExtension(mBaseTexFormat), stream);
|
||||
bitmap.writeBitmap(formatToExtension(mBaseTexFormat), _getBaseTexCacheFileName());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue