# NNS_G2dLoadPaletteEx

## C Specification

      #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, sets the load results, and sets the image format in the image palette proxy. With compressed palette data, an unused palette number (all colors in the palette are set to RGB(0,0,0)) is discarded. Only the data for necessary palette numbers are stored. Please note that the compressed palette feature does not have any effect on the 256-color palette. 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

10/04/2004 Initial version.