- Fixed: side_t::GetLightLevel relied on the global 'linedef' variable for

automatic fake contrast.
- Changed: Fake contrast now uses the WALLF_AUTOCONTRAST globally instead
  of manipulating the sides' light values individually. This allows changing
  the fake contrast at run time and also allows adding individual relative
  lighting on top of it which is a planned UDMF feature.


SVN r991 (trunk)
This commit is contained in:
Christoph Oelckers 2008-05-23 07:54:09 +00:00
commit 5574aaca15
6 changed files with 27 additions and 29 deletions

View file

@ -1601,7 +1601,6 @@ void P_FinishLoadingLineDef(line_t *ld, int alpha)
ld->backsector = ld->sidenum[1]!=NO_SIDE ? sides[ld->sidenum[1]].sector : 0;
float dx = FIXED2FLOAT(ld->v2->x - ld->v1->x);
float dy = FIXED2FLOAT(ld->v2->y - ld->v1->y);
SBYTE light;
int linenum = ld-lines;
if (ld->frontsector == NULL)
@ -1611,20 +1610,16 @@ void P_FinishLoadingLineDef(line_t *ld, int alpha)
// [RH] Set some new sidedef properties
int len = (int)(sqrtf (dx*dx + dy*dy) + 0.5f);
light = dy == 0 ? level.WallHorizLight :
dx == 0 ? level.WallVertLight : 0;
if (ld->sidenum[0] != NO_SIDE)
{
sides[ld->sidenum[0]].linenum = linenum;
sides[ld->sidenum[0]].TexelLength = len;
sides[ld->sidenum[0]].Light = light;
}
if (ld->sidenum[1] != NO_SIDE)
{
sides[ld->sidenum[1]].linenum = linenum;
sides[ld->sidenum[1]].TexelLength = len;
sides[ld->sidenum[1]].Light = light;
}
switch (ld->special)
@ -2171,6 +2166,7 @@ void P_LoadSideDefs2 (MapData * map)
sd->SetTextureXOffset(LittleShort(msd->textureoffset)<<FRACBITS);
sd->SetTextureYOffset(LittleShort(msd->rowoffset)<<FRACBITS);
sd->linenum = NO_INDEX;
sd->Flags = WALLF_AUTOCONTRAST;
// killough 4/4/98: allow sidedef texture names to be overloaded
// killough 4/11/98: refined to allow colormaps to work as wall