From 00895c245eaa398c1f428db9147f5b1890b40e38 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 5 Feb 2016 15:39:06 +0100 Subject: [PATCH] - mpved all software renderer specific code for the portals into the render sources. --- src/portal.cpp | 4 ---- src/portal.h | 19 ------------------- src/r_bsp.h | 2 -- src/r_main.cpp | 1 + src/r_segs.cpp | 3 +++ src/r_segs.h | 21 +++++++++++++++++++++ 6 files changed, 25 insertions(+), 25 deletions(-) diff --git a/src/portal.cpp b/src/portal.cpp index d45219ea30..3b17eb74af 100644 --- a/src/portal.cpp +++ b/src/portal.cpp @@ -10,10 +10,6 @@ // simulation recurions maximum CVAR(Int, sv_portal_recursions, 4, CVAR_ARCHIVE|CVAR_SERVERINFO) -PortalDrawseg* CurrentPortal = NULL; -int CurrentPortalUniq = 0; -bool CurrentPortalInSkybox = false; - // [ZZ] lots of floats here to avoid overflowing a lot bool R_IntersectLines(fixed_t o1x, fixed_t o1y, fixed_t p1x, fixed_t p1y, fixed_t o2x, fixed_t o2y, fixed_t p2x, fixed_t p2y, diff --git a/src/portal.h b/src/portal.h index 103e3072b4..be48488216 100644 --- a/src/portal.h +++ b/src/portal.h @@ -8,25 +8,6 @@ #include "p_local.h" #include "m_bbox.h" -/* portal structure, this is used in r_ code in order to store drawsegs with portals (and mirrors) */ -struct PortalDrawseg -{ - line_t* src; // source line (the one drawn) this doesn't change over render loops - line_t* dst; // destination line (the one that the portal is linked with, equals 'src' for mirrors) - - int x1; // drawseg x1 - int x2; // drawseg x2 - - int len; - TArray ceilingclip; - TArray floorclip; - - bool mirror; // true if this is a mirror (src should equal dst) -}; - -extern PortalDrawseg* CurrentPortal; -extern int CurrentPortalUniq; -extern bool CurrentPortalInSkybox; /* code ported from prototype */ bool P_ClipLineToPortal(line_t* line, line_t* portal, fixed_t viewx, fixed_t viewy, bool partial = true, bool samebehind = true); diff --git a/src/r_bsp.h b/src/r_bsp.h index 3b2a399e33..8c19a26703 100644 --- a/src/r_bsp.h +++ b/src/r_bsp.h @@ -107,8 +107,6 @@ extern size_t FirstInterestingDrawseg; extern int WindowLeft, WindowRight; extern WORD MirrorFlags; -extern TArray WallPortals; - typedef void (*drawfunc_t) (int start, int stop); EXTERN_CVAR (Bool, r_drawflat) // [RH] Don't texture segs? diff --git a/src/r_main.cpp b/src/r_main.cpp index 4c2b89c0a2..883ab13dc9 100644 --- a/src/r_main.cpp +++ b/src/r_main.cpp @@ -37,6 +37,7 @@ #include "r_local.h" #include "r_plane.h" #include "r_bsp.h" +#include "r_segs.h" #include "r_3dfloors.h" #include "r_sky.h" #include "st_stuff.h" diff --git a/src/r_segs.cpp b/src/r_segs.cpp index 1f09dbf184..79b5251c49 100644 --- a/src/r_segs.cpp +++ b/src/r_segs.cpp @@ -67,6 +67,9 @@ CVAR(Bool, r_np2, true, 0) extern fixed_t globaluclip, globaldclip; +PortalDrawseg* CurrentPortal = NULL; +int CurrentPortalUniq = 0; +bool CurrentPortalInSkybox = false; // OPTIMIZE: closed two sided lines as single sided diff --git a/src/r_segs.h b/src/r_segs.h index b8bf965116..e2f8d76112 100644 --- a/src/r_segs.h +++ b/src/r_segs.h @@ -49,4 +49,25 @@ extern fixed_t rw_lightstep; extern fixed_t rw_lightleft; extern fixed_t rw_offset; +/* portal structure, this is used in r_ code in order to store drawsegs with portals (and mirrors) */ +struct PortalDrawseg +{ + line_t* src; // source line (the one drawn) this doesn't change over render loops + line_t* dst; // destination line (the one that the portal is linked with, equals 'src' for mirrors) + + int x1; // drawseg x1 + int x2; // drawseg x2 + + int len; + TArray ceilingclip; + TArray floorclip; + + bool mirror; // true if this is a mirror (src should equal dst) +}; + +extern PortalDrawseg* CurrentPortal; +extern int CurrentPortalUniq; +extern bool CurrentPortalInSkybox; +extern TArray WallPortals; + #endif