mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-29 23:33:00 +00:00
- linked new properties with the renderer.
Support for the softpoly renderer still missing.
This commit is contained in:
parent
3a249cb06f
commit
03537e90ff
8 changed files with 41 additions and 10 deletions
|
@ -2057,10 +2057,10 @@ void DAutomap::drawSubsectors()
|
|||
if (roverz < cmpz)
|
||||
{
|
||||
maptex = *(rover->top.texture);
|
||||
flatcolor = *(rover->top.flatcolor);
|
||||
floorplane = rover->top.plane;
|
||||
sector_t *model = rover->top.model;
|
||||
int selector = (rover->flags & FF_INVERTPLANES) ? sector_t::floor : sector_t::ceiling;
|
||||
flatcolor = model->SpecialColors[selector];
|
||||
rotation = -model->GetAngle(selector);
|
||||
scalex = model->GetXScale(selector);
|
||||
scaley = model->GetYScale(selector);
|
||||
|
|
|
@ -1106,6 +1106,7 @@ void MapLoader::LoadSectors (MapData *map, FMissingTextureTracker &missingtex)
|
|||
ss->prevsec = -1; // stair retriggering until build completes
|
||||
memset(ss->SpecialColors, -1, sizeof(ss->SpecialColors));
|
||||
memset(ss->AdditiveColors, 0, sizeof(ss->AdditiveColors));
|
||||
ss->ColorScaleFactor[0] = ss->ColorScaleFactor[1] = ss->ColorScaleFactor[2] = 1.f;
|
||||
|
||||
ss->SetAlpha(sector_t::floor, 1.);
|
||||
ss->SetAlpha(sector_t::ceiling, 1.);
|
||||
|
|
|
@ -1503,6 +1503,7 @@ public:
|
|||
sec->SetYScale(sector_t::ceiling, 1.);
|
||||
sec->SetAlpha(sector_t::floor, 1.);
|
||||
sec->SetAlpha(sector_t::ceiling, 1.);
|
||||
sec->ColorScaleFactor[0] = sec->ColorScaleFactor[1] = sec->ColorScaleFactor[2] = 1.f;
|
||||
sec->thinglist = nullptr;
|
||||
sec->touching_thinglist = nullptr; // phares 3/14/98
|
||||
sec->sectorportal_thinglist = nullptr;
|
||||
|
|
|
@ -126,14 +126,12 @@ void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flags, int
|
|||
{
|
||||
ffloor->bottom.plane = &sec2->floorplane;
|
||||
ffloor->bottom.texture = &sec2->planes[sector_t::floor].Texture;
|
||||
ffloor->bottom.flatcolor = &sec2->SpecialColors[sector_t::floor];
|
||||
ffloor->bottom.isceiling = sector_t::floor;
|
||||
}
|
||||
else
|
||||
{
|
||||
ffloor->bottom.plane = &sec2->ceilingplane;
|
||||
ffloor->bottom.texture = &sec2->planes[sector_t::ceiling].Texture;
|
||||
ffloor->bottom.flatcolor = &sec2->SpecialColors[sector_t::ceiling];
|
||||
ffloor->bottom.isceiling = sector_t::ceiling;
|
||||
}
|
||||
|
||||
|
@ -141,7 +139,6 @@ void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flags, int
|
|||
{
|
||||
ffloor->top.plane = &sec2->ceilingplane;
|
||||
ffloor->top.texture = &sec2->planes[sector_t::ceiling].Texture;
|
||||
ffloor->top.flatcolor = &sec2->SpecialColors[sector_t::ceiling];
|
||||
ffloor->toplightlevel = &sec2->lightlevel;
|
||||
ffloor->top.isceiling = sector_t::ceiling;
|
||||
}
|
||||
|
@ -149,7 +146,6 @@ void P_Add3DFloor(sector_t* sec, sector_t* sec2, line_t* master, int flags, int
|
|||
{
|
||||
ffloor->top.plane = &sec->floorplane;
|
||||
ffloor->top.texture = &sec2->planes[sector_t::floor].Texture;
|
||||
ffloor->top.flatcolor = &sec2->SpecialColors[sector_t::floor];
|
||||
ffloor->toplightlevel = &sec->lightlevel;
|
||||
ffloor->top.isceiling = sector_t::floor;
|
||||
ffloor->top.model = sec;
|
||||
|
|
|
@ -68,7 +68,6 @@ struct F3DFloor
|
|||
secplane_t * plane;
|
||||
const FTextureID * texture;
|
||||
sector_t * model;
|
||||
PalEntry * flatcolor;
|
||||
int isceiling;
|
||||
int vindex;
|
||||
bool copied;
|
||||
|
|
|
@ -301,6 +301,10 @@ public:
|
|||
FColormap Colormap; // light and fog
|
||||
PalEntry FlatColor;
|
||||
PalEntry AddColor;
|
||||
PalEntry BlendColor;
|
||||
float DesaturationFactor, ColorFactor;
|
||||
int BlendMode;
|
||||
bool Invert;
|
||||
ERenderStyle renderstyle;
|
||||
|
||||
float alpha;
|
||||
|
|
|
@ -308,6 +308,12 @@ void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
|
|||
di->SetFog(state, lightlevel, rel, di->isFullbrightScene(), &Colormap, false);
|
||||
state.SetObjectColor(FlatColor | 0xff000000);
|
||||
state.SetAddColor(AddColor | 0xff000000);
|
||||
state.SetBlendColor(BlendColor);
|
||||
state.SetObjectBlendMode(BlendMode);
|
||||
state.SetColorizeFactor(ColorFactor);
|
||||
state.SetObjectDesaturateFactor(DesaturationFactor);
|
||||
state.SetObjectInvert(Invert);
|
||||
|
||||
|
||||
if (hacktype & SSRF_PLANEHACK)
|
||||
{
|
||||
|
@ -334,7 +340,6 @@ void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
|
|||
flatvertices += 4;
|
||||
flatprimitives++;
|
||||
}
|
||||
state.SetObjectColor(0xffffffff);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -356,8 +361,8 @@ void HWFlat::DrawFlat(HWDrawInfo *di, FRenderState &state, bool translucent)
|
|||
state.EnableTextureMatrix(false);
|
||||
}
|
||||
state.SetRenderStyle(DefaultRenderStyle());
|
||||
state.SetObjectColor(0xffffffff);
|
||||
}
|
||||
state.SetObjectColor(0xffffffff);
|
||||
state.SetAddColor(0);
|
||||
state.SetBlendColor(0);
|
||||
state.SetObjectDesaturateFactor(0);
|
||||
|
@ -454,12 +459,22 @@ void HWFlat::SetFrom3DFloor(F3DFloor *rover, bool top, bool underside)
|
|||
Colormap.LightColor = light->extra_colormap.FadeColor;
|
||||
FlatColor = 0xffffffff;
|
||||
AddColor = 0;
|
||||
BlendColor = 0;
|
||||
BlendMode = 0;
|
||||
ColorFactor = 1.f;
|
||||
DesaturationFactor = 0.f;
|
||||
Invert = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Colormap.CopyFrom3DLight(light);
|
||||
FlatColor = *plane.flatcolor;
|
||||
// AddColor = sector->SpecialColors[sector_t::add];
|
||||
FlatColor = plane.model->SpecialColors[plane.isceiling];
|
||||
AddColor = plane.model->AdditiveColors[plane.isceiling];
|
||||
BlendColor = plane.model->BlendColors[plane.isceiling];
|
||||
BlendMode = plane.model->BlendModes[plane.isceiling];
|
||||
ColorFactor = plane.model->ColorScaleFactor[plane.isceiling];
|
||||
DesaturationFactor = plane.model->MaterialDesaturationFactor[plane.isceiling];
|
||||
Invert = plane.model->InvertMode(plane.isceiling);
|
||||
}
|
||||
|
||||
|
||||
|
@ -515,6 +530,12 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector, int which)
|
|||
Colormap = frontsector->Colormap;
|
||||
FlatColor = frontsector->SpecialColors[sector_t::floor];
|
||||
AddColor = frontsector->AdditiveColors[sector_t::floor];
|
||||
BlendColor = frontsector->BlendColors[sector_t::floor];
|
||||
BlendMode = frontsector->BlendModes[sector_t::floor];
|
||||
DesaturationFactor = frontsector->MaterialDesaturationFactor[sector_t::floor];
|
||||
ColorFactor = frontsector->ColorScaleFactor[sector_t::floor];
|
||||
Invert = frontsector->InvertMode(sector_t::floor);
|
||||
|
||||
port = frontsector->ValidatePortal(sector_t::floor);
|
||||
if ((stack = (port != NULL)))
|
||||
{
|
||||
|
@ -571,6 +592,11 @@ void HWFlat::ProcessSector(HWDrawInfo *di, sector_t * frontsector, int which)
|
|||
Colormap = frontsector->Colormap;
|
||||
FlatColor = frontsector->SpecialColors[sector_t::ceiling];
|
||||
AddColor = frontsector->AdditiveColors[sector_t::ceiling];
|
||||
BlendColor = frontsector->BlendColors[sector_t::ceiling];
|
||||
BlendMode = frontsector->BlendModes[sector_t::ceiling];
|
||||
DesaturationFactor = frontsector->MaterialDesaturationFactor[sector_t::ceiling];
|
||||
ColorFactor = frontsector->ColorScaleFactor[sector_t::ceiling];
|
||||
Invert = frontsector->InvertMode(sector_t::ceiling);
|
||||
port = frontsector->ValidatePortal(sector_t::ceiling);
|
||||
if ((stack = (port != NULL)))
|
||||
{
|
||||
|
|
|
@ -175,6 +175,10 @@ void HWWall::RenderTexturedWall(HWDrawInfo *di, FRenderState &state, int rflags)
|
|||
state.SetObjectColor(color1);
|
||||
state.SetObjectColor2((color1 != color2) ? color2 : PalEntry(0));
|
||||
state.SetAddColor(side->GetAdditiveColor(tierndx, frontsector));
|
||||
state.SetBlendColor(side->GetBlendColor(tierndx, frontsector));
|
||||
state.SetObjectBlendMode(side->GetBlendMode(tierndx, frontsector));
|
||||
state.SetObjectDesaturateFactor(side->GetDesaturationFactor(tierndx, frontsector));
|
||||
state.SetObjectInvert(side->GetInvertMode(tierndx, frontsector));
|
||||
|
||||
if (color1 != color2)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue