]> git.mxchange.org Git - flightgear.git/commitdiff
Add a pre/post draw call back to strobe lights so we can make them bigger
authorcurt <curt>
Fri, 18 Oct 2002 18:43:50 +0000 (18:43 +0000)
committercurt <curt>
Fri, 18 Oct 2002 18:43:50 +0000 (18:43 +0000)
so they will stand out from everything else.

src/Cockpit/steam.cxx
src/Objects/pt_lights.cxx

index 99875e6c9aa1fcaad8834fb45c6f49a4903af9b5..0e89df2a6709dea0839a962e924fca686baf7c47 100644 (file)
@@ -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,
index 733e6f77594c77cac2f4a59597c87bee9a804bb9..b778d75d48438f757553b959806b582a7c1223ba 100644 (file)
 #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.