@@ -865,6 +865,9 @@ void VTF::setPlatform(Platform newPlatform) {
865865		case  PLATFORM_PC:
866866			break ;
867867		case  PLATFORM_XBOX:
868+ 			//  Have to do it this roundabout way to fix cubemaps
869+ 			this ->setVersion (0 );
870+ 			this ->platform  = newPlatform;
868871			this ->setVersion (2 );
869872			break ;
870873		case  PLATFORM_X360:
@@ -951,12 +954,10 @@ void VTF::setVersion(uint32_t newVersion) {
951954		this ->removeFlags (FLAG_MASK_V3);
952955	}
953956	if  ((this ->version  < 4  && newVersion >= 4 ) || (this ->version  >= 4  && newVersion < 4 )) {
954- 		this ->removeFlags (FLAG_MASK_V4);
955- 		this ->removeFlags (FLAG_MASK_V4_TF2);
957+ 		this ->removeFlags (FLAG_MASK_V4 | FLAG_MASK_V4_TF2);
956958	}
957959	if  ((this ->version  < 5  && newVersion >= 5 ) || (this ->version  >= 5  && newVersion < 5 )) {
958- 		this ->removeFlags (FLAG_MASK_V5);
959- 		this ->removeFlags (FLAG_MASK_V5_CSGO);
960+ 		this ->removeFlags (FLAG_MASK_V5 | FLAG_MASK_V5_CSGO);
960961	}
961962	this ->setSRGB (srgb);
962963
@@ -1223,7 +1224,7 @@ uint8_t VTF::getFaceCount() const {
12231224	if  (!(this ->flags  & FLAG_V0_ENVMAP)) {
12241225		return  1 ;
12251226	}
1226- 	if  (this ->version  >= 6 ) {
1227+ 	if  (this ->platform  == PLATFORM_XBOX ||  this -> version  >= 6 ) {
12271228		//  All v7.6 VTFs are sane, and we need this special case to fix a bug in the parser where
12281229		//  it won't recognize cubemaps as cubemaps because the image resource is compressed!
12291230		return  6 ;
@@ -1934,7 +1935,7 @@ void VTF::computeFallback(ImageConversion::ResizeFilter filter) {
19341935
19351936	this ->fallbackWidth  = 8 ;
19361937	this ->fallbackHeight  = 8 ;
1937- 	this ->fallbackMipCount  = ImageDimensions::getActualMipCountForDimsOnConsole (this ->fallbackWidth , this ->fallbackHeight );
1938+ 	this ->fallbackMipCount  = ( this -> flags  & FLAG_V0_NO_MIP) ?  1  :  ImageDimensions::getActualMipCountForDimsOnConsole (this ->fallbackWidth , this ->fallbackHeight );
19381939
19391940	std::vector<std::byte> fallbackData;
19401941	fallbackData.resize (ImageFormatDetails::getDataLength (this ->format , this ->fallbackMipCount , this ->frameCount , faceCount, this ->fallbackWidth , this ->fallbackHeight ));
0 commit comments