From ef133dc68270b77f9fd9b611ec794fab991780fb Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 Nov 2010 17:05:21 +0000 Subject: [PATCH] - changed skybox code to use the alpha from the sector plane. - removed alpha from skybox viewpoints. SVN r2993 (trunk) --- src/g_shared/a_sharedglobal.h | 1 - src/g_shared/a_skies.cpp | 7 ++++++- src/p_spec.cpp | 5 +++-- src/r_plane.cpp | 3 ++- src/r_segs.cpp | 2 ++ 5 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/g_shared/a_sharedglobal.h b/src/g_shared/a_sharedglobal.h index c152bf44d1..849321451b 100644 --- a/src/g_shared/a_sharedglobal.h +++ b/src/g_shared/a_sharedglobal.h @@ -97,7 +97,6 @@ public: bool bInSkybox; bool bAlways; TObjPtr Mate; - fixed_t PlaneAlpha; }; class AStackPoint : public ASkyViewpoint diff --git a/src/g_shared/a_skies.cpp b/src/g_shared/a_skies.cpp index 0454498e29..21edd2ba1a 100644 --- a/src/g_shared/a_skies.cpp +++ b/src/g_shared/a_skies.cpp @@ -69,7 +69,12 @@ void ASkyViewpoint::BeginPlay () void ASkyViewpoint::Serialize (FArchive &arc) { Super::Serialize (arc); - arc << bInSkybox << bAlways << Mate << PlaneAlpha; + arc << bInSkybox << bAlways << Mate; + if (SaveVersion < 2992) + { + fixed_t eatme; + arc << eatme; + } } void ASkyViewpoint::Destroy () diff --git a/src/p_spec.cpp b/src/p_spec.cpp index d48ef90d65..79242f52cd 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -870,7 +870,7 @@ static void SetupFloorPortal (AStackPoint *point) if (Sector->FloorSkyBox != NULL) { Sector->FloorSkyBox->Mate = point; - Sector->FloorSkyBox->PlaneAlpha = Scale (point->args[0], OPAQUE, 255); + Sector->SetAlpha(sector_t::floor, Scale (point->args[0], OPAQUE, 255)); } } @@ -882,7 +882,7 @@ static void SetupCeilingPortal (AStackPoint *point) if (Sector->CeilingSkyBox != NULL) { Sector->CeilingSkyBox->Mate = point; - Sector->CeilingSkyBox->PlaneAlpha = Scale (point->args[0], OPAQUE, 255); + Sector->SetAlpha(sector_t::ceiling, Scale (point->args[0], OPAQUE, 255)); } } @@ -919,6 +919,7 @@ void P_SetupPortals() fixed_t deltay1 = points[i]->Mate->y - points[i]->y; fixed_t deltax2 = points[j]->Mate->x - points[j]->x; fixed_t deltay2 = points[j]->Mate->y - points[j]->y; + if (deltax1 == deltax2 && deltay1 == deltay2) { if (points[j]->Sector->FloorSkyBox == points[j]->Mate) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index a5a40bc12a..abf813fd75 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -561,6 +561,7 @@ visplane_t *R_FindPlane (const secplane_t &height, FTextureID picnum, int lightl plane = height; isskybox = false; sky = 0; // not skyflatnum so it can't be a sky + skybox = NULL; alpha = FRACUNIT; } @@ -728,6 +729,7 @@ visplane_t *R_CheckPlane (visplane_t *pl, int start, int stop) new_pl->viewz = pl->viewz; new_pl->viewangle = pl->viewangle; new_pl->sky = pl->sky; + new_pl->alpha = pl->alpha; pl = new_pl; pl->minx = start; pl->maxx = stop; @@ -1178,7 +1180,6 @@ void R_DrawSkyBoxes () viewxStack.Push (viewx); viewyStack.Push (viewy); viewzStack.Push (viewz); - pl->alpha = sky->PlaneAlpha; visplaneStack.Push (pl); R_RenderBSPNode (nodes + numnodes - 1); diff --git a/src/r_segs.cpp b/src/r_segs.cpp index eed5d78a83..55f80649ef 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -1295,6 +1295,7 @@ void R_NewWall (bool needlights) // killough 3/7/98: Add checks for (x,y) offsets || backsector->GetXOffset(sector_t::floor) != frontsector->GetXOffset(sector_t::floor) || backsector->GetYOffset(sector_t::floor) != frontsector->GetYOffset(sector_t::floor) + || backsector->GetAlpha(sector_t::floor) != frontsector->GetAlpha(sector_t::floor) // killough 4/15/98: prevent 2s normals // from bleeding through deep water @@ -1326,6 +1327,7 @@ void R_NewWall (bool needlights) // killough 3/7/98: Add checks for (x,y) offsets || backsector->GetXOffset(sector_t::ceiling) != frontsector->GetXOffset(sector_t::ceiling) || backsector->GetYOffset(sector_t::ceiling) != frontsector->GetYOffset(sector_t::ceiling) + || backsector->GetAlpha(sector_t::ceiling) != frontsector->GetAlpha(sector_t::ceiling) // killough 4/15/98: prevent 2s normals // from bleeding through fake ceilings