X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=blobdiff_plain;f=wad.h;h=2aaa1b8d30d92a8525066cdb97cf4d6fc47e540c;hp=51e6dec37f0d6ee10bf3128410c89b4a71a8040e;hb=ef993d0f1682d3fb86bdef33043d7b106ce51d13;hpb=8dcce44300385b12c46d494c06aadcfa35a8bc14 diff --git a/wad.h b/wad.h index 51e6dec3..2aaa1b8d 100644 --- a/wad.h +++ b/wad.h @@ -8,7 +8,7 @@ of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. @@ -19,6 +19,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ // wad.h +#ifndef WAD_H +#define WAD_H + +#include +struct sizebuf_s; + //=============== // TYPES //=============== @@ -36,22 +42,22 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define TYP_SOUND 67 #define TYP_MIPTEX 68 -typedef struct +typedef struct qpic_s { int width, height; - byte data[4]; // variably sized + unsigned char data[4]; // variably sized } qpic_t; -typedef struct +typedef struct wadinfo_s { char identification[4]; // should be WAD2 or 2DAW int numlumps; int infotableofs; } wadinfo_t; -typedef struct +typedef struct lumpinfo_s { int filepos; int disksize; @@ -62,19 +68,13 @@ typedef struct char name[16]; // must be null terminated } lumpinfo_t; -extern int wad_numlumps; -extern lumpinfo_t *wad_lumps; -extern byte *wad_base; +void W_UnloadAll(void); +unsigned char *W_GetLumpName(const char *name, int64_t *returnfilesize); -void W_LoadWadFile (char *filename); -void W_CleanupName (char *in, char *out); -lumpinfo_t *W_GetLumpinfo (char *name); -void *W_GetLumpName (char *name); -void *W_GetLumpNum (int num); +// halflife texture wads +void W_LoadTextureWadFile(char *filename, int complain); +unsigned char *W_GetTextureBGRA(char *name); // returns tempmempool allocated image data, width and height are in image_width and image_height +unsigned char *W_ConvertWAD3TextureBGRA(struct sizebuf_s *sb); // returns tempmempool allocated image data, width and height are in image_width and image_height -void SwapPic (qpic_t *pic); +#endif -// LordHavoc: added alternate texture WAD2/WAD3 system for easier loading of HalfLife texture wads -extern image_width, image_height; -void W_LoadTextureWadFile (char *filename, int complain); -byte *W_GetTexture (char *name, int matchwidth, int matchheight); // returns malloc'd image data, width and height are in image_width and image_height (yeah yeah so I'm lazy...)