#include "wad.h"
-void SwapPic (qpic_t *pic);
-
-
/*
==================
W_CleanupName
out[i] = 0;
}
-void *W_GetLumpName(const char *name)
+static int wad_numlumps = 0;
+static lumpinfo_t *wad_lumps = NULL;
+static unsigned char *wad_base = NULL;
+
+unsigned char *W_GetLumpName(const char *name)
{
int i;
fs_offset_t filesize;
char clean[16];
wadinfo_t *header;
int infotableofs;
- void *temp;
- static int wad_loaded = false;
- static int wad_numlumps = 0;
- static lumpinfo_t *wad_lumps = NULL;
- static unsigned char *wad_base = NULL;
W_CleanupName (name, clean);
- if (!wad_loaded)
+ if (!wad_base)
{
- wad_loaded = true;
- if ((wad_base = FS_LoadFile ("gfx.wad", cl_mempool, false, &filesize)))
+ if ((wad_base = FS_LoadFile ("gfx.wad", cls.permanentmempool, false, &filesize)))
{
- if (memcmp(temp, "WAD2", 4))
+ if (memcmp(wad_base, "WAD2", 4))
{
Con_Print("gfx.wad doesn't have WAD2 id\n");
Mem_Free(wad_base);
lump->filepos = LittleLong(lump->filepos);
lump->size = LittleLong(lump->size);
W_CleanupName (lump->name, lump->name);
- if (lump->type == TYP_QPIC)
- SwapPic ( (qpic_t *)(wad_base + lump->filepos));
}
}
}
for (lump = wad_lumps, i = 0;i < wad_numlumps;i++, lump++)
if (!strcmp(clean, lump->name))
- return (void *)(wad_base + lump->filepos);
+ return (wad_base + lump->filepos);
if (wad_base)
Con_DPrintf("W_GetLumpByName(\"%s\"): couldn't find file in gfx.wad\n", name);
=============================================================================
*/
-void SwapPic (qpic_t *pic)
-{
- pic->width = LittleLong(pic->width);
- pic->height = LittleLong(pic->height);
-}
-
// LordHavoc: added alternate WAD2/WAD3 system for HalfLife texture wads
#define TEXWAD_MAXIMAGES 16384
typedef struct texwadlump_s