void W_ReleaseAllWads(void) { size_t i; W_DoneCache(); for (i = 0; i < numwadfiles; i++) { if (wadfiles[i].handle) { // close(wadfiles[i].handle); fclose(wadfiles[i].handle); free(wadfiles[i].data); wadfiles[i].handle = 0; } } numwadfiles = 0; free(wadfiles); wadfiles = NULL; numlumps = 0; free(lumpinfo); lumpinfo = NULL; V_FreePlaypal(); }
void W_Init(void) { // CPhipps - start with nothing numlumps = 0; lumpinfo = NULL; // CPhipps - new wadfiles array used // open all the files, load headers, and count lumps for (unsigned int i = 0; i < resource_files->len; i++) W_AddFile(i); if (!numlumps) I_Error("W_Init: No files found"); //jff 1/23/98 // get all the sprites and flats into one marked block each // killough 1/24/98: change interface to use M_START/M_END explicitly // killough 4/17/98: Add namespace tags to each entry // killough 4/4/98: add colormap markers W_CoalesceMarkedResource("S_START", "S_END", ns_sprites); W_CoalesceMarkedResource("F_START", "F_END", ns_flats); W_CoalesceMarkedResource("C_START", "C_END", ns_colormaps); W_CoalesceMarkedResource("B_START", "B_END", ns_prboom); r_have_internal_hires = ( 0 < W_CoalesceMarkedResource("HI_START", "HI_END", ns_hires) ); // killough 1/31/98: initialize lump hash table W_HashLumps(); /* cph 2001/07/07 - separated cache setup */ W_InitCache(); V_FreePlaypal(); }
void W_ReleaseAllWads(void) { W_DoneCache(); D_ClearResourceFiles(); numlumps = 0; free(lumpinfo); lumpinfo = NULL; V_FreePlaypal(); }