Begin work on making custom lighting optional
This commit is contained in:
parent
bb31da5053
commit
0d6aad827b
3 changed files with 25 additions and 0 deletions
|
|
@ -1402,10 +1402,12 @@ void readlevelheader(MYFILE *f, char * name)
|
|||
else if (fastcmp(word, "LIGHTCONTRAST"))
|
||||
{
|
||||
usemaplighting(num, word)->light_contrast = (UINT8)i;
|
||||
usemaplighting(num, word)->use_custom_light = true;
|
||||
}
|
||||
else if (fastcmp(word, "SPRITEBACKLIGHT") || fastcmp(word, "ENCORESPRITEBACKLIGHT"))
|
||||
{
|
||||
usemaplighting(num, word)->sprite_backlight = (SINT8)i;
|
||||
usemaplighting(num, word)->use_custom_light = true;
|
||||
}
|
||||
else if (fastcmp(word, "LIGHTANGLE") || fastcmp(word, "ENCORELIGHTANGLE"))
|
||||
{
|
||||
|
|
@ -1421,6 +1423,7 @@ void readlevelheader(MYFILE *f, char * name)
|
|||
lighting->use_light_angle = true;
|
||||
lighting->light_angle = FixedAngle(FloatToFixed(atof(word2)));
|
||||
}
|
||||
usemaplighting(num, word)->use_custom_light = true;
|
||||
}
|
||||
// Individual triggers for level flags, for ease of use (and 2.0 compatibility)
|
||||
else if (fastcmp(word, "SCRIPTISFILE"))
|
||||
|
|
|
|||
|
|
@ -339,6 +339,7 @@ struct customoption_t
|
|||
|
||||
struct mapheader_lighting_t
|
||||
{
|
||||
boolean use_custom_light; ///< Decides if this should use custom lighting.
|
||||
UINT8 light_contrast; ///< Range of wall lighting. 0 is no lighting.
|
||||
SINT8 sprite_backlight; ///< Subtract from wall lighting for sprites only.
|
||||
boolean use_light_angle; ///< When false, wall lighting is evenly distributed. When true, wall lighting is directional.
|
||||
|
|
|
|||
|
|
@ -387,6 +387,7 @@ void P_DeleteFlickies(INT16 i)
|
|||
|
||||
static void P_ClearMapHeaderLighting(mapheader_lighting_t *lighting)
|
||||
{
|
||||
lighting->use_custom_light = false;
|
||||
lighting->light_contrast = 16;
|
||||
lighting->sprite_backlight = 0;
|
||||
lighting->use_light_angle = false;
|
||||
|
|
@ -3785,6 +3786,16 @@ boolean P_SectorUsesDirectionalLighting(const sector_t *sector)
|
|||
|
||||
boolean P_ApplyLightOffset(UINT8 baselightnum, const sector_t *sector)
|
||||
{
|
||||
mapheader_lighting_t *lighting = &mapheaderinfo[gamemap-1]->lighting;
|
||||
|
||||
if (encoremode && mapheaderinfo[gamemap-1]->use_encore_lighting)
|
||||
{
|
||||
lighting = &mapheaderinfo[gamemap-1]->lighting_encore;
|
||||
}
|
||||
|
||||
if (lighting->use_custom_light == false)
|
||||
return (baselightnum < LIGHTLEVELS-1 && baselightnum > 0);
|
||||
|
||||
if (!P_SectorUsesDirectionalLighting(sector))
|
||||
{
|
||||
return false;
|
||||
|
|
@ -3797,6 +3808,16 @@ boolean P_ApplyLightOffset(UINT8 baselightnum, const sector_t *sector)
|
|||
|
||||
boolean P_ApplyLightOffsetFine(UINT8 baselightlevel, const sector_t *sector)
|
||||
{
|
||||
mapheader_lighting_t *lighting = &mapheaderinfo[gamemap-1]->lighting;
|
||||
|
||||
if (encoremode && mapheaderinfo[gamemap-1]->use_encore_lighting)
|
||||
{
|
||||
lighting = &mapheaderinfo[gamemap-1]->lighting_encore;
|
||||
}
|
||||
|
||||
if (lighting->use_custom_light == false)
|
||||
return (baselightlevel < LIGHTLEVELS-1 && baselightlevel > 0);
|
||||
|
||||
if (!P_SectorUsesDirectionalLighting(sector))
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue