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-28 00:35:22 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2017-01-29 06:49:04 +00:00
|
|
|
#include "swrenderer/drawers/r_drawerargs.h"
|
2017-01-24 07:41:35 +00:00
|
|
|
#include "r_line.h"
|
|
|
|
|
2016-12-28 00:35:22 +00:00
|
|
|
class FTexture;
|
|
|
|
struct FLightNode;
|
2017-01-12 15:21:46 +00:00
|
|
|
struct seg_t;
|
2017-01-24 07:41:35 +00:00
|
|
|
struct FLightNode;
|
|
|
|
struct FDynamicColormap;
|
2016-12-28 00:35:22 +00:00
|
|
|
|
|
|
|
namespace swrenderer
|
|
|
|
{
|
2017-01-26 06:03:27 +00:00
|
|
|
struct DrawSegment;
|
2017-01-03 17:57:48 +00:00
|
|
|
struct FWallCoords;
|
2017-01-24 07:41:35 +00:00
|
|
|
class ProjectedWallLine;
|
|
|
|
class ProjectedWallTexcoords;
|
|
|
|
struct WallSampler;
|
|
|
|
|
|
|
|
class RenderWallPart
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
void Render(
|
2017-01-29 09:05:37 +00:00
|
|
|
const WallDrawerArgs &drawerargs,
|
2017-01-24 07:41:35 +00:00
|
|
|
sector_t *frontsector,
|
|
|
|
seg_t *curline,
|
|
|
|
const FWallCoords &WallC,
|
|
|
|
FTexture *rw_pic,
|
|
|
|
int x1,
|
|
|
|
int x2,
|
|
|
|
const short *walltop,
|
|
|
|
const short *wallbottom,
|
|
|
|
double texturemid,
|
|
|
|
float *swall,
|
|
|
|
fixed_t *lwall,
|
|
|
|
double yscale,
|
|
|
|
double top,
|
|
|
|
double bottom,
|
|
|
|
bool mask,
|
|
|
|
int wallshade,
|
|
|
|
fixed_t xoffset,
|
|
|
|
float light,
|
|
|
|
float lightstep,
|
|
|
|
FLightNode *light_list,
|
|
|
|
bool foggy,
|
|
|
|
FDynamicColormap *basecolormap);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void ProcessWallNP2(const short *uwal, const short *dwal, double texturemid, float *swal, fixed_t *lwal, double top, double bot);
|
|
|
|
void ProcessWall(const short *uwal, const short *dwal, double texturemid, float *swal, fixed_t *lwal);
|
|
|
|
void ProcessStripedWall(const short *uwal, const short *dwal, double texturemid, float *swal, fixed_t *lwal);
|
|
|
|
void ProcessNormalWall(const short *uwal, const short *dwal, double texturemid, float *swal, fixed_t *lwal);
|
2017-01-30 10:43:15 +00:00
|
|
|
void ProcessWallWorker(const short *uwal, const short *dwal, double texturemid, float *swal, fixed_t *lwal);
|
|
|
|
void Draw1Column(int x, int y1, int y2, WallSampler &sampler);
|
2017-01-24 07:41:35 +00:00
|
|
|
|
|
|
|
int x1 = 0;
|
|
|
|
int x2 = 0;
|
|
|
|
FTexture *rw_pic = nullptr;
|
|
|
|
sector_t *frontsector = nullptr;
|
|
|
|
seg_t *curline = nullptr;
|
|
|
|
FWallCoords WallC;
|
|
|
|
|
|
|
|
double yrepeat = 0.0;
|
|
|
|
int wallshade = 0;
|
|
|
|
fixed_t xoffset = 0;
|
|
|
|
float light = 0.0f;
|
|
|
|
float lightstep = 0.0f;
|
|
|
|
bool foggy = false;
|
|
|
|
FDynamicColormap *basecolormap = nullptr;
|
|
|
|
FLightNode *light_list = nullptr;
|
|
|
|
bool mask = false;
|
2017-01-28 06:08:59 +00:00
|
|
|
|
2017-01-29 09:05:37 +00:00
|
|
|
WallDrawerArgs drawerargs;
|
2017-01-24 07:41:35 +00:00
|
|
|
};
|
2017-01-01 09:28:35 +00:00
|
|
|
|
2016-12-28 00:35:22 +00:00
|
|
|
struct WallSampler
|
|
|
|
{
|
|
|
|
WallSampler() { }
|
2017-01-18 23:02:51 +00:00
|
|
|
WallSampler(int y1, double texturemid, float swal, double yrepeat, fixed_t xoffset, double xmagnitude, FTexture *texture);
|
2016-12-28 00:35:22 +00:00
|
|
|
|
|
|
|
uint32_t uv_pos;
|
|
|
|
uint32_t uv_step;
|
|
|
|
uint32_t uv_max;
|
|
|
|
|
|
|
|
const BYTE *source;
|
|
|
|
const BYTE *source2;
|
|
|
|
uint32_t texturefracx;
|
|
|
|
uint32_t height;
|
|
|
|
};
|
|
|
|
}
|