All pastes #675550 Raw Edit

Someone

public cpp v1 · immutable
#675550 ·published 2007-08-30 08:01 UTC
rendered paste body
bool HasAlphaChannel( char *pfile ){	FILE *fptex = fopen( pfile, "rb" );	if( !fptex )	{		printf( "Error: HasAlphaChannel( %s ) failed, Can't open texture!\n", pfile );		return false;	}	VTFFileHeader_t *ptex = ( VTFFileHeader_t * )malloc( sizeof( VTFFileHeader_t ) );	fread( ptex, 1, sizeof( VTFFileHeader_t ), fptex );	if( ptex->flags ^ TEXTUREFLAGS_EIGHTBITALPHA || ptex->flags ^ TEXTUREFLAGS_ONEBITALPHA )	{		return true;	}	return false;}