- Replaced WALLF_AUTOCONTRAST with WALLF_NOFAKECONTRAST so that the

default setting for the flags is 0.
- Added: doom2day's smoothlighting
- Added: dontincrement argument to A_CheckForReload.


SVN r1179 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-21 08:04:21 +00:00
parent f64862fe75
commit 76cb09d546
12 changed files with 64 additions and 27 deletions

View file

@ -1,4 +1,8 @@
August 21, 2008 (Changes by Graf Zahl)
- Replaced WALLF_AUTOCONTRAST with WALLF_NOFAKECONTRAST so that the
default setting for the flags is 0.
- Added: doom2day's smoothlighting
- Added: dontincrement argument to A_CheckForReload.
- Fixed: The UDMF parser wrote class filter bits into SkillFilter.
- Fixed: (SBARINFO patch) DrawInventoryBar has a missing argument in
one of its drawgraphic calls.

View file

@ -278,6 +278,7 @@ static const char *MapInfoMapLevel[] =
"lightning",
"fadetable",
"evenlighting",
"smoothlighting",
"noautosequences",
"forcenoskystretch",
"allowfreelook",
@ -429,6 +430,7 @@ MapHandlers[] =
{ MITYPE_SETFLAG, LEVEL_STARTLIGHTNING, 0 },
{ MITYPE_LUMPNAME, lioffset(fadetable), 0 },
{ MITYPE_CLRBYTES, lioffset(WallVertLight), lioffset(WallHorizLight) },
{ MITYPE_SETFLAG, LEVEL_SMOOTHLIGHTING, 0 },
{ MITYPE_SETFLAG, LEVEL_SNDSEQTOTALCTRL, 0 },
{ MITYPE_SETFLAG, LEVEL_FORCENOSKYSTRETCH, 0 },
{ MITYPE_SCFLAGS, LEVEL_FREELOOK_YES, ~LEVEL_FREELOOK_NO },

View file

@ -122,6 +122,8 @@
#define LEVEL_DUMMYSWITCHES UCONST64(0x40000000000000)
#define LEVEL_HEXENHACK UCONST64(0x80000000000000) // Level was defined in a Hexen style MAPINFO
#define LEVEL_SMOOTHLIGHTING UCONST64(0x100000000000000) // Level uses the smooth lighting feature.
struct acsdefered_s;

View file

@ -405,5 +405,6 @@ xx(offsety_bottom)
xx(light)
xx(lightabsolute)
xx(nofakecontrast)
xx(smoothlighting)
xx(Renderstyle)

View file

@ -2177,7 +2177,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;
sd->Flags = 0;
// killough 4/4/98: allow sidedef texture names to be overloaded
// killough 4/11/98: refined to allow colormaps to work as wall

View file

@ -765,20 +765,18 @@ DWallLightTransfer::DWallLightTransfer (sector_t *srcSec, int target, BYTE flags
Flags = flags;
DoTransfer (LastLight = srcSec->lightlevel, target, Flags);
if (!(flags&WLF_NOFAKECONTRAST)) wallflags = WALLF_AUTOCONTRAST|WALLF_ABSLIGHTING;
else wallflags = WALLF_ABSLIGHTING;
if (!(flags&WLF_NOFAKECONTRAST)) wallflags = WALLF_ABSLIGHTING;
else wallflags = WALLF_NOFAKECONTRAST|WALLF_ABSLIGHTING;
for (linenum = -1; (linenum = P_FindLineFromID (target, linenum)) >= 0; )
{
if (flags & WLF_SIDE1 && lines[linenum].sidenum[0]!=NO_SIDE)
{
sides[lines[linenum].sidenum[0]].Flags &= ~WALLF_AUTOCONTRAST;
sides[lines[linenum].sidenum[0]].Flags |= wallflags;
}
if (flags & WLF_SIDE2 && lines[linenum].sidenum[1]!=NO_SIDE)
{
sides[lines[linenum].sidenum[0]].Flags &= ~WALLF_AUTOCONTRAST;
sides[lines[linenum].sidenum[1]].Flags |= wallflags;
}
}

View file

@ -738,8 +738,13 @@ struct UDMFParser
break;
case NAME_nofakecontrast:
if (CheckBool(key)) sd->Flags&=~WALLF_AUTOCONTRAST;
else sd->Flags|=WALLF_AUTOCONTRAST;
if (CheckBool(key)) sd->Flags |= WALLF_NOFAKECONTRAST;
else sd->Flags &= WALLF_NOFAKECONTRAST;
break;
case NAME_smoothlighting:
if (CheckBool(key)) sd->Flags |= WALLF_SMOOTHLIGHTING;
else sd->Flags &= ~WALLF_SMOOTHLIGHTING;
break;
default:

View file

@ -622,7 +622,8 @@ enum
{
WALLF_ABSLIGHTING = 1, // Light is absolute instead of relative
WALLF_NOAUTODECALS = 2, // Do not attach impact decals to this wall
WALLF_AUTOCONTRAST = 4, // Automatically handle fake contrast in side_t::GetLightLevel
WALLF_NOFAKECONTRAST = 4, // Don't do fake contrast for this wall in side_t::GetLightLevel
WALLF_SMOOTHLIGHTING = 8, // Similar to autocontrast but applies to all angles.
};
struct side_t

View file

@ -1421,6 +1421,8 @@ void R_NewWall (bool needlights)
}
}
CVAR(Bool, r_smoothlighting, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
int side_t::GetLightLevel (bool foggy, int baselight) const
{
if (Flags & WALLF_ABSLIGHTING)
@ -1431,11 +1433,23 @@ int side_t::GetLightLevel (bool foggy, int baselight) const
if (!foggy) // Don't do relative lighting in foggy sectors
{
if (Flags & WALLF_AUTOCONTRAST)
if (!(Flags & WALLF_NOFAKECONTRAST))
{
if((level.flags & LEVEL_SMOOTHLIGHTING) || (Flags & WALLF_SMOOTHLIGHTING) || r_smoothlighting)
{
baselight += int // OMG LEE KILLOUGH LIVES! :/
(
(float(level.WallHorizLight)
+abs(atan(float(linedef->dy)/float(linedef->dx))/float(1.57079))
*float(level.WallVertLight - level.WallHorizLight))
);
}
else
{
baselight += lines[linenum].dx==0? level.WallVertLight :
lines[linenum].dy==0? level.WallHorizLight : 0;
}
}
if (!(Flags & WALLF_ABSLIGHTING))
{
baselight += this->Light;

View file

@ -2192,13 +2192,20 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckForReload)
ACTION_PARAM_START(2);
ACTION_PARAM_INT(count, 0);
ACTION_PARAM_STATE(jump, 1);
ACTION_PARAM_BOOL(dontincrement, 2)
if (count <= 0) return;
AWeapon *weapon = self->player->ReadyWeapon;
weapon->ReloadCounter = (weapon->ReloadCounter+1) % count;
int ReloadCounter = weapon->ReloadCounter;
if(!dontincrement || ReloadCounter != 0)
ReloadCounter = (weapon->ReloadCounter+1) % count;
else // 0 % 1 = 1? So how do we check if the weapon was never fired? We should only do this when we're not incrementing the counter though.
ReloadCounter = 1;
// If we have not made our last shot...
if (weapon->ReloadCounter != 0)
if (ReloadCounter != 0)
{
// Go back to the refire frames, instead of continuing on to the reload frames.
ACTION_JUMP(jump);
@ -2208,6 +2215,9 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_CheckForReload)
// We need to reload. However, don't reload if we're out of ammo.
weapon->CheckAmmo( false, false );
}
if(!dontincrement)
weapon->ReloadCounter = ReloadCounter;
}
//===========================================================================

View file

@ -75,7 +75,7 @@
// SAVESIG should match SAVEVER.
// MINSAVEVER is the minimum level snapshot version that can be loaded.
#define MINSAVEVER 1129
#define MINSAVEVER 1179
#if SVN_REVISION_NUMBER < MINSAVEVER
// Never write a savegame with a version lower than what we need

View file

@ -38,7 +38,7 @@ ACTOR Inventory native
action native A_CheckReload();
action native A_GunFlash();
action native A_Saw(sound fullsound = "weapons/sawfull", sound hitsound = "weapons/sawhit", int damage = 2, class<Actor> pufftype = "BulletPuff");
action native A_CheckForReload(int counter, state label);
action native A_CheckForReload(int counter, state label, bool dontincrement = false);
action native A_ResetReloadCounter();
action native A_RestoreSpecialPosition();
action native A_RestoreSpecialDoomThing();