2017-04-17 10:27:19 +00:00
|
|
|
//-----------------------------------------------------------------------------
|
2017-01-03 06:17:54 +00:00
|
|
|
//
|
2017-04-17 10:27:19 +00:00
|
|
|
// Copyright 1993-1996 id Software
|
|
|
|
// Copyright 1999-2016 Randy Heit
|
|
|
|
// Copyright 2016 Magnus Norddahl
|
2017-01-03 06:17:54 +00:00
|
|
|
//
|
2017-04-17 10:27:19 +00:00
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
2017-01-03 06:17:54 +00:00
|
|
|
//
|
2017-04-17 10:27:19 +00:00
|
|
|
// This program is distributed in the hope that it will be useful,
|
2017-01-03 06:17:54 +00:00
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
2017-04-17 10:27:19 +00:00
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU General Public License for more details.
|
2017-01-03 06:17:54 +00:00
|
|
|
//
|
2017-04-17 10:27:19 +00:00
|
|
|
// You should have received a copy of the GNU General Public License
|
|
|
|
// along with this program. If not, see http://www.gnu.org/licenses/
|
|
|
|
//
|
|
|
|
//-----------------------------------------------------------------------------
|
2016-12-30 06:51:39 +00:00
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2016-12-31 11:45:07 +00:00
|
|
|
#include "r_visiblesprite.h"
|
2017-01-24 03:15:54 +00:00
|
|
|
#include "r_data/colormaps.h"
|
2016-12-30 06:51:39 +00:00
|
|
|
|
2017-01-12 15:21:46 +00:00
|
|
|
class DPSprite;
|
|
|
|
|
2016-12-30 06:51:39 +00:00
|
|
|
namespace swrenderer
|
|
|
|
{
|
2017-01-24 03:15:54 +00:00
|
|
|
class NoAccelPlayerSprite
|
2017-01-11 17:35:20 +00:00
|
|
|
{
|
|
|
|
public:
|
2017-01-24 03:15:54 +00:00
|
|
|
short x1 = 0;
|
|
|
|
short x2 = 0;
|
2017-01-09 13:28:31 +00:00
|
|
|
|
2017-01-24 03:15:54 +00:00
|
|
|
double texturemid = 0.0;
|
|
|
|
|
|
|
|
fixed_t xscale = 0;
|
|
|
|
float yscale = 0.0f;
|
|
|
|
|
|
|
|
FTexture *pic = nullptr;
|
|
|
|
|
|
|
|
fixed_t xiscale = 0;
|
|
|
|
fixed_t startfrac = 0;
|
|
|
|
|
|
|
|
float Alpha = 0.0f;
|
|
|
|
FRenderStyle RenderStyle;
|
|
|
|
uint32_t Translation = 0;
|
|
|
|
uint32_t FillColor = 0;
|
|
|
|
|
|
|
|
ColormapLight Light;
|
|
|
|
|
|
|
|
short renderflags = 0;
|
|
|
|
|
2017-02-04 11:38:05 +00:00
|
|
|
void Render(RenderThread *thread);
|
2017-01-24 03:15:54 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class HWAccelPlayerSprite
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
FTexture *pic = nullptr;
|
|
|
|
double texturemid = 0.0;
|
|
|
|
float yscale = 0.0f;
|
|
|
|
fixed_t xscale = 0;
|
|
|
|
|
|
|
|
float Alpha = 0.0f;
|
|
|
|
FRenderStyle RenderStyle;
|
|
|
|
uint32_t Translation = 0;
|
|
|
|
uint32_t FillColor = 0;
|
|
|
|
|
|
|
|
FDynamicColormap *basecolormap = nullptr;
|
|
|
|
int x1 = 0;
|
|
|
|
|
|
|
|
bool flip = false;
|
|
|
|
FSpecialColormap *special = nullptr;
|
|
|
|
PalEntry overlay = 0;
|
|
|
|
FColormapStyle colormapstyle;
|
|
|
|
bool usecolormapstyle = false;
|
|
|
|
};
|
|
|
|
|
|
|
|
class RenderPlayerSprites
|
|
|
|
{
|
|
|
|
public:
|
2017-02-03 23:25:37 +00:00
|
|
|
RenderPlayerSprites(RenderThread *thread);
|
2017-01-24 03:15:54 +00:00
|
|
|
|
|
|
|
void Render();
|
|
|
|
void RenderRemaining();
|
2017-01-11 17:35:20 +00:00
|
|
|
|
2017-02-03 23:25:37 +00:00
|
|
|
RenderThread *Thread = nullptr;
|
|
|
|
|
2017-01-11 17:35:20 +00:00
|
|
|
private:
|
2017-01-24 03:15:54 +00:00
|
|
|
void RenderSprite(DPSprite *pspr, AActor *owner, float bobx, float boby, double wx, double wy, double ticfrac, int spriteshade, FDynamicColormap *basecolormap, bool foggy);
|
2017-01-11 17:35:20 +00:00
|
|
|
|
2017-01-11 17:38:51 +00:00
|
|
|
enum { BASEXCENTER = 160 };
|
|
|
|
enum { BASEYCENTER = 100 };
|
|
|
|
|
2017-01-24 03:15:54 +00:00
|
|
|
TArray<HWAccelPlayerSprite> AcceleratedSprites;
|
2017-02-04 14:51:54 +00:00
|
|
|
sector_t tempsec;
|
2017-01-11 17:35:20 +00:00
|
|
|
};
|
2016-12-30 06:51:39 +00:00
|
|
|
}
|