16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 20:29:17 +02:00

minor refactoring, shadows colour influenced by sun/moon positions

This commit is contained in:
tmj-fstate
2017-08-03 16:00:48 +02:00
parent c8a70e5280
commit 238ea7547d
9 changed files with 162 additions and 150 deletions

View File

@@ -60,10 +60,10 @@ light_array::update() {
if( ( true == light.owner->MoverParameters->Battery ) || ( true == light.owner->MoverParameters->ConverterFlag ) ) {
// with power on, the intensity depends on the state of activated switches
auto const &lightbits = light.owner->iLights[ light.index ];
light.count = 0 +
( ( lightbits & 1 ) ? 1 : 0 ) +
( ( lightbits & 4 ) ? 1 : 0 ) +
( ( lightbits & 16 ) ? 1 : 0 );
light.count = 0
+ ( ( lightbits & TMoverParameters::light::headlight_left ) ? 1 : 0 )
+ ( ( lightbits & TMoverParameters::light::headlight_right ) ? 1 : 0 )
+ ( ( lightbits & TMoverParameters::light::headlight_upper ) ? 1 : 0 );
if( light.count > 0 ) {
// TODO: intensity can be affected further by dim switch or other factors