2008-01-27 11:25:03 +00:00
|
|
|
/*
|
|
|
|
** gl_sky.cpp
|
|
|
|
** Sky preparation code.
|
|
|
|
**
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
** Copyright 2002-2005 Christoph Oelckers
|
|
|
|
** All rights reserved.
|
|
|
|
**
|
|
|
|
** Redistribution and use in source and binary forms, with or without
|
|
|
|
** modification, are permitted provided that the following conditions
|
|
|
|
** are met:
|
|
|
|
**
|
|
|
|
** 1. Redistributions of source code must retain the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer.
|
|
|
|
** 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
** notice, this list of conditions and the following disclaimer in the
|
|
|
|
** documentation and/or other materials provided with the distribution.
|
|
|
|
** 3. The name of the author may not be used to endorse or promote products
|
|
|
|
** derived from this software without specific prior written permission.
|
|
|
|
** 4. When not used as part of GZDoom or a GZDoom derivative, this code will be
|
|
|
|
** covered by the terms of the GNU Lesser General Public License as published
|
|
|
|
** by the Free Software Foundation; either version 2.1 of the License, or (at
|
|
|
|
** your option) any later version.
|
- Added the following clause to all GL renderer related files (Skulltag devlopers, beware!):
Full disclosure of the entire project's source code, except for third party libraries is mandartory.
(NOTE: This clause is non-negotiable!)
- Fixed: The alpha for 3D floors was always set to 0.
Update to ZDoom r1056:
- Changed: I_Error and I_FatalError now use ZDoom's internal string formatting
code to process their messages. This was necessary to handle the %zu format
option used in some memory allocation failure messages.
- Fixed: The flat texture scaling action specials were completely broken.
- The sound code now handles restarting looping sounds itself. As far as
the rest of the game is concerned, these sounds will never stop once they
have been started until they are explicitly stopped. If they are evicted
from their channels, the sound code will restart them as soon as possible.
This means that instead of this:
if (!S_IsActorPlayingSomething(actor, CHAN_WEAPON, -1))
{
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
}
The following is now just as effective:
S_Sound(actor, CHAN_WEAPON|CHAN_LOOP, soundid, 1, ATTN_NORM);
There are also a couple of other ramifications presented by this change:
* The full state of the sound system (sans music) is now stored in save
games. Any sounds that were playing when you saved will still be
playing when you load. (Try saving while Korax is making a speech in
Hexen to hear it.)
* Using snd_reset will also preserve any playing sounds.
* Movie playback is disabled, probably forever. I did not want to
update the MovieDisable/ResumeSound stuff for the new eviction
tracking code. A properly updated movie player will use the VMR,
which doesn't need these functions, since it would pipe the sound
straight through the sound system like everything else, so I decided
to dump them now, which leaves the movie player in a totally unworkable
state.
- Removed some unused constant definitions from sc_man.cpp.
git-svn-id: http://mancubus.net/svn/hosted/gzdoom/trunk@128 b0f79afe-0144-0410-b225-9a4edf0717df
2008-06-29 10:08:16 +00:00
|
|
|
** 5. Full disclosure of the entire project's source code, except for third
|
2008-06-29 10:27:22 +00:00
|
|
|
** party libraries is mandatory. (NOTE: This clause is non-negotiable!)
|
2008-01-27 11:25:03 +00:00
|
|
|
**
|
|
|
|
** THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
** IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
** OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
** IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
** INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
** NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
**---------------------------------------------------------------------------
|
|
|
|
**
|
|
|
|
*/
|
|
|
|
|
2009-09-25 23:09:24 +00:00
|
|
|
#include "gl/system/gl_system.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
#include "a_sharedglobal.h"
|
2008-09-15 23:47:00 +00:00
|
|
|
#include "g_level.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
#include "r_sky.h"
|
2009-09-25 17:42:07 +00:00
|
|
|
#include "r_main.h"
|
2010-09-09 07:22:17 +00:00
|
|
|
#include "doomdata.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
#include "gl/gl_functions.h"
|
2009-09-24 22:31:33 +00:00
|
|
|
|
2009-09-25 17:42:07 +00:00
|
|
|
#include "gl/data/gl_data.h"
|
2009-09-25 21:57:47 +00:00
|
|
|
#include "gl/renderer/gl_lightdata.h"
|
2009-09-25 08:43:53 +00:00
|
|
|
#include "gl/scene/gl_drawinfo.h"
|
|
|
|
#include "gl/scene/gl_portal.h"
|
2009-09-24 22:31:33 +00:00
|
|
|
#include "gl/textures/gl_material.h"
|
2009-09-25 21:01:58 +00:00
|
|
|
#include "gl/utility/gl_convert.h"
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
CVAR(Bool,gl_noskyboxes, false, 0)
|
|
|
|
extern int skyfog;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
NoSkyDraw = 89
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Calculate sky texture
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2010-11-14 20:41:16 +00:00
|
|
|
void GLWall::SkyPlane(sector_t *sector, int plane, bool allowreflect)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-11-14 20:41:16 +00:00
|
|
|
FPortal *portal = sector->portals[plane];
|
|
|
|
if (portal != NULL)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-11-14 20:41:16 +00:00
|
|
|
if (GLPortal::instack[1-plane]) return;
|
2010-11-20 14:25:56 +00:00
|
|
|
type=RENDERWALL_SECTORSTACK;
|
2010-11-14 20:41:16 +00:00
|
|
|
this->portal = portal;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2010-11-14 20:41:16 +00:00
|
|
|
else if (sector->GetTexture(plane)==skyflatnum)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-11-14 20:41:16 +00:00
|
|
|
GLSkyInfo skyinfo;
|
|
|
|
ASkyViewpoint * skyboxx = plane == sector_t::floor? sector->FloorSkyBox : sector->CeilingSkyBox;
|
|
|
|
|
|
|
|
// JUSTHIT is used as an indicator that a skybox is in use.
|
|
|
|
// This is to avoid recursion
|
2008-03-21 21:15:56 +00:00
|
|
|
|
2010-11-14 20:41:16 +00:00
|
|
|
if (!gl_noskyboxes && skyboxx && GLRenderer->mViewActor!=skyboxx && !(skyboxx->flags&MF_JUSTHIT))
|
|
|
|
{
|
|
|
|
type=RENDERWALL_SKYBOX;
|
|
|
|
skybox=skyboxx;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-14 20:41:16 +00:00
|
|
|
int sky1 = sector->sky;
|
|
|
|
memset(&skyinfo, 0, sizeof(skyinfo));
|
|
|
|
if ((sky1 & PL_SKYFLAT) && (sky1 & (PL_SKYFLAT-1)))
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-11-14 20:41:16 +00:00
|
|
|
const line_t *l = &lines[(sky1&(PL_SKYFLAT-1))-1];
|
|
|
|
const side_t *s = l->sidedef[0];
|
|
|
|
int pos;
|
|
|
|
|
|
|
|
if (level.flags & LEVEL_SWAPSKIES && s->GetTexture(side_t::bottom).isValid())
|
|
|
|
{
|
|
|
|
pos = side_t::bottom;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
pos = side_t::top;
|
|
|
|
}
|
|
|
|
|
|
|
|
FTextureID texno = s->GetTexture(pos);
|
|
|
|
skyinfo.texture[0] = FMaterial::ValidateTexture(texno, true);
|
|
|
|
if (!skyinfo.texture[0] || skyinfo.texture[0]->tex->UseType == FTexture::TEX_Null) goto normalsky;
|
|
|
|
skyinfo.skytexno1 = texno;
|
|
|
|
skyinfo.x_offset[0] = ANGLE_TO_FLOAT(s->GetTextureXOffset(pos));
|
|
|
|
skyinfo.y_offset = FIXED2FLOAT(s->GetTextureYOffset(pos));
|
|
|
|
skyinfo.mirrored = !l->args[2];
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2010-11-14 20:41:16 +00:00
|
|
|
else
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-11-14 20:41:16 +00:00
|
|
|
normalsky:
|
|
|
|
if (level.flags&LEVEL_DOUBLESKY)
|
|
|
|
{
|
|
|
|
skyinfo.texture[1]=FMaterial::ValidateTexture(sky1texture, true);
|
|
|
|
skyinfo.x_offset[1] = GLRenderer->mSky1Pos;
|
|
|
|
skyinfo.doublesky = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
if ((level.flags&LEVEL_SWAPSKIES || (sky1==PL_SKYFLAT) || (level.flags&LEVEL_DOUBLESKY)) &&
|
|
|
|
sky2texture!=sky1texture) // If both skies are equal use the scroll offset of the first!
|
|
|
|
{
|
|
|
|
skyinfo.texture[0]=FMaterial::ValidateTexture(sky2texture, true);
|
|
|
|
skyinfo.skytexno1=sky2texture;
|
|
|
|
skyinfo.sky2 = true;
|
|
|
|
skyinfo.x_offset[0] = GLRenderer->mSky2Pos;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
skyinfo.texture[0]=FMaterial::ValidateTexture(sky1texture, true);
|
|
|
|
skyinfo.skytexno1=sky1texture;
|
|
|
|
skyinfo.x_offset[0] = GLRenderer->mSky1Pos;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2010-11-14 20:41:16 +00:00
|
|
|
if (skyfog>0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-11-14 20:41:16 +00:00
|
|
|
skyinfo.fadecolor=Colormap.FadeColor;
|
|
|
|
skyinfo.fadecolor.a=0;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2010-11-14 20:41:16 +00:00
|
|
|
else skyinfo.fadecolor=0;
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2010-11-14 20:41:16 +00:00
|
|
|
type=RENDERWALL_SKY;
|
|
|
|
sky=UniqueSkies.Get(&skyinfo);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (allowreflect && sector->GetReflect(plane) > 0)
|
|
|
|
{
|
|
|
|
if ((plane == sector_t::ceiling && viewz > sector->ceilingplane.d) ||
|
|
|
|
(plane == sector_t::floor && viewz < -sector->floorplane.d)) return;
|
|
|
|
type=RENDERWALL_PLANEMIRROR;
|
|
|
|
planemirror = plane == sector_t::ceiling? §or->ceilingplane : §or->floorplane;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2010-11-14 20:41:16 +00:00
|
|
|
else return;
|
|
|
|
PutWall(0);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Skies on one sided walls
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2010-11-13 13:55:53 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
void GLWall::SkyNormal(sector_t * fs,vertex_t * v1,vertex_t * v2)
|
|
|
|
{
|
2010-11-13 13:55:53 +00:00
|
|
|
ztop[0]=ztop[1]=32768.0f;
|
|
|
|
zbottom[0]=zceil[0];
|
|
|
|
zbottom[1]=zceil[1];
|
2010-11-14 20:41:16 +00:00
|
|
|
SkyPlane(fs, sector_t::ceiling, true);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2010-11-13 13:55:53 +00:00
|
|
|
ztop[0]=zfloor[0];
|
|
|
|
ztop[1]=zfloor[1];
|
|
|
|
zbottom[0]=zbottom[1]=-32768.0f;
|
2010-11-21 08:08:22 +00:00
|
|
|
SkyPlane(fs, sector_t::floor, true);
|
2010-11-13 13:55:53 +00:00
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Upper Skies on two sided walls
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2010-11-13 13:55:53 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
void GLWall::SkyTop(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex_t * v2)
|
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
if (fs->GetTexture(sector_t::ceiling)==skyflatnum)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if ((bs->special&0xff) == NoSkyDraw) return;
|
2008-08-22 07:36:50 +00:00
|
|
|
if (bs->GetTexture(sector_t::ceiling)==skyflatnum)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// if the back sector is closed the sky must be drawn!
|
|
|
|
if (bs->ceilingplane.ZatPoint(v1) > bs->floorplane.ZatPoint(v1) ||
|
|
|
|
bs->ceilingplane.ZatPoint(v2) > bs->floorplane.ZatPoint(v2) || bs->transdoor)
|
|
|
|
return;
|
|
|
|
|
|
|
|
// one more check for some ugly transparent door hacks
|
2010-09-09 07:22:17 +00:00
|
|
|
if (bs->floorplane.a==0 && bs->floorplane.b==0 && fs->floorplane.a==0 && fs->floorplane.b==0)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
2010-09-09 07:22:17 +00:00
|
|
|
if (bs->GetPlaneTexZ(sector_t::floor)==fs->GetPlaneTexZ(sector_t::floor)+FRACUNIT)
|
|
|
|
{
|
|
|
|
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
|
|
|
|
if (!tex || tex->UseType==FTexture::TEX_Null) return;
|
|
|
|
|
|
|
|
// very, very, very ugly special case (See Icarus MAP14)
|
|
|
|
// It is VERY important that this is only done for a floor height difference of 1
|
|
|
|
// or it will cause glitches elsewhere.
|
|
|
|
tex = TexMan(seg->sidedef->GetTexture(side_t::mid));
|
|
|
|
if (tex != NULL && !(seg->linedef->flags & ML_DONTPEGTOP) &&
|
|
|
|
seg->sidedef->GetTextureYOffset(side_t::mid) > 0)
|
|
|
|
{
|
|
|
|
ztop[0]=ztop[1]=32768.0f;
|
|
|
|
zbottom[0]=zbottom[1]=
|
|
|
|
FIXED2FLOAT(bs->ceilingplane.ZatPoint(v2) + seg->sidedef->GetTextureYOffset(side_t::mid));
|
2010-11-14 20:41:16 +00:00
|
|
|
SkyPlane(fs, sector_t::ceiling, false);
|
2010-09-09 07:22:17 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
ztop[0]=ztop[1]=32768.0f;
|
|
|
|
|
2008-03-21 21:15:56 +00:00
|
|
|
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::top));
|
2010-09-09 07:22:17 +00:00
|
|
|
if (bs->GetTexture(sector_t::ceiling) != skyflatnum)
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
zbottom[0]=zceil[0];
|
|
|
|
zbottom[1]=zceil[1];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-11-20 09:47:15 +00:00
|
|
|
zbottom[0]=FIXED2FLOAT(bs->ceilingplane.ZatPoint(v1));
|
|
|
|
zbottom[1]=FIXED2FLOAT(bs->ceilingplane.ZatPoint(v2));
|
2008-01-27 11:25:03 +00:00
|
|
|
flags|=GLWF_SKYHACK; // mid textures on such lines need special treatment!
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-13 13:55:53 +00:00
|
|
|
FPortal *pfront = fs->portals[sector_t::ceiling];
|
|
|
|
FPortal *pback = bs->portals[sector_t::ceiling];
|
2010-11-21 08:08:22 +00:00
|
|
|
float frontreflect = fs->GetReflect(sector_t::ceiling);
|
|
|
|
if (frontreflect > 0)
|
|
|
|
{
|
|
|
|
float backreflect = bs->GetReflect(sector_t::ceiling);
|
|
|
|
if (backreflect > 0 && bs->ceilingplane.d == fs->ceilingplane.d)
|
|
|
|
{
|
|
|
|
// Don't add intra-portal line to the portal.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (pfront == NULL || pfront == pback)
|
2010-11-14 20:41:16 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2010-11-13 13:55:53 +00:00
|
|
|
|
|
|
|
// stacked sectors
|
|
|
|
fixed_t fsc1=fs->ceilingplane.ZatPoint(v1);
|
|
|
|
fixed_t fsc2=fs->ceilingplane.ZatPoint(v2);
|
|
|
|
|
|
|
|
ztop[0]=ztop[1]=32768.0f;
|
|
|
|
zbottom[0]=FIXED2FLOAT(fsc1);
|
|
|
|
zbottom[1]=FIXED2FLOAT(fsc2);
|
|
|
|
}
|
|
|
|
|
2010-11-14 20:41:16 +00:00
|
|
|
SkyPlane(fs, sector_t::ceiling, true);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//==========================================================================
|
|
|
|
//
|
|
|
|
// Lower Skies on two sided walls
|
|
|
|
//
|
|
|
|
//==========================================================================
|
2010-11-13 13:55:53 +00:00
|
|
|
|
2008-01-27 11:25:03 +00:00
|
|
|
void GLWall::SkyBottom(seg_t * seg,sector_t * fs,sector_t * bs,vertex_t * v1,vertex_t * v2)
|
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
if (fs->GetTexture(sector_t::floor)==skyflatnum)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
if ((bs->special&0xff) == NoSkyDraw) return;
|
2008-03-21 21:15:56 +00:00
|
|
|
FTexture * tex = TexMan(seg->sidedef->GetTexture(side_t::bottom));
|
2008-01-27 11:25:03 +00:00
|
|
|
|
|
|
|
// For lower skies the normal logic only applies to walls with no lower texture!
|
|
|
|
if (tex->UseType==FTexture::TEX_Null)
|
|
|
|
{
|
2008-08-22 07:36:50 +00:00
|
|
|
if (bs->GetTexture(sector_t::floor)==skyflatnum)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
// if the back sector is closed the sky must be drawn!
|
|
|
|
if (bs->ceilingplane.ZatPoint(v1) > bs->floorplane.ZatPoint(v1) ||
|
|
|
|
bs->ceilingplane.ZatPoint(v2) > bs->floorplane.ZatPoint(v2))
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// Special hack for Vrack2b
|
2009-11-20 09:47:15 +00:00
|
|
|
if (bs->floorplane.ZatPoint(FIXED2FLOAT(viewx), FIXED2FLOAT(viewy)) > FIXED2FLOAT(viewz)) return;
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
zbottom[0]=zbottom[1]=-32768.0f;
|
|
|
|
|
2008-08-22 07:36:50 +00:00
|
|
|
if ((tex && tex->UseType!=FTexture::TEX_Null) || bs->GetTexture(sector_t::floor)!=skyflatnum)
|
2008-01-27 11:25:03 +00:00
|
|
|
{
|
|
|
|
ztop[0]=zfloor[0];
|
|
|
|
ztop[1]=zfloor[1];
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2009-11-20 09:47:15 +00:00
|
|
|
ztop[0]=FIXED2FLOAT(bs->floorplane.ZatPoint(v1));
|
|
|
|
ztop[1]=FIXED2FLOAT(bs->floorplane.ZatPoint(v2));
|
2008-01-27 11:25:03 +00:00
|
|
|
flags|=GLWF_SKYHACK; // mid textures on such lines need special treatment!
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2010-11-13 13:55:53 +00:00
|
|
|
FPortal *pfront = fs->portals[sector_t::floor];
|
|
|
|
FPortal *pback = bs->portals[sector_t::floor];
|
2010-11-21 08:08:22 +00:00
|
|
|
float frontreflect = fs->GetReflect(sector_t::floor);
|
|
|
|
if (frontreflect > 0)
|
|
|
|
{
|
|
|
|
float backreflect = bs->GetReflect(sector_t::floor);
|
|
|
|
if (backreflect > 0 && bs->floorplane.d == fs->floorplane.d)
|
|
|
|
{
|
|
|
|
// Don't add intra-portal line to the portal.
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (pfront == NULL || pfront == pback)
|
2010-11-14 20:41:16 +00:00
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2010-11-13 13:55:53 +00:00
|
|
|
// stacked sectors
|
|
|
|
fixed_t fsc1=fs->floorplane.ZatPoint(v1);
|
|
|
|
fixed_t fsc2=fs->floorplane.ZatPoint(v2);
|
2008-01-27 11:25:03 +00:00
|
|
|
|
2010-11-13 13:55:53 +00:00
|
|
|
zbottom[0]=zbottom[1]=-32768.0f;
|
|
|
|
ztop[0]=FIXED2FLOAT(fsc1);
|
|
|
|
ztop[1]=FIXED2FLOAT(fsc2);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2010-11-13 13:55:53 +00:00
|
|
|
|
2010-11-14 20:41:16 +00:00
|
|
|
SkyPlane(fs, sector_t::floor, true);
|
2008-01-27 11:25:03 +00:00
|
|
|
}
|
2010-11-27 21:11:30 +00:00
|
|
|
|