mirror of
https://github.com/ZDoom/gzdoom-last-svn.git
synced 2025-06-03 18:51:22 +00:00
- Update to ZDoom r3224:
Emulate the size limit of Doom's lightscale table by capping the value of vis passed to GETPALOOKUP. The end result is that there is a minimum distance around you where light amplification stops and it gets no brighter. Should this scale with visibility? I can't say. So, yeah, it turns out all these years ago, I made this out to be harder than it really is. Fixed: Light levels outside the range [0,255] really do matter. Added FDARI's latest actor pointer submission. Added kgsws's 3D floor textute rotation fix. Added DavidPH's damage type specific damage color submission. Added DavidPH's A_PainAttack extension submission. Fixed: Telefrag damage should not be affected by skill damage factors. Added A_GunFlash extension submission. Added DONTCORPSE submission. Added SEEINVISIBLE submission. Added submission for disabling some new and rather pointless GCC warnings. Fixed: Selecting TiMidity++ as a MIDI device without a working timidity.exe, then switching to a different MIDI device would leave music silent until a new song was started. (The discrepancy between mus_playing.handle and currSong is one which should probably be handled properly at some point.) Fixed: Typo in FClipRect::Intersect() could case bad clipping. git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@1216 b0f79afe-0144-0410-b225-9a4edf0717df
This commit is contained in:
parent
e150d13413
commit
dbd6c3d6b5
49 changed files with 740 additions and 332 deletions
120
src/r_plane.cpp
120
src/r_plane.cpp
|
@ -251,64 +251,88 @@ void STACK_ARGS R_CalcTiltedLighting (fixed_t lval, fixed_t lend, int width)
|
|||
BYTE *basecolormapdata = basecolormap->Maps;
|
||||
int i = 0;
|
||||
|
||||
lval = planeshade - lval;
|
||||
lend = planeshade - lend;
|
||||
|
||||
if (width == 0 || lval == lend)
|
||||
{ // Constant lighting
|
||||
lightfiller = basecolormapdata + (GETPALOOKUP (-lval, 0) << COLORMAPSHIFT);
|
||||
}
|
||||
else if ((lstep = (lend - lval) / width) < 0)
|
||||
{ // Going from dark to light
|
||||
if (lval < FRACUNIT)
|
||||
{ // All bright
|
||||
lightfiller = basecolormapdata;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lval >= NUMCOLORMAPS*FRACUNIT)
|
||||
{ // Starts beyond the dark end
|
||||
BYTE *clight = basecolormapdata + ((NUMCOLORMAPS-1) << COLORMAPSHIFT);
|
||||
while (lval >= NUMCOLORMAPS*FRACUNIT && i <= width)
|
||||
{
|
||||
tiltlighting[i++] = clight;
|
||||
lval += lstep;
|
||||
}
|
||||
if (i > width)
|
||||
return;
|
||||
}
|
||||
while (i <= width && lval >= 0)
|
||||
{
|
||||
tiltlighting[i++] = basecolormapdata + ((lval >> FRACBITS) << COLORMAPSHIFT);
|
||||
lval += lstep;
|
||||
}
|
||||
lightfiller = basecolormapdata;
|
||||
}
|
||||
lightfiller = basecolormapdata + (GETPALOOKUP(lval, planeshade) << COLORMAPSHIFT);
|
||||
}
|
||||
else
|
||||
{ // Going from light to dark
|
||||
if (lval >= (NUMCOLORMAPS-1)*FRACUNIT)
|
||||
{ // All dark
|
||||
lightfiller = basecolormapdata + ((NUMCOLORMAPS-1) << COLORMAPSHIFT);
|
||||
{
|
||||
lstep = (lend - lval) / width;
|
||||
if (lval >= MAXLIGHTVIS)
|
||||
{ // lval starts "too bright".
|
||||
lightfiller = basecolormapdata + (GETPALOOKUP(lval, planeshade) << COLORMAPSHIFT);
|
||||
for (; i <= width && lval >= MAXLIGHTVIS; ++i)
|
||||
{
|
||||
tiltlighting[i] = lightfiller;
|
||||
lval += lstep;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (lend >= MAXLIGHTVIS)
|
||||
{ // lend ends "too bright".
|
||||
lightfiller = basecolormapdata + (GETPALOOKUP(lend, planeshade) << COLORMAPSHIFT);
|
||||
for (; width > i && lend >= MAXLIGHTVIS; --width)
|
||||
{
|
||||
tiltlighting[width] = lightfiller;
|
||||
lend -= lstep;
|
||||
}
|
||||
}
|
||||
if (width > 0)
|
||||
{
|
||||
while (lval < 0 && i <= width)
|
||||
{
|
||||
tiltlighting[i++] = basecolormapdata;
|
||||
lval += lstep;
|
||||
lval = planeshade - lval;
|
||||
lend = planeshade - lend;
|
||||
lstep = (lend - lval) / width;
|
||||
if (lstep < 0)
|
||||
{ // Going from dark to light
|
||||
if (lval < FRACUNIT)
|
||||
{ // All bright
|
||||
lightfiller = basecolormapdata;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (lval >= NUMCOLORMAPS*FRACUNIT)
|
||||
{ // Starts beyond the dark end
|
||||
BYTE *clight = basecolormapdata + ((NUMCOLORMAPS-1) << COLORMAPSHIFT);
|
||||
while (lval >= NUMCOLORMAPS*FRACUNIT && i <= width)
|
||||
{
|
||||
tiltlighting[i++] = clight;
|
||||
lval += lstep;
|
||||
}
|
||||
if (i > width)
|
||||
return;
|
||||
}
|
||||
while (i <= width && lval >= 0)
|
||||
{
|
||||
tiltlighting[i++] = basecolormapdata + ((lval >> FRACBITS) << COLORMAPSHIFT);
|
||||
lval += lstep;
|
||||
}
|
||||
lightfiller = basecolormapdata;
|
||||
}
|
||||
}
|
||||
if (i > width)
|
||||
return;
|
||||
while (i <= width && lval < (NUMCOLORMAPS-1)*FRACUNIT)
|
||||
{
|
||||
tiltlighting[i++] = basecolormapdata + ((lval >> FRACBITS) << COLORMAPSHIFT);
|
||||
lval += lstep;
|
||||
else
|
||||
{ // Going from light to dark
|
||||
if (lval >= (NUMCOLORMAPS-1)*FRACUNIT)
|
||||
{ // All dark
|
||||
lightfiller = basecolormapdata + ((NUMCOLORMAPS-1) << COLORMAPSHIFT);
|
||||
}
|
||||
else
|
||||
{
|
||||
while (lval < 0 && i <= width)
|
||||
{
|
||||
tiltlighting[i++] = basecolormapdata;
|
||||
lval += lstep;
|
||||
}
|
||||
if (i > width)
|
||||
return;
|
||||
while (i <= width && lval < (NUMCOLORMAPS-1)*FRACUNIT)
|
||||
{
|
||||
tiltlighting[i++] = basecolormapdata + ((lval >> FRACBITS) << COLORMAPSHIFT);
|
||||
lval += lstep;
|
||||
}
|
||||
lightfiller = basecolormapdata + ((NUMCOLORMAPS-1) << COLORMAPSHIFT);
|
||||
}
|
||||
}
|
||||
lightfiller = basecolormapdata + ((NUMCOLORMAPS-1) << COLORMAPSHIFT);
|
||||
}
|
||||
}
|
||||
|
||||
for (; i <= width; i++)
|
||||
{
|
||||
tiltlighting[i] = lightfiller;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue