From: curt Date: Fri, 18 Oct 2002 18:43:50 +0000 (+0000) Subject: Add a pre/post draw call back to strobe lights so we can make them bigger X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9c561ab860f0799c2ebb3d588ec8dfbfbcc991b8;p=flightgear.git Add a pre/post draw call back to strobe lights so we can make them bigger so they will stand out from everything else. --- diff --git a/src/Cockpit/steam.cxx b/src/Cockpit/steam.cxx index 99875e6c9..0e89df2a6 100644 --- a/src/Cockpit/steam.cxx +++ b/src/Cockpit/steam.cxx @@ -319,6 +319,8 @@ void FGSteam::_CatchUp() occasionally due to some dirt in the tube or on the ball. */ // cout << current_aircraft.fdm_state->get_A_Z_pilot() << endl; + // cout << "Ay = " << current_aircraft.fdm_state->get_A_Y_pilot() + // << " Az = " << current_aircraft.fdm_state->get_A_Z_pilot() << endl; d = -current_aircraft.fdm_state->get_A_Z_pilot(); if ( d < 1 ) d = 1; set_lowpass ( & the_TC_rad, diff --git a/src/Objects/pt_lights.cxx b/src/Objects/pt_lights.cxx index 733e6f775..b778d75d4 100644 --- a/src/Objects/pt_lights.cxx +++ b/src/Objects/pt_lights.cxx @@ -29,6 +29,23 @@ #include "pt_lights.hxx" +// strobe pre-draw (we want a larger point size) +static int StrobePreDraw( ssgEntity *e ) { + glPushAttrib( GL_POINT_BIT ); + glPointSize(4.0); + glEnable(GL_POINT_SMOOTH); + + return true; +} + +// strobe post-draw (we want a larger point size) +static int StrobePostDraw( ssgEntity *e ) { + glPopAttrib(); + + return true; +} + + // Generate a directional light ssgLeaf *gen_directional_light( sgVec3 pt, sgVec3 dir, sgVec3 up, const string &material ) { @@ -243,6 +260,9 @@ ssgTimedSelector *gen_reil_lights( const point_list &nodes, << material ); } + leaf->setCallback( SSG_CALLBACK_PREDRAW, StrobePreDraw ); + leaf->setCallback( SSG_CALLBACK_POSTDRAW, StrobePostDraw ); + ssgTimedSelector *reil = new ssgTimedSelector; // need to add this twice to work around an ssg bug @@ -326,6 +346,9 @@ ssgTimedSelector *gen_rabbit_lights( const point_list &nodes, << material ); } + leaf->setCallback( SSG_CALLBACK_PREDRAW, StrobePreDraw ); + leaf->setCallback( SSG_CALLBACK_POSTDRAW, StrobePostDraw ); + rabbit->addKid( leaf ); if ( first ) { // ssg bug where first entry in animation is ignored.