mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 15:21:51 +00:00
Merge remote-tracking branch 'gz/master' into thereisnospoon
This commit is contained in:
commit
9a54a5affe
36 changed files with 195 additions and 59 deletions
|
@ -216,13 +216,20 @@ Note: All <bool> fields default to false unless mentioned otherwise.
|
||||||
ceilingterrain = <string>; // Sets the terrain for the sector's ceiling. Default = 'use the flat texture's terrain definition.'
|
ceilingterrain = <string>; // Sets the terrain for the sector's ceiling. Default = 'use the flat texture's terrain definition.'
|
||||||
floor_reflect = <float>; // reflectiveness of floor (OpenGL only, not functional on sloped sectors)
|
floor_reflect = <float>; // reflectiveness of floor (OpenGL only, not functional on sloped sectors)
|
||||||
ceiling_reflect = <float>; // reflectiveness of ceiling (OpenGL only, not functional on sloped sectors)
|
ceiling_reflect = <float>; // reflectiveness of ceiling (OpenGL only, not functional on sloped sectors)
|
||||||
floorglowcolor = <integer>; // Sector's floor glow color as RRGGBB value, default = 'use texture's definition'. Set to -1 to disable glowing.
|
|
||||||
floorglowheight = <float>; // Height of floor glow. This only has an effect for the sector's own glow color, but not for a texture based glow.
|
|
||||||
ceilingglowcolor = <integer>; // Sector's ceiling glow color as RRGGBB value, default = 'use texture's definition'. Set to -1 to disable glowing.
|
|
||||||
ceilingglowheight = <float>; // Height of ceiling glow. This only has an effect for the sector's own glow color, but not for a texture based glow.
|
|
||||||
fogdensity = <integer>; // Sets an explicit fog density for the sector, overriding the default calculation from the light level. Value range is 0-510,
|
fogdensity = <integer>; // Sets an explicit fog density for the sector, overriding the default calculation from the light level. Value range is 0-510,
|
||||||
// 0 meaning that the default is to be used, 2 equalling the density of a light level of 250, and 255 equalling the density of
|
// 0 meaning that the default is to be used, 2 equalling the density of a light level of 250, and 255 equalling the density of
|
||||||
// a light level of 0.
|
// a light level of 0. (OpenGL only)
|
||||||
|
floorglowcolor = <integer>; // Sector's floor glow color as RRGGBB value, default = 'use texture's definition'. Set to -1 to disable glowing. (OpenGL 3.x and newer only)
|
||||||
|
floorglowheight = <float>; // Height of floor glow. This only has an effect for the sector's own glow color, but not for a texture based glow. (OpenGL 3.x and newer only)
|
||||||
|
ceilingglowcolor = <integer>; // Sector's ceiling glow color as RRGGBB value, default = 'use texture's definition'. Set to -1 to disable glowing. (OpenGL 3.x and newer only)
|
||||||
|
ceilingglowheight = <float>; // Height of ceiling glow. This only has an effect for the sector's own glow color, but not for a texture based glow. (OpenGL 3.x and newer only)
|
||||||
|
color_floor = <int>; // Material color of sector's floor (OpenGL only, dynamic lighting only works properly in OpenGL 3.x and later) Default is white (0xffffff)
|
||||||
|
color_ceiling = <int>; // Material color of sector's ceiling (OpenGL only, dynamic lighting only works properly in OpenGL 3.x and later) Default is white (0xffffff)
|
||||||
|
color_walltop = <int>; // Material color of top of sector's sidedefs (OpenGL only, dynamic lighting only works properly in OpenGL 3.x and later,
|
||||||
|
in OpenGL 2.x this will define the entire wall's color) Default is white (0xffffff)
|
||||||
|
color_wallbottom = <int>; // Material color of bottom of sector's sidedefs (OpenGL 3.x and later only) Default is white (0xffffff)
|
||||||
|
color_sprites = <int>; // Material color of sprites in sector (OpenGL only.) Default is white (0xffffff)
|
||||||
|
|
||||||
|
|
||||||
portal_ceil_blocksound = <bool> // ceiling portal blocks sound.
|
portal_ceil_blocksound = <bool> // ceiling portal blocks sound.
|
||||||
portal_ceil_disabled = <bool> // ceiling portal disabled.
|
portal_ceil_disabled = <bool> // ceiling portal disabled.
|
||||||
|
@ -413,9 +420,12 @@ Added 'moreids' for linedefs and sectors.
|
||||||
added clarification about character encoding
|
added clarification about character encoding
|
||||||
added sector damage properties.
|
added sector damage properties.
|
||||||
|
|
||||||
1.27 05.01.2016
|
1.27 05.01.2017
|
||||||
floor_reflect and ceiling_reflect.
|
floor_reflect and ceiling_reflect.
|
||||||
|
|
||||||
|
1.28 28.01.2017
|
||||||
|
sector material colors.
|
||||||
|
|
||||||
===============================================================================
|
===============================================================================
|
||||||
EOF
|
EOF
|
||||||
===============================================================================
|
===============================================================================
|
||||||
|
|
|
@ -1898,6 +1898,7 @@ void AM_drawSubsectors()
|
||||||
double scalex, scaley;
|
double scalex, scaley;
|
||||||
double originx, originy;
|
double originx, originy;
|
||||||
FDynamicColormap *colormap;
|
FDynamicColormap *colormap;
|
||||||
|
PalEntry flatcolor;
|
||||||
mpoint_t originpt;
|
mpoint_t originpt;
|
||||||
|
|
||||||
screen->StartSimplePolys();
|
screen->StartSimplePolys();
|
||||||
|
@ -1941,6 +1942,7 @@ void AM_drawSubsectors()
|
||||||
colormap = sec->ColorMap;
|
colormap = sec->ColorMap;
|
||||||
|
|
||||||
FTextureID maptex = sec->GetTexture(sector_t::floor);
|
FTextureID maptex = sec->GetTexture(sector_t::floor);
|
||||||
|
flatcolor = sec->SpecialColors[sector_t::floor];
|
||||||
|
|
||||||
scalex = sec->GetXScale(sector_t::floor);
|
scalex = sec->GetXScale(sector_t::floor);
|
||||||
scaley = sec->GetYScale(sector_t::floor);
|
scaley = sec->GetYScale(sector_t::floor);
|
||||||
|
@ -1989,6 +1991,7 @@ void AM_drawSubsectors()
|
||||||
if (roverz < cmpz)
|
if (roverz < cmpz)
|
||||||
{
|
{
|
||||||
maptex = *(rover->top.texture);
|
maptex = *(rover->top.texture);
|
||||||
|
flatcolor = *(rover->top.flatcolor);
|
||||||
floorplane = rover->top.plane;
|
floorplane = rover->top.plane;
|
||||||
sector_t *model = rover->top.model;
|
sector_t *model = rover->top.model;
|
||||||
int selector = (rover->flags & FF_INVERTPLANES) ? sector_t::floor : sector_t::ceiling;
|
int selector = (rover->flags & FF_INVERTPLANES) ? sector_t::floor : sector_t::ceiling;
|
||||||
|
@ -2049,6 +2052,7 @@ void AM_drawSubsectors()
|
||||||
scale / scaley,
|
scale / scaley,
|
||||||
rotation,
|
rotation,
|
||||||
colormap,
|
colormap,
|
||||||
|
flatcolor,
|
||||||
floorlight,
|
floorlight,
|
||||||
f_y + f_h
|
f_y + f_h
|
||||||
);
|
);
|
||||||
|
|
|
@ -3875,7 +3875,7 @@ void FParser::SF_SetColor(void)
|
||||||
color.r=intvalue(t_argv[1]);
|
color.r=intvalue(t_argv[1]);
|
||||||
color.g=intvalue(t_argv[2]);
|
color.g=intvalue(t_argv[2]);
|
||||||
color.b=intvalue(t_argv[3]);
|
color.b=intvalue(t_argv[3]);
|
||||||
color.a=0;
|
color.a = 0;
|
||||||
}
|
}
|
||||||
else return;
|
else return;
|
||||||
|
|
||||||
|
@ -3883,7 +3883,17 @@ void FParser::SF_SetColor(void)
|
||||||
FSSectorTagIterator itr(tagnum);
|
FSSectorTagIterator itr(tagnum);
|
||||||
while ((i = itr.Next()) >= 0)
|
while ((i = itr.Next()) >= 0)
|
||||||
{
|
{
|
||||||
level.sectors[i].ColorMap = GetSpecialLights (color, level.sectors[i].ColorMap->Fade, 0);
|
if (!DFraggleThinker::ActiveThinker->setcolormaterial)
|
||||||
|
level.sectors[i].ColorMap = GetSpecialLights(color, level.sectors[i].ColorMap->Fade, 0);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// little hack for testing the D64 color stuff.
|
||||||
|
for (int j = 0; j < 4; j++) level.sectors[i].SpecialColors[j] = color;
|
||||||
|
// simulates 'nocoloredspritelighting' settings.
|
||||||
|
int v = (color.r + color.g + color.b) / 3;
|
||||||
|
v = (255 + v + v) / 3;
|
||||||
|
level.sectors[i].SpecialColors[sector_t::sprites] = PalEntry(255, v, v, v);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -73,15 +73,18 @@ struct FFsOptions : public FOptionalMapinfoData
|
||||||
{
|
{
|
||||||
identifier = "fragglescript";
|
identifier = "fragglescript";
|
||||||
nocheckposition = false;
|
nocheckposition = false;
|
||||||
|
setcolormaterial = false;
|
||||||
}
|
}
|
||||||
virtual FOptionalMapinfoData *Clone() const
|
virtual FOptionalMapinfoData *Clone() const
|
||||||
{
|
{
|
||||||
FFsOptions *newopt = new FFsOptions;
|
FFsOptions *newopt = new FFsOptions;
|
||||||
newopt->identifier = identifier;
|
newopt->identifier = identifier;
|
||||||
newopt->nocheckposition = nocheckposition;
|
newopt->nocheckposition = nocheckposition;
|
||||||
|
newopt->setcolormaterial = setcolormaterial;
|
||||||
return newopt;
|
return newopt;
|
||||||
}
|
}
|
||||||
bool nocheckposition;
|
bool nocheckposition;
|
||||||
|
bool setcolormaterial;
|
||||||
};
|
};
|
||||||
|
|
||||||
DEFINE_MAP_OPTION(fs_nocheckposition, false)
|
DEFINE_MAP_OPTION(fs_nocheckposition, false)
|
||||||
|
@ -99,6 +102,21 @@ DEFINE_MAP_OPTION(fs_nocheckposition, false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_MAP_OPTION(fs_setcolormaterial, false)
|
||||||
|
{
|
||||||
|
FFsOptions *opt = info->GetOptData<FFsOptions>("fragglescript");
|
||||||
|
|
||||||
|
if (parse.CheckAssign())
|
||||||
|
{
|
||||||
|
parse.sc.MustGetNumber();
|
||||||
|
opt->setcolormaterial = !!parse.sc.Number;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
opt->setcolormaterial = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
// Process the lump to strip all unneeded information from it
|
// Process the lump to strip all unneeded information from it
|
||||||
|
@ -307,6 +325,7 @@ bool FScriptLoader::ParseInfo(MapData * map)
|
||||||
if (opt != NULL)
|
if (opt != NULL)
|
||||||
{
|
{
|
||||||
DFraggleThinker::ActiveThinker->nocheckposition = opt->nocheckposition;
|
DFraggleThinker::ActiveThinker->nocheckposition = opt->nocheckposition;
|
||||||
|
DFraggleThinker::ActiveThinker->setcolormaterial = opt->setcolormaterial;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -695,6 +695,7 @@ public:
|
||||||
TObjPtr<DRunningScript> RunningScripts;
|
TObjPtr<DRunningScript> RunningScripts;
|
||||||
TArray<TObjPtr<AActor> > SpawnedThings;
|
TArray<TObjPtr<AActor> > SpawnedThings;
|
||||||
bool nocheckposition;
|
bool nocheckposition;
|
||||||
|
bool setcolormaterial;
|
||||||
|
|
||||||
DFraggleThinker();
|
DFraggleThinker();
|
||||||
void OnDestroy() override;
|
void OnDestroy() override;
|
||||||
|
|
|
@ -174,7 +174,7 @@ void F2DDrawer::AddTexture(FTexture *img, DrawParms &parms)
|
||||||
|
|
||||||
void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
|
void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
|
||||||
double originx, double originy, double scalex, double scaley,
|
double originx, double originy, double scalex, double scaley,
|
||||||
DAngle rotation, FDynamicColormap *colormap, int lightlevel)
|
DAngle rotation, FDynamicColormap *colormap, PalEntry flatcolor, int lightlevel)
|
||||||
{
|
{
|
||||||
FMaterial *gltexture = FMaterial::ValidateTexture(texture, false);
|
FMaterial *gltexture = FMaterial::ValidateTexture(texture, false);
|
||||||
|
|
||||||
|
@ -191,6 +191,7 @@ void F2DDrawer::AddPoly(FTexture *texture, FVector2 *points, int npoints,
|
||||||
poly.mLightLevel = lightlevel;
|
poly.mLightLevel = lightlevel;
|
||||||
poly.mVertCount = npoints;
|
poly.mVertCount = npoints;
|
||||||
poly.mVertIndex = (int)mVertices.Reserve(npoints);
|
poly.mVertIndex = (int)mVertices.Reserve(npoints);
|
||||||
|
poly.mFlatColor = flatcolor;
|
||||||
|
|
||||||
bool dorotate = rotation != 0;
|
bool dorotate = rotation != 0;
|
||||||
|
|
||||||
|
@ -438,8 +439,10 @@ void F2DDrawer::Draw()
|
||||||
cm = dsp->mColormap;
|
cm = dsp->mColormap;
|
||||||
gl_SetColor(dsp->mLightLevel, 0, cm, 1.f);
|
gl_SetColor(dsp->mLightLevel, 0, cm, 1.f);
|
||||||
gl_RenderState.SetMaterial(dsp->mTexture, CLAMP_NONE, 0, -1, false);
|
gl_RenderState.SetMaterial(dsp->mTexture, CLAMP_NONE, 0, -1, false);
|
||||||
|
gl_RenderState.SetObjectColor(dsp->mFlatColor|0xff000000);
|
||||||
gl_RenderState.Apply();
|
gl_RenderState.Apply();
|
||||||
glDrawArrays(GL_TRIANGLE_FAN, dsp->mVertIndex, dsp->mVertCount);
|
glDrawArrays(GL_TRIANGLE_FAN, dsp->mVertIndex, dsp->mVertCount);
|
||||||
|
gl_RenderState.SetObjectColor(0xffffffff);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,6 +45,7 @@ class F2DDrawer : public FSimpleVertexBuffer
|
||||||
FMaterial *mTexture;
|
FMaterial *mTexture;
|
||||||
int mLightLevel;
|
int mLightLevel;
|
||||||
FDynamicColormap *mColormap;
|
FDynamicColormap *mColormap;
|
||||||
|
PalEntry mFlatColor;
|
||||||
};
|
};
|
||||||
|
|
||||||
TArray<FSimpleVertex> mVertices;
|
TArray<FSimpleVertex> mVertices;
|
||||||
|
@ -61,7 +62,7 @@ public:
|
||||||
|
|
||||||
void AddPoly(FTexture *texture, FVector2 *points, int npoints,
|
void AddPoly(FTexture *texture, FVector2 *points, int npoints,
|
||||||
double originx, double originy, double scalex, double scaley,
|
double originx, double originy, double scalex, double scaley,
|
||||||
DAngle rotation, FDynamicColormap *colormap, int lightlevel);
|
DAngle rotation, FDynamicColormap *colormap, PalEntry flatcolor, int lightlevel);
|
||||||
|
|
||||||
void AddLine(int x1, int y1, int x2, int y2, int palcolor, uint32 color);
|
void AddLine(int x1, int y1, int x2, int y2, int palcolor, uint32 color);
|
||||||
void AddPixel(int x1, int y1, int palcolor, uint32 color);
|
void AddPixel(int x1, int y1, int palcolor, uint32 color);
|
||||||
|
|
|
@ -304,6 +304,11 @@ float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity)
|
||||||
// uses approximations of Legacy's default settings.
|
// uses approximations of Legacy's default settings.
|
||||||
density = fogdensity ? fogdensity : 18;
|
density = fogdensity ? fogdensity : 18;
|
||||||
}
|
}
|
||||||
|
else if (sectorfogdensity != 0)
|
||||||
|
{
|
||||||
|
// case 2: Sector has an explicit fog density set.
|
||||||
|
density = sectorfogdensity;
|
||||||
|
}
|
||||||
else if ((fogcolor.d & 0xffffff) == 0)
|
else if ((fogcolor.d & 0xffffff) == 0)
|
||||||
{
|
{
|
||||||
// case 1: black fog
|
// case 1: black fog
|
||||||
|
@ -316,11 +321,6 @@ float gl_GetFogDensity(int lightlevel, PalEntry fogcolor, int sectorfogdensity)
|
||||||
density = 0;
|
density = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (sectorfogdensity != 0)
|
|
||||||
{
|
|
||||||
// case 2: Sector has an explicit fog density set.
|
|
||||||
density = sectorfogdensity;
|
|
||||||
}
|
|
||||||
else if (outsidefogdensity != 0 && outsidefogcolor.a != 0xff && (fogcolor.d & 0xffffff) == (outsidefogcolor.d & 0xffffff))
|
else if (outsidefogdensity != 0 && outsidefogcolor.a != 0xff && (fogcolor.d & 0xffffff) == (outsidefogcolor.d & 0xffffff))
|
||||||
{
|
{
|
||||||
// case 3. outsidefogdensity has already been set as needed
|
// case 3. outsidefogdensity has already been set as needed
|
||||||
|
|
|
@ -135,11 +135,13 @@ CUSTOM_CVAR(Float, gl_ssao_exponent, 1.8f, 0)
|
||||||
|
|
||||||
CUSTOM_CVAR(Float, gl_paltonemap_powtable, 2.0f, CVAR_ARCHIVE | CVAR_NOINITCALL)
|
CUSTOM_CVAR(Float, gl_paltonemap_powtable, 2.0f, CVAR_ARCHIVE | CVAR_NOINITCALL)
|
||||||
{
|
{
|
||||||
|
if (GLRenderer)
|
||||||
GLRenderer->ClearTonemapPalette();
|
GLRenderer->ClearTonemapPalette();
|
||||||
}
|
}
|
||||||
|
|
||||||
CUSTOM_CVAR(Bool, gl_paltonemap_reverselookup, true, CVAR_ARCHIVE | CVAR_NOINITCALL)
|
CUSTOM_CVAR(Bool, gl_paltonemap_reverselookup, true, CVAR_ARCHIVE | CVAR_NOINITCALL)
|
||||||
{
|
{
|
||||||
|
if (GLRenderer)
|
||||||
GLRenderer->ClearTonemapPalette();
|
GLRenderer->ClearTonemapPalette();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -216,7 +216,7 @@ public:
|
||||||
|
|
||||||
void FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
|
void FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
|
||||||
double originx, double originy, double scalex, double scaley,
|
double originx, double originy, double scalex, double scaley,
|
||||||
DAngle rotation, FDynamicColormap *colormap, int lightlevel, int bottomclip);
|
DAngle rotation, FDynamicColormap *colormap, PalEntry flatcolor, int lightlevel, int bottomclip);
|
||||||
|
|
||||||
int PTM_BestColor (const uint32 *pal_in, int r, int g, int b, int first, int num);
|
int PTM_BestColor (const uint32 *pal_in, int r, int g, int b, int first, int num);
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,7 @@ void FRenderState::Reset()
|
||||||
mModelMatrixEnabled = false;
|
mModelMatrixEnabled = false;
|
||||||
mTextureMatrixEnabled = false;
|
mTextureMatrixEnabled = false;
|
||||||
mObjectColor = 0xffffffff;
|
mObjectColor = 0xffffffff;
|
||||||
|
mObjectColor2 = 0;
|
||||||
mVertexBuffer = mCurrentVertexBuffer = NULL;
|
mVertexBuffer = mCurrentVertexBuffer = NULL;
|
||||||
mColormapState = CM_DEFAULT;
|
mColormapState = CM_DEFAULT;
|
||||||
mSoftLight = 0;
|
mSoftLight = 0;
|
||||||
|
@ -144,6 +145,8 @@ bool FRenderState::ApplyShader()
|
||||||
|
|
||||||
glVertexAttrib4fv(VATTR_COLOR, mColor.vec);
|
glVertexAttrib4fv(VATTR_COLOR, mColor.vec);
|
||||||
glVertexAttrib4fv(VATTR_NORMAL, mNormal.vec);
|
glVertexAttrib4fv(VATTR_NORMAL, mNormal.vec);
|
||||||
|
//activeShader->muObjectColor2.Set(mObjectColor2);
|
||||||
|
activeShader->muObjectColor2.Set(mObjectColor2);
|
||||||
|
|
||||||
activeShader->muDesaturation.Set(mDesaturation / 255.f);
|
activeShader->muDesaturation.Set(mDesaturation / 255.f);
|
||||||
activeShader->muFogEnabled.Set(fogset);
|
activeShader->muFogEnabled.Set(fogset);
|
||||||
|
@ -166,8 +169,6 @@ bool FRenderState::ApplyShader()
|
||||||
{
|
{
|
||||||
activeShader->muGlowTopColor.Set(mGlowTop.vec);
|
activeShader->muGlowTopColor.Set(mGlowTop.vec);
|
||||||
activeShader->muGlowBottomColor.Set(mGlowBottom.vec);
|
activeShader->muGlowBottomColor.Set(mGlowBottom.vec);
|
||||||
activeShader->muGlowTopPlane.Set(mGlowTopPlane.vec);
|
|
||||||
activeShader->muGlowBottomPlane.Set(mGlowBottomPlane.vec);
|
|
||||||
activeShader->currentglowstate = 1;
|
activeShader->currentglowstate = 1;
|
||||||
}
|
}
|
||||||
else if (activeShader->currentglowstate)
|
else if (activeShader->currentglowstate)
|
||||||
|
@ -175,10 +176,13 @@ bool FRenderState::ApplyShader()
|
||||||
// if glowing is on, disable it.
|
// if glowing is on, disable it.
|
||||||
activeShader->muGlowTopColor.Set(nulvec);
|
activeShader->muGlowTopColor.Set(nulvec);
|
||||||
activeShader->muGlowBottomColor.Set(nulvec);
|
activeShader->muGlowBottomColor.Set(nulvec);
|
||||||
activeShader->muGlowTopPlane.Set(nulvec);
|
|
||||||
activeShader->muGlowBottomPlane.Set(nulvec);
|
|
||||||
activeShader->currentglowstate = 0;
|
activeShader->currentglowstate = 0;
|
||||||
}
|
}
|
||||||
|
if (mGlowEnabled || mObjectColor2.a != 0)
|
||||||
|
{
|
||||||
|
activeShader->muGlowTopPlane.Set(mGlowTopPlane.vec);
|
||||||
|
activeShader->muGlowBottomPlane.Set(mGlowBottomPlane.vec);
|
||||||
|
}
|
||||||
|
|
||||||
if (mSplitEnabled)
|
if (mSplitEnabled)
|
||||||
{
|
{
|
||||||
|
|
|
@ -106,6 +106,7 @@ class FRenderState
|
||||||
FStateVec4 mClipLine;
|
FStateVec4 mClipLine;
|
||||||
PalEntry mFogColor;
|
PalEntry mFogColor;
|
||||||
PalEntry mObjectColor;
|
PalEntry mObjectColor;
|
||||||
|
PalEntry mObjectColor2;
|
||||||
FStateVec4 mDynColor;
|
FStateVec4 mDynColor;
|
||||||
float mClipSplit[2];
|
float mClipSplit[2];
|
||||||
|
|
||||||
|
@ -381,6 +382,11 @@ public:
|
||||||
mObjectColor = pe;
|
mObjectColor = pe;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetObjectColor2(PalEntry pe)
|
||||||
|
{
|
||||||
|
mObjectColor2 = pe;
|
||||||
|
}
|
||||||
|
|
||||||
void SetFog(PalEntry c, float d)
|
void SetFog(PalEntry c, float d)
|
||||||
{
|
{
|
||||||
const float LOG2E = 1.442692f; // = 1/log(2)
|
const float LOG2E = 1.442692f; // = 1/log(2)
|
||||||
|
|
|
@ -379,6 +379,7 @@ void GLFlat::Draw(int pass, bool trans) // trans only has meaning for GLPASS_LIG
|
||||||
case GLPASS_ALL: // Same, but also creates the dynlight data.
|
case GLPASS_ALL: // Same, but also creates the dynlight data.
|
||||||
gl_SetColor(lightlevel, rel, Colormap,1.0f);
|
gl_SetColor(lightlevel, rel, Colormap,1.0f);
|
||||||
gl_SetFog(lightlevel, rel, &Colormap, false);
|
gl_SetFog(lightlevel, rel, &Colormap, false);
|
||||||
|
gl_RenderState.SetObjectColor(FlatColor | 0xff000000);
|
||||||
if (sector->special != GLSector_Skybox)
|
if (sector->special != GLSector_Skybox)
|
||||||
{
|
{
|
||||||
gl_RenderState.SetMaterial(gltexture, CLAMP_NONE, 0, -1, false);
|
gl_RenderState.SetMaterial(gltexture, CLAMP_NONE, 0, -1, false);
|
||||||
|
@ -391,6 +392,7 @@ void GLFlat::Draw(int pass, bool trans) // trans only has meaning for GLPASS_LIG
|
||||||
gl_RenderState.SetMaterial(gltexture, CLAMP_XY, 0, -1, false);
|
gl_RenderState.SetMaterial(gltexture, CLAMP_XY, 0, -1, false);
|
||||||
DrawSkyboxSector(pass, (pass == GLPASS_ALL || dynlightindex > -1));
|
DrawSkyboxSector(pass, (pass == GLPASS_ALL || dynlightindex > -1));
|
||||||
}
|
}
|
||||||
|
gl_RenderState.SetObjectColor(0xffffffff);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GLPASS_LIGHTSONLY:
|
case GLPASS_LIGHTSONLY:
|
||||||
|
@ -404,6 +406,7 @@ void GLFlat::Draw(int pass, bool trans) // trans only has meaning for GLPASS_LIG
|
||||||
if (renderstyle==STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE);
|
if (renderstyle==STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE);
|
||||||
gl_SetColor(lightlevel, rel, Colormap, alpha);
|
gl_SetColor(lightlevel, rel, Colormap, alpha);
|
||||||
gl_SetFog(lightlevel, rel, &Colormap, false);
|
gl_SetFog(lightlevel, rel, &Colormap, false);
|
||||||
|
gl_RenderState.SetObjectColor(FlatColor | 0xff000000);
|
||||||
if (!gltexture)
|
if (!gltexture)
|
||||||
{
|
{
|
||||||
gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f);
|
gl_RenderState.AlphaFunc(GL_GEQUAL, 0.f);
|
||||||
|
@ -421,6 +424,7 @@ void GLFlat::Draw(int pass, bool trans) // trans only has meaning for GLPASS_LIG
|
||||||
gl_RenderState.EnableTextureMatrix(false);
|
gl_RenderState.EnableTextureMatrix(false);
|
||||||
}
|
}
|
||||||
if (renderstyle==STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
if (renderstyle==STYLE_Add) gl_RenderState.BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
gl_RenderState.SetObjectColor(0xffffffff);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GLPASS_LIGHTTEX:
|
case GLPASS_LIGHTTEX:
|
||||||
|
@ -546,8 +550,16 @@ void GLFlat::SetFrom3DFloor(F3DFloor *rover, bool top, bool underside)
|
||||||
lightlist_t *light = P_GetPlaneLight(sector, plane.plane, underside);
|
lightlist_t *light = P_GetPlaneLight(sector, plane.plane, underside);
|
||||||
lightlevel = gl_ClampLight(*light->p_lightlevel);
|
lightlevel = gl_ClampLight(*light->p_lightlevel);
|
||||||
|
|
||||||
if (rover->flags & FF_FOG) Colormap.LightColor = (light->extra_colormap)->Fade;
|
if (rover->flags & FF_FOG)
|
||||||
else Colormap.CopyFrom3DLight(light);
|
{
|
||||||
|
Colormap.LightColor = (light->extra_colormap)->Fade;
|
||||||
|
FlatColor = 0xffffffff;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Colormap.CopyFrom3DLight(light);
|
||||||
|
FlatColor = *plane.flatcolor;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
alpha = rover->alpha/255.0f;
|
alpha = rover->alpha/255.0f;
|
||||||
|
@ -604,6 +616,7 @@ void GLFlat::ProcessSector(sector_t * frontsector)
|
||||||
|
|
||||||
lightlevel = gl_ClampLight(frontsector->GetFloorLight());
|
lightlevel = gl_ClampLight(frontsector->GetFloorLight());
|
||||||
Colormap = frontsector->ColorMap;
|
Colormap = frontsector->ColorMap;
|
||||||
|
FlatColor = frontsector->SpecialColors[sector_t::floor];
|
||||||
port = frontsector->ValidatePortal(sector_t::floor);
|
port = frontsector->ValidatePortal(sector_t::floor);
|
||||||
if ((stack = (port != NULL)))
|
if ((stack = (port != NULL)))
|
||||||
{
|
{
|
||||||
|
@ -663,6 +676,7 @@ void GLFlat::ProcessSector(sector_t * frontsector)
|
||||||
|
|
||||||
lightlevel = gl_ClampLight(frontsector->GetCeilingLight());
|
lightlevel = gl_ClampLight(frontsector->GetCeilingLight());
|
||||||
Colormap = frontsector->ColorMap;
|
Colormap = frontsector->ColorMap;
|
||||||
|
FlatColor = frontsector->SpecialColors[sector_t::ceiling];
|
||||||
port = frontsector->ValidatePortal(sector_t::ceiling);
|
port = frontsector->ValidatePortal(sector_t::ceiling);
|
||||||
if ((stack = (port != NULL)))
|
if ((stack = (port != NULL)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -309,6 +309,7 @@ void GLSprite::Draw(int pass)
|
||||||
gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_sprite_threshold);
|
gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_sprite_threshold);
|
||||||
gl_RenderState.SetColor(0.2f,0.2f,0.2f,fuzzalpha, Colormap.desaturation);
|
gl_RenderState.SetColor(0.2f,0.2f,0.2f,fuzzalpha, Colormap.desaturation);
|
||||||
additivefog = true;
|
additivefog = true;
|
||||||
|
lightlist = nullptr; // the fuzz effect does not use the sector's light level so splitting is not needed.
|
||||||
}
|
}
|
||||||
else if (RenderStyle.BlendOp == STYLEOP_Add && RenderStyle.DestAlpha == STYLEALPHA_One)
|
else if (RenderStyle.BlendOp == STYLEOP_Add && RenderStyle.DestAlpha == STYLEALPHA_One)
|
||||||
{
|
{
|
||||||
|
@ -320,15 +321,21 @@ void GLSprite::Draw(int pass)
|
||||||
glEnable(GL_POLYGON_OFFSET_FILL);
|
glEnable(GL_POLYGON_OFFSET_FILL);
|
||||||
glPolygonOffset(-1.0f, -128.0f);
|
glPolygonOffset(-1.0f, -128.0f);
|
||||||
}
|
}
|
||||||
if (RenderStyle.BlendOp!=STYLEOP_Shadow)
|
if (RenderStyle.BlendOp != STYLEOP_Shadow)
|
||||||
{
|
{
|
||||||
if (gl_lights && GLRenderer->mLightCount && !gl_fixedcolormap && !fullbright)
|
if (gl_lights && GLRenderer->mLightCount && !gl_fixedcolormap && !fullbright)
|
||||||
{
|
{
|
||||||
gl_SetDynSpriteLight(gl_light_sprites ? actor : NULL, gl_light_particles ? particle : NULL);
|
gl_SetDynSpriteLight(gl_light_sprites ? actor : NULL, gl_light_particles ? particle : NULL);
|
||||||
}
|
}
|
||||||
|
PalEntry finalcol(ThingColor.a,
|
||||||
|
ThingColor.r * actor->Sector->SpecialColors[sector_t::sprites].r / 255,
|
||||||
|
ThingColor.g * actor->Sector->SpecialColors[sector_t::sprites].g / 255,
|
||||||
|
ThingColor.b * actor->Sector->SpecialColors[sector_t::sprites].b / 255);
|
||||||
|
|
||||||
|
gl_RenderState.SetObjectColor(finalcol);
|
||||||
gl_SetColor(lightlevel, rel, Colormap, trans);
|
gl_SetColor(lightlevel, rel, Colormap, trans);
|
||||||
}
|
}
|
||||||
gl_RenderState.SetObjectColor(ThingColor);
|
|
||||||
|
|
||||||
if (gl_isBlack(Colormap.FadeColor)) foglevel=lightlevel;
|
if (gl_isBlack(Colormap.FadeColor)) foglevel=lightlevel;
|
||||||
|
|
||||||
|
|
|
@ -301,6 +301,7 @@ public:
|
||||||
FMaterial *gltexture;
|
FMaterial *gltexture;
|
||||||
|
|
||||||
FColormap Colormap; // light and fog
|
FColormap Colormap; // light and fog
|
||||||
|
PalEntry FlatColor;
|
||||||
ERenderStyle renderstyle;
|
ERenderStyle renderstyle;
|
||||||
|
|
||||||
float alpha;
|
float alpha;
|
||||||
|
|
|
@ -24,6 +24,7 @@
|
||||||
#include "p_local.h"
|
#include "p_local.h"
|
||||||
#include "p_lnspec.h"
|
#include "p_lnspec.h"
|
||||||
#include "a_sharedglobal.h"
|
#include "a_sharedglobal.h"
|
||||||
|
#include "g_levellocals.h"
|
||||||
#include "gl/gl_functions.h"
|
#include "gl/gl_functions.h"
|
||||||
|
|
||||||
#include "gl/system/gl_interface.h"
|
#include "gl/system/gl_interface.h"
|
||||||
|
@ -326,9 +327,9 @@ void GLWall::RenderTextured(int rflags)
|
||||||
if (flags & GLWF_GLOW)
|
if (flags & GLWF_GLOW)
|
||||||
{
|
{
|
||||||
gl_RenderState.EnableGlow(true);
|
gl_RenderState.EnableGlow(true);
|
||||||
gl_RenderState.SetGlowPlanes(topplane, bottomplane);
|
|
||||||
gl_RenderState.SetGlowParams(topglowcolor, bottomglowcolor);
|
gl_RenderState.SetGlowParams(topglowcolor, bottomglowcolor);
|
||||||
}
|
}
|
||||||
|
gl_RenderState.SetGlowPlanes(topplane, bottomplane);
|
||||||
gl_RenderState.SetMaterial(gltexture, flags & 3, 0, -1, false);
|
gl_RenderState.SetMaterial(gltexture, flags & 3, 0, -1, false);
|
||||||
|
|
||||||
if (type == RENDERWALL_M2SNF)
|
if (type == RENDERWALL_M2SNF)
|
||||||
|
@ -339,12 +340,14 @@ void GLWall::RenderTextured(int rflags)
|
||||||
}
|
}
|
||||||
gl_SetFog(255, 0, NULL, false);
|
gl_SetFog(255, 0, NULL, false);
|
||||||
}
|
}
|
||||||
|
gl_RenderState.SetObjectColor(seg->frontsector->SpecialColors[sector_t::walltop] | 0xff000000);
|
||||||
|
gl_RenderState.SetObjectColor2(seg->frontsector->SpecialColors[sector_t::wallbottom] | 0xff000000);
|
||||||
|
|
||||||
float absalpha = fabsf(alpha);
|
float absalpha = fabsf(alpha);
|
||||||
if (lightlist == NULL)
|
if (lightlist == NULL)
|
||||||
{
|
{
|
||||||
gl_SetColor(lightlevel, rel, Colormap, absalpha);
|
|
||||||
if (type != RENDERWALL_M2SNF) gl_SetFog(lightlevel, rel, &Colormap, RenderStyle == STYLE_Add);
|
if (type != RENDERWALL_M2SNF) gl_SetFog(lightlevel, rel, &Colormap, RenderStyle == STYLE_Add);
|
||||||
|
gl_SetColor(lightlevel, rel, Colormap, absalpha);
|
||||||
RenderWall(rflags);
|
RenderWall(rflags);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -374,6 +377,8 @@ void GLWall::RenderTextured(int rflags)
|
||||||
|
|
||||||
gl_RenderState.EnableSplit(false);
|
gl_RenderState.EnableSplit(false);
|
||||||
}
|
}
|
||||||
|
gl_RenderState.SetObjectColor(0xffffffff);
|
||||||
|
gl_RenderState.SetObjectColor2(0);
|
||||||
gl_RenderState.SetTextureMode(tmode);
|
gl_RenderState.SetTextureMode(tmode);
|
||||||
gl_RenderState.EnableGlow(false);
|
gl_RenderState.EnableGlow(false);
|
||||||
}
|
}
|
||||||
|
|
|
@ -370,7 +370,12 @@ void FGLRenderer::DrawPlayerSprites(sector_t * viewsector, bool hudModelStep)
|
||||||
|
|
||||||
// now draw the different layers of the weapon
|
// now draw the different layers of the weapon
|
||||||
gl_RenderState.EnableBrightmap(true);
|
gl_RenderState.EnableBrightmap(true);
|
||||||
gl_RenderState.SetObjectColor(ThingColor);
|
PalEntry finalcol(ThingColor.a,
|
||||||
|
ThingColor.r * viewsector->SpecialColors[sector_t::sprites].r / 255,
|
||||||
|
ThingColor.g * viewsector->SpecialColors[sector_t::sprites].g / 255,
|
||||||
|
ThingColor.b * viewsector->SpecialColors[sector_t::sprites].b / 255);
|
||||||
|
|
||||||
|
gl_RenderState.SetObjectColor(finalcol);
|
||||||
gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_sprite_threshold);
|
gl_RenderState.AlphaFunc(GL_GEQUAL, gl_mask_sprite_threshold);
|
||||||
|
|
||||||
// hack alert! Rather than changing everything in the underlying lighting code let's just temporarily change
|
// hack alert! Rather than changing everything in the underlying lighting code let's just temporarily change
|
||||||
|
|
|
@ -225,6 +225,7 @@ bool FShader::Load(const char * name, const char * vert_prog_lump, const char *
|
||||||
muFogColor.Init(hShader, "uFogColor");
|
muFogColor.Init(hShader, "uFogColor");
|
||||||
muDynLightColor.Init(hShader, "uDynLightColor");
|
muDynLightColor.Init(hShader, "uDynLightColor");
|
||||||
muObjectColor.Init(hShader, "uObjectColor");
|
muObjectColor.Init(hShader, "uObjectColor");
|
||||||
|
muObjectColor2.Init(hShader, "uObjectColor2");
|
||||||
muGlowBottomColor.Init(hShader, "uGlowBottomColor");
|
muGlowBottomColor.Init(hShader, "uGlowBottomColor");
|
||||||
muGlowTopColor.Init(hShader, "uGlowTopColor");
|
muGlowTopColor.Init(hShader, "uGlowTopColor");
|
||||||
muGlowBottomPlane.Init(hShader, "uGlowBottomPlane");
|
muGlowBottomPlane.Init(hShader, "uGlowBottomPlane");
|
||||||
|
|
|
@ -271,6 +271,7 @@ class FShader
|
||||||
FBufferedUniformPE muFogColor;
|
FBufferedUniformPE muFogColor;
|
||||||
FBufferedUniform4f muDynLightColor;
|
FBufferedUniform4f muDynLightColor;
|
||||||
FBufferedUniformPE muObjectColor;
|
FBufferedUniformPE muObjectColor;
|
||||||
|
FBufferedUniformPE muObjectColor2;
|
||||||
FUniform4f muGlowBottomColor;
|
FUniform4f muGlowBottomColor;
|
||||||
FUniform4f muGlowTopColor;
|
FUniform4f muGlowTopColor;
|
||||||
FUniform4f muGlowBottomPlane;
|
FUniform4f muGlowBottomPlane;
|
||||||
|
|
|
@ -470,11 +470,11 @@ void OpenGLFrameBuffer::Clear(int left, int top, int right, int bottom, int palc
|
||||||
|
|
||||||
void OpenGLFrameBuffer::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
|
void OpenGLFrameBuffer::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
|
||||||
double originx, double originy, double scalex, double scaley,
|
double originx, double originy, double scalex, double scaley,
|
||||||
DAngle rotation, FDynamicColormap *colormap, int lightlevel, int bottomclip)
|
DAngle rotation, FDynamicColormap *colormap, PalEntry flatcolor, int lightlevel, int bottomclip)
|
||||||
{
|
{
|
||||||
if (GLRenderer != nullptr && GLRenderer->m2DDrawer != nullptr && npoints >= 3)
|
if (GLRenderer != nullptr && GLRenderer->m2DDrawer != nullptr && npoints >= 3)
|
||||||
{
|
{
|
||||||
GLRenderer->m2DDrawer->AddPoly(texture, points, npoints, originx, originy, scalex, scaley, rotation, colormap, lightlevel);
|
GLRenderer->m2DDrawer->AddPoly(texture, points, npoints, originx, originy, scalex, scaley, rotation, colormap, flatcolor, lightlevel);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -71,7 +71,7 @@ public:
|
||||||
|
|
||||||
void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
|
void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
|
||||||
double originx, double originy, double scalex, double scaley,
|
double originx, double originy, double scalex, double scaley,
|
||||||
DAngle rotation, FDynamicColormap *colormap, int lightlevel, int bottomclip);
|
DAngle rotation, FDynamicColormap *colormap, PalEntry flatcolor, int lightlevel, int bottomclip);
|
||||||
|
|
||||||
FNativePalette *CreatePalette(FRemapTable *remap);
|
FNativePalette *CreatePalette(FRemapTable *remap);
|
||||||
|
|
||||||
|
|
|
@ -549,6 +549,11 @@ xx(Lightceilingabsolute)
|
||||||
xx(Gravity)
|
xx(Gravity)
|
||||||
xx(Lightcolor)
|
xx(Lightcolor)
|
||||||
xx(Fadecolor)
|
xx(Fadecolor)
|
||||||
|
xx(Color_Floor)
|
||||||
|
xx(Color_Ceiling)
|
||||||
|
xx(Color_Walltop)
|
||||||
|
xx(Color_Wallbottom)
|
||||||
|
xx(Color_Sprites)
|
||||||
xx(Desaturation)
|
xx(Desaturation)
|
||||||
xx(SoundSequence)
|
xx(SoundSequence)
|
||||||
xx(Silent)
|
xx(Silent)
|
||||||
|
|
|
@ -136,12 +136,14 @@ static void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flag
|
||||||
{
|
{
|
||||||
ffloor->bottom.plane = &sec2->floorplane;
|
ffloor->bottom.plane = &sec2->floorplane;
|
||||||
ffloor->bottom.texture = &sec2->planes[sector_t::floor].Texture;
|
ffloor->bottom.texture = &sec2->planes[sector_t::floor].Texture;
|
||||||
|
ffloor->bottom.flatcolor = &sec2->SpecialColors[sector_t::floor];
|
||||||
ffloor->bottom.isceiling = sector_t::floor;
|
ffloor->bottom.isceiling = sector_t::floor;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ffloor->bottom.plane = &sec2->ceilingplane;
|
ffloor->bottom.plane = &sec2->ceilingplane;
|
||||||
ffloor->bottom.texture = &sec2->planes[sector_t::ceiling].Texture;
|
ffloor->bottom.texture = &sec2->planes[sector_t::ceiling].Texture;
|
||||||
|
ffloor->bottom.flatcolor = &sec2->SpecialColors[sector_t::ceiling];
|
||||||
ffloor->bottom.isceiling = sector_t::ceiling;
|
ffloor->bottom.isceiling = sector_t::ceiling;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,6 +151,7 @@ static void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flag
|
||||||
{
|
{
|
||||||
ffloor->top.plane = &sec2->ceilingplane;
|
ffloor->top.plane = &sec2->ceilingplane;
|
||||||
ffloor->top.texture = &sec2->planes[sector_t::ceiling].Texture;
|
ffloor->top.texture = &sec2->planes[sector_t::ceiling].Texture;
|
||||||
|
ffloor->top.flatcolor = &sec2->SpecialColors[sector_t::ceiling];
|
||||||
ffloor->toplightlevel = &sec2->lightlevel;
|
ffloor->toplightlevel = &sec2->lightlevel;
|
||||||
ffloor->top.isceiling = sector_t::ceiling;
|
ffloor->top.isceiling = sector_t::ceiling;
|
||||||
}
|
}
|
||||||
|
@ -156,6 +159,7 @@ static void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flag
|
||||||
{
|
{
|
||||||
ffloor->top.plane = &sec->floorplane;
|
ffloor->top.plane = &sec->floorplane;
|
||||||
ffloor->top.texture = &sec2->planes[sector_t::floor].Texture;
|
ffloor->top.texture = &sec2->planes[sector_t::floor].Texture;
|
||||||
|
ffloor->top.flatcolor = &sec2->SpecialColors[sector_t::floor];
|
||||||
ffloor->toplightlevel = &sec->lightlevel;
|
ffloor->toplightlevel = &sec->lightlevel;
|
||||||
ffloor->top.isceiling = sector_t::floor;
|
ffloor->top.isceiling = sector_t::floor;
|
||||||
ffloor->top.model = sec;
|
ffloor->top.model = sec;
|
||||||
|
@ -165,10 +169,7 @@ static void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flag
|
||||||
if (flags&FF_INVERTSECTOR)
|
if (flags&FF_INVERTSECTOR)
|
||||||
{
|
{
|
||||||
// switch the planes
|
// switch the planes
|
||||||
F3DFloor::planeref sp = ffloor->top;
|
std::swap(ffloor->top, ffloor->bottom);
|
||||||
|
|
||||||
ffloor->top=ffloor->bottom;
|
|
||||||
ffloor->bottom=sp;
|
|
||||||
|
|
||||||
if (flags&FF_SWIMMABLE)
|
if (flags&FF_SWIMMABLE)
|
||||||
{
|
{
|
||||||
|
@ -192,11 +193,10 @@ static void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flag
|
||||||
ffloor->flags &= ~FF_ADDITIVETRANS;
|
ffloor->flags &= ~FF_ADDITIVETRANS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(flags & FF_THISINSIDE) {
|
if(flags & FF_THISINSIDE)
|
||||||
|
{
|
||||||
// switch the planes
|
// switch the planes
|
||||||
F3DFloor::planeref sp = ffloor->top;
|
std::swap(ffloor->top, ffloor->bottom);
|
||||||
ffloor->top=ffloor->bottom;
|
|
||||||
ffloor->bottom=sp;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sec->e->XFloor.ffloors.Push(ffloor);
|
sec->e->XFloor.ffloors.Push(ffloor);
|
||||||
|
|
|
@ -69,6 +69,7 @@ struct F3DFloor
|
||||||
secplane_t * plane;
|
secplane_t * plane;
|
||||||
const FTextureID * texture;
|
const FTextureID * texture;
|
||||||
sector_t * model;
|
sector_t * model;
|
||||||
|
PalEntry * flatcolor;
|
||||||
int isceiling;
|
int isceiling;
|
||||||
int vindex;
|
int vindex;
|
||||||
bool copied;
|
bool copied;
|
||||||
|
|
|
@ -276,6 +276,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, sector_t &p, sector_t
|
||||||
("linked_floor", p.e->Linked.Floor.Sectors)
|
("linked_floor", p.e->Linked.Floor.Sectors)
|
||||||
("linked_ceiling", p.e->Linked.Ceiling.Sectors)
|
("linked_ceiling", p.e->Linked.Ceiling.Sectors)
|
||||||
("colormap", p.ColorMap, def->ColorMap)
|
("colormap", p.ColorMap, def->ColorMap)
|
||||||
|
.Array("specialcolors", p.SpecialColors, def->SpecialColors, 5, true)
|
||||||
("gravity", p.gravity, def->gravity)
|
("gravity", p.gravity, def->gravity)
|
||||||
.Terrain("floorterrain", p.terrainnum[0], &def->terrainnum[0])
|
.Terrain("floorterrain", p.terrainnum[0], &def->terrainnum[0])
|
||||||
.Terrain("ceilingterrain", p.terrainnum[1], &def->terrainnum[1])
|
.Terrain("ceilingterrain", p.terrainnum[1], &def->terrainnum[1])
|
||||||
|
|
|
@ -1504,6 +1504,7 @@ void P_LoadSectors (MapData *map, FMissingTextureTracker &missingtex)
|
||||||
ss->SeqName = NAME_None;
|
ss->SeqName = NAME_None;
|
||||||
ss->nextsec = -1; //jff 2/26/98 add fields to support locking out
|
ss->nextsec = -1; //jff 2/26/98 add fields to support locking out
|
||||||
ss->prevsec = -1; // stair retriggering until build completes
|
ss->prevsec = -1; // stair retriggering until build completes
|
||||||
|
memset(ss->SpecialColors, -1, sizeof(ss->SpecialColors));
|
||||||
|
|
||||||
ss->SetAlpha(sector_t::floor, 1.);
|
ss->SetAlpha(sector_t::floor, 1.);
|
||||||
ss->SetAlpha(sector_t::ceiling, 1.);
|
ss->SetAlpha(sector_t::ceiling, 1.);
|
||||||
|
|
|
@ -1307,6 +1307,7 @@ public:
|
||||||
sec->sectornum = index;
|
sec->sectornum = index;
|
||||||
sec->damageinterval = 32;
|
sec->damageinterval = 32;
|
||||||
sec->terrainnum[sector_t::ceiling] = sec->terrainnum[sector_t::floor] = -1;
|
sec->terrainnum[sector_t::ceiling] = sec->terrainnum[sector_t::floor] = -1;
|
||||||
|
memset(sec->SpecialColors, -1, sizeof(sec->SpecialColors));
|
||||||
if (floordrop) sec->Flags = SECF_FLOORDROP;
|
if (floordrop) sec->Flags = SECF_FLOORDROP;
|
||||||
// killough 3/7/98: end changes
|
// killough 3/7/98: end changes
|
||||||
|
|
||||||
|
@ -1459,6 +1460,26 @@ public:
|
||||||
fadecolor = CheckInt(key);
|
fadecolor = CheckInt(key);
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
case NAME_Color_Floor:
|
||||||
|
sec->SpecialColors[sector_t::floor] = CheckInt(key) || 0xff000000;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NAME_Color_Ceiling:
|
||||||
|
sec->SpecialColors[sector_t::ceiling] = CheckInt(key) || 0xff000000;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NAME_Color_Walltop:
|
||||||
|
sec->SpecialColors[sector_t::walltop] = CheckInt(key) || 0xff000000;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NAME_Color_Wallbottom:
|
||||||
|
sec->SpecialColors[sector_t::wallbottom] = CheckInt(key) || 0xff000000;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case NAME_Color_Sprites:
|
||||||
|
sec->SpecialColors[sector_t::sprites] = CheckInt(key) || 0xff000000;
|
||||||
|
break;
|
||||||
|
|
||||||
case NAME_Desaturation:
|
case NAME_Desaturation:
|
||||||
desaturation = int(255*CheckFloat(key));
|
desaturation = int(255*CheckFloat(key));
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -660,10 +660,15 @@ public:
|
||||||
FSectorPortal *ValidatePortal(int which);
|
FSectorPortal *ValidatePortal(int which);
|
||||||
void CheckPortalPlane(int plane);
|
void CheckPortalPlane(int plane);
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
floor,
|
floor,
|
||||||
ceiling
|
ceiling,
|
||||||
|
// only used for specialcolors array
|
||||||
|
walltop,
|
||||||
|
wallbottom,
|
||||||
|
sprites
|
||||||
};
|
};
|
||||||
|
|
||||||
struct splane
|
struct splane
|
||||||
|
@ -961,6 +966,7 @@ public:
|
||||||
|
|
||||||
// [RH] give floor and ceiling even more properties
|
// [RH] give floor and ceiling even more properties
|
||||||
FDynamicColormap *ColorMap; // [RH] Per-sector colormap
|
FDynamicColormap *ColorMap; // [RH] Per-sector colormap
|
||||||
|
PalEntry SpecialColors[5];
|
||||||
|
|
||||||
|
|
||||||
TObjPtr<AActor> SoundTarget;
|
TObjPtr<AActor> SoundTarget;
|
||||||
|
|
|
@ -8202,14 +8202,16 @@ FxExpression *FxVMFunctionCall::Resolve(FCompileContext& ctx)
|
||||||
{
|
{
|
||||||
// only cast implicit-string types for vararg, leave everything else as-is
|
// only cast implicit-string types for vararg, leave everything else as-is
|
||||||
// this was outright copypasted from FxFormat
|
// this was outright copypasted from FxFormat
|
||||||
ArgList[i] = ArgList[i]->Resolve(ctx);
|
x = ArgList[i]->Resolve(ctx);
|
||||||
if (ArgList[i]->ValueType == TypeName ||
|
if (x)
|
||||||
ArgList[i]->ValueType == TypeSound)
|
{
|
||||||
|
if (x->ValueType == TypeName ||
|
||||||
|
x->ValueType == TypeSound)
|
||||||
{
|
{
|
||||||
x = new FxStringCast(ArgList[i]);
|
x = new FxStringCast(ArgList[i]);
|
||||||
x = x->Resolve(ctx);
|
x = x->Resolve(ctx);
|
||||||
}
|
}
|
||||||
else x = ArgList[i];
|
}
|
||||||
}
|
}
|
||||||
else if (!(flag & (VARF_Ref|VARF_Out)))
|
else if (!(flag & (VARF_Ref|VARF_Out)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1272,7 +1272,7 @@ void DCanvas::FinishSimplePolys()
|
||||||
|
|
||||||
void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
|
void DCanvas::FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
|
||||||
double originx, double originy, double scalex, double scaley, DAngle rotation,
|
double originx, double originy, double scalex, double scaley, DAngle rotation,
|
||||||
FDynamicColormap *colormap, int lightlevel, int bottomclip)
|
FDynamicColormap *colormap, PalEntry flatcolor, int lightlevel, int bottomclip)
|
||||||
{
|
{
|
||||||
#ifndef NO_SWRENDER
|
#ifndef NO_SWRENDER
|
||||||
using namespace swrenderer;
|
using namespace swrenderer;
|
||||||
|
|
|
@ -224,7 +224,7 @@ public:
|
||||||
// Fill a simple polygon with a texture
|
// Fill a simple polygon with a texture
|
||||||
virtual void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
|
virtual void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
|
||||||
double originx, double originy, double scalex, double scaley, DAngle rotation,
|
double originx, double originy, double scalex, double scaley, DAngle rotation,
|
||||||
struct FDynamicColormap *colormap, int lightlevel, int bottomclip);
|
struct FDynamicColormap *colormap, PalEntry flatcolor, int lightlevel, int bottomclip);
|
||||||
|
|
||||||
// Set an area to a specified color
|
// Set an area to a specified color
|
||||||
virtual void Clear (int left, int top, int right, int bottom, int palcolor, uint32 color);
|
virtual void Clear (int left, int top, int right, int bottom, int palcolor, uint32 color);
|
||||||
|
|
|
@ -3092,7 +3092,7 @@ void D3DFB::FlatFill(int left, int top, int right, int bottom, FTexture *src, bo
|
||||||
|
|
||||||
void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
|
void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
|
||||||
double originx, double originy, double scalex, double scaley,
|
double originx, double originy, double scalex, double scaley,
|
||||||
DAngle rotation, FDynamicColormap *colormap, int lightlevel, int bottomclip)
|
DAngle rotation, FDynamicColormap *colormap, PalEntry flatcolor, int lightlevel, int bottomclip)
|
||||||
{
|
{
|
||||||
// Use an equation similar to player sprites to determine shade
|
// Use an equation similar to player sprites to determine shade
|
||||||
double fadelevel = clamp((LIGHT2SHADE(lightlevel)/65536. - 12) / NUMCOLORMAPS, 0.0, 1.0);
|
double fadelevel = clamp((LIGHT2SHADE(lightlevel)/65536. - 12) / NUMCOLORMAPS, 0.0, 1.0);
|
||||||
|
@ -3113,7 +3113,7 @@ void D3DFB::FillSimplePoly(FTexture *texture, FVector2 *points, int npoints,
|
||||||
}
|
}
|
||||||
if (In2D < 2)
|
if (In2D < 2)
|
||||||
{
|
{
|
||||||
Super::FillSimplePoly(texture, points, npoints, originx, originy, scalex, scaley, rotation, colormap, lightlevel, bottomclip);
|
Super::FillSimplePoly(texture, points, npoints, originx, originy, scalex, scaley, rotation, colormap, flatcolor, lightlevel, bottomclip);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!InScene)
|
if (!InScene)
|
||||||
|
|
|
@ -265,7 +265,7 @@ public:
|
||||||
void DrawPixel(int x, int y, int palcolor, uint32 rgbcolor);
|
void DrawPixel(int x, int y, int palcolor, uint32 rgbcolor);
|
||||||
void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
|
void FillSimplePoly(FTexture *tex, FVector2 *points, int npoints,
|
||||||
double originx, double originy, double scalex, double scaley,
|
double originx, double originy, double scalex, double scaley,
|
||||||
DAngle rotation, FDynamicColormap *colormap, int lightlevel, int bottomclip) override;
|
DAngle rotation, FDynamicColormap *colormap, PalEntry flatcolor, int lightlevel, int bottomclip) override;
|
||||||
bool WipeStartScreen(int type);
|
bool WipeStartScreen(int type);
|
||||||
void WipeEndScreen();
|
void WipeEndScreen();
|
||||||
bool WipeDo(int ticks);
|
bool WipeDo(int ticks);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
in vec4 pixelpos;
|
in vec4 pixelpos;
|
||||||
in vec2 glowdist;
|
in vec3 glowdist;
|
||||||
|
|
||||||
in vec4 vWorldNormal;
|
in vec4 vWorldNormal;
|
||||||
in vec4 vEyeNormal;
|
in vec4 vEyeNormal;
|
||||||
|
@ -89,7 +89,8 @@ vec4 getTexel(vec2 st)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
texel *= uObjectColor;
|
if (uObjectColor2.a == 0) texel *= uObjectColor;
|
||||||
|
else texel *= mix(uObjectColor, uObjectColor2, glowdist.z);
|
||||||
|
|
||||||
return desaturate(texel);
|
return desaturate(texel);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ in vec4 aColor;
|
||||||
in vec4 aVertex2;
|
in vec4 aVertex2;
|
||||||
in vec4 aNormal;
|
in vec4 aNormal;
|
||||||
out vec4 pixelpos;
|
out vec4 pixelpos;
|
||||||
out vec2 glowdist;
|
out vec3 glowdist;
|
||||||
|
|
||||||
out vec4 vWorldNormal;
|
out vec4 vWorldNormal;
|
||||||
out vec4 vEyeNormal;
|
out vec4 vEyeNormal;
|
||||||
|
@ -50,8 +50,11 @@ void main()
|
||||||
pixelpos.xyz = worldcoord.xyz;
|
pixelpos.xyz = worldcoord.xyz;
|
||||||
pixelpos.w = -eyeCoordPos.z/eyeCoordPos.w;
|
pixelpos.w = -eyeCoordPos.z/eyeCoordPos.w;
|
||||||
|
|
||||||
glowdist.x = -((uGlowTopPlane.w + uGlowTopPlane.x * worldcoord.x + uGlowTopPlane.y * worldcoord.z) * uGlowTopPlane.z) - worldcoord.y;
|
float topatpoint = -((uGlowTopPlane.w + uGlowTopPlane.x * worldcoord.x + uGlowTopPlane.y * worldcoord.z) * uGlowTopPlane.z);
|
||||||
glowdist.y = worldcoord.y + ((uGlowBottomPlane.w + uGlowBottomPlane.x * worldcoord.x + uGlowBottomPlane.y * worldcoord.z) * uGlowBottomPlane.z);
|
float bottomatpoint = -((uGlowBottomPlane.w + uGlowBottomPlane.x * worldcoord.x + uGlowBottomPlane.y * worldcoord.z) * uGlowBottomPlane.z);
|
||||||
|
glowdist.x = topatpoint - worldcoord.y;
|
||||||
|
glowdist.y = worldcoord.y - bottomatpoint;
|
||||||
|
glowdist.z = clamp(glowdist.x / (topatpoint - bottomatpoint), 0.0, 1.0);
|
||||||
|
|
||||||
if (uSplitBottomPlane.z != 0.0)
|
if (uSplitBottomPlane.z != 0.0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -15,6 +15,7 @@ uniform float uAlphaThreshold;
|
||||||
|
|
||||||
// colors
|
// colors
|
||||||
uniform vec4 uObjectColor;
|
uniform vec4 uObjectColor;
|
||||||
|
uniform vec4 uObjectColor2;
|
||||||
uniform vec4 uDynLightColor;
|
uniform vec4 uDynLightColor;
|
||||||
uniform vec4 uFogColor;
|
uniform vec4 uFogColor;
|
||||||
uniform float uDesaturationFactor;
|
uniform float uDesaturationFactor;
|
||||||
|
|
Loading…
Reference in a new issue