NNS_G2dLoadPaletteEx

Syntax

#include <nnsys/g2d/g2d_Image.h>
void NNS_G2dLoadPaletteEx(
                                    const NNSG2dPaletteData*            pSrcData,
                                    const NNSG2dPaletteCompressInfo*    pCmpInfo,
                                    u32                                 addr,
                                    NNS_G2D_VRAM_TYPE                   type, 
                                    NNSG2dImagePaletteProxy*            pPltProxy);
  

Arguments

pSrcData [IN] input palette data source
pCmpInfo [IN] Palette compression information
addr [IN] Load destination address
type [IN] VRAM type to use (3D, 2D-Main, or 2D-Sub)
pPltProxy [OUT] Image palette proxy that stores the load result

Return Values

None.

Description

This function loads the compressed palette data into the hardware, and sets the load results and image format in the image palette proxy.
With compressed palette data, unused palette numbers (with all colors in the palette set to RGB(0,0,0)) are discarded. Only the data for necessary palette numbers is stored.
Note: Accordingly, the compressed palette feature does not have any effect on 256-color palettes.
By using this function for loading, the palette data is loaded into the original palette number location.
Compressed palette data is output by specifying the -pcm option.)


    (Code sample)
    NNSG2dPaletteData*          pPltData    = NULL;
    NNSG2dPaletteCompressInfo*  pPltCmpData = NULL;
    void*  pFile = NULL;
    
    if( MyLoadFileToMainMem_( "test_data.NCLR", &pFile ) )
    {
        //
        // Try initializing the compressed information block
        //
        const BOOL bCmpLoaded = NNS_G2dGetUnpackedPaletteCompressInfo( pFile, &pPltCmpData );
               
        
        if( NNS_G2dGetUnpackedPaletteData( pFile, &pPltData ) )
        {
            if( bCmpLoaded )
            {
                //
                // Use this function
                //
                NNS_G2dLoadPaletteEx( pPltData, pPltCmpData, myPlttAddr, myVramType, &myPltProxy_ );         
            }else{
                //
                // Use the normal palette load function
                //
                NNS_G2dLoadPalette( pPltData, myPlttAddr, myVramType, &myPltProxy_ );         
            }
        }
    }

See Also

None.

Revision History

2004/10/04 Initial version.


CONFIDENTIAL