From: curt Date: Mon, 4 Dec 2000 23:25:05 +0000 (+0000) Subject: Bring lights in in stages as it get's darker. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=a775392e31d84d832cce9d6b63fcf199ec98cdc1;p=flightgear.git Bring lights in in stages as it get's darker. --- diff --git a/src/Scenery/newcache.cxx b/src/Scenery/newcache.cxx index 2f0a489af..15ed409d6 100644 --- a/src/Scenery/newcache.cxx +++ b/src/Scenery/newcache.cxx @@ -133,7 +133,7 @@ static void print_refs( ssgSelector *sel, ssgTransform *trans, #endif -static ssgLeaf *gen_lights( ssgVertexArray *lights ) { +static ssgLeaf *gen_lights( ssgVertexArray *lights, float bright ) { // Allocate ssg structure ssgNormalArray *nl = NULL; ssgTexCoordArray *tl = NULL; @@ -141,7 +141,7 @@ static ssgLeaf *gen_lights( ssgVertexArray *lights ) { // default to slightly yellow lights for now sgVec4 color; - sgSetVec4( color, 1.0, 1.0, 0.7, 1.0 ); + sgSetVec4( color, 1.0 * bright, 1.0 * bright, 0.7 * bright, 1.0 ); cl->add( color ); // create ssg leaf @@ -250,12 +250,25 @@ void FGNewCache::fill_in( const FGBucket& b ) { terrain->addKid( e->terra_transform ); e->lights_transform = NULL; + e->lights_range = NULL; /* uncomment this section for testing ground lights */ - ssgLeaf *lights = gen_lights( light_pts ); - if ( lights ) { + if ( light_pts->getNum() ) { + cout << "generating lights" << endl; e->lights_transform = new ssgTransform; e->lights_range = new ssgRangeSelector; - e->lights_range->addKid( lights ); + e->lights_brightness = new ssgSelector; + ssgLeaf *lights; + + lights = gen_lights( light_pts, 0.6 ); + e->lights_brightness->addKid( lights ); + + lights = gen_lights( light_pts, 0.8 ); + e->lights_brightness->addKid( lights ); + + lights = gen_lights( light_pts, 1.0 ); + e->lights_brightness->addKid( lights ); + + e->lights_range->addKid( e->lights_brightness ); e->lights_transform->addKid( e->lights_range ); e->lights_transform->setTransform( &sgcoord ); ground->addKid( e->lights_transform ); diff --git a/src/Scenery/tileentry.cxx b/src/Scenery/tileentry.cxx index 565d12f98..5a94eae4c 100644 --- a/src/Scenery/tileentry.cxx +++ b/src/Scenery/tileentry.cxx @@ -36,6 +36,7 @@ #include #include
#include +#include