- lumpinfo_t *lump_p;
- wadinfo_t *header;
- int i;
- int infotableofs;
- void *temp;
-
- temp = FS_LoadFile (filename, false);
- if (!temp)
- Sys_Error ("W_LoadWadFile: couldn't load %s", filename);
-
- if (wad_mempool)
- Mem_FreePool(&wad_mempool);
- wad_mempool = Mem_AllocPool(filename);
- wad_base = Mem_Alloc(wad_mempool, fs_filesize);
-
- memcpy(wad_base, temp, fs_filesize);
- Mem_Free(temp);
-
- header = (wadinfo_t *)wad_base;
-
- if (memcmp(header->identification, "WAD2", 4))
- Sys_Error ("Wad file %s doesn't have WAD2 id\n",filename);
-
- wad_numlumps = LittleLong(header->numlumps);
- infotableofs = LittleLong(header->infotableofs);
- wad_lumps = (lumpinfo_t *)(wad_base + infotableofs);
+ int i;
+ for (i = 0;i < numlumps;i++)
+ {
+ lumps[i].filepos = LittleLong(lumps[i].filepos);
+ lumps[i].disksize = LittleLong(lumps[i].disksize);
+ lumps[i].size = LittleLong(lumps[i].size);
+ W_CleanupName(lumps[i].name, lumps[i].name);
+ }
+}