// close all hlwad files and free their lumps data
for (i = 0;i < Mem_ExpandableArray_IndexRange(&wad.hlwads);i++)
{
- w = Mem_ExpandableArray_RecordAtIndex(&wad.hlwads, i);
+ w = (mwad_t *) Mem_ExpandableArray_RecordAtIndex(&wad.hlwads, i);
if (!w)
continue;
if (w->file)
int numlumps;
mwad_t *w;
- file = FS_Open (filename, "rb", false, false);
+ file = FS_OpenVirtualFile(filename, false);
if (!file)
{
if (complain)
if (!wad.hlwads.mempool)
Mem_ExpandableArray_NewArray(&wad.hlwads, cls.permanentmempool, sizeof(mwad_t), 16);
- w = Mem_ExpandableArray_AllocRecord(&wad.hlwads);
+ w = (mwad_t *) Mem_ExpandableArray_AllocRecord(&wad.hlwads);
w->file = file;
w->numlumps = numlumps;
- w->lumps = Mem_Alloc(cls.permanentmempool, w->numlumps * sizeof(lumpinfo_t));
+ w->lumps = (lumpinfo_t *) Mem_Alloc(cls.permanentmempool, w->numlumps * sizeof(lumpinfo_t));
if (!w->lumps)
{
unsigned char *data;
mwad_t *w;
char texname[17];
+ size_t range;
texname[16] = 0;
W_CleanupName(name, texname);
if (!wad.hlwads.mempool)
Mem_ExpandableArray_NewArray(&wad.hlwads, cls.permanentmempool, sizeof(mwad_t), 16);
- for (k = 0;k < Mem_ExpandableArray_IndexRange(&wad.hlwads);k++)
+ range = Mem_ExpandableArray_IndexRange(&wad.hlwads);
+ for (k = 0;k < range;k++)
{
w = (mwad_t *)Mem_ExpandableArray_RecordAtIndex(&wad.hlwads, k);
if (!w)