NNS_G2dSetOamSoftEmuUVFlipCorrectFunc

Syntax

#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 the NNS_G2dResetOamSoftEmuUVFlipCorrectFunc function.

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 prepared as a workaround of the specifications that require the texture sampling position to shift out of synch 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 sampling location correction for affine-transformed sprites.
This is based on the assessment that it is more realistic to use resource-based responses for sampling location correction of affine-transformed sprites when factors such as processing load are considered. (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