X-Git-Url: http://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=wad.c;h=12978f383a6b8969343bb543c0e3df60cca91c2b;hp=7087ce69a909a69ddc4f67a63b75687c54037837;hb=c0b28902ae728d6089484e8f205aa118cd5b525b;hpb=69a9f6bb4ea7d2a62b22238da58fe99d0ebd41d8 diff --git a/wad.c b/wad.c index 7087ce69..12978f38 100644 --- a/wad.c +++ b/wad.c @@ -24,9 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "wad.h" -void SwapPic (qpic_t *pic); - - /* ================== W_CleanupName @@ -58,7 +55,11 @@ static void W_CleanupName (const char *in, char *out) 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; @@ -66,16 +67,11 @@ void *W_GetLumpName(const char *name) char clean[16]; wadinfo_t *header; int infotableofs; - 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", cls.permanentmempool, false, &filesize))) { if (memcmp(wad_base, "WAD2", 4)) @@ -96,8 +92,6 @@ void *W_GetLumpName(const char *name) 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)); } } } @@ -105,7 +99,7 @@ void *W_GetLumpName(const char *name) 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); @@ -122,12 +116,6 @@ automatic byte swapping ============================================================================= */ -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