mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-21 19:03:11 -04:00
support BRGHTMPS lump from Doom Retro (#846)
* u_scanner: make internal functions `static` * add support for `SPRITE` and `FLAT` * scan multiple BRGHTMPS lumps, move data to autoload directory * do not scan twice (BRIGHTMAP must be defined before use) * implement STATE * skip BRGHTMPS lumps in demo footer * add NOBRIGHTMAP special case * implement optional DOOM|DOOM2 fields
This commit is contained in:
parent
cde9dd6aec
commit
88a94d21f0
80
autoload/chex.wad/brghtmps.lmp
Normal file
80
autoload/chex.wad/brghtmps.lmp
Normal file
@ -0,0 +1,80 @@
|
||||
BRIGHTMAP NOTGRAY 4,9-79,112-255
|
||||
BRIGHTMAP GREENONLY1 112-127
|
||||
BRIGHTMAP GREENONLY2 112-125
|
||||
BRIGHTMAP GREENONLY3 112-123
|
||||
BRIGHTMAP REDANDGREEN 16-47,112-127,173-191
|
||||
BRIGHTMAP CHEXRED 176-177
|
||||
BRIGHTMAP CHEXGREEN 112-115
|
||||
BRIGHTMAP CHEXREDGREEN 45,112-118,174-177
|
||||
|
||||
TEXTURE BIGDOOR1 GREENONLY3
|
||||
// TEXTURE BIGDOOR4 GREENONLY3 // C1: some stray green pixels, C2: many stray green pixels
|
||||
// TEXTURE BRNBIGL GREENONLY3
|
||||
// TEXTURE BRNBIGR GREENONLY3 // C1, C2: one stray green pixel
|
||||
// TEXTURE BRNSMAL2 GREENONLY3 // C1, C2: many stray green pixels
|
||||
TEXTURE COMP2 NOTGRAY
|
||||
// TEXTURE COMPTALL NOTGRAY
|
||||
TEXTURE COMPUTE2 NOTGRAY
|
||||
TEXTURE LITE5 GREENONLY2
|
||||
TEXTURE STARTAN3 GREENONLY2
|
||||
TEXTURE SW1BRCOM CHEXRED
|
||||
TEXTURE SW1BRN1 CHEXGREEN
|
||||
TEXTURE SW1BRN2 CHEXRED
|
||||
TEXTURE SW1BRNGN CHEXRED
|
||||
TEXTURE SW1BROWN CHEXRED
|
||||
TEXTURE SW1COMM CHEXRED
|
||||
TEXTURE SW1COMP CHEXRED
|
||||
TEXTURE SW1DIRT CHEXGREEN
|
||||
TEXTURE SW1METAL CHEXREDGREEN
|
||||
TEXTURE SW1PIPE CHEXGREEN
|
||||
TEXTURE SW1STARG CHEXRED
|
||||
TEXTURE SW1STON1 CHEXRED
|
||||
TEXTURE SW1STRTN CHEXRED
|
||||
TEXTURE SW2BRCOM CHEXGREEN
|
||||
TEXTURE SW2BRN1 CHEXRED
|
||||
TEXTURE SW2BRN2 CHEXGREEN
|
||||
TEXTURE SW2BRNGN CHEXGREEN
|
||||
TEXTURE SW2BROWN CHEXGREEN
|
||||
TEXTURE SW2COMM CHEXGREEN
|
||||
TEXTURE SW2COMP CHEXGREEN
|
||||
TEXTURE SW2DIRT CHEXRED
|
||||
TEXTURE SW2METAL CHEXREDGREEN
|
||||
TEXTURE SW2PIPE CHEXRED
|
||||
TEXTURE SW2STARG CHEXGREEN
|
||||
TEXTURE SW2STON1 CHEXGREEN
|
||||
TEXTURE SW2STONE CHEXGREEN
|
||||
TEXTURE SW2STRTN CHEXGREEN
|
||||
// TEXTURE BIGDOOR5 GREENONLY1 // C1, C2: some stray green pixels
|
||||
// TEXTURE BIGDOOR6 GREENONLY1 // C1, C2: some stray green pixels
|
||||
TEXTURE CEMENT3 GREENONLY3
|
||||
TEXTURE SKINFACE GREENONLY1
|
||||
TEXTURE SKINTEK1 GREENONLY1
|
||||
TEXTURE SKSPINE2 GREENONLY3
|
||||
TEXTURE SW1BLUE CHEXGREEN
|
||||
TEXTURE SW1HOT CHEXGREEN
|
||||
TEXTURE SW1SKIN CHEXGREEN
|
||||
TEXTURE SW1VINE CHEXGREEN // C1: some stray green pixels in the vines
|
||||
TEXTURE SW1WOOD CHEXGREEN
|
||||
TEXTURE SW2BLUE CHEXRED
|
||||
TEXTURE SW2CMT CHEXGREEN
|
||||
TEXTURE SW2GSTON CHEXRED
|
||||
TEXTURE SW2HOT CHEXRED
|
||||
TEXTURE SW2SKIN CHEXRED
|
||||
TEXTURE SW2VINE CHEXRED
|
||||
TEXTURE SW2WOOD CHEXRED
|
||||
TEXTURE WOOD4 CHEXREDGREEN
|
||||
TEXTURE WOODGARG CHEXRED
|
||||
TEXTURE WOODSKUL CHEXREDGREEN
|
||||
|
||||
// Chainsaw
|
||||
SPRITE CSAW REDANDGREEN
|
||||
// Shotgun
|
||||
SPRITE SHOT REDANDGREEN
|
||||
// Chaingun
|
||||
SPRITE MGUN REDANDGREEN
|
||||
// Rocket launcher
|
||||
SPRITE LAUN REDANDGREEN
|
||||
// Plasmagun
|
||||
SPRITE PLAS REDANDGREEN
|
||||
// BFG9000
|
||||
SPRITE BFUG REDANDGREEN
|
5
autoload/chex2.wad/brghtmps.lmp
Normal file
5
autoload/chex2.wad/brghtmps.lmp
Normal file
@ -0,0 +1,5 @@
|
||||
// TEXTURE COMPTALL GREENONLY3 // C2: many stray green pixels
|
||||
TEXTURE LITE5 NOBRIGHTMAP
|
||||
TEXTURE SKINTEK1 NOBRIGHTMAP
|
||||
TEXTURE SW1VINE NOBRIGHTMAP // C1: some stray green pixels in the vines
|
||||
TEXTURE SW2VINE NOBRIGHTMAP
|
112
autoload/doom-all/brghtmps.lmp
Normal file
112
autoload/doom-all/brghtmps.lmp
Normal file
@ -0,0 +1,112 @@
|
||||
BRIGHTMAP NOTGRAY 4,9-79,112-255
|
||||
BRIGHTMAP NOTGRAYORBROWN 4,9-63,112-125,152-255
|
||||
BRIGHTMAP NOTGRAYORBROWN2 4,9-63,112-125,152-157,160-255
|
||||
BRIGHTMAP BLUEGREENBROWNRED 43,65-68,116,121-125,164-167,172,175,205-207,240-245
|
||||
BRIGHTMAP BLUEGREENBROWN 45,65-68,70,73,76,121-124,164-167,190,206-207,240-241,243
|
||||
BRIGHTMAP BLUEANDORANGE 45,164-167,190,206-207,240-241,243
|
||||
BRIGHTMAP REDONLY 45,173-191
|
||||
BRIGHTMAP REDONLY2 173-183
|
||||
BRIGHTMAP GREENONLY1 112-127
|
||||
BRIGHTMAP GREENONLY2 112-125
|
||||
BRIGHTMAP GREENONLY3 112-123
|
||||
BRIGHTMAP YELLOWONLY 160-167,224-231,249
|
||||
BRIGHTMAP REDANDGREEN 16-47,112-127,173-191
|
||||
BRIGHTMAP BLUEANDGREEN 112-124,192-207,240-245
|
||||
BRIGHTMAP BRIGHTTAN 56,58,60-62,64-65,67,69,139,143,147-148,150
|
||||
|
||||
TEXTURE COMP2 BLUEANDGREEN
|
||||
TEXTURE COMPSTA1 NOTGRAY
|
||||
TEXTURE COMPSTA2 NOTGRAY
|
||||
TEXTURE COMPUTE1 BLUEGREENBROWNRED
|
||||
TEXTURE COMPUTE2 BLUEGREENBROWN
|
||||
TEXTURE COMPUTE3 BLUEANDORANGE
|
||||
TEXTURE EXITSIGN NOTGRAY
|
||||
TEXTURE EXITSTON REDONLY
|
||||
TEXTURE PLANET1 NOTGRAY
|
||||
TEXTURE SILVER2 NOTGRAY
|
||||
TEXTURE SILVER3 NOTGRAYORBROWN2
|
||||
TEXTURE SLADSKUL REDONLY
|
||||
TEXTURE SW1BRCOM REDONLY
|
||||
TEXTURE SW1BRIK REDONLY
|
||||
TEXTURE SW1COMM REDONLY
|
||||
TEXTURE SW1DIRT REDONLY
|
||||
TEXTURE SW1MET2 REDONLY
|
||||
TEXTURE SW1STON1 REDONLY
|
||||
TEXTURE SW1STONE REDONLY
|
||||
TEXTURE SW1STRTN REDONLY
|
||||
TEXTURE SW2BLUE REDONLY
|
||||
TEXTURE SW2BRCOM GREENONLY2
|
||||
TEXTURE SW2BRIK GREENONLY1
|
||||
TEXTURE SW2BRN1 GREENONLY2
|
||||
TEXTURE SW2BRN2 GREENONLY1
|
||||
TEXTURE SW2BRNGN GREENONLY3
|
||||
TEXTURE SW2COMM GREENONLY1
|
||||
TEXTURE SW2COMP REDONLY
|
||||
TEXTURE SW2DIRT GREENONLY2
|
||||
TEXTURE SW2EXIT NOTGRAY
|
||||
TEXTURE SW2GRAY NOTGRAY
|
||||
TEXTURE SW2GRAY1 NOTGRAY
|
||||
TEXTURE SW2GSTON REDONLY
|
||||
// [crispy] Special case: fewer colors lit.
|
||||
TEXTURE SW2HOT REDONLY2
|
||||
TEXTURE SW2MET2 GREENONLY1
|
||||
TEXTURE SW2METAL GREENONLY3
|
||||
TEXTURE SW2MOD1 GREENONLY1
|
||||
TEXTURE SW2PANEL REDONLY
|
||||
TEXTURE SW2ROCK REDONLY
|
||||
TEXTURE SW2SLAD REDONLY
|
||||
TEXTURE SW2STON1 GREENONLY3
|
||||
TEXTURE SW2STON6 REDONLY
|
||||
TEXTURE SW2STONE GREENONLY2
|
||||
TEXTURE SW2STRTN GREENONLY1
|
||||
TEXTURE SW2TEK GREENONLY1
|
||||
TEXTURE SW2VINE GREENONLY1
|
||||
TEXTURE SW2WOOD REDONLY
|
||||
TEXTURE SW2ZIM REDONLY
|
||||
TEXTURE WOOD4 REDONLY
|
||||
TEXTURE WOODGARG REDONLY
|
||||
TEXTURE WOODSKUL REDONLY
|
||||
//TEXTURE ZELDOOR REDONLY
|
||||
TEXTURE LITEBLU1 NOTGRAY
|
||||
TEXTURE LITEBLU2 NOTGRAY
|
||||
TEXTURE SW2SATYR BRIGHTTAN
|
||||
TEXTURE SW2LION BRIGHTTAN
|
||||
TEXTURE SW2GARG BRIGHTTAN
|
||||
TEXTURE SW2STON2 REDONLY DOOM
|
||||
TEXTURE SW1BRN1 REDONLY DOOM2
|
||||
TEXTURE SW1STARG REDONLY DOOM2
|
||||
TEXTURE SW1STON2 REDONLY DOOM2
|
||||
TEXTURE SW2MARB REDONLY DOOM2
|
||||
TEXTURE SW2STARG GREENONLY2 DOOM2
|
||||
TEXTURE SW2STON2 GREENONLY2 DOOM2
|
||||
TEXTURE SPCDOOR3 GREENONLY1 DOOM2
|
||||
TEXTURE PIPEWAL1 GREENONLY1 DOOM2
|
||||
TEXTURE TEKLITE2 GREENONLY1 DOOM2
|
||||
TEXTURE TEKBRON2 YELLOWONLY DOOM2
|
||||
//TEXTURE SW2SKULL GREENONLY2 DOOM2
|
||||
// [crispy] Final Doom textures
|
||||
// Plutonia exclusive
|
||||
//TEXTURE SW2SKULL REDONLY
|
||||
|
||||
// Armor Bonus
|
||||
SPRITE BON2 GREENONLY2
|
||||
// Cell Charge
|
||||
SPRITE CELL GREENONLY2
|
||||
// Barrel
|
||||
SPRITE BAR1 GREENONLY3
|
||||
// Cell Charge Pack
|
||||
SPRITE CELP YELLOWONLY
|
||||
// BFG9000
|
||||
SPRITE BFUG REDONLY
|
||||
// Plasmagun
|
||||
SPRITE PLAS REDONLY
|
||||
|
||||
// [crispy] only three select brightmapped flats
|
||||
FLAT CONS1_1 NOTGRAYORBROWN
|
||||
FLAT CONS1_5 NOTGRAYORBROWN
|
||||
FLAT CONS1_7 NOTGRAYORBROWN
|
||||
|
||||
STATE 84 REDONLY // S_BFG1
|
||||
STATE 85 REDONLY // S_BFG2
|
||||
STATE 86 REDONLY // S_BFG3
|
||||
STATE 87 REDONLY // S_BFG4
|
82
autoload/hacx.wad/brghtmps.lmp
Normal file
82
autoload/hacx.wad/brghtmps.lmp
Normal file
@ -0,0 +1,82 @@
|
||||
BRIGHTMAP NOTGRAYORBROWN 4,9-63,112-125,152-255
|
||||
BRIGHTMAP REDONLY 45,173-191
|
||||
BRIGHTMAP GREENONLY1 112-127
|
||||
BRIGHTMAP REDANDGREEN 16-47,112-127,173-191
|
||||
BRIGHTMAP CHEXRED 176-177
|
||||
BRIGHTMAP HACXLIGHTNING 4,168,192-199,208,224
|
||||
|
||||
// TEXTURE BFALL1 REDANDGREEN
|
||||
// TEXTURE BFALL2 REDANDGREEN
|
||||
// TEXTURE BFALL3 REDANDGREEN
|
||||
// TEXTURE BFALL4 REDANDGREEN
|
||||
TEXTURE BRNSMALR GREENONLY1
|
||||
TEXTURE DOORRED REDANDGREEN
|
||||
TEXTURE SLADWALL CHEXRED
|
||||
// TEXTURE SW1BRCOM REDONLY
|
||||
// TEXTURE SW1BRN1 REDANDGREEN
|
||||
TEXTURE SW1BRN2 NOTGRAYORBROWN
|
||||
TEXTURE SW1BRNGN NOTGRAYORBROWN
|
||||
// TEXTURE SW1BROWN NOTGRAYORBROWN
|
||||
// TEXTURE SW2BRCOM GREENONLY1
|
||||
// TEXTURE SW2BRN1 REDANDGREEN
|
||||
TEXTURE SW2BRN2 NOTGRAYORBROWN
|
||||
// TEXTURE SW2BROWN NOTGRAYORBROWN
|
||||
TEXTURE COMPSPAN GREENONLY1
|
||||
TEXTURE COMPSTA1 NOTGRAYORBROWN
|
||||
// TEXTURE COMPSTA2 NOTGRAYORBROWN
|
||||
TEXTURE HD5 REDANDGREEN
|
||||
// TEXTURE HD8 REDANDGREEN
|
||||
// TEXTURE HD9 REDANDGREEN
|
||||
TEXTURE BLAKWAL2 REDANDGREEN
|
||||
TEXTURE CEMENT7 GREENONLY1
|
||||
TEXTURE ROCK4 REDONLY
|
||||
// TEXTURE SLOPPY1 NOTGRAYORBROWN
|
||||
// TEXTURE SPCDOOR4 NOTGRAYORBROWN
|
||||
TEXTURE ZZZFACE1 GREENONLY1
|
||||
TEXTURE ZZZFACE2 REDANDGREEN
|
||||
TEXTURE HW166 REDANDGREEN
|
||||
TEXTURE HW510 NOTGRAYORBROWN
|
||||
TEXTURE HW511 NOTGRAYORBROWN
|
||||
TEXTURE HW512 NOTGRAYORBROWN
|
||||
|
||||
// Chainsaw
|
||||
SPRITE CSAW REDONLY
|
||||
// Plasmagun
|
||||
SPRITE PLAS REDONLY
|
||||
// Cell Charge
|
||||
SPRITE CELL REDONLY
|
||||
// Cell Charge Pack
|
||||
SPRITE CELP REDONLY
|
||||
// Rocket launcher
|
||||
SPRITE LAUN REDANDGREEN
|
||||
// Medikit
|
||||
SPRITE MEDI REDANDGREEN
|
||||
// Rocket
|
||||
SPRITE ROCK GREENONLY1
|
||||
// Box of rockets
|
||||
SPRITE BROK GREENONLY1
|
||||
// Health Bonus
|
||||
SPRITE BON1 NOTGRAYORBROWN
|
||||
// Stimpack
|
||||
SPRITE STIM NOTGRAYORBROWN
|
||||
|
||||
FLAT FLOOR1_1 NOTGRAYORBROWN
|
||||
FLAT FLOOR1_7 NOTGRAYORBROWN
|
||||
FLAT FLOOR3_3 NOTGRAYORBROWN
|
||||
FLAT NUKAGE1 NOTGRAYORBROWN
|
||||
FLAT NUKAGE2 NOTGRAYORBROWN
|
||||
FLAT NUKAGE3 NOTGRAYORBROWN
|
||||
FLAT BLOOD1 GREENONLY1
|
||||
FLAT BLOOD2 GREENONLY1
|
||||
FLAT BLOOD3 GREENONLY1
|
||||
FLAT SLIME13 NOTGRAYORBROWN
|
||||
FLAT SLIME14 NOTGRAYORBROWN
|
||||
FLAT SLIME15 NOTGRAYORBROWN
|
||||
|
||||
STATE 72 HACXLIGHTNING // S_SAW2
|
||||
STATE 73 HACXLIGHTNING // S_SAW3
|
||||
STATE 57 REDANDGREEN // S_MISSILE
|
||||
STATE 67 REDONLY // S_SAW
|
||||
STATE 68 REDONLY // S_SAWB
|
||||
STATE 74 REDONLY // S_PLASMA
|
||||
STATE 78 REDONLY // S_PLASMA2
|
22
autoload/tnt.wad/brghtmps.lmp
Normal file
22
autoload/tnt.wad/brghtmps.lmp
Normal file
@ -0,0 +1,22 @@
|
||||
// [crispy] Final Doom textures
|
||||
// TNT - Evilution exclusive
|
||||
TEXTURE PNK4EXIT REDONLY
|
||||
TEXTURE SLAD2 NOTGRAYORBROWN
|
||||
TEXTURE SLAD3 NOTGRAYORBROWN
|
||||
TEXTURE SLAD4 NOTGRAYORBROWN
|
||||
TEXTURE SLAD5 NOTGRAYORBROWN
|
||||
TEXTURE SLAD6 NOTGRAYORBROWN
|
||||
TEXTURE SLAD7 NOTGRAYORBROWN
|
||||
TEXTURE SLAD8 NOTGRAYORBROWN
|
||||
TEXTURE SLAD9 NOTGRAYORBROWN
|
||||
TEXTURE SLAD10 NOTGRAYORBROWN
|
||||
TEXTURE SLAD11 NOTGRAYORBROWN
|
||||
TEXTURE SLADRIP1 NOTGRAYORBROWN
|
||||
TEXTURE SLADRIP3 NOTGRAYORBROWN
|
||||
TEXTURE M_TEC GREENONLY2
|
||||
TEXTURE LITERED2 REDONLY
|
||||
TEXTURE BTNTMETL NOTGRAYORBROWN
|
||||
TEXTURE BTNTSLVR NOTGRAYORBROWN
|
||||
TEXTURE LITEYEL2 YELLOWONLY
|
||||
TEXTURE LITEYEL3 YELLOWONLY
|
||||
TEXTURE YELMETAL YELLOWONLY
|
105
src/d_main.c
105
src/d_main.c
@ -74,6 +74,7 @@
|
||||
#include "p_map.h" // MELEERANGE
|
||||
#include "i_endoom.h"
|
||||
#include "d_quit.h"
|
||||
#include "r_bmaps.h"
|
||||
|
||||
#include "dsdhacked.h"
|
||||
|
||||
@ -116,6 +117,11 @@ static char *D_dehout(void)
|
||||
return s;
|
||||
}
|
||||
|
||||
static void ProcessDehLump(int lumpnum)
|
||||
{
|
||||
ProcessDehFile(NULL, D_dehout(), lumpnum);
|
||||
}
|
||||
|
||||
char **wadfiles;
|
||||
|
||||
boolean devparm; // started game with -devparm
|
||||
@ -1564,71 +1570,28 @@ static void D_AutoloadPWadDehDir()
|
||||
// ProcessDehFile() indicates that the data comes from the lump number
|
||||
// indicated by the third argument, instead of from a file.
|
||||
|
||||
static void D_ProcessDehInWad(int i, boolean in_iwad)
|
||||
static void D_ProcessInWad(int i, const char *name, void (*Process)(int lumpnum),
|
||||
boolean iwad)
|
||||
{
|
||||
//!
|
||||
// @category mod
|
||||
//
|
||||
// Avoid loading DEHACKED lumps embedded into WAD files.
|
||||
//
|
||||
|
||||
if (M_CheckParm("-nodehlump"))
|
||||
if (i >= 0)
|
||||
{
|
||||
return;
|
||||
D_ProcessInWad(lumpinfo[i].next, name, Process, iwad);
|
||||
if (!strncasecmp(lumpinfo[i].name, name, 8) &&
|
||||
lumpinfo[i].namespace == ns_global &&
|
||||
(iwad ? W_IsIWADLump(i) : !W_IsIWADLump(i)))
|
||||
{
|
||||
Process(i);
|
||||
}
|
||||
}
|
||||
|
||||
if (i >= 0)
|
||||
{
|
||||
D_ProcessDehInWad(lumpinfo[i].next, in_iwad);
|
||||
if (!strncasecmp(lumpinfo[i].name, "dehacked", 8) &&
|
||||
lumpinfo[i].namespace == ns_global &&
|
||||
(in_iwad ? W_IsIWADLump(i) : !W_IsIWADLump(i)))
|
||||
ProcessDehFile(NULL, D_dehout(), i);
|
||||
}
|
||||
}
|
||||
|
||||
#define D_ProcessDehInWads() D_ProcessDehInWad(lumpinfo[W_LumpNameHash \
|
||||
("dehacked") % (unsigned) numlumps].index, false);
|
||||
|
||||
#define D_ProcessDehInIWad() D_ProcessDehInWad(lumpinfo[W_LumpNameHash \
|
||||
("dehacked") % (unsigned) numlumps].index, true);
|
||||
|
||||
// Process multiple UMAPINFO files
|
||||
|
||||
static void D_ProcessUMInWad(int i)
|
||||
static void D_ProcessInWads(const char *name, void (*Process)(int lumpnum),
|
||||
boolean iwad)
|
||||
{
|
||||
if (i >= 0)
|
||||
{
|
||||
D_ProcessUMInWad(lumpinfo[i].next);
|
||||
if (!strncasecmp(lumpinfo[i].name, "umapinfo", 8) &&
|
||||
lumpinfo[i].namespace == ns_global)
|
||||
{
|
||||
U_ParseMapInfo(false, (const char *)W_CacheLumpNum(i, PU_CACHE), W_LumpLength(i));
|
||||
}
|
||||
}
|
||||
D_ProcessInWad(lumpinfo[W_LumpNameHash(name) % (unsigned)numlumps].index,
|
||||
name, Process, iwad);
|
||||
}
|
||||
|
||||
#define D_ProcessUMInWads() D_ProcessUMInWad(lumpinfo[W_LumpNameHash \
|
||||
("umapinfo") % (unsigned) numlumps].index);
|
||||
|
||||
// Process multiple UMAPDEF files
|
||||
|
||||
static void D_ProcessDefaultsInWad(int i)
|
||||
{
|
||||
if (i >= 0)
|
||||
{
|
||||
D_ProcessDefaultsInWad(lumpinfo[i].next);
|
||||
if (!strncasecmp(lumpinfo[i].name, "umapdef", 7) &&
|
||||
lumpinfo[i].namespace == ns_global)
|
||||
{
|
||||
U_ParseMapInfo(true, (const char *)W_CacheLumpNum(i, PU_CACHE), W_LumpLength(i));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define D_ProcessDefaultsInWads() D_ProcessDefaultsInWad(lumpinfo[W_LumpNameHash \
|
||||
("umapdef") % (unsigned) numlumps].index);
|
||||
|
||||
// mbf21: don't want to reorganize info.c structure for a few tweaks...
|
||||
|
||||
static void D_InitTables(void)
|
||||
@ -2399,20 +2362,32 @@ void D_DoomMain(void)
|
||||
putchar('\n'); // killough 3/6/98: add a newline, by popular demand :)
|
||||
|
||||
// process deh in IWAD
|
||||
D_ProcessDehInIWad();
|
||||
|
||||
//!
|
||||
// @category mod
|
||||
//
|
||||
// Avoid loading DEHACKED lumps embedded into WAD files.
|
||||
//
|
||||
|
||||
if (!M_ParmExists("-nodehlump"))
|
||||
{
|
||||
D_ProcessInWads("DEHACKED", ProcessDehLump, true);
|
||||
}
|
||||
|
||||
// process .deh files specified on the command line with -deh or -bex.
|
||||
D_ProcessDehCommandLine();
|
||||
|
||||
// process deh in wads and .deh files from autoload directory
|
||||
// before deh in wads from -file parameter
|
||||
|
||||
D_AutoloadDehDir();
|
||||
|
||||
D_ProcessDehInWads(); // killough 10/98: now process all deh in wads
|
||||
// killough 10/98: now process all deh in wads
|
||||
if (!M_ParmExists("-nodehlump"))
|
||||
{
|
||||
D_ProcessInWads("DEHACKED", ProcessDehLump, false);
|
||||
}
|
||||
|
||||
// process .deh files from PWADs autoload directories
|
||||
|
||||
D_AutoloadPWadDehDir();
|
||||
|
||||
PostProcessDeh();
|
||||
@ -2444,7 +2419,9 @@ void D_DoomMain(void)
|
||||
I_Error("\nThis is not the registered version.");
|
||||
}
|
||||
|
||||
D_ProcessDefaultsInWads();
|
||||
D_ProcessInWads("UMAPDEF", U_ParseMapDefInfo, false);
|
||||
|
||||
D_ProcessInWads("BRGHTMPS", R_ParseBrightmaps, false);
|
||||
|
||||
//!
|
||||
// @category mod
|
||||
@ -2452,9 +2429,9 @@ void D_DoomMain(void)
|
||||
// Disable UMAPINFO loading.
|
||||
//
|
||||
|
||||
if (!M_CheckParm("-nomapinfo"))
|
||||
if (!M_ParmExists("-nomapinfo"))
|
||||
{
|
||||
D_ProcessUMInWads();
|
||||
D_ProcessInWads("UMAPINFO", U_ParseMapInfo, false);
|
||||
}
|
||||
|
||||
V_InitColorTranslation(); //jff 4/24/98 load color translation lumps
|
||||
|
19
src/g_game.c
19
src/g_game.c
@ -3798,9 +3798,10 @@ extern char **dehfiles;
|
||||
|
||||
static void G_AddDemoFooter(void)
|
||||
{
|
||||
char *tmp = NULL;
|
||||
size_t len = 0;
|
||||
int i;
|
||||
size_t len = 0;
|
||||
boolean has_files = false;
|
||||
char *tmp;
|
||||
|
||||
MEMFILE *stream = mem_fopen_write();
|
||||
|
||||
@ -3811,10 +3812,18 @@ static void G_AddDemoFooter(void)
|
||||
|
||||
for (i = 1; wadfiles[i]; i++)
|
||||
{
|
||||
if (i == 1)
|
||||
mem_fputs(" -file", stream);
|
||||
const char *base_name = M_BaseName(wadfiles[i]);
|
||||
|
||||
tmp = M_StringJoin(" \"", M_BaseName(wadfiles[i]), "\"", NULL);
|
||||
if (!strcasecmp("brghtmps.lmp", base_name))
|
||||
continue;
|
||||
|
||||
if (!has_files)
|
||||
{
|
||||
mem_fputs(" -file", stream);
|
||||
has_files = true;
|
||||
}
|
||||
|
||||
tmp = M_StringJoin(" \"", base_name, "\"", NULL);
|
||||
mem_fputs(tmp, stream);
|
||||
free(tmp);
|
||||
}
|
||||
|
1207
src/r_bmaps.c
1207
src/r_bmaps.c
File diff suppressed because it is too large
Load Diff
@ -24,12 +24,14 @@
|
||||
|
||||
extern int brightmaps;
|
||||
|
||||
extern void R_InitBrightmaps ();
|
||||
void R_ParseBrightmaps(int lumpnum);
|
||||
|
||||
extern const byte *(*R_BrightmapForTexName) (const char *texname);
|
||||
extern const byte *(*R_BrightmapForSprite) (const int type);
|
||||
extern const byte *(*R_BrightmapForFlatNum) (const int num);
|
||||
extern const byte *(*R_BrightmapForState) (const int state);
|
||||
void R_InitFlatBrightmaps(void);
|
||||
|
||||
const byte *R_BrightmapForTexName(const char *texname);
|
||||
const byte *R_BrightmapForSprite(const int type);
|
||||
const byte *R_BrightmapForFlatNum(const int num);
|
||||
const byte *R_BrightmapForState(const int state);
|
||||
|
||||
extern const byte **texturebrightmap;
|
||||
|
||||
|
@ -999,11 +999,10 @@ void R_InitData(void)
|
||||
{
|
||||
// [crispy] Moved R_InitFlats() to the top, because it sets firstflat/lastflat
|
||||
// which are required by R_InitTextures() to prevent flat lumps from being
|
||||
// mistaken as patches and by R_InitBrightmaps() to set brightmaps for flats.
|
||||
// R_InitBrightmaps() comes next, because it sets R_BrightmapForTexName()
|
||||
// to initialize brightmaps depending on gameversion in R_InitTextures().
|
||||
// mistaken as patches and by R_InitFlatBrightmaps() to set brightmaps for
|
||||
// flats.
|
||||
R_InitFlats();
|
||||
R_InitBrightmaps();
|
||||
R_InitFlatBrightmaps();
|
||||
R_InitTextures();
|
||||
R_InitSpriteLumps();
|
||||
R_InitTranMap(1); // killough 2/21/98, 3/6/98
|
||||
|
@ -27,6 +27,7 @@
|
||||
#include "i_system.h"
|
||||
#include "m_misc2.h"
|
||||
#include "u_scanner.h"
|
||||
#include "w_wad.h"
|
||||
|
||||
#include "u_mapinfo.h"
|
||||
|
||||
@ -727,10 +728,11 @@ static boolean UpdateDefaultMapEntry(mapentry_t *val, int num)
|
||||
return false;
|
||||
}
|
||||
|
||||
void U_ParseMapInfo(boolean is_default, const char *buffer, size_t length)
|
||||
void U_ParseMapDefInfo(int lumpnum)
|
||||
{
|
||||
unsigned int i;
|
||||
u_scanner_t scanner = U_ScanOpen(buffer, length, "UMAPINFO");
|
||||
const char *buffer = W_CacheLumpNum(lumpnum, PU_CACHE);
|
||||
size_t length = W_LumpLength(lumpnum);
|
||||
u_scanner_t scanner = U_ScanOpen(buffer, length, "UMAPDEF");
|
||||
|
||||
while (U_HasTokensLeft(&scanner))
|
||||
{
|
||||
@ -741,11 +743,26 @@ void U_ParseMapInfo(boolean is_default, const char *buffer, size_t length)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (is_default)
|
||||
default_mapinfo.mapcount++;
|
||||
default_mapinfo.maps = (mapentry_t*)realloc(default_mapinfo.maps, sizeof(mapentry_t)*default_mapinfo.mapcount);
|
||||
default_mapinfo.maps[default_mapinfo.mapcount-1] = parsed;
|
||||
}
|
||||
U_ScanClose(&scanner);
|
||||
}
|
||||
|
||||
void U_ParseMapInfo(int lumpnum)
|
||||
{
|
||||
unsigned int i;
|
||||
const char *buffer = W_CacheLumpNum(lumpnum, PU_CACHE);
|
||||
size_t length = W_LumpLength(lumpnum);
|
||||
u_scanner_t scanner = U_ScanOpen(buffer, length, "UMAPINFO");
|
||||
|
||||
while (U_HasTokensLeft(&scanner))
|
||||
{
|
||||
mapentry_t parsed = { 0 };
|
||||
if (!ParseMapEntry(&scanner, &parsed))
|
||||
{
|
||||
default_mapinfo.mapcount++;
|
||||
default_mapinfo.maps = (mapentry_t*)realloc(default_mapinfo.maps, sizeof(mapentry_t)*default_mapinfo.mapcount);
|
||||
default_mapinfo.maps[default_mapinfo.mapcount-1] = parsed;
|
||||
U_Error(&scanner, "Skipping entry: %s", scanner.string);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -68,6 +68,8 @@ mapentry_t *G_LookupMapinfo(int episode, int map);
|
||||
|
||||
boolean U_CheckField(char *str);
|
||||
|
||||
void U_ParseMapInfo(boolean is_default, const char *buffer, size_t length);
|
||||
void U_ParseMapDefInfo(int lumpnum);
|
||||
|
||||
void U_ParseMapInfo(int lumpnum);
|
||||
|
||||
#endif
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "m_misc2.h"
|
||||
#include "u_scanner.h"
|
||||
|
||||
const char* U_TokenNames[TK_NumSpecialTokens] =
|
||||
static const char* U_TokenNames[TK_NumSpecialTokens] =
|
||||
{
|
||||
"Identifier", // case insensitive identifier, beginning with a letter and may contain [a-z0-9_]
|
||||
"String Constant",
|
||||
@ -52,10 +52,10 @@ const char* U_TokenNames[TK_NumSpecialTokens] =
|
||||
"Right Shift"
|
||||
};
|
||||
|
||||
void U_CheckForWhitespace(u_scanner_t* scanner);
|
||||
void U_ExpandState(u_scanner_t* scanner);
|
||||
void U_Unescape(char *str);
|
||||
void U_SetString(char **ptr, const char *start, int length);
|
||||
static void U_CheckForWhitespace(u_scanner_t* scanner);
|
||||
static void U_ExpandState(u_scanner_t* scanner);
|
||||
static void U_Unescape(char *str);
|
||||
static void U_SetString(char **ptr, const char *start, int length);
|
||||
|
||||
u_scanner_t U_ScanOpen(const char* data, int length, const char* name)
|
||||
{
|
||||
@ -86,13 +86,13 @@ void U_ScanClose(u_scanner_t* scanner)
|
||||
free(scanner->data);
|
||||
}
|
||||
|
||||
void U_IncrementLine(u_scanner_t* scanner)
|
||||
static void U_IncrementLine(u_scanner_t* scanner)
|
||||
{
|
||||
scanner->line++;
|
||||
scanner->lineStart = scanner->scanPos;
|
||||
}
|
||||
|
||||
void U_CheckForWhitespace(u_scanner_t* scanner)
|
||||
static void U_CheckForWhitespace(u_scanner_t* scanner)
|
||||
{
|
||||
int comment = 0; // 1 = till next new line, 2 = till end block
|
||||
while(scanner->scanPos < scanner->length)
|
||||
@ -180,7 +180,7 @@ boolean U_CheckToken(u_scanner_t* s, char token)
|
||||
return false;
|
||||
}
|
||||
|
||||
void U_ExpandState(u_scanner_t* s)
|
||||
static void U_ExpandState(u_scanner_t* s)
|
||||
{
|
||||
s->logicalPosition = s->scanPos;
|
||||
U_CheckForWhitespace(s);
|
||||
@ -194,7 +194,7 @@ void U_ExpandState(u_scanner_t* s)
|
||||
s->tokenLinePosition = s->nextState.tokenLinePosition;
|
||||
}
|
||||
|
||||
void U_SaveState(u_scanner_t* s, u_scanner_t savedstate)
|
||||
static void U_SaveState(u_scanner_t* s, u_scanner_t savedstate)
|
||||
{
|
||||
// This saves the entire parser state except for the data pointer.
|
||||
if (savedstate.string != NULL) free(savedstate.string);
|
||||
@ -206,7 +206,7 @@ void U_SaveState(u_scanner_t* s, u_scanner_t savedstate)
|
||||
savedstate.data = NULL;
|
||||
}
|
||||
|
||||
void U_RestoreState(u_scanner_t* s, u_scanner_t savedstate)
|
||||
static void U_RestoreState(u_scanner_t* s, u_scanner_t savedstate)
|
||||
{
|
||||
if (savedstate.data == NULL)
|
||||
{
|
||||
@ -518,8 +518,14 @@ boolean U_MustGetIdentifier(u_scanner_t* s, const char *ident)
|
||||
return true;
|
||||
}
|
||||
|
||||
// Convenience helpers that parse an entire number including a leading minus or plus sign
|
||||
boolean U_ScanInteger(u_scanner_t* s)
|
||||
void U_Unget(u_scanner_t* s)
|
||||
{
|
||||
s->needNext = false;
|
||||
}
|
||||
|
||||
// Convenience helpers that parse an entire number including a leading minus or
|
||||
// plus sign
|
||||
static boolean U_ScanInteger(u_scanner_t* s)
|
||||
{
|
||||
boolean neg = false;
|
||||
if (!U_GetNextToken(s, true))
|
||||
@ -553,7 +559,7 @@ boolean U_ScanInteger(u_scanner_t* s)
|
||||
return true;
|
||||
}
|
||||
|
||||
boolean U_ScanFloat(u_scanner_t* s)
|
||||
static boolean U_ScanFloat(u_scanner_t* s)
|
||||
{
|
||||
boolean neg = false;
|
||||
if (!U_GetNextToken(s, true))
|
||||
@ -635,7 +641,8 @@ boolean U_HasTokensLeft(u_scanner_t* s)
|
||||
return (s->scanPos < s->length);
|
||||
}
|
||||
|
||||
// This is taken from ZDoom's strbin function which can do a lot more than just unescaping backslashes and quotation marks.
|
||||
// This is taken from ZDoom's strbin function which can do a lot more than just
|
||||
// unescaping backslashes and quotation marks.
|
||||
void U_Unescape(char *str)
|
||||
{
|
||||
char *p = str, c;
|
||||
@ -725,7 +732,7 @@ void U_Unescape(char *str)
|
||||
*str = 0;
|
||||
}
|
||||
|
||||
void U_SetString(char **ptr, const char *start, int length)
|
||||
static void U_SetString(char **ptr, const char *start, int length)
|
||||
{
|
||||
if (length == -1)
|
||||
length = strlen(start);
|
||||
|
@ -100,6 +100,7 @@ boolean U_MustGetFloat(u_scanner_t* s);
|
||||
boolean U_CheckToken(u_scanner_t* scanner, char token);
|
||||
boolean U_CheckInteger(u_scanner_t* s);
|
||||
boolean U_CheckFloat(u_scanner_t* s);
|
||||
void U_Unget(u_scanner_t* s);
|
||||
|
||||
void PRINTF_ATTR(2, 0) U_Error(u_scanner_t* s, const char *msg, ...);
|
||||
void U_ErrorToken(u_scanner_t* s, int token);
|
||||
|
Loading…
x
Reference in New Issue
Block a user