NNS_G2dSetOamSoftEmuUVFlipCorrectFunc

C Specification

#include <nnsys/g2d/g2d_OamSoftwareSpriteDraw.h>

void    NNS_G2dSetOamSoftEmuUVFlipCorrectFunc( NNS_G2dOamSoftEmuUVFlipCorrectFunc pFunc );
                            
                            

Arguments

pFunc [IN] UV value-correction function pointer used in OAM software sprite emulation

Return Values

None.

Description

Sets the UV value-correction function pointer used in OAM software sprite emulation. To invalidate this function pointer, use NNS_G2dResetOamSoftEmuUVFlipCorrectFunc. In its arguments, the callback calls the pointer to the software 4-corner UV values and the horizontal and vertical flip-state flags. This function was designed in order to get around the fact that the texture sampling position skews by 1 texel when the software sprite flip process is performed. A typical implementation is shown below.

void UVFlipCorrectFunc_
(
    fx32*   pRetU0,
    fx32*   pRetV0,
    fx32*   pRetU1,
    fx32*   pRetV1,
    BOOL   bFilpH,
    BOOL   bFilpV
)
{
    if( bFilpH )
    {
        *pRetU0 -= FX32_ONE;
        *pRetU1 -= FX32_ONE;
    }

    if( bFilpV )
    {
        *pRetV0 -= FX32_ONE;
        *pRetV1 -= FX32_ONE;
    }
}
The correction function that can be set with this function does not support the sampling location correction of the sprite after the affine transformation.
This is based on the assessment that the sampling location correction of affine transformation sprite should be processed with the material, considering the processing load and such. (Processes done with the material are countermeasures, such as placing transparent color on the pixels around the cell so that the result of the sample location shift will not be highly visible.)

See Also

NNS_G2dResetOamSoftEmuUVFlipCorrectFunc

Revision History

2004/11/10 Added sample code.
2004/07/20 Initial version.


CONFIDENTIAL