2019-10-05 10:28:08 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-01-06 01:41:47 +00:00
|
|
|
#include "palentry.h"
|
2019-11-05 22:35:38 +00:00
|
|
|
#include "gl_buffers.h"
|
2020-01-03 09:09:38 +00:00
|
|
|
#include "renderstyle.h"
|
|
|
|
struct GLState;
|
2020-04-26 21:17:54 +00:00
|
|
|
class FMaterial;
|
2021-03-01 19:48:03 +00:00
|
|
|
class FModel;
|
2019-10-05 10:28:08 +00:00
|
|
|
|
2020-01-03 22:38:50 +00:00
|
|
|
enum EMatrixType
|
|
|
|
{
|
2020-01-19 15:06:31 +00:00
|
|
|
Matrix_Model,
|
2020-01-03 22:38:50 +00:00
|
|
|
// These are the only ones being used.
|
|
|
|
NUMMATRICES
|
|
|
|
};
|
|
|
|
|
2019-10-19 20:46:37 +00:00
|
|
|
enum PRSFlags
|
|
|
|
{
|
|
|
|
RF_ColorOnly = 1,
|
|
|
|
RF_FogDisabled = 128,
|
2020-04-11 22:21:35 +00:00
|
|
|
RF_MapFog = 256, // RRRA E2L1.
|
2019-10-19 20:46:37 +00:00
|
|
|
|
2020-05-29 18:15:42 +00:00
|
|
|
RF_TINT_Grayscale = 0x10000,
|
|
|
|
RF_TINT_Invert = 0x20000,
|
|
|
|
RF_TINT_Colorize = 0x40000,
|
|
|
|
RF_TINT_BLEND_Screen = 0x80000,
|
|
|
|
RF_TINT_BLEND_Overlay = 0x100000,
|
|
|
|
RF_TINT_BLEND_Hardlight = 0x200000,
|
|
|
|
RF_TINT_BLENDMASK = RF_TINT_BLEND_Screen | RF_TINT_BLEND_Overlay | RF_TINT_BLEND_Hardlight,
|
|
|
|
RF_TINT_MASK = 0x3f0000,
|
2020-01-02 22:15:16 +00:00
|
|
|
|
|
|
|
STF_BLEND = 1,
|
|
|
|
STF_COLORMASK = 2,
|
|
|
|
STF_DEPTHMASK = 4,
|
|
|
|
STF_DEPTHTEST = 8,
|
|
|
|
STF_STENCILWRITE = 32,
|
|
|
|
STF_STENCILTEST = 64,
|
|
|
|
STF_CULLCW = 128,
|
|
|
|
STF_CULLCCW = 256,
|
2020-01-02 22:56:35 +00:00
|
|
|
STF_CLEARCOLOR = 1024,
|
|
|
|
STF_CLEARDEPTH = 2048,
|
2020-01-03 09:48:01 +00:00
|
|
|
STF_VIEWPORTSET = 4096,
|
2020-01-18 21:41:08 +00:00
|
|
|
STF_SCISSORSET = 8192,
|
2019-10-19 20:46:37 +00:00
|
|
|
};
|
|
|
|
|
2020-11-10 08:08:48 +00:00
|
|
|
struct PolymostTextureState
|
|
|
|
{
|
|
|
|
FGameTexture* mTexture = nullptr;
|
|
|
|
EUpscaleFlags uFlags;
|
|
|
|
int mScaleFlags;
|
|
|
|
int mClampMode;
|
|
|
|
int mTranslation;
|
|
|
|
int mOverrideShader;
|
|
|
|
bool mChanged;
|
|
|
|
|
|
|
|
void Reset()
|
|
|
|
{
|
|
|
|
mTexture = nullptr;
|
|
|
|
uFlags = UF_None;
|
|
|
|
mScaleFlags = 0;
|
|
|
|
mTranslation = 0;
|
|
|
|
mClampMode = CLAMP_NONE;
|
|
|
|
mOverrideShader = -1;
|
|
|
|
mChanged = false;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2019-10-05 10:28:08 +00:00
|
|
|
struct PolymostRenderState
|
|
|
|
{
|
2020-01-18 21:41:08 +00:00
|
|
|
int vindex, vcount, primtype;
|
2020-09-26 09:59:24 +00:00
|
|
|
int Shade;
|
2021-04-01 17:09:08 +00:00
|
|
|
int drawblack = false;
|
2019-10-19 23:14:48 +00:00
|
|
|
float ShadeDiv = 62.f;
|
|
|
|
float VisFactor = 128.f;
|
2019-10-19 20:46:37 +00:00
|
|
|
int Flags = 0;
|
2020-06-11 21:55:23 +00:00
|
|
|
int TextureMode = TM_NORMAL;
|
2020-06-08 06:16:50 +00:00
|
|
|
FVector2 NPOTEmulation = { 0.f, 0.f };
|
2020-06-07 20:06:47 +00:00
|
|
|
float AlphaThreshold = 0.5f;
|
2019-11-10 09:01:31 +00:00
|
|
|
bool AlphaTest = true;
|
2020-01-03 10:43:44 +00:00
|
|
|
float Color[4] = { 1,1,1,1 };
|
2020-06-12 20:32:49 +00:00
|
|
|
short matrixIndex[NUMMATRICES] = { -1 };
|
2020-02-06 17:43:27 +00:00
|
|
|
FDepthBiasState mBias{ };
|
2020-11-10 08:08:48 +00:00
|
|
|
PolymostTextureState mMaterial;
|
2021-03-01 19:48:03 +00:00
|
|
|
FModel* model = nullptr;
|
|
|
|
int mframes[2] = { 0,0 };
|
|
|
|
float mfactor = 0;
|
2019-11-10 09:01:31 +00:00
|
|
|
|
2020-01-02 22:15:16 +00:00
|
|
|
int StateFlags = STF_COLORMASK|STF_DEPTHMASK;
|
2020-01-03 09:09:38 +00:00
|
|
|
FRenderStyle Style{};
|
2020-01-03 10:43:44 +00:00
|
|
|
int DepthFunc = 1;
|
2020-01-02 22:56:35 +00:00
|
|
|
PalEntry ClearColor = 0;
|
2020-01-03 09:48:01 +00:00
|
|
|
short vp_x, vp_y, vp_w, vp_h;
|
2020-01-05 09:21:34 +00:00
|
|
|
short sc_x = SHRT_MIN, sc_y, sc_w, sc_h;
|
2020-01-02 22:15:16 +00:00
|
|
|
|
2019-10-19 20:46:37 +00:00
|
|
|
PalEntry FogColor;
|
2019-11-05 22:35:38 +00:00
|
|
|
|
2021-01-27 22:52:40 +00:00
|
|
|
bool Apply(FRenderState & state, GLState& oldState);
|
2019-10-05 10:28:08 +00:00
|
|
|
};
|