From 385017d1ec5b3df65f4d1887fdf93e33007915b2 Mon Sep 17 00:00:00 2001 From: walbourn_cp Date: Thu, 11 Sep 2014 15:24:23 -0700 Subject: [PATCH] Made ScratchImage::OverrideFormat more flexible (and less safe) --- DirectXTex/DirectXTexImage.cpp | 9 --------- 1 file changed, 9 deletions(-) diff --git a/DirectXTex/DirectXTexImage.cpp b/DirectXTex/DirectXTexImage.cpp index f754034..6b9c209 100644 --- a/DirectXTex/DirectXTexImage.cpp +++ b/DirectXTex/DirectXTexImage.cpp @@ -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;