From 0884a09b3870aee7c3237e1a1dac2fc380eac64c Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 31 Dec 2016 14:00:12 +0100 Subject: [PATCH] Move floorclip, ceilingclip, floorplane and ceilingplane closer to their location --- src/swrenderer/scene/r_3dfloors.cpp | 1 + src/swrenderer/scene/r_plane.cpp | 10 ---------- src/swrenderer/scene/r_plane.h | 6 ------ src/swrenderer/scene/r_portal.cpp | 1 + src/swrenderer/scene/r_segs.cpp | 10 ++++++++++ src/swrenderer/scene/r_segs.h | 5 +++++ 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/swrenderer/scene/r_3dfloors.cpp b/src/swrenderer/scene/r_3dfloors.cpp index 5cb8f7a8db..f2d7f88e8b 100644 --- a/src/swrenderer/scene/r_3dfloors.cpp +++ b/src/swrenderer/scene/r_3dfloors.cpp @@ -12,6 +12,7 @@ #include "swrenderer/r_main.h" #include "r_bsp.h" #include "r_plane.h" +#include "r_segs.h" #include "c_cvars.h" #include "r_3dfloors.h" diff --git a/src/swrenderer/scene/r_plane.cpp b/src/swrenderer/scene/r_plane.cpp index cbfd85a92e..397b5efde4 100644 --- a/src/swrenderer/scene/r_plane.cpp +++ b/src/swrenderer/scene/r_plane.cpp @@ -82,8 +82,6 @@ namespace swrenderer extern subsector_t *InSubsector; -visplane_t *floorplane; -visplane_t *ceilingplane; // These are copies of the main parameters used when drawing stacked sectors. // When you change the main parameters, you should copy them here too *unless* @@ -94,14 +92,6 @@ double stacked_visibility; DVector3 stacked_viewpos; DAngle stacked_angle; -// -// Clip values are the solid pixel bounding the range. -// floorclip starts out SCREENHEIGHT and is just outside the range -// ceilingclip starts out 0 and is just inside the range -// -short floorclip[MAXWIDTH]; -short ceilingclip[MAXWIDTH]; - // // texture mapping // diff --git a/src/swrenderer/scene/r_plane.h b/src/swrenderer/scene/r_plane.h index 09f039e55d..aad67beda9 100644 --- a/src/swrenderer/scene/r_plane.h +++ b/src/swrenderer/scene/r_plane.h @@ -28,9 +28,6 @@ namespace swrenderer { -extern short floorclip[MAXWIDTH]; -extern short ceilingclip[MAXWIDTH]; - void R_ClearPlanes (bool fullclear); void R_AddPlaneLights(visplane_t *plane, FLightNode *light_head); @@ -42,9 +39,6 @@ void R_MapVisPlane (visplane_t *pl, void (*mapfunc)(int y, int x1, int x2), void visplane_t *R_FindPlane(const secplane_t &height, FTextureID picnum, int lightlevel, double alpha, bool additive, const FTransform &xform, int sky, FSectorPortal *portal); visplane_t *R_CheckPlane(visplane_t *pl, int start, int stop); -extern visplane_t* floorplane; -extern visplane_t* ceilingplane; - } #endif // __R_PLANE_H__ diff --git a/src/swrenderer/scene/r_portal.cpp b/src/swrenderer/scene/r_portal.cpp index d2897d6563..98c3d8af85 100644 --- a/src/swrenderer/scene/r_portal.cpp +++ b/src/swrenderer/scene/r_portal.cpp @@ -37,6 +37,7 @@ #include "swrenderer/segments/r_drawsegment.h" #include "r_things.h" #include "r_3dfloors.h" +#include "r_segs.h" #include "swrenderer/r_main.h" #include "swrenderer/r_memory.h" diff --git a/src/swrenderer/scene/r_segs.cpp b/src/swrenderer/scene/r_segs.cpp index 41c34f6823..6a87ab7562 100644 --- a/src/swrenderer/scene/r_segs.cpp +++ b/src/swrenderer/scene/r_segs.cpp @@ -141,6 +141,16 @@ FTexture *rw_pic; static fixed_t *maskedtexturecol; +visplane_t *floorplane; +visplane_t *ceilingplane; + +// Clip values are the solid pixel bounding the range. +// floorclip starts out SCREENHEIGHT and is just outside the range +// ceilingclip starts out 0 and is just inside the range +// +short floorclip[MAXWIDTH]; +short ceilingclip[MAXWIDTH]; + inline bool IsFogBoundary (sector_t *front, sector_t *back) { diff --git a/src/swrenderer/scene/r_segs.h b/src/swrenderer/scene/r_segs.h index 7dafafa9dd..cf73ce82a7 100644 --- a/src/swrenderer/scene/r_segs.h +++ b/src/swrenderer/scene/r_segs.h @@ -56,6 +56,11 @@ extern float rw_lightleft; extern fixed_t rw_offset; extern FTexture *rw_pic; +extern short floorclip[MAXWIDTH]; +extern short ceilingclip[MAXWIDTH]; +extern visplane_t *floorplane; +extern visplane_t *ceilingplane; + } #endif