revert #1148 as prematurely incorporated

it's getting there, but there have been a few spots noted where it eroneously corrupts text, so we'll have to pull this back out for a bit barring a proper resolution
This commit is contained in:
AzaezelX 2024-01-11 13:33:03 -06:00
parent 78b56688d3
commit f946088214
22 changed files with 1813 additions and 20385 deletions

View file

@ -67,7 +67,14 @@ bool TerrainBlock::exportHeightMap( const UTF8 *filePath, const String &format )
}
}
if ( !output.writeBitmap( format, filePath) )
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 ) )
{
Con::errorf( "TerrainBlock::exportHeightMap() - Error writing %s: %s !", format.c_str(), filePath );
return false;
@ -113,7 +120,14 @@ 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() );
if ( !output.writeBitmap( format, filePath) )
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 ) )
{
Con::errorf( "TerrainBlock::exportLayerMaps() - Error writing %s: %s !", format.c_str(), filePath );
return false;

View file

@ -477,9 +477,16 @@ 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), _getBaseTexCacheFileName());
bitmap.writeBitmap(formatToExtension(mBaseTexFormat), stream);
}
}