mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-27 06:12:19 +00:00
# Conflicts: # wadsrc/static/compatibility.txt
This commit is contained in:
commit
978152f483
10 changed files with 93 additions and 15 deletions
|
@ -80,6 +80,7 @@ enum
|
||||||
CP_CLEARSPECIAL,
|
CP_CLEARSPECIAL,
|
||||||
CP_SETACTIVATION,
|
CP_SETACTIVATION,
|
||||||
CP_SECTORFLOOROFFSET,
|
CP_SECTORFLOOROFFSET,
|
||||||
|
CP_SETSECTORSPECIAL,
|
||||||
CP_SETWALLYSCALE,
|
CP_SETWALLYSCALE,
|
||||||
CP_SETTHINGZ,
|
CP_SETTHINGZ,
|
||||||
CP_SETTAG,
|
CP_SETTAG,
|
||||||
|
@ -294,6 +295,15 @@ void ParseCompatibility()
|
||||||
sc.MustGetFloat();
|
sc.MustGetFloat();
|
||||||
CompatParams.Push(int(sc.Float*65536.));
|
CompatParams.Push(int(sc.Float*65536.));
|
||||||
}
|
}
|
||||||
|
else if (sc.Compare("setsectorspecial"))
|
||||||
|
{
|
||||||
|
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
|
||||||
|
CompatParams.Push(CP_SETSECTORSPECIAL);
|
||||||
|
sc.MustGetNumber();
|
||||||
|
CompatParams.Push(sc.Number);
|
||||||
|
sc.MustGetNumber();
|
||||||
|
CompatParams.Push(sc.Number);
|
||||||
|
}
|
||||||
else if (sc.Compare("setwallyscale"))
|
else if (sc.Compare("setwallyscale"))
|
||||||
{
|
{
|
||||||
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
|
if (flags.ExtCommandIndex == ~0u) flags.ExtCommandIndex = CompatParams.Size();
|
||||||
|
@ -529,6 +539,16 @@ void SetCompatibilityParams()
|
||||||
i += 3;
|
i += 3;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CP_SETSECTORSPECIAL:
|
||||||
|
{
|
||||||
|
const int index = CompatParams[i + 1];
|
||||||
|
if (index < numsectors)
|
||||||
|
{
|
||||||
|
sectors[index].special = CompatParams[i + 2];
|
||||||
|
}
|
||||||
|
i += 3;
|
||||||
|
break;
|
||||||
|
}
|
||||||
case CP_SETWALLYSCALE:
|
case CP_SETWALLYSCALE:
|
||||||
{
|
{
|
||||||
if (CompatParams[i+1] < numlines)
|
if (CompatParams[i+1] < numlines)
|
||||||
|
|
|
@ -552,7 +552,7 @@ void FDDSTexture::ReadRGB (FWadLump &lump, BYTE *tcbuf)
|
||||||
DWORD r = (c & RMask) << RShiftL; r |= r >> RShiftR;
|
DWORD r = (c & RMask) << RShiftL; r |= r >> RShiftR;
|
||||||
DWORD g = (c & GMask) << GShiftL; g |= g >> GShiftR;
|
DWORD g = (c & GMask) << GShiftL; g |= g >> GShiftR;
|
||||||
DWORD b = (c & BMask) << BShiftL; b |= b >> BShiftR;
|
DWORD b = (c & BMask) << BShiftL; b |= b >> BShiftR;
|
||||||
*pixelp = RGB32k.RGB[r >> 27][g >> 27][b >> 27];
|
*pixelp = RGB256k.RGB[r >> 26][g >> 26][b >> 26];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -638,7 +638,7 @@ void FDDSTexture::DecompressDXT1 (FWadLump &lump, BYTE *tcbuf)
|
||||||
// Pick colors from the palette for each of the four colors.
|
// Pick colors from the palette for each of the four colors.
|
||||||
/*if (!tcbuf)*/ for (i = 3; i >= 0; --i)
|
/*if (!tcbuf)*/ for (i = 3; i >= 0; --i)
|
||||||
{
|
{
|
||||||
palcol[i] = color[i].a ? RGB32k.RGB[color[i].r >> 3][color[i].g >> 3][color[i].b >> 3] : 0;
|
palcol[i] = color[i].a ? RGB256k.RGB[color[i].r >> 2][color[i].g >> 2][color[i].b >> 2] : 0;
|
||||||
}
|
}
|
||||||
// Now decode this 4x4 block to the pixel buffer.
|
// Now decode this 4x4 block to the pixel buffer.
|
||||||
for (y = 0; y < 4; ++y)
|
for (y = 0; y < 4; ++y)
|
||||||
|
@ -718,7 +718,7 @@ void FDDSTexture::DecompressDXT3 (FWadLump &lump, bool premultiplied, BYTE *tcbu
|
||||||
// Pick colors from the palette for each of the four colors.
|
// Pick colors from the palette for each of the four colors.
|
||||||
if (!tcbuf) for (i = 3; i >= 0; --i)
|
if (!tcbuf) for (i = 3; i >= 0; --i)
|
||||||
{
|
{
|
||||||
palcol[i] = RGB32k.RGB[color[i].r >> 3][color[i].g >> 3][color[i].b >> 3];
|
palcol[i] = RGB256k.RGB[color[i].r >> 2][color[i].g >> 2][color[i].b >> 2];
|
||||||
}
|
}
|
||||||
// Now decode this 4x4 block to the pixel buffer.
|
// Now decode this 4x4 block to the pixel buffer.
|
||||||
for (y = 0; y < 4; ++y)
|
for (y = 0; y < 4; ++y)
|
||||||
|
@ -823,7 +823,7 @@ void FDDSTexture::DecompressDXT5 (FWadLump &lump, bool premultiplied, BYTE *tcbu
|
||||||
// Pick colors from the palette for each of the four colors.
|
// Pick colors from the palette for each of the four colors.
|
||||||
if (!tcbuf) for (i = 3; i >= 0; --i)
|
if (!tcbuf) for (i = 3; i >= 0; --i)
|
||||||
{
|
{
|
||||||
palcol[i] = RGB32k.RGB[color[i].r >> 3][color[i].g >> 3][color[i].b >> 3];
|
palcol[i] = RGB256k.RGB[color[i].r >> 2][color[i].g >> 2][color[i].b >> 2];
|
||||||
}
|
}
|
||||||
// Now decode this 4x4 block to the pixel buffer.
|
// Now decode this 4x4 block to the pixel buffer.
|
||||||
for (y = 0; y < 4; ++y)
|
for (y = 0; y < 4; ++y)
|
||||||
|
|
|
@ -404,7 +404,7 @@ void FJPEGTexture::MakeTexture ()
|
||||||
case JCS_RGB:
|
case JCS_RGB:
|
||||||
for (int x = Width; x > 0; --x)
|
for (int x = Width; x > 0; --x)
|
||||||
{
|
{
|
||||||
*out = RGB32k.RGB[in[0]>>3][in[1]>>3][in[2]>>3];
|
*out = RGB256k.RGB[in[0]>>2][in[1]>>2][in[2]>>2];
|
||||||
out += Height;
|
out += Height;
|
||||||
in += 3;
|
in += 3;
|
||||||
}
|
}
|
||||||
|
@ -428,7 +428,7 @@ void FJPEGTexture::MakeTexture ()
|
||||||
int r = in[3] - (((256-in[0])*in[3]) >> 8);
|
int r = in[3] - (((256-in[0])*in[3]) >> 8);
|
||||||
int g = in[3] - (((256-in[1])*in[3]) >> 8);
|
int g = in[3] - (((256-in[1])*in[3]) >> 8);
|
||||||
int b = in[3] - (((256-in[2])*in[3]) >> 8);
|
int b = in[3] - (((256-in[2])*in[3]) >> 8);
|
||||||
*out = RGB32k.RGB[r >> 3][g >> 3][b >> 3];
|
*out = RGB256k.RGB[r >> 2][g >> 2][b >> 2];
|
||||||
out += Height;
|
out += Height;
|
||||||
in += 4;
|
in += 4;
|
||||||
}
|
}
|
||||||
|
|
|
@ -532,7 +532,7 @@ void FMultiPatchTexture::MakeTexture ()
|
||||||
{
|
{
|
||||||
if (*out == 0 && in[3] != 0)
|
if (*out == 0 && in[3] != 0)
|
||||||
{
|
{
|
||||||
*out = RGB32k.RGB[in[2]>>3][in[1]>>3][in[0]>>3];
|
*out = RGB256k.RGB[in[2]>>2][in[1]>>2][in[0]>>2];
|
||||||
}
|
}
|
||||||
out += Height;
|
out += Height;
|
||||||
in += 4;
|
in += 4;
|
||||||
|
|
|
@ -529,7 +529,7 @@ void FPCXTexture::MakeTexture()
|
||||||
{
|
{
|
||||||
for(int x=0; x < Width; x++)
|
for(int x=0; x < Width; x++)
|
||||||
{
|
{
|
||||||
Pixels[y+Height*x] = RGB32k.RGB[row[0]>>3][row[1]>>3][row[2]>>3];
|
Pixels[y+Height*x] = RGB256k.RGB[row[0]>>2][row[1]>>2][row[2]>>2];
|
||||||
row+=3;
|
row+=3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -535,7 +535,7 @@ void FPNGTexture::MakeTexture ()
|
||||||
{
|
{
|
||||||
if (!HaveTrans)
|
if (!HaveTrans)
|
||||||
{
|
{
|
||||||
*out++ = RGB32k.RGB[in[0]>>3][in[1]>>3][in[2]>>3];
|
*out++ = RGB256k.RGB[in[0]>>2][in[1]>>2][in[2]>>2];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -547,7 +547,7 @@ void FPNGTexture::MakeTexture ()
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*out++ = RGB32k.RGB[in[0]>>3][in[1]>>3][in[2]>>3];
|
*out++ = RGB256k.RGB[in[0]>>2][in[1]>>2][in[2]>>2];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
in += pitch;
|
in += pitch;
|
||||||
|
@ -592,7 +592,7 @@ void FPNGTexture::MakeTexture ()
|
||||||
{
|
{
|
||||||
for (y = Height; y > 0; --y)
|
for (y = Height; y > 0; --y)
|
||||||
{
|
{
|
||||||
*out++ = in[3] < 128 ? 0 : RGB32k.RGB[in[0]>>3][in[1]>>3][in[2]>>3];
|
*out++ = in[3] < 128 ? 0 : RGB256k.RGB[in[0]>>2][in[1]>>2][in[2]>>2];
|
||||||
in += pitch;
|
in += pitch;
|
||||||
}
|
}
|
||||||
in -= backstep;
|
in -= backstep;
|
||||||
|
|
|
@ -394,7 +394,7 @@ void FTGATexture::MakeTexture ()
|
||||||
for(int x=0;x<Width;x++)
|
for(int x=0;x<Width;x++)
|
||||||
{
|
{
|
||||||
int v = LittleLong(*p);
|
int v = LittleLong(*p);
|
||||||
Pixels[x*Height+y] = RGB32k.RGB[(v>>10) & 0x1f][(v>>5) & 0x1f][v & 0x1f];
|
Pixels[x*Height+y] = RGB256k.RGB[((v>>10) & 0x1f)*2][((v>>5) & 0x1f)*2][(v & 0x1f)*2];
|
||||||
p+=step_x;
|
p+=step_x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -406,7 +406,7 @@ void FTGATexture::MakeTexture ()
|
||||||
BYTE * p = ptr + y * Pitch;
|
BYTE * p = ptr + y * Pitch;
|
||||||
for(int x=0;x<Width;x++)
|
for(int x=0;x<Width;x++)
|
||||||
{
|
{
|
||||||
Pixels[x*Height+y] = RGB32k.RGB[p[2]>>3][p[1]>>3][p[0]>>3];
|
Pixels[x*Height+y] = RGB256k.RGB[p[2]>>2][p[1]>>2][p[0]>>2];
|
||||||
p+=step_x;
|
p+=step_x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -420,7 +420,7 @@ void FTGATexture::MakeTexture ()
|
||||||
BYTE * p = ptr + y * Pitch;
|
BYTE * p = ptr + y * Pitch;
|
||||||
for(int x=0;x<Width;x++)
|
for(int x=0;x<Width;x++)
|
||||||
{
|
{
|
||||||
Pixels[x*Height+y] = RGB32k.RGB[p[2]>>3][p[1]>>3][p[0]>>3];
|
Pixels[x*Height+y] = RGB256k.RGB[p[2]>>2][p[1]>>2][p[0]>>2];
|
||||||
p+=step_x;
|
p+=step_x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -432,7 +432,7 @@ void FTGATexture::MakeTexture ()
|
||||||
BYTE * p = ptr + y * Pitch;
|
BYTE * p = ptr + y * Pitch;
|
||||||
for(int x=0;x<Width;x++)
|
for(int x=0;x<Width;x++)
|
||||||
{
|
{
|
||||||
Pixels[x*Height+y] = p[3] >= 128? RGB32k.RGB[p[2]>>3][p[1]>>3][p[0]>>3] : 0;
|
Pixels[x*Height+y] = p[3] >= 128? RGB256k.RGB[p[2]>>2][p[1]>>2][p[0]>>2] : 0;
|
||||||
p+=step_x;
|
p+=step_x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -144,8 +144,10 @@ DWORD Col2RGB8[65][256];
|
||||||
DWORD *Col2RGB8_LessPrecision[65];
|
DWORD *Col2RGB8_LessPrecision[65];
|
||||||
DWORD Col2RGB8_Inverse[65][256];
|
DWORD Col2RGB8_Inverse[65][256];
|
||||||
ColorTable32k RGB32k;
|
ColorTable32k RGB32k;
|
||||||
|
ColorTable256k RGB256k;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static DWORD Col2RGB8_2[63][256];
|
static DWORD Col2RGB8_2[63][256];
|
||||||
|
|
||||||
// [RH] The framebuffer is no longer a mere byte array.
|
// [RH] The framebuffer is no longer a mere byte array.
|
||||||
|
@ -709,6 +711,11 @@ static void BuildTransTable (const PalEntry *palette)
|
||||||
for (g = 0; g < 32; g++)
|
for (g = 0; g < 32; g++)
|
||||||
for (b = 0; b < 32; b++)
|
for (b = 0; b < 32; b++)
|
||||||
RGB32k.RGB[r][g][b] = ColorMatcher.Pick ((r<<3)|(r>>2), (g<<3)|(g>>2), (b<<3)|(b>>2));
|
RGB32k.RGB[r][g][b] = ColorMatcher.Pick ((r<<3)|(r>>2), (g<<3)|(g>>2), (b<<3)|(b>>2));
|
||||||
|
// create the RGB666 lookup table
|
||||||
|
for (r = 0; r < 64; r++)
|
||||||
|
for (g = 0; g < 64; g++)
|
||||||
|
for (b = 0; b < 64; b++)
|
||||||
|
RGB256k.RGB[r][g][b] = ColorMatcher.Pick ((r<<2)|(r>>4), (g<<2)|(g>>4), (b<<2)|(b>>4));
|
||||||
|
|
||||||
int x, y;
|
int x, y;
|
||||||
|
|
||||||
|
|
|
@ -465,6 +465,14 @@ union ColorTable32k
|
||||||
};
|
};
|
||||||
extern "C" ColorTable32k RGB32k;
|
extern "C" ColorTable32k RGB32k;
|
||||||
|
|
||||||
|
// [SP] RGB666 support
|
||||||
|
union ColorTable256k
|
||||||
|
{
|
||||||
|
BYTE RGB[64][64][64];
|
||||||
|
BYTE All[64 *64 *64];
|
||||||
|
};
|
||||||
|
extern "C" ColorTable256k RGB256k;
|
||||||
|
|
||||||
// Col2RGB8 is a pre-multiplied palette for color lookup. It is stored in a
|
// Col2RGB8 is a pre-multiplied palette for color lookup. It is stored in a
|
||||||
// special R10B10G10 format for efficient blending computation.
|
// special R10B10G10 format for efficient blending computation.
|
||||||
// --RRRRRrrr--BBBBBbbb--GGGGGggg-- at level 64
|
// --RRRRRrrr--BBBBBbbb--GGGGGggg-- at level 64
|
||||||
|
|
|
@ -454,6 +454,49 @@ D7F6E9F08C39A17026349A04F8C0B0BE // Return to Hadron, e1m9
|
||||||
pointonline
|
pointonline
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Remove unreachable secrets
|
||||||
|
F6EE16F770AD309D608EA0B1F1E249FC // Ultimate Doom, e4m3
|
||||||
|
{
|
||||||
|
setsectorspecial 124 0
|
||||||
|
setsectorspecial 125 0
|
||||||
|
// clear staircase to secret area
|
||||||
|
setsectorspecial 127 0
|
||||||
|
setsectorspecial 128 0
|
||||||
|
setsectorspecial 129 0
|
||||||
|
setsectorspecial 130 0
|
||||||
|
setsectorspecial 131 0
|
||||||
|
setsectorspecial 132 0
|
||||||
|
setsectorspecial 133 0
|
||||||
|
setsectorspecial 134 0
|
||||||
|
setsectorspecial 136 0
|
||||||
|
setsectorspecial 137 0
|
||||||
|
setsectorspecial 138 0
|
||||||
|
setsectorspecial 147 0
|
||||||
|
setsectorspecial 148 0
|
||||||
|
setsectorspecial 149 0
|
||||||
|
setsectorspecial 150 0
|
||||||
|
setsectorspecial 151 0
|
||||||
|
setsectorspecial 152 0
|
||||||
|
setsectorspecial 155 0
|
||||||
|
}
|
||||||
|
94D4C869A0C02EF4F7375022B36AAE45 // Ultimate Doom, e4m7
|
||||||
|
{
|
||||||
|
setsectorspecial 263 0
|
||||||
|
setsectorspecial 264 0
|
||||||
|
}
|
||||||
|
1A540BA717BF9EC85F8522594C352F2A // Doom II, map15
|
||||||
|
{
|
||||||
|
setsectorspecial 147 0
|
||||||
|
}
|
||||||
|
110F84DE041052B59307FAF0293E6BC0 // Doom II, map27
|
||||||
|
{
|
||||||
|
setsectorspecial 93 0
|
||||||
|
}
|
||||||
|
ABC4EB5A1535ECCD0061AD14F3547908 // Plutonia Experiment, map26
|
||||||
|
{
|
||||||
|
setsectorspecial 156 0
|
||||||
|
}
|
||||||
|
|
||||||
712BB4CFBD0753178CA0C6814BE4C288 // map12 BTSX_E1 - patch some rendering glitches that are problematic to detect
|
712BB4CFBD0753178CA0C6814BE4C288 // map12 BTSX_E1 - patch some rendering glitches that are problematic to detect
|
||||||
{
|
{
|
||||||
setsectortag 545 32000
|
setsectortag 545 32000
|
||||||
|
|
Loading…
Reference in a new issue