diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 38db16a17..44a1b122d 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -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. @@ -58,14 +62,14 @@ August 12, 2008 (Changes by Graf Zahl) - Removed code related to internal ActorInfo definitions from dobjtype.cpp. - removed unneeded file dehackedactions.h -August 11, 2008 -- Ported asm_x86_64/tmap3.nas to AT&T syntax so it can be compiled with gas. - After finding out that gas does have directives to describe the .eh_frame - metadata, I figured that would be significantly easier and quicker than - trying to locate all the scattered docs needed to construct it by hand. - Unfortunately, this now means I have to maintain two versions of exactly - the same code. :( - +August 11, 2008 +- Ported asm_x86_64/tmap3.nas to AT&T syntax so it can be compiled with gas. + After finding out that gas does have directives to describe the .eh_frame + metadata, I figured that would be significantly easier and quicker than + trying to locate all the scattered docs needed to construct it by hand. + Unfortunately, this now means I have to maintain two versions of exactly + the same code. :( + August 11, 2008 (Changes by Graf Zahl) - Removed 'eval' modifier from DECORATE. All int, float and bool parameters are 'eval' now by default. diff --git a/src/g_level.cpp b/src/g_level.cpp index 475c63d61..5c75c5891 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -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 }, diff --git a/src/g_level.h b/src/g_level.h index bfa4c8a20..28486df6c 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -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; diff --git a/src/namedef.h b/src/namedef.h index c8b21280b..3be9657c7 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -405,5 +405,6 @@ xx(offsety_bottom) xx(light) xx(lightabsolute) xx(nofakecontrast) +xx(smoothlighting) xx(Renderstyle) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 0800e8f04..10f0da490 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -2177,7 +2177,7 @@ void P_LoadSideDefs2 (MapData * map) sd->SetTextureXOffset(LittleShort(msd->textureoffset)<SetTextureYOffset(LittleShort(msd->rowoffset)<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 diff --git a/src/p_spec.cpp b/src/p_spec.cpp index a168edb2d..316174d26 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -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; } } diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 61271f3af..407fdedb5 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -733,13 +733,18 @@ struct UDMFParser break; case NAME_lightabsolute: - if (CheckBool(key)) sd->Flags|=WALLF_ABSLIGHTING; - else sd->Flags&=~WALLF_ABSLIGHTING; + if (CheckBool(key)) sd->Flags |= WALLF_ABSLIGHTING; + else sd->Flags &= ~WALLF_ABSLIGHTING; 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: diff --git a/src/r_defs.h b/src/r_defs.h index 3466574ab..bcd852bd1 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -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 diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 28e376c7d..a7ffe4515 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -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,10 +1433,22 @@ 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)) { - baselight += lines[linenum].dx==0? level.WallVertLight : - lines[linenum].dy==0? level.WallHorizLight : 0; + 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)) { diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 76be23ca9..cf19c5902 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -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; } //=========================================================================== diff --git a/src/version.h b/src/version.h index 1f19ca811..013688fcc 100644 --- a/src/version.h +++ b/src/version.h @@ -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 diff --git a/wadsrc/static/actors/shared/inventory.txt b/wadsrc/static/actors/shared/inventory.txt index fcbafbaca..129eac58d 100644 --- a/wadsrc/static/actors/shared/inventory.txt +++ b/wadsrc/static/actors/shared/inventory.txt @@ -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 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();