#include <nnsys/g2d/g2d_OamSoftwareSpriteDraw.h>
void NNS_G2dSetOamSoftEmuUVFlipCorrectFunc( NNS_G2dOamSoftEmuUVFlipCorrectFunc pFunc );
| pFunc | [IN] UV value-correction function pointer used in OAM software sprite emulation |
None.
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.
NNS_G2dResetOamSoftEmuUVFlipCorrectFunc
11/10/2004 Added sample code.
07/20/2004 Initial version.