From 669ce7327229074912c186dab0ae07b7aaa922bf Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 7 Nov 2010 15:30:41 +0000 Subject: [PATCH] - made the alpha used by stacked sectors part of the visplane. This will be needed to fix the merging of stacks with the same displacement but different alpha values. SVN r2990 (trunk) --- src/r_plane.cpp | 24 ++++++++---------------- src/r_plane.h | 1 + 2 files changed, 9 insertions(+), 16 deletions(-) diff --git a/src/r_plane.cpp b/src/r_plane.cpp index cd0b9f4a5e..8fd055053b 100644 --- a/src/r_plane.cpp +++ b/src/r_plane.cpp @@ -1034,26 +1034,19 @@ void R_DrawSinglePlane (visplane_t *pl, fixed_t alpha, bool masked) CVAR (Bool, r_skyboxes, true, 0) static int numskyboxes; -struct VisplaneAndAlpha -{ - visplane_t *Visplane; - fixed_t Alpha; -}; - void R_DrawSkyBoxes () { static TArray interestingStack; static TArray drawsegStack; static TArray visspriteStack; static TArray viewxStack, viewyStack, viewzStack; - static TArray visplaneStack; + static TArray visplaneStack; numskyboxes = 0; if (visplanes[MAXVISPLANES] == NULL) return; - VisplaneAndAlpha vaAdder = { 0 }; int savedextralight = extralight; fixed_t savedx = viewx; fixed_t savedy = viewy; @@ -1169,9 +1162,8 @@ void R_DrawSkyBoxes () viewxStack.Push (viewx); viewyStack.Push (viewy); viewzStack.Push (viewz); - vaAdder.Visplane = pl; - vaAdder.Alpha = sky->PlaneAlpha; - visplaneStack.Push (vaAdder); + pl->alpha = sky->PlaneAlpha; + visplaneStack.Push (pl); R_RenderBSPNode (nodes + numnodes - 1); R_DrawPlanes (); @@ -1200,13 +1192,13 @@ void R_DrawSkyBoxes () ds_p = firstdrawseg; vissprite_p = firstvissprite; - visplaneStack.Pop (vaAdder); - if (vaAdder.Alpha > 0) + visplaneStack.Pop (pl); + if (pl->alpha > 0) { - R_DrawSinglePlane (vaAdder.Visplane, vaAdder.Alpha, true); + R_DrawSinglePlane (pl, pl->alpha, true); } - *freehead = vaAdder.Visplane; - freehead = &vaAdder.Visplane->next; + *freehead = pl; + freehead = &pl->next; } firstvissprite = vissprites; vissprite_p = vissprites + savedvissprite_p; diff --git a/src/r_plane.h b/src/r_plane.h index 369083badb..6dfd1e00d9 100644 --- a/src/r_plane.h +++ b/src/r_plane.h @@ -54,6 +54,7 @@ struct visplane_s float visibility; fixed_t viewx, viewy, viewz; angle_t viewangle; + fixed_t alpha; unsigned short *bottom; // [RH] bottom and top arrays are dynamically unsigned short pad; // allocated immediately after the