void FWadCollection::ReadLump (int lump, void *dest) { FWadLump lumpr = OpenLumpNum (lump); long size = lumpr.GetLength (); long numread = lumpr.Read (dest, size); if (numread != size) { I_Error ("W_ReadLump: only read %ld of %ld on lump %i\n", numread, size, lump); } }
FString::FString (ELumpNum lumpnum) { FWadLump lumpr = Wads.OpenLumpNum ((int)lumpnum); long size = lumpr.GetLength (); AllocBuffer (1 + size); long numread = lumpr.Read (&Chars[0], size); Chars[size] = '\0'; if (numread != size) { I_Error ("ConstructStringFromLump: Only read %ld of %ld bytes on lump %i (%s)\n", numread, size, lumpnum, Wads.GetLumpFullName((int)lumpnum)); } }