Made ScratchImage::OverrideFormat more flexible (and less safe)

This commit is contained in:
walbourn_cp 2014-09-11 15:24:23 -07:00
parent 15d1a22921
commit 385017d1ec

View File

@ -693,15 +693,6 @@ bool ScratchImage::OverrideFormat( DXGI_FORMAT f )
if ( !IsValid( f ) || IsPlanar( f ) || IsPalettized( f ) )
return false;
if ( ( BitsPerPixel( f ) != BitsPerPixel( _metadata.format ) )
|| ( IsCompressed( f ) != IsCompressed( _metadata.format ) )
|| ( IsPacked( f ) != IsPacked( _metadata.format ) )
|| ( IsVideo( f ) != IsVideo( _metadata.format ) ) )
{
// Can't change the effective pitch of the format this way
return false;
}
for( size_t index = 0; index < _nimages; ++index )
{
_image[ index ].format = f;