diff --git a/gzdoom.vcproj b/gzdoom.vcproj index ad30cee5..005384d8 100644 --- a/gzdoom.vcproj +++ b/gzdoom.vcproj @@ -6611,42 +6611,6 @@ /> - - - - - - - - - - - - - - diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 9d7bb3ca..bdd70322 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -141,6 +141,9 @@ Note: All fields default to false unless mentioned otherwise. light = ; // This side's light level. Default is 0. lightabsolute = ; // true = 'light' is an absolute value. Default is // relative to the owning sector's light level. + lightfog = ; // true = This side's relative lighting is used even in + // foggy sectors. Default is to disable relative + // lighting in foggy sectors. nofakecontrast = ; // Disables use of fake contrast on this sidedef. smoothlighting = ; // Use smooth fake contrast. clipmidtex = ; // Side's mid textures are clipped to floor and ceiling. diff --git a/src/g_game.cpp b/src/g_game.cpp index 74189ead..d96e37fc 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -161,7 +161,7 @@ int consoleplayer; // player taking events int gametic; CVAR(Bool, demo_compress, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG); -char demoname[256]; +FString demoname; bool demorecording; bool demoplayback; bool netdemo; @@ -2271,7 +2271,7 @@ void G_WriteDemoTiccmd (ticcmd_t *cmd, int player, int buf) void G_RecordDemo (const char* name) { usergame = false; - strcpy (demoname, name); + demoname = name; FixPathSeperator (demoname); DefaultExtension (demoname, ".lmp"); maxdemosize = 0x20000; @@ -2710,11 +2710,18 @@ bool G_CheckDemoStatus (void) formlen = demobuffer + 4; WriteLong (int(demo_p - demobuffer - 8), &formlen); - M_WriteFile (demoname, demobuffer, int(demo_p - demobuffer)); + bool saved = M_WriteFile (demoname, demobuffer, int(demo_p - demobuffer)); M_Free (demobuffer); demorecording = false; stoprecording = false; - Printf ("Demo %s recorded\n", demoname); + if (saved) + { + Printf ("Demo %s recorded\n", demoname.GetChars()); + } + else + { + Printf ("Demo %s could not be saved\n", demoname.GetChars()); + } } return false; diff --git a/src/g_shared/a_action.cpp b/src/g_shared/a_action.cpp index c283b572..1149bc2c 100644 --- a/src/g_shared/a_action.cpp +++ b/src/g_shared/a_action.cpp @@ -350,7 +350,6 @@ CUSTOM_CVAR(Int, sv_corpsequeuesize, 64, CVAR_ARCHIVE|CVAR_SERVERINFO) while (first != NULL && first->Count > (DWORD)self) { DCorpsePointer *next = iterator.Next (); - next->Count = first->Count; first->Destroy (); first = next; } @@ -373,9 +372,8 @@ DCorpsePointer::DCorpsePointer (AActor *ptr) if (first->Count >= (DWORD)sv_corpsequeuesize) { DCorpsePointer *next = iterator.Next (); - next->Count = first->Count; first->Destroy (); - return; + first = next; } } ++first->Count; diff --git a/src/namedef.h b/src/namedef.h index 50fa9f29..34f9b723 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -448,6 +448,7 @@ xx(scalex_bottom) xx(scaley_bottom) xx(light) xx(lightabsolute) +xx(lightfog) xx(nofakecontrast) xx(smoothlighting) xx(blockprojectiles) diff --git a/src/p_sectors.cpp b/src/p_sectors.cpp index dd0404f2..201ca148 100644 --- a/src/p_sectors.cpp +++ b/src/p_sectors.cpp @@ -996,10 +996,10 @@ int side_t::GetLightLevel (bool foggy, int baselight, bool noabsolute, int *pfak baselight += rel; } } - if (!(Flags & WALLF_ABSLIGHTING)) - { - baselight = clamp(baselight + this->Light, 0, 255); - } + } + if (!(Flags & WALLF_ABSLIGHTING) && (!foggy || (Flags & WALLF_LIGHT_FOG))) + { + baselight = clamp(baselight + this->Light, 0, 255); } return baselight; } diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 2bc3e0be..5abe4090 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -1053,6 +1053,10 @@ public: Flag(sd->Flags, WALLF_ABSLIGHTING, key); continue; + case NAME_lightfog: + Flag(sd->Flags, WALLF_LIGHT_FOG, key); + continue; + case NAME_nofakecontrast: Flag(sd->Flags, WALLF_NOFAKECONTRAST, key); continue; diff --git a/src/r_defs.h b/src/r_defs.h index 5dad3bcb..de3fb2cd 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -815,6 +815,7 @@ enum WALLF_CLIP_MIDTEX = 16, // Like the line counterpart, but only for this side. WALLF_WRAP_MIDTEX = 32, // Like the line counterpart, but only for this side. WALLF_POLYOBJ = 64, // This wall belongs to a polyobject. + WALLF_LIGHT_FOG = 128, // This wall's Light is used even in fog. }; struct side_t diff --git a/src/r_segs.cpp b/src/r_segs.cpp index bfeab506..8c22b3e5 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -2427,7 +2427,20 @@ void R_StoreWallRange (int start, int stop) } ds_p->light = rw_light; ds_p->lightstep = rw_lightstep; - ds_p->shade = wallshade; + + // Masked midtextures should get the light level from the sector they reference, + // not from the current subsector, which is what the current wallshade value + // comes from. We make an exeption for polyobjects, however, since their "home" + // sector should be whichever one they move into. + if (curline->sidedef->Flags & WALLF_POLYOBJ) + { + ds_p->shade = wallshade; + } + else + { + ds_p->shade = LIGHT2SHADE(curline->sidedef->GetLightLevel(foggy, curline->frontsector->lightlevel) + + r_actualextralight); + } if (ds_p->bFogBoundary || ds_p->maskedtexturecol != -1) { diff --git a/src/s_advsound.cpp b/src/s_advsound.cpp index f4c343fa..5c49d69e 100644 --- a/src/s_advsound.cpp +++ b/src/s_advsound.cpp @@ -519,6 +519,7 @@ int S_AddSoundLump (const char *logicalname, int lump) newsfx.bUsed = false; newsfx.bSingular = false; newsfx.bTentative = false; + newsfx.bPlayerSilent = false; newsfx.link = sfxinfo_t::NO_LINK; newsfx.Rolloff.RolloffType = ROLLOFF_Doom; newsfx.Rolloff.MinDistance = 0; @@ -1110,10 +1111,14 @@ static void S_AddSNDINFO (int lump) case SI_PlayerSound: { // $playersound FString pclass; - int gender, refid; + int gender, refid, sfxnum; S_ParsePlayerSoundCommon (sc, pclass, gender, refid); - S_AddPlayerSound (pclass, gender, refid, sc.String); + sfxnum = S_AddPlayerSound (pclass, gender, refid, sc.String); + if (0 == stricmp(sc.String, "dsempty")) + { + S_sfx[sfxnum].bPlayerSilent = true; + } } break; @@ -1665,7 +1670,9 @@ static int S_LookupPlayerSound (int classidx, int gender, FSoundID refid) // If we're not done parsing SNDINFO yet, assume that the target sound is valid if (PlayerClassesIsSorted && (sndnum == 0 || - ((S_sfx[sndnum].lumpnum == -1 || S_sfx[sndnum].lumpnum == sfx_empty) && S_sfx[sndnum].link == sfxinfo_t::NO_LINK))) + ((S_sfx[sndnum].lumpnum == -1 || S_sfx[sndnum].lumpnum == sfx_empty) && + S_sfx[sndnum].link == sfxinfo_t::NO_LINK && + !S_sfx[sndnum].bPlayerSilent))) { // This sound is unavailable. if (ingender != 0) { // Try "male" diff --git a/src/s_sound.h b/src/s_sound.h index 8b0e4dde..2f4f6864 100644 --- a/src/s_sound.h +++ b/src/s_sound.h @@ -57,6 +57,7 @@ struct sfxinfo_t WORD bUsed:1; WORD bSingular:1; WORD bTentative:1; + WORD bPlayerSilent:1; // This player sound is intentionally silent. int LoopStart; // -1 means no specific loop defined diff --git a/src/svnrevision.h b/src/svnrevision.h index 830d21d6..14100d51 100644 --- a/src/svnrevision.h +++ b/src/svnrevision.h @@ -3,5 +3,5 @@ // This file was automatically generated by the // updaterevision tool. Do not edit by hand. -#define ZD_SVN_REVISION_STRING "3932" -#define ZD_SVN_REVISION_NUMBER 3932 +#define ZD_SVN_REVISION_STRING "3938" +#define ZD_SVN_REVISION_NUMBER 3938