# NNS_G2dInitMCAnimationInstance

## Syntax

      #include <nnsys/g2d/g2d_MultiCellAnimation.h>

      void NNS_G2dInitMCAnimationInstance
      (
          NNSG2dMultiCellAnimation*          pMultiCellAnim,
          void*                              pWork,
          const NNSG2dCellAnimBankData*      pAnimBank,
          const NNSG2dCellDataBank*          pCellDataBank,
          const NNSG2dMultiCellDataBank*     pMultiCellDataBank,
          NNSG2dMCType                       mcType
      );

## Arguments

`pMultiCellAnim` | [OUT] Multicell animation
`pWork` | [IN] Work region used by the multicell entity
`pAnimBank` | [IN] Animation bank that defines the cell animation that composes the multicell
`pCellDataBank` | [IN] Cell data bank
`pMultiCellDataBank` | [IN] Multicell data bank
`mcType` | [IN] Multicell entity type (`NNSG2dMCType` type)

## Return Values

None.

## Description

Initializes multicell animation. The `pWork` argument is a pointer to the memory region in the entity to be used as the work region. The work region size required for initializing the entity is obtained with the `NNS_G2dGetMCWorkAreaSize` function. The `mcType` argument is an `NNSG2dMCType` enumerator that expresses the multicell animation entity type. The `NNSG2dMCType` definition is shown below. ``

    typedef enum
    {
        NNS_G2D_MCTYPE_DONOT_SHARE_CELLANIM,
        NNS_G2D_MCTYPE_SHARE_CELLANIM

    }NNSG2dMCType;

When `NNS_G2D_MCTYPE_DONOT_SHARE_CELLANIM` is specified as `mcType`, the entity is initialized as a data structure identical to those of past versions and is processed in the same manner. As long as the programmer does not access multicell structure nodes to overwrite data, designating `NNS_G2D_MCTYPE_SHARE_CELLANIM` when initializing the entity provides an advantage in memory consumption and processing efficiency.
When `NNS_G2D_MCTYPE_SHARE_CELLANIM` is specified as `mcType` and when data is input that plays back the same animation sequence on multiple nodes of a multicell, the cell animation entity is shared among those multiple nodes. This sharing reduces the memory consumption and the processing load for animation updates.
When `NNS_G2D_MCTYPE_SHARE_CELLANIM` has been specified, the multicell runtime entity does not store node-equivalent information. As a result, location changes and affine conversions in units of nodes are not supported. However, this option uses fewer hardware resources (affine parameters) than `NNS_G2D_MCTYPE_DONOT_SHARE_CELLANIM` because it is guaranteed that nodes that play back the same cell animation will reference the same affine parameters, due to the above limitations. This is particularly true when rendering with the 2D graphics engine.
This function replaces the `NNS_G2dInitMCAnimation`, `NNS_G2dInitMCInstance`, and `NNS_G2dSetMCDataToMCInstance` functions. The previous functions will remain to maintain compatibility.
For new development, use this new function.

## See Also

`NNS_G2dGetMCWorkAreaSize`
`NNS_G2dInitMCAnimation`
`NNS_G2dInitMCInstance`
`NNS_G2dSetMCDataToMCInstance`

## Revision History

2005/01/31 Initial version.

CONFIDENTIAL