1 /* Emacs style mode select -*- C++ -*-
2 *-----------------------------------------------------------------------------
5 * PrBoom a Doom port merged with LxDoom and LSDLDoom
6 * based on BOOM, a modified and improved DOOM engine
7 * Copyright (C) 1999 by
8 * id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman
9 * Copyright (C) 1999-2000 by
10 * Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian Schulze
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
30 *-----------------------------------------------------------------------------*/
48 char identification
[4]; // Should be "IWAD" or "PWAD".
62 // NO_PREDEFINED_LUMPS causes none of the predefined lumps in info.c to be
63 // included, and removes all extra code which is only there for them
64 // Saves a little memory normally, lots if any were overridden, and makes
65 // the executable smaller
66 #define NO_PREDEFINED_LUMPS
71 // WADFILE I/O related stuff.
74 // CPhipps - defined enum in wider scope
75 // Ty 08/29/98 - add source field to identify where this lump came from
77 // CPhipps - define elements in order of 'how new/unusual'
78 source_iwad
=0, // iwad file load
79 source_pre
, // predefined lump
80 source_auto_load
, // lump auto-loaded by config file
81 source_pwad
, // pwad file load
82 source_lmp
, // lmp file load
88 // WARNING: order of some fields important (see info.c).
92 #ifndef NO_PREDEFINED_LUMPS
93 const void *data
; // killough 1/31/98: points to predefined lump data
96 // killough 1/31/98: hash table fields, used for ultra-fast hash table lookup
99 // killough 4/17/98: namespace tags, to prevent conflicts between resources
109 unsigned int locks
; // CPhipps - wad lump locking
113 // killough 1/31/98: predefined lumps
114 extern const size_t num_predefined_lumps
;
115 extern const lumpinfo_t predefined_lumps
[];
117 extern void **lumpcache
;
118 extern lumpinfo_t
*lumpinfo
;
121 // CPhipps - changed wad init
122 // We _must_ have the wadfiles[] the same as those actually loaded, so there
123 // is no point having these separate entities. This belongs here.
124 struct wadfile_info
{
129 extern struct wadfile_info
*wadfiles
;
131 extern size_t numwadfiles
; // CPhipps - size of the wadfiles array
133 void W_Init(void); // CPhipps - uses the above array
135 // killough 4/17/98: if W_CheckNumForName() called with only
136 // one argument, pass ns_global as the default namespace
138 #define W_CheckNumForName(name) (W_CheckNumForName)(name, ns_global)
139 int (W_CheckNumForName
)(const char* name
, int); // killough 4/17/98
140 int W_GetNumForName (const char* name
);
141 int W_LumpLength (int lump
);
142 void W_ReadLump (int lump
, void *dest
);
143 // CPhipps - modified for 'new' lump locking
144 void* W_CacheLumpNum (int lump
, unsigned short locks
);
145 void W_UnlockLumpNum(int lump
, signed short unlocks
);
147 /* cph - special version to return lump with padding, for sound lumps */
148 void * W_CacheLumpNumPadded(int lump
, size_t len
, unsigned char pad
);
150 // CPhipps - convenience macros
151 #define W_CacheLumpNum(num) (W_CacheLumpNum)((num),1)
152 #define W_CacheLumpName(name) W_CacheLumpNum (W_GetNumForName(name))
154 #define W_UnlockLumpNum(num) (W_UnlockLumpNum)((num),1)
155 #define W_UnlockLumpName(name) W_UnlockLumpNum (W_GetNumForName(name))
157 char *AddDefaultExtension(char *, const char *); // killough 1/18/98
158 void ExtractFileBase(const char *, char *); // killough
159 unsigned W_LumpNameHash(const char *s
); // killough 1/31/98
161 // Function to write all predefined lumps to a PWAD if requested
162 extern void WritePredefinedLumpWad(const char *filename
); // jff 5/6/98