mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-12-09 17:43:07 +00:00
Merge branch 'darken-header' into 'master'
"DARKNESS" mapheader option for Shrink lighting See merge request KartKrew/Kart!1549
This commit is contained in:
commit
cbbb820414
4 changed files with 6 additions and 1 deletions
|
|
@ -1290,6 +1290,8 @@ void readlevelheader(MYFILE *f, char * name)
|
|||
mapheaderinfo[num]->skybox_scaley = (INT16)i;
|
||||
else if (fastcmp(word, "SKYBOXSCALEZ"))
|
||||
mapheaderinfo[num]->skybox_scalez = (INT16)i;
|
||||
else if (fastcmp(word, "DARKNESS"))
|
||||
mapheaderinfo[num]->darkness = FloatToFixed(atof(word2));
|
||||
else if (fastcmp(word, "LEVELFLAGS"))
|
||||
mapheaderinfo[num]->levelflags = get_number(word2);
|
||||
else if (fastcmp(word, "MENUFLAGS"))
|
||||
|
|
|
|||
|
|
@ -507,6 +507,8 @@ struct mapheader_t
|
|||
INT16 skybox_scaley; ///< Skybox Y axis scale.
|
||||
INT16 skybox_scalez; ///< Skybox Z axis scale.
|
||||
|
||||
fixed_t darkness; ///< Pohbee darkness multiplier
|
||||
|
||||
// Distance information
|
||||
fixed_t mobj_scale; ///< Defines the size all object calculations are relative to
|
||||
fixed_t default_waypoint_radius; ///< 0 is a special value for DEFAULT_WAYPOINT_RADIUS, but scaled with mobjscale
|
||||
|
|
|
|||
|
|
@ -436,6 +436,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 num)
|
|||
mapheaderinfo[num]->skybox_scalex = 16;
|
||||
mapheaderinfo[num]->skybox_scaley = 16;
|
||||
mapheaderinfo[num]->skybox_scalez = 16;
|
||||
mapheaderinfo[num]->darkness = FRACUNIT;
|
||||
mapheaderinfo[num]->runsoc[0] = '#';
|
||||
mapheaderinfo[num]->scriptname[0] = '#';
|
||||
mapheaderinfo[num]->precutscenenum = 0;
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ INT32 R_AdjustLightLevel(INT32 light)
|
|||
|
||||
if (!debugrender_highlight && cv_debugrender_contrast.value == 0)
|
||||
{
|
||||
const fixed_t darken = FixedMul(darkness, kRange);
|
||||
const fixed_t darken = FixedMul(FixedMul(darkness, mapheaderinfo[gamemap-1]->darkness), kRange);
|
||||
return std::clamp((light * FRACUNIT) - darken, 0, kRange) / FRACUNIT;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue