##### Ninja Library - Texture Function

# njReleaseCacheTextureNum

Releases cache memory

### FORMAT

`

  Sint32 njReleaseCacheTextureNum( n )
  Uint32 n

`

### PARAMETER

  `n` | Texture number in the current texture list

### RETURN

  1 | Successful |
  -1 | Failure |

### DESCRIPTION

  Releases the cache memory for texture #n.

### EXAMPLE

      NJS_TEXNAME texname[2];
      NJS_TEXLIST texlist ={texname,2};
      /* Prepare to read in two textures */
      NJS_TEXMEMLIST texmemlist[2];
      Sint8 *texbuf;
      Sint8 *cachebuf;
      njInitTexture(texmemlist,2);
      texbuf = syMalloc(0x20800);
      njInitTextureBuffer(texbuf,0x20000);
      /* Set cache buffer 256x256x2bytex2=0x40000*/
      cachebuf = syMalloc(0x40000);
      njInitCacheTextureBuffer(cachebuf,0x40000);
      njSetTextureName(&texname[0],"file1.pvr",0,NJD_TEXATTR_TYPE_FILE|
          NJD_TEXTURE_CACHE|NJD_TEXATTR_GLOBALINDEX);
      njSetTextureName(&texname[1],"file2.pvr",1,NJD_TEXATTR_TYPE_FILE|
          NJD_TEXTURE_CACHE|NJD_TEXATTR_GLOBALINDEX);
      /* Load texture and read into cache */
      njLoadTexture(&texlist);
      /* Set texlist as the current texture list */
      njSetTexture(&texlist);
      /* Read texture from cache into texture memory*/
      njLoadCacheTextureNum(0);
      njLoadCacheTextureNum(1);
      syFree(texbuf);
      /* Set current texture to texlist #0 file1.pvr*/
      njSetTextureNum(0);
          :
      /* lit. Drawing texture with texture in file1.pvr */
          :
      /* Release texture #0 in cache */
      njReleaseCacheTextureNum(0);

### NOTE

  Current texture list must be specified by `njSetTexture()` function. The specified texture must be loaded into cache memory. Even if texture in cache memory is released, the one in texture memory will not be released. Refer to texture document for more details.

### REFERENCE

  `njReleaseCacheTextureAll()
  njReleaseCacheTextureNumG()
  `

njReleaseCacheTextureNum

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999