2017-01-03 06:17:54 +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.
|
|
|
|
//
|
2016-12-30 05:42:20 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stddef.h>
|
|
|
|
#include "r_defs.h"
|
2017-01-19 00:47:58 +00:00
|
|
|
#include "r_state.h"
|
|
|
|
#include "swrenderer/r_memory.h"
|
2016-12-30 05:42:20 +00:00
|
|
|
|
|
|
|
class ADynamicLight;
|
|
|
|
struct FLightNode;
|
|
|
|
struct FDynamicColormap;
|
|
|
|
struct FSectorPortal;
|
|
|
|
|
|
|
|
namespace swrenderer
|
|
|
|
{
|
|
|
|
struct visplane_light
|
|
|
|
{
|
|
|
|
ADynamicLight *lightsource;
|
|
|
|
visplane_light *next;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct visplane_t
|
|
|
|
{
|
2017-01-19 00:47:58 +00:00
|
|
|
visplane_t();
|
2016-12-30 05:42:20 +00:00
|
|
|
|
2017-01-19 00:47:58 +00:00
|
|
|
void AddLights(FLightNode *node);
|
|
|
|
void Render(fixed_t alpha, bool additive, bool masked);
|
|
|
|
|
|
|
|
visplane_t *next = nullptr; // Next visplane in hash chain -- killough
|
|
|
|
|
|
|
|
FDynamicColormap *colormap = nullptr; // [RH] Support multiple colormaps
|
|
|
|
FSectorPortal *portal = nullptr; // [RH] Support sky boxes
|
|
|
|
visplane_light *lights = nullptr;
|
2016-12-30 05:42:20 +00:00
|
|
|
|
|
|
|
FTransform xform;
|
|
|
|
secplane_t height;
|
|
|
|
FTextureID picnum;
|
2017-01-19 00:47:58 +00:00
|
|
|
int lightlevel = 0;
|
|
|
|
int left = viewwidth;
|
|
|
|
int right = 0;
|
|
|
|
int sky = 0;
|
2016-12-30 05:42:20 +00:00
|
|
|
|
|
|
|
// [RH] This set of variables copies information from the time when the
|
|
|
|
// visplane is created. They are only used by stacks so that you can
|
|
|
|
// have stacked sectors inside a skybox. If the visplane is not for a
|
|
|
|
// stack, then they are unused.
|
2017-01-19 00:47:58 +00:00
|
|
|
int extralight = 0;
|
|
|
|
double visibility = 0.0;
|
|
|
|
DVector3 viewpos = { 0.0, 0.0, 0.0 };
|
|
|
|
DAngle viewangle = { 0.0 };
|
|
|
|
fixed_t Alpha = 0;
|
|
|
|
bool Additive = false;
|
2016-12-30 05:42:20 +00:00
|
|
|
|
|
|
|
// kg3D - keep track of mirror and skybox owner
|
2017-01-19 00:47:58 +00:00
|
|
|
int CurrentSkybox = 0;
|
|
|
|
int CurrentPortalUniq = 0; // mirror counter, counts all of them
|
|
|
|
int MirrorFlags = 0; // this is not related to CurrentMirror
|
2016-12-30 05:42:20 +00:00
|
|
|
|
2017-01-19 00:47:58 +00:00
|
|
|
uint16_t *bottom = nullptr;
|
|
|
|
uint16_t *top = nullptr;
|
2016-12-30 05:42:20 +00:00
|
|
|
};
|
|
|
|
}
|