diff --git a/.github/workflows/win_msvc.yml b/.github/workflows/win_msvc.yml index 1d84d9c1..8b3fc190 100644 --- a/.github/workflows/win_msvc.yml +++ b/.github/workflows/win_msvc.yml @@ -50,7 +50,8 @@ jobs: - name: Configure run: | cmake -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DENABLE_WERROR=ON ` - -DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" + -DCMAKE_TOOLCHAIN_FILE="${{ env.VCPKG_ROOT }}/scripts/buildsystems/vcpkg.cmake" ` + -DVCPKG_OVERLAY_TRIPLETS="triplets-custom" - name: Build run: cmake --build build diff --git a/autoload/chex.wad/brghtmps.lmp b/autoload/chex.wad/brghtmps.lmp new file mode 100644 index 00000000..ec08815d --- /dev/null +++ b/autoload/chex.wad/brghtmps.lmp @@ -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 diff --git a/autoload/chex2.wad/brghtmps.lmp b/autoload/chex2.wad/brghtmps.lmp new file mode 100644 index 00000000..5edd77be --- /dev/null +++ b/autoload/chex2.wad/brghtmps.lmp @@ -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 diff --git a/autoload/doom-all/brghtmps.lmp b/autoload/doom-all/brghtmps.lmp new file mode 100644 index 00000000..908b6179 --- /dev/null +++ b/autoload/doom-all/brghtmps.lmp @@ -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 diff --git a/autoload/hacx.wad/brghtmps.lmp b/autoload/hacx.wad/brghtmps.lmp new file mode 100644 index 00000000..15994a89 --- /dev/null +++ b/autoload/hacx.wad/brghtmps.lmp @@ -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 diff --git a/autoload/tnt.wad/brghtmps.lmp b/autoload/tnt.wad/brghtmps.lmp new file mode 100644 index 00000000..35834e38 --- /dev/null +++ b/autoload/tnt.wad/brghtmps.lmp @@ -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 diff --git a/src/d_main.c b/src/d_main.c index dc5905b8..445034b9 100644 --- a/src/d_main.c +++ b/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 diff --git a/src/g_game.c b/src/g_game.c index 73eed625..5e8ff6ca 100644 --- a/src/g_game.c +++ b/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); } diff --git a/src/r_bmaps.c b/src/r_bmaps.c index 6375b656..d6b085e2 100644 --- a/src/r_bmaps.c +++ b/src/r_bmaps.c @@ -23,966 +23,333 @@ #include "doomstat.h" #include "r_data.h" #include "w_wad.h" +#include "m_misc2.h" +#include "u_scanner.h" int brightmaps; -// [crispy] brightmap data +#define COLORMASK_SIZE 256 -static const byte nobrightmap[256] = {0}; - -static const byte notgray[256] = -{ - 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1,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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; - -static const byte hacxlightning[256] = -{ - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -}; +static const byte nobrightmap[COLORMASK_SIZE] = { 0 }; const byte *dc_brightmap = nobrightmap; -// [crispy] brightmaps for textures +typedef struct { + const char *name; + byte colormask[COLORMASK_SIZE]; +} brightmap_t; -enum +static void ReadColormask(u_scanner_t *s, byte *colormask) { - DOOM1AND2, - DOOM1ONLY, - DOOM2ONLY, -}; + memset(colormask, 0, COLORMASK_SIZE); + do + { + unsigned int color1 = 0, color2 = 0; + + if (U_MustGetInteger(s)) + { + color1 = s->number; + if (color1 >= 0 && color1 < COLORMASK_SIZE) + colormask[color1] = 1; + } + + if (!U_CheckToken(s, '-')) + continue; + + if (U_MustGetInteger(s)) + { + color2 = s->number; + if (color2 >= 0 && color2 < COLORMASK_SIZE) + { + int i; + for (i = color1 + 1; i <= color2; ++i) + colormask[i] = 1; + } + } + } while (U_CheckToken(s, ',')); +} + +#define BRIGHTMAPS_INITIAL_SIZE 32 +static brightmap_t *brightmaps_array; +static int num_brightmaps; + +static void AddBrightmap(brightmap_t *brightmap) +{ + static int size; + + if (num_brightmaps >= size) + { + size = (size ? size * 2 : BRIGHTMAPS_INITIAL_SIZE); + brightmaps_array = I_Realloc(brightmaps_array, + size * sizeof(brightmap_t)); + } + + memcpy(brightmaps_array + num_brightmaps, brightmap, sizeof(brightmap_t)); + num_brightmaps++; +} typedef struct { - const char *const texture; - const int game; - const byte *colormask; -} fullbright_t; + brightmap_t *brightmap; + const char *name; + int num; +} elem_t; -static const fullbright_t fullbright_doom[] = { - // [crispy] common textures - {"COMP2", DOOM1AND2, blueandgreen}, - {"COMPSTA1", DOOM1AND2, notgray}, - {"COMPSTA2", DOOM1AND2, notgray}, - {"COMPUTE1", DOOM1AND2, bluegreenbrownred}, - {"COMPUTE2", DOOM1AND2, bluegreenbrown}, - {"COMPUTE3", DOOM1AND2, blueandorange}, - {"EXITSIGN", DOOM1AND2, notgray}, - {"EXITSTON", DOOM1AND2, redonly}, - {"PLANET1", DOOM1AND2, notgray}, - {"SILVER2", DOOM1AND2, notgray}, - {"SILVER3", DOOM1AND2, notgrayorbrown2}, - {"SLADSKUL", DOOM1AND2, redonly}, - {"SW1BRCOM", DOOM1AND2, redonly}, - {"SW1BRIK", DOOM1AND2, redonly}, - {"SW1BRN1", DOOM2ONLY, redonly}, - {"SW1COMM", DOOM1AND2, redonly}, - {"SW1DIRT", DOOM1AND2, redonly}, - {"SW1MET2", DOOM1AND2, redonly}, - {"SW1STARG", DOOM2ONLY, redonly}, - {"SW1STON1", DOOM1AND2, redonly}, - {"SW1STON2", DOOM2ONLY, redonly}, - {"SW1STONE", DOOM1AND2, redonly}, - {"SW1STRTN", DOOM1AND2, redonly}, - {"SW2BLUE", DOOM1AND2, redonly}, - {"SW2BRCOM", DOOM1AND2, greenonly2}, - {"SW2BRIK", DOOM1AND2, greenonly1}, - {"SW2BRN1", DOOM1AND2, greenonly2}, - {"SW2BRN2", DOOM1AND2, greenonly1}, - {"SW2BRNGN", DOOM1AND2, greenonly3}, - {"SW2COMM", DOOM1AND2, greenonly1}, - {"SW2COMP", DOOM1AND2, redonly}, - {"SW2DIRT", DOOM1AND2, greenonly2}, - {"SW2EXIT", DOOM1AND2, notgray}, - {"SW2GRAY", DOOM1AND2, notgray}, - {"SW2GRAY1", DOOM1AND2, notgray}, - {"SW2GSTON", DOOM1AND2, redonly}, - // [crispy] Special case: fewer colors lit. - {"SW2HOT", DOOM1AND2, redonly2}, - {"SW2MARB", DOOM2ONLY, redonly}, - {"SW2MET2", DOOM1AND2, greenonly1}, - {"SW2METAL", DOOM1AND2, greenonly3}, - {"SW2MOD1", DOOM1AND2, greenonly1}, - {"SW2PANEL", DOOM1AND2, redonly}, - {"SW2ROCK", DOOM1AND2, redonly}, - {"SW2SLAD", DOOM1AND2, redonly}, - {"SW2STARG", DOOM2ONLY, greenonly2}, - {"SW2STON1", DOOM1AND2, greenonly3}, - // [crispy] beware! - {"SW2STON2", DOOM1ONLY, redonly}, - {"SW2STON2", DOOM2ONLY, greenonly2}, - {"SW2STON6", DOOM1AND2, redonly}, - {"SW2STONE", DOOM1AND2, greenonly2}, - {"SW2STRTN", DOOM1AND2, greenonly1}, - {"SW2TEK", DOOM1AND2, greenonly1}, - {"SW2VINE", DOOM1AND2, greenonly1}, - {"SW2WOOD", DOOM1AND2, redonly}, - {"SW2ZIM", DOOM1AND2, redonly}, - {"WOOD4", DOOM1AND2, redonly}, - {"WOODGARG", DOOM1AND2, redonly}, - {"WOODSKUL", DOOM1AND2, redonly}, -// {"ZELDOOR", DOOM1AND2, redonly}, - {"LITEBLU1", DOOM1AND2, notgray}, - {"LITEBLU2", DOOM1AND2, notgray}, - {"SPCDOOR3", DOOM2ONLY, greenonly1}, - {"PIPEWAL1", DOOM2ONLY, greenonly1}, - {"TEKLITE2", DOOM2ONLY, greenonly1}, - {"TEKBRON2", DOOM2ONLY, yellowonly}, -// {"SW2SKULL", DOOM2ONLY, greenonly2}, - {"SW2SATYR", DOOM1AND2, brighttan}, - {"SW2LION", DOOM1AND2, brighttan}, - {"SW2GARG", DOOM1AND2, brighttan}, - // [crispy] Final Doom textures - // TNT - Evilution exclusive - {"PNK4EXIT", DOOM2ONLY, redonly}, - {"SLAD2", DOOM2ONLY, notgrayorbrown}, - {"SLAD3", DOOM2ONLY, notgrayorbrown}, - {"SLAD4", DOOM2ONLY, notgrayorbrown}, - {"SLAD5", DOOM2ONLY, notgrayorbrown}, - {"SLAD6", DOOM2ONLY, notgrayorbrown}, - {"SLAD7", DOOM2ONLY, notgrayorbrown}, - {"SLAD8", DOOM2ONLY, notgrayorbrown}, - {"SLAD9", DOOM2ONLY, notgrayorbrown}, - {"SLAD10", DOOM2ONLY, notgrayorbrown}, - {"SLAD11", DOOM2ONLY, notgrayorbrown}, - {"SLADRIP1", DOOM2ONLY, notgrayorbrown}, - {"SLADRIP3", DOOM2ONLY, notgrayorbrown}, - {"M_TEC", DOOM2ONLY, greenonly2}, - {"LITERED2", DOOM2ONLY, redonly}, - {"BTNTMETL", DOOM2ONLY, notgrayorbrown}, - {"BTNTSLVR", DOOM2ONLY, notgrayorbrown}, - {"LITEYEL2", DOOM2ONLY, yellowonly}, - {"LITEYEL3", DOOM2ONLY, yellowonly}, - {"YELMETAL", DOOM2ONLY, yellowonly}, - // Plutonia exclusive -// {"SW2SKULL", DOOM2ONLY, redonly}, +#define ELEMS_INITIAL_SIZE 32 + +typedef struct +{ + elem_t *elems; + int num_elems; + int size; +} array_t; + +static array_t textures_bm; +static array_t flats_bm; +static array_t sprites_bm; +static array_t states_bm; + +static void AddElem(array_t *array, elem_t *elem) +{ + if (array->num_elems >= array->size) + { + array->size = array->size ? 2 * array->size : ELEMS_INITIAL_SIZE; + array->elems = I_Realloc(array->elems, array->size * sizeof(elem_t)); + } + + memcpy(array->elems + array->num_elems, elem, sizeof(elem_t)); + array->num_elems++; +} + +static brightmap_t *GetBrightmap(const char *name) +{ + int i; + for (i = 0; i < num_brightmaps; ++i) + { + if (!strcasecmp(brightmaps_array[i].name, name)) + return &brightmaps_array[i]; + } + return NULL; +} + +enum +{ + DOOM1AND2, + DOOM1ONLY, + DOOM2ONLY }; -static const fullbright_t fullbright_chex[] = { - {"BIGDOOR1", DOOM1AND2, greenonly3}, -// {"BIGDOOR4", DOOM1AND2, greenonly3}, // C1: some stray green pixels, C2: many stray green pixels -// {"BRNBIGL", DOOM1AND2, greenonly3}, -// {"BRNBIGR", DOOM1AND2, greenonly3}, // C1, C2: one stray green pixel -// {"BRNSMAL2", DOOM1AND2, greenonly3}, // C1, C2: many stray green pixels - {"COMP2", DOOM1AND2, notgray}, -// {"COMPTALL", DOOM1ONLY, notgray}, -// {"COMPTALL", DOOM2ONLY, greenonly3}, // C2: many stray green pixels - {"COMPUTE2", DOOM1AND2, notgray}, - {"LITE5", DOOM1ONLY, greenonly2}, - {"STARTAN3", DOOM1AND2, greenonly2}, - {"SW1BRCOM", DOOM1AND2, chexred}, - {"SW1BRN1", DOOM1AND2, chexgreen}, - {"SW1BRN2", DOOM1AND2, chexred}, - {"SW1BRNGN", DOOM1AND2, chexred}, - {"SW1BROWN", DOOM1AND2, chexred}, - {"SW1COMM", DOOM1AND2, chexred}, - {"SW1COMP", DOOM1AND2, chexred}, - {"SW1DIRT", DOOM1AND2, chexgreen}, - {"SW1METAL", DOOM1AND2, chexredgreen}, - {"SW1PIPE", DOOM1AND2, chexgreen}, - {"SW1STARG", DOOM1AND2, chexred}, - {"SW1STON1", DOOM1AND2, chexred}, - {"SW1STRTN", DOOM1AND2, chexred}, - {"SW2BRCOM", DOOM1AND2, chexgreen}, - {"SW2BRN1", DOOM1AND2, chexred}, - {"SW2BRN2", DOOM1AND2, chexgreen}, - {"SW2BRNGN", DOOM1AND2, chexgreen}, - {"SW2BROWN", DOOM1AND2, chexgreen}, - {"SW2COMM", DOOM1AND2, chexgreen}, - {"SW2COMP", DOOM1AND2, chexgreen}, - {"SW2DIRT", DOOM1AND2, chexred}, - {"SW2METAL", DOOM1AND2, chexredgreen}, - {"SW2PIPE", DOOM1AND2, chexred}, - {"SW2STARG", DOOM1AND2, chexgreen}, - {"SW2STON1", DOOM1AND2, chexgreen}, - {"SW2STONE", DOOM1AND2, chexgreen}, - {"SW2STRTN", DOOM1AND2, chexgreen}, -// {"BIGDOOR5", DOOM1AND2, greenonly1}, // C1, C2: some stray green pixels -// {"BIGDOOR6", DOOM1AND2, greenonly1}, // C1, C2: some stray green pixels - {"CEMENT3", DOOM1AND2, greenonly3}, - {"SKINFACE", DOOM1AND2, greenonly1}, - {"SKINTEK1", DOOM1ONLY, greenonly1}, - {"SKSPINE2", DOOM1AND2, greenonly3}, - {"SW1BLUE", DOOM1AND2, chexgreen}, - {"SW1HOT", DOOM1AND2, chexgreen}, - {"SW1SKIN", DOOM1AND2, chexgreen}, - {"SW1VINE", DOOM1ONLY, chexgreen}, // C1: some stray green pixels in the vines - {"SW1WOOD", DOOM1AND2, chexgreen}, - {"SW2BLUE", DOOM1AND2, chexred}, - {"SW2CMT", DOOM1AND2, chexgreen}, - {"SW2GSTON", DOOM1AND2, chexred}, - {"SW2HOT", DOOM1AND2, chexred}, - {"SW2SKIN", DOOM1AND2, chexred}, - {"SW2VINE", DOOM1ONLY, chexred}, - {"SW2WOOD", DOOM1AND2, chexred}, - {"WOOD4", DOOM1AND2, chexredgreen}, - {"WOODGARG", DOOM1AND2, chexred}, - {"WOODSKUL", DOOM1AND2, chexredgreen}, -}; - -static const fullbright_t fullbright_hacx[] = { -// {"BFALL1", DOOM2ONLY, redandgreen}, -// {"BFALL2", DOOM2ONLY, redandgreen}, -// {"BFALL3", DOOM2ONLY, redandgreen}, -// {"BFALL4", DOOM2ONLY, redandgreen}, - {"BRNSMALR", DOOM2ONLY, greenonly1}, - {"DOORRED", DOOM2ONLY, redandgreen}, - {"SLADWALL", DOOM2ONLY, chexred}, -// {"SW1BRCOM", DOOM2ONLY, redonly}, -// {"SW1BRN1", DOOM2ONLY, redandgreen}, - {"SW1BRN2", DOOM2ONLY, notgrayorbrown}, - {"SW1BRNGN", DOOM2ONLY, notgrayorbrown}, -// {"SW1BROWN", DOOM2ONLY, notgrayorbrown}, -// {"SW2BRCOM", DOOM2ONLY, greenonly1}, -// {"SW2BRN1", DOOM2ONLY, redandgreen}, - {"SW2BRN2", DOOM2ONLY, notgrayorbrown}, -// {"SW2BROWN", DOOM2ONLY, notgrayorbrown}, - {"COMPSPAN", DOOM2ONLY, greenonly1}, - {"COMPSTA1", DOOM2ONLY, notgrayorbrown}, -// {"COMPSTA2", DOOM2ONLY, notgrayorbrown}, - {"HD5", DOOM2ONLY, redandgreen}, -// {"HD8", DOOM2ONLY, redandgreen}, -// {"HD9", DOOM2ONLY, redandgreen}, - {"BLAKWAL2", DOOM2ONLY, redandgreen}, - {"CEMENT7", DOOM2ONLY, greenonly1}, - {"ROCK4", DOOM2ONLY, redonly}, -// {"SLOPPY1", DOOM2ONLY, notgrayorbrown}, -// {"SPCDOOR4", DOOM2ONLY, notgrayorbrown}, - {"ZZZFACE1", DOOM2ONLY, greenonly1}, - {"ZZZFACE2", DOOM2ONLY, redandgreen}, - {"HW166", DOOM2ONLY, redandgreen}, - {"HW510", DOOM2ONLY, notgrayorbrown}, - {"HW511", DOOM2ONLY, notgrayorbrown}, - {"HW512", DOOM2ONLY, notgrayorbrown}, -}; - -static const byte *R_BrightmapForTexName_Doom (const char *texname) +static boolean ParseProperty(u_scanner_t *s, elem_t *elem) { - int i; + char *name; + brightmap_t *brightmap; - for (i = 0; i < arrlen(fullbright_doom); i++) - { - const fullbright_t *fullbright = &fullbright_doom[i]; + int game = DOOM1AND2; - if ((gamemission == doom && fullbright->game == DOOM2ONLY) || - (gamemission != doom && fullbright->game == DOOM1ONLY)) - { - continue; - } + U_MustGetToken(s, TK_Identifier); + name = M_StringDuplicate(s->string); + U_MustGetToken(s, TK_Identifier); + brightmap = GetBrightmap(s->string); + if (!brightmap) + { + U_Error(s, "brightmap '%s' not found", s->string); + free(name); + return false; + } + if (U_CheckToken(s, TK_Identifier)) + { + if (!strcasecmp("DOOM", s->string) || !strcasecmp("DOOM1", s->string)) + { + game = DOOM1ONLY; + if (U_CheckToken(s, '|')) + { + if (U_MustGetIdentifier(s, "DOOM2")) + game = DOOM1AND2; + } + } + else if (!strcasecmp("DOOM2", s->string)) + { + game = DOOM2ONLY; + } + else + { + U_Unget(s); + } + } + if ((gamemission == doom && game == DOOM2ONLY) || + (gamemission == doom2 && game == DOOM1ONLY)) + { + free(name); + return false; + } - if (!strncasecmp(fullbright->texture, texname, 8)) - { - return fullbright->colormask; - } - } - - return nobrightmap; + elem->name = name; + elem->brightmap = brightmap; + return true; } -static boolean chex2 = false; - -static const byte *R_BrightmapForTexName_Chex (const char *texname) +void R_InitFlatBrightmaps(void) { - int i; - - for (i = 0; i < arrlen(fullbright_chex); i++) - { - const fullbright_t *fullbright = &fullbright_chex[i]; - - if ((chex2 && fullbright->game == DOOM1ONLY) || - (!chex2 && fullbright->game == DOOM2ONLY)) - { - continue; - } - - if (!strncasecmp(fullbright->texture, texname, 8)) - { - return fullbright->colormask; - } - } - - return nobrightmap; + int i; + for (i = 0; i < flats_bm.num_elems; ++i) + { + flats_bm.elems[i].num = R_FlatNumForName(flats_bm.elems[i].name); + } } -static const byte *R_BrightmapForTexName_Hacx (const char *texname) +const byte *R_BrightmapForTexName(const char *texname) { - int i; + int i; - for (i = 0; i < arrlen(fullbright_hacx); i++) - { - const fullbright_t *fullbright = &fullbright_hacx[i]; + for (i = textures_bm.num_elems - 1; i >= 0; i--) + { + if (!strncasecmp(textures_bm.elems[i].name, texname, 8)) + { + return textures_bm.elems[i].brightmap->colormask; + } + } - if (!strncasecmp(fullbright->texture, texname, 8)) - { - return fullbright->colormask; - } - } - - return nobrightmap; + return nobrightmap; } -// [crispy] brightmaps for sprites - -// [crispy] adapted from russian-doom/src/doom/r_things.c:617-639 -static const byte *R_BrightmapForSprite_Doom (const int type) +const byte *R_BrightmapForSprite(const int type) { - if (STRICTMODE(brightmaps)) - { - switch (type) - { - // Armor Bonus - case SPR_BON2: - // Cell Charge - case SPR_CELL: - { - return greenonly2; - break; - } - // Barrel - case SPR_BAR1: - { - return greenonly3; - break; - } - // Cell Charge Pack - case SPR_CELP: - { - return yellowonly; - break; - } - // BFG9000 - case SPR_BFUG: - // Plasmagun - case SPR_PLAS: - { - return redonly; - break; - } - } - } + if (STRICTMODE(brightmaps)) + { + int i; + for (i = sprites_bm.num_elems - 1; i >= 0 ; i--) + { + if (sprites_bm.elems[i].num == type) + { + return sprites_bm.elems[i].brightmap->colormask; + } + } + } - return nobrightmap; + return nobrightmap; } -static const byte *R_BrightmapForSprite_Chex (const int type) +const byte *R_BrightmapForFlatNum(const int num) { - // [crispy] TODO - /* - if (STRICTMODE(brightmaps)) - { - switch (type) - { - // Chainsaw - case SPR_CSAW: - // Shotgun - case SPR_SHOT: - // Chaingun - case SPR_MGUN: - // Rocket launcher - case SPR_LAUN: - // Plasmagun - case SPR_PLAS: - // BFG9000 - case SPR_BFUG: - { - return redandgreen; - break; - } - } - } - */ - return nobrightmap; + if (STRICTMODE(brightmaps)) + { + int i; + for (i = flats_bm.num_elems - 1; i >= 0; i--) + { + if (flats_bm.elems[i].num == num) + { + return flats_bm.elems[i].brightmap->colormask; + } + } + } + + return nobrightmap; } -static const byte *R_BrightmapForSprite_Hacx (const int type) +const byte *R_BrightmapForState(const int state) { - if (STRICTMODE(brightmaps)) - { - switch (type) - { - // Chainsaw - case SPR_CSAW: - // Plasmagun - case SPR_PLAS: - // Cell Charge - case SPR_CELL: - // Cell Charge Pack - case SPR_CELP: - { - return redonly; - break; - } - // Rocket launcher - case SPR_LAUN: - // Medikit - case SPR_MEDI: - { - return redandgreen; - break; - } - // Rocket - case SPR_ROCK: - // Box of rockets - case SPR_BROK: - { - return greenonly1; - break; - } - // Health Bonus - case SPR_BON1: - // Stimpack - case SPR_STIM: - { - return notgrayorbrown; - break; - } - } - } + if (STRICTMODE(brightmaps)) + { + int i; + for (i = states_bm.num_elems - 1; i >= 0; i--) + { + if (states_bm.elems[i].num == state) + { + return states_bm.elems[i].brightmap->colormask; + } + } + } - return nobrightmap; + return nobrightmap; } -// [crispy] brightmaps for flats - -static int bmapflatnum[12]; - -static const byte *R_BrightmapForFlatNum_Doom (const int num) +void R_ParseBrightmaps(int lumpnum) { - if (STRICTMODE(brightmaps)) - { - if (num == bmapflatnum[0] || - num == bmapflatnum[1] || - num == bmapflatnum[2]) - { - return notgrayorbrown; - } - } + u_scanner_t scanner, *s; + const char *data = W_CacheLumpNum(lumpnum, PU_CACHE); + int length = W_LumpLength(lumpnum); - return nobrightmap; -} - -static const byte *R_BrightmapForFlatNum_Hacx (const int num) -{ - if (STRICTMODE(brightmaps)) - { - if (num == bmapflatnum[0] || - num == bmapflatnum[1] || - num == bmapflatnum[2] || - num == bmapflatnum[3] || - num == bmapflatnum[4] || - num == bmapflatnum[5] || - num == bmapflatnum[9] || - num == bmapflatnum[10] || - num == bmapflatnum[11]) - { - return notgrayorbrown; - } - - if (num == bmapflatnum[6] || - num == bmapflatnum[7] || - num == bmapflatnum[8]) - { - return greenonly1; - } - } - - return nobrightmap; -} - -static const byte *R_BrightmapForFlatNum_None (const int num) -{ - return nobrightmap; -} - -// [crispy] brightmaps for states - -static const byte *R_BrightmapForState_Doom (const int state) -{ - if (STRICTMODE(brightmaps)) - { - switch (state) - { - case S_BFG1: - case S_BFG2: - case S_BFG3: - case S_BFG4: - { - return redonly; - break; - } - } - } - - return nobrightmap; -} - -static const byte *R_BrightmapForState_Hacx (const int state) -{ - if (STRICTMODE(brightmaps)) - { - switch (state) - { - case S_SAW2: - case S_SAW3: - { - return hacxlightning; - break; - } - case S_MISSILE: - { - return redandgreen; - break; - } - case S_SAW: - case S_SAWB: - case S_PLASMA: - case S_PLASMA2: - { - return redonly; - break; - } - } - } - - return nobrightmap; -} - -static const byte *R_BrightmapForState_None (const int state) -{ - return nobrightmap; -} - -// [crispy] initialize brightmaps - -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); - -void R_InitBrightmaps () -{ - if (gamemission == pack_hacx) - { - bmapflatnum[0] = R_FlatNumForName("FLOOR1_1"); - bmapflatnum[1] = R_FlatNumForName("FLOOR1_7"); - bmapflatnum[2] = R_FlatNumForName("FLOOR3_3"); - bmapflatnum[3] = R_FlatNumForName("NUKAGE1"); - bmapflatnum[4] = R_FlatNumForName("NUKAGE2"); - bmapflatnum[5] = R_FlatNumForName("NUKAGE3"); - bmapflatnum[6] = R_FlatNumForName("BLOOD1"); - bmapflatnum[7] = R_FlatNumForName("BLOOD2"); - bmapflatnum[8] = R_FlatNumForName("BLOOD3"); - bmapflatnum[9] = R_FlatNumForName("SLIME13"); - bmapflatnum[10] = R_FlatNumForName("SLIME14"); - bmapflatnum[11] = R_FlatNumForName("SLIME15"); - - R_BrightmapForTexName = R_BrightmapForTexName_Hacx; - R_BrightmapForSprite = R_BrightmapForSprite_Hacx; - R_BrightmapForFlatNum = R_BrightmapForFlatNum_Hacx; - R_BrightmapForState = R_BrightmapForState_Hacx; - } - else - if (gamemission == pack_chex) - { - int lump; - - // [crispy] detect Chex Quest 2 - lump = W_CheckNumForName("INTERPIC"); - if (!strcasecmp(W_WadNameForLump(lump), "chex2.wad")) - { - chex2 = true; - } - - R_BrightmapForTexName = R_BrightmapForTexName_Chex; - R_BrightmapForSprite = R_BrightmapForSprite_Chex; - R_BrightmapForFlatNum = R_BrightmapForFlatNum_None; - R_BrightmapForState = R_BrightmapForState_None; - } - else - { - // [crispy] only three select brightmapped flats - bmapflatnum[0] = R_FlatNumForName("CONS1_1"); - bmapflatnum[1] = R_FlatNumForName("CONS1_5"); - bmapflatnum[2] = R_FlatNumForName("CONS1_7"); - - R_BrightmapForTexName = R_BrightmapForTexName_Doom; - R_BrightmapForSprite = R_BrightmapForSprite_Doom; - R_BrightmapForFlatNum = R_BrightmapForFlatNum_Doom; - R_BrightmapForState = R_BrightmapForState_Doom; - } + if (!num_brightmaps) + { + brightmap_t brightmap; + brightmap.name = "NOBRIGHTMAP"; + memset(brightmap.colormask, 0, COLORMASK_SIZE); + AddBrightmap(&brightmap); + } + + scanner = U_ScanOpen(data, length, "BRGHTMPS"); + s = &scanner; + while (U_HasTokensLeft(s)) + { + if (!U_CheckToken(s, TK_Identifier)) + { + U_GetNextToken(s, true); + continue; + } + if (!strcasecmp("BRIGHTMAP", s->string)) + { + brightmap_t brightmap; + U_MustGetToken(s, TK_Identifier); + brightmap.name = M_StringDuplicate(s->string); + ReadColormask(s, brightmap.colormask); + AddBrightmap(&brightmap); + } + else if (!strcasecmp("TEXTURE", s->string)) + { + elem_t elem; + if (ParseProperty(s, &elem)) + { + AddElem(&textures_bm, &elem); + } + } + else if (!strcasecmp("SPRITE", s->string)) + { + elem_t elem; + if (ParseProperty(s, &elem)) + { + int i; + for (i = 0; i < num_sprites; ++i) + { + if (!strcasecmp(elem.name, sprnames[i])) + break; + } + if (i == num_sprites) + { + U_Error(s, "sprite '%s' not found", elem.name); + } + elem.num = i; + AddElem(&sprites_bm, &elem); + } + } + else if (!strcasecmp("FLAT", s->string)) + { + elem_t elem; + if (ParseProperty(s, &elem)) + { + AddElem(&flats_bm, &elem); + } + } + else if (!strcasecmp("STATE", s->string)) + { + elem_t elem; + elem.name = NULL; + U_MustGetInteger(s); + elem.num = s->number; + if (elem.num < 0 || elem.num >= num_states) + { + U_Error(s, "state '%d' not found", elem.num); + } + U_MustGetToken(s, TK_Identifier); + elem.brightmap = GetBrightmap(s->string); + if (elem.brightmap) + { + AddElem(&states_bm, &elem); + } + else + { + U_Error(s, "brightmap '%s' not found", s->string); + } + } + } + U_ScanClose(s); } diff --git a/src/r_bmaps.h b/src/r_bmaps.h index b7b33e12..23251457 100644 --- a/src/r_bmaps.h +++ b/src/r_bmaps.h @@ -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; diff --git a/src/r_data.c b/src/r_data.c index ef29df64..16fee5af 100644 --- a/src/r_data.c +++ b/src/r_data.c @@ -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 diff --git a/src/u_mapinfo.c b/src/u_mapinfo.c index 9f0cd1f9..e3a420d4 100644 --- a/src/u_mapinfo.c +++ b/src/u_mapinfo.c @@ -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; } diff --git a/src/u_mapinfo.h b/src/u_mapinfo.h index a47feb73..e7a9e144 100644 --- a/src/u_mapinfo.h +++ b/src/u_mapinfo.h @@ -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 diff --git a/src/u_scanner.c b/src/u_scanner.c index 133d6bf0..b8ddc6b3 100644 --- a/src/u_scanner.c +++ b/src/u_scanner.c @@ -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); diff --git a/src/u_scanner.h b/src/u_scanner.h index 70a67a33..83f8417d 100644 --- a/src/u_scanner.h +++ b/src/u_scanner.h @@ -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); diff --git a/triplets-custom/x64-windows.cmake b/triplets-custom/x64-windows.cmake new file mode 100644 index 00000000..bc4419ac --- /dev/null +++ b/triplets-custom/x64-windows.cmake @@ -0,0 +1,9 @@ +set(VCPKG_TARGET_ARCHITECTURE x64) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_BUILD_TYPE release) + +if(${PORT} MATCHES "libsamplerate") + set(VCPKG_CXX_FLAGS "/fp:fast") + set(VCPKG_C_FLAGS "/fp:fast") +endif() diff --git a/triplets-custom/x86-windows.cmake b/triplets-custom/x86-windows.cmake new file mode 100644 index 00000000..40eb51a0 --- /dev/null +++ b/triplets-custom/x86-windows.cmake @@ -0,0 +1,9 @@ +set(VCPKG_TARGET_ARCHITECTURE x86) +set(VCPKG_CRT_LINKAGE dynamic) +set(VCPKG_LIBRARY_LINKAGE dynamic) +set(VCPKG_BUILD_TYPE release) + +if(${PORT} MATCHES "libsamplerate") + set(VCPKG_CXX_FLAGS "/fp:fast") + set(VCPKG_C_FLAGS "/fp:fast") +endif()