engine/EngineVideoTextureManager.c
/*	Special case of AlphaEdgeFix for textures that only need it because they were padded.
	Operates in place on 32bit data, and expects unpadded height and width values.
*/
Special case of AlphaEdgeFix for textures that only need it because they were padded.
Operates in place on 32bit data, and expects unpadded height and width values.
Special case of AlphaEdgeFix for textures that only need it because they were padded . Operates in place on 32bit data and expects unpadded height and width values .
void TexMgr_PadEdgeFixW(uint8_t *data, int width, int height)
{
	uint8_t *src, *dst;
	int i, padw, padh;
	padw = TexMgr_PadConditional(width);
	padh = TexMgr_PadConditional(height);
	src = data + (width - 1) * 4;
	for (i=0; i<padh; i++)
	{
		src[4] = src[0];
		src[5] = src[1];
		src[6] = src[2];
		src += padw * 4;
	}
	src = data;
	dst = data + (padw - 1) * 4;
	for (i=0; i<padh; i++)
	{
		dst[0] = src[0];
		dst[1] = src[1];
		dst[2] = src[2];
		src += padw * 4;
		dst += padw * 4;
	}
}
void TexMgr_PadEdgeFixW ( uint8_t * data , int width , int height ) { uint8_t * src , * dst ; int i , padw , padh ; padw = TexMgr_PadConditional ( width ) ; padh = TexMgr_PadConditional ( height ) ; src = data + ( width - 1 ) * 4 ; for ( i = 0 ; i < padh ; i ++ ) { src [ 4 ] = src [ 0 ] ; src [ 5 ] = src [ 1 ] ; src [ 6 ] = src [ 2 ] ; src += padw * 4 ; } src = data ; dst = data + ( padw - 1 ) * 4 ; for ( i = 0 ; i < padh ; i ++ ) { dst [ 0 ] = src [ 0 ] ; dst [ 1 ] = src [ 1 ] ; dst [ 2 ] = src [ 2 ] ; src += padw * 4 ; dst += padw * 4 ; } }
Special case of AlphaEdgeFix for textures that only need it because they were padded.
Special case of AlphaEdgeFix for textures that only need it because they were padded .
//copy last full column to first empty column, leaving alpha byte at zero //copy first full column to last empty column, leaving alpha byte at zero