- csprogsdata = FS_LoadFile(csprogsfn, tempmempool, true, &csprogsdatasize);
+ if(cls.caughtcsprogsdata && cls.caughtcsprogsdatasize == requiredsize && CRC_Block(cls.caughtcsprogsdata, (size_t)cls.caughtcsprogsdatasize) == requiredcrc)
+ {
+ Con_DPrintf("Using buffered \"%s\"\n", csprogsfn);
+ csprogsdata = cls.caughtcsprogsdata;
+ csprogsdatasize = cls.caughtcsprogsdatasize;
+ cls.caughtcsprogsdata = NULL;
+ cls.caughtcsprogsdatasize = 0;
+ }
+ else
+ {
+ Con_DPrintf("Not using buffered \"%s\" (buffered: %p, %d)\n", csprogsfn, cls.caughtcsprogsdata, (int) cls.caughtcsprogsdatasize);
+ csprogsdata = FS_LoadFile(csprogsfn, tempmempool, true, &csprogsdatasize);
+ }