Darken features and building that you cannot see, just like the tiles they stand on.

git-svn-id: https://warzone2100.svn.sourceforge.net/svnroot/warzone2100/trunk@9323 4a71c877-e1ca-e34f-864e-861f7616d084
master
Per Inge Mathisen 2010-01-18 16:52:33 +00:00 committed by Git SVN Gateway
parent d1ca417ef2
commit 9fed940d7c
1 changed files with 18 additions and 0 deletions

View File

@ -1789,6 +1789,12 @@ void renderFeature(FEATURE *psFeature)
{
brightness = pal_SetBrightness(avGetObjLightLevel((BASE_OBJECT*)psFeature, brightness.byte.r));
}
if (!hasSensorOnTile(mapTile(map_coord(psFeature->pos.x), map_coord(psFeature->pos.y)), psFeature->player))
{
brightness.byte.r /= 2;
brightness.byte.g /= 2;
brightness.byte.b /= 2;
}
if (psFeature->psStats->subType == FEAT_BUILDING
|| psFeature->psStats->subType == FEAT_SKYSCRAPER
@ -2116,6 +2122,12 @@ void renderStructure(STRUCTURE *psStructure)
{
buildingBrightness = pal_SetBrightness(avGetObjLightLevel((BASE_OBJECT*)psStructure, buildingBrightness.byte.r));
}
if (!hasSensorOnTile(mapTile(map_coord(psStructure->pos.x), map_coord(psStructure->pos.y)), psStructure->player))
{
buildingBrightness.byte.r /= 2;
buildingBrightness.byte.g /= 2;
buildingBrightness.byte.b /= 2;
}
}
if (!defensive)
@ -2538,6 +2550,12 @@ static BOOL renderWallSection(STRUCTURE *psStructure)
{
buildingBrightness = pal_SetBrightness(avGetObjLightLevel((BASE_OBJECT*)psStructure, buildingBrightness.byte.r));
}
if (!hasSensorOnTile(mapTile(map_coord(psStructure->pos.x), map_coord(psStructure->pos.y)), psStructure->player))
{
buildingBrightness.byte.r /= 2;
buildingBrightness.byte.g /= 2;
buildingBrightness.byte.b /= 2;
}
}
brightness = buildingBrightness;