mirror of
https://github.com/ZDoom/gzdoom.git
synced 2025-03-21 18:31:10 +00:00
hooked up the per-level colormaps with the hardware renderer.
This commit is contained in:
parent
e12f2ce0fe
commit
12bc9db609
7 changed files with 7 additions and 7 deletions
|
@ -1822,11 +1822,8 @@ void FLevelLocals::Init()
|
|||
}
|
||||
}
|
||||
|
||||
if (strnicmp (info->CustomColorMap.GetChars(), "COLORMAP", 8) != 0)
|
||||
{
|
||||
flags3 |= LEVEL3_HAS_CUSTOM_COLORMAP;
|
||||
}
|
||||
|
||||
globalcolormap = R_ColormapNumForName(info->CustomColorMap.GetChars());
|
||||
airsupply = info->airsupply*TICRATE;
|
||||
outsidefog = info->outsidefog;
|
||||
WallVertLight = info->WallVertLight*2;
|
||||
|
|
|
@ -642,6 +642,7 @@ public:
|
|||
double sky1pos, sky2pos;
|
||||
float hw_sky1pos, hw_sky2pos;
|
||||
bool skystretch;
|
||||
uint32_t globalcolormap;
|
||||
|
||||
int total_secrets;
|
||||
int found_secrets;
|
||||
|
|
|
@ -270,7 +270,6 @@ enum ELevelFlags : unsigned int
|
|||
LEVEL3_AVOIDMELEE = 0x00020000, // global flag needed for proper MBF support.
|
||||
LEVEL3_NOJUMPDOWN = 0x00040000, // only for MBF21. Inverse of MBF's dog_jumping flag.
|
||||
LEVEL3_LIGHTCREATED = 0x00080000, // a light had been created in the last frame
|
||||
LEVEL3_HAS_CUSTOM_COLORMAP = 0x00100000, // custom colormap property from dsda-doom
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -693,7 +693,7 @@ struct sector_t
|
|||
int sky; // MBF sky transfer info.
|
||||
int validcount; // if == validcount, already checked
|
||||
|
||||
uint32_t bottommap, midmap, topmap; // killough 4/4/98: dynamic colormaps
|
||||
uint32_t selfmap, bottommap, midmap, topmap; // killough 4/4/98: dynamic colormaps
|
||||
// [RH] these can also be blend values if
|
||||
// the alpha mask is non-zero
|
||||
|
||||
|
|
|
@ -303,6 +303,7 @@ FSerializer &Serialize(FSerializer &arc, const char *key, sector_t &p, sector_t
|
|||
//("bottommap", p.bottommap)
|
||||
//("midmap", p.midmap)
|
||||
//("topmap", p.topmap)
|
||||
//("selfmap", p.selfmap) // todo: if this becomes changeable we need a colormap serializer.
|
||||
("damageamount", p.damageamount, def->damageamount)
|
||||
("damageinterval", p.damageinterval, def->damageinterval)
|
||||
("leakydamage", p.leakydamage, def->leakydamage)
|
||||
|
|
|
@ -250,6 +250,8 @@ FVector4 V_CalcBlend(sector_t* viewsector, PalEntry* modulateColor)
|
|||
auto s = viewsector->heightsec;
|
||||
blendv = s->floorplane.PointOnSide(vpp) < 0 ? s->bottommap : s->ceilingplane.PointOnSide(vpp) < 0 ? s->topmap : s->midmap;
|
||||
}
|
||||
else if (viewsector->selfmap != 0) blendv = viewsector->selfmap;
|
||||
else blendv = viewsector->Level->globalcolormap;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -271,7 +271,7 @@ void FSoftwareRenderer::SetColormap(FLevelLocals *Level)
|
|||
NormalLight.Maps = realcolormaps.Maps;
|
||||
NormalLight.ChangeColor(PalEntry(255, 255, 255), 0);
|
||||
NormalLight.ChangeFade(Level->fadeto);
|
||||
if(Level->info->flags3 & LEVEL3_HAS_CUSTOM_COLORMAP)
|
||||
if(Level->globalcolormap != 0) // this deliberately ignores the translated value and goes directly to the source.
|
||||
{
|
||||
SetDefaultColormap(Level->info->CustomColorMap.GetChars());
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue