From 92783750647a5149473b33837ab35af472848ac5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 Nov 2010 22:12:38 +0000 Subject: [PATCH] - added 'flooralpha' and 'ceilingalpha' sector properties. They only have meaning if a sector stack portal is defined in this sector. If set to anything less than 1.0 these will override the alpha set by a portal. This is mostly for Sector_SetPortal to avoid defining multiple portals that only differ by their plane translucency. SVN r2995 (trunk) --- specs/udmf_zdoom.txt | 2 ++ src/namedef.h | 2 ++ src/p_spec.cpp | 6 ++++-- src/p_udmf.cpp | 10 ++++++++++ 4 files changed, 18 insertions(+), 2 deletions(-) diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index fef3fa996..1a4dbeffa 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -153,6 +153,8 @@ Note: All fields default to false unless mentioned otherwise. // relative to the owning sector's light level. lightceilingabsolute = ; // true = 'lightceiling' is an absolute value. Default is // relative to the owning sector's light level. + alphafloor = ; // translucency of floor plane (only has meaning with Sector_SetPortal) Default is 1.0. + alphaceiling = ; // translucency of ceiling plane (only has meaning with Sector_SetPortal) Default is 1.0. gravity = ; // Sector's gravity. Default is 1.0. lightcolor = ; // Sector'S light color as RRGGBB value, default = 0xffffff. fadecolor = ; // Sector'S fog color as RRGGBB value, default = 0x000000. diff --git a/src/namedef.h b/src/namedef.h index 4a00c99c9..684d447f6 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -419,6 +419,8 @@ xx(Silent) xx(Nofallingdamage) xx(Dropactors) xx(NoRespawn) +xx(Alphafloor) +xx(Alphaceiling) xx(offsetx_top) xx(offsety_top) diff --git a/src/p_spec.cpp b/src/p_spec.cpp index 79242f52c..631662641 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -870,7 +870,8 @@ static void SetupFloorPortal (AStackPoint *point) if (Sector->FloorSkyBox != NULL) { Sector->FloorSkyBox->Mate = point; - Sector->SetAlpha(sector_t::floor, Scale (point->args[0], OPAQUE, 255)); + if (Sector->GetAlpha(sector_t::floor) == OPAQUE) + Sector->SetAlpha(sector_t::floor, Scale (point->args[0], OPAQUE, 255)); } } @@ -882,7 +883,8 @@ static void SetupCeilingPortal (AStackPoint *point) if (Sector->CeilingSkyBox != NULL) { Sector->CeilingSkyBox->Mate = point; - Sector->SetAlpha(sector_t::ceiling, Scale (point->args[0], OPAQUE, 255)); + if (Sector->GetAlpha(sector_t::ceiling) == OPAQUE) + Sector->SetAlpha(sector_t::ceiling, Scale (point->args[0], OPAQUE, 255)); } } diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 8ae9403b2..0fba825b0 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -1074,6 +1074,8 @@ public: sec->SetYScale(sector_t::floor, FRACUNIT); sec->SetXScale(sector_t::ceiling, FRACUNIT); sec->SetYScale(sector_t::ceiling, FRACUNIT); + sec->SetAlpha(sector_t::floor, FRACUNIT); + sec->SetAlpha(sector_t::ceiling, FRACUNIT); sec->thinglist = NULL; sec->touching_thinglist = NULL; // phares 3/14/98 sec->seqType = (level.flags & LEVEL_SNDSEQTOTALCTRL) ? 0 : -1; @@ -1185,6 +1187,14 @@ public: sec->SetPlaneLight(sector_t::ceiling, CheckInt(key)); continue; + case NAME_Alphafloor: + sec->SetAlpha(sector_t::floor, CheckFixed(key)); + continue; + + case NAME_Alphaceiling: + sec->SetAlpha(sector_t::ceiling, CheckFixed(key)); + continue; + case NAME_Lightfloorabsolute: if (CheckBool(key)) sec->ChangeFlags(sector_t::floor, 0, PLANEF_ABSLIGHTING); else sec->ChangeFlags(sector_t::floor, PLANEF_ABSLIGHTING, 0);