2017-01-11 22:27:35 +00:00
|
|
|
//
|
|
|
|
// Copyright (C) 1993-1996 by id Software, Inc.
|
|
|
|
//
|
|
|
|
// This source is available for distribution and/or modification
|
|
|
|
// only under the terms of the DOOM Source Code License as
|
|
|
|
// published by id Software. All rights reserved.
|
|
|
|
//
|
|
|
|
// The source is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "r_defs.h"
|
|
|
|
|
|
|
|
struct FSectorPortal;
|
|
|
|
|
|
|
|
namespace swrenderer
|
|
|
|
{
|
|
|
|
struct visplane_t;
|
|
|
|
|
|
|
|
class VisiblePlaneList
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
static VisiblePlaneList *Instance();
|
|
|
|
|
|
|
|
void Clear(bool fullclear);
|
|
|
|
|
2017-01-12 20:29:19 +00:00
|
|
|
visplane_t *FindPlane(const secplane_t &height, FTextureID picnum, int lightlevel, double Alpha, bool additive, const FTransform &xxform, int sky, FSectorPortal *portal, FDynamicColormap *basecolormap);
|
2017-01-11 22:27:35 +00:00
|
|
|
visplane_t *GetRange(visplane_t *pl, int start, int stop);
|
|
|
|
|
2017-01-19 02:02:32 +00:00
|
|
|
bool HasPortalPlanes() const;
|
|
|
|
visplane_t *PopFirstPortalPlane();
|
|
|
|
void ClearPortalPlanes();
|
|
|
|
|
2017-01-11 22:27:35 +00:00
|
|
|
int Render();
|
|
|
|
void RenderHeight(double height);
|
|
|
|
|
|
|
|
private:
|
|
|
|
VisiblePlaneList();
|
|
|
|
visplane_t *Add(unsigned hash);
|
|
|
|
|
2017-01-19 02:02:32 +00:00
|
|
|
enum { MAXVISPLANES = 128 }; // must be a power of 2
|
|
|
|
visplane_t *visplanes[MAXVISPLANES + 1];
|
|
|
|
|
2017-01-11 22:27:35 +00:00
|
|
|
static unsigned CalcHash(int picnum, int lightlevel, const secplane_t &height) { return (unsigned)((picnum) * 3 + (lightlevel)+(FLOAT2FIXED((height).fD())) * 7) & (MAXVISPLANES - 1); }
|
|
|
|
};
|
|
|
|
}
|