##### Ninja Library - Texture Function

# njLoadTexturePvmMemory

Loads PVM memory format

### FORMAT

`

  Sint32 njLoadTexturePvmMemory( *addr, *texlist )
  Uint8 *addr
  NJS_TEXLIST *texlist

`

### PARAMETER

  `*addr` | PVM format texture memory address
  `*texlist` | Texture list

### RETURN

  1 | Successful |
  -1 | Failed |

### DESCRIPTION

  Loads PVM format texture memory. The texture list is the one set with `njSetPvmTextureList()` function. Texture buffer not required.

### EXAMPLE

      When 20 textures in PVM format texture memory

      #define NUM 20
      NJS_TEXNAME texname[NUM];
      NJS_TEXLIST texlist;
      NJS_TEXMEMLIST texmemlist[NUM];
      /* 1 file name can be 28 characters long */
      char filename[NUM][28];
      Uint8 *PvmTexture;
      GDFS fp;
      Sint32 file_size;
      Sint32 file_sect;
      njInitTexture(texmemlist,NUM);
      /* File open */
      fp = gdFsOpen("f40.pvm",NULL);
      /* Determine file size */
      gdFsGetFileSize(fp,&file_size);
      /* Finish calculating maximum sectors */
      file_sect = gdFsCalcSctSize(file_size);
      /* Secure space required for loading */
      PvmTexture = syMalloc(file_sect*2048);
      /* Load file */
      gdFsRead(fp,file_sect,PvmTexture);
      /* Close file */
      gdFsClose(fp);
      njSetPvmTextureList( &texlist, texname,(char*)filename,NUM);
      /* Load PVM texture */
      njLoadTexturePvmMemory(PvmTexture,&texlist);

### REFERENCE

  `njLoadTexturePvmFile()
  `

njLoadTexturePvmMemory

COPYRIGHT © SEGA ENTERPRISES, LTD., 1998,1999