r_phase5.c
//
// Load and decode a compressed graphic resource and store it in the lumpcache
//
Load and decode a compressed graphic resource and store it in the lumpcache
Load and decode a compressed graphic resource and store it in the lumpcache
static pixel_t *R_LoadPixels(int lumpnum)
{
   void       *rdest;
   byte       *rsrc;
   lumpinfo_t *info;
   int         count;
   rdest = lumpcache[lumpnum];
   if(rdest != NULL)
      return rdest;
   info  = &lumpinfo[lumpnum];
   count = BIGLONG(info->size); 
   rdest = R_Malloc(count * 2, &lumpcache[lumpnum]);
   rsrc  = wadfileptr + BIGLONG(info->filepos); 
   R_decode(rsrc, rdest);
   lumpcache[lumpnum] = rdest;
   return rdest;
}
static pixel_t * R_LoadPixels ( int lumpnum ) { void * rdest ; byte * rsrc ; lumpinfo_t * info ; int count ; rdest = lumpcache [ lumpnum ] ; if ( rdest != NULL ) return rdest ; info = & lumpinfo [ lumpnum ] ; count = BIGLONG ( info -> size ) ; rdest = R_Malloc ( count * 2 , & lumpcache [ lumpnum ] ) ; rsrc = wadfileptr + BIGLONG ( info -> filepos ) ; R_decode ( rsrc , rdest ) ; lumpcache [ lumpnum ] = rdest ; return rdest ; }
Load and decode a compressed graphic resource and store it in the lumpcache
Load and decode a compressed graphic resource and store it in the lumpcache
// already cached? // CALICO: endianness correction required // allocate at doubled lump size, as translates from 8-bit paletted to  // 16-bit CRY while decompressing // CALICO: ditto // decompress