]> git.mxchange.org Git - flightgear.git/commitdiff
FG_ to SG_ namespace changes.
authorcurt <curt>
Sat, 24 Mar 2001 02:36:45 +0000 (02:36 +0000)
committercurt <curt>
Sat, 24 Mar 2001 02:36:45 +0000 (02:36 +0000)
23 files changed:
src/Cockpit/cockpit.cxx
src/Cockpit/hud_ladr.cxx
src/Cockpit/hud_tbi.cxx
src/FDM/Balloon/BalloonSim.cpp
src/FDM/JSBSim/FGDefs.h
src/FDM/JSBSim/FGFCS.h
src/FDM/JSBSim/FGRotation.h
src/FDM/JSBSim/FGState.cpp
src/FDM/JSBSim/FGTrim.cpp
src/FDM/LaRCsim.cxx
src/FDM/MagicCarpet.cxx
src/GUI/mouse.cxx
src/Main/keyboard.cxx
src/Main/main.cxx
src/Main/options.cxx
src/Main/ttest.cxx
src/Main/viewer_lookat.cxx
src/Main/viewer_rph.cxx
src/Network/ray.cxx
src/Sound/morse.cxx
src/Time/light.cxx
src/Time/moonpos.cxx
src/Time/sunpos.cxx

index 9ffee6e009ea404dc8370657caa7b7d0bb0fe892..c29f536161f1dde7ecb9a131b5bc54cb95ffb34e 100644 (file)
@@ -274,7 +274,7 @@ float get_climb_rate( void )
 
 float get_view_direction( void )
 {
-    double view_off = SG_2PI - globals->get_current_view()->get_view_offset();
+    double view_off = SGD_2PI - globals->get_current_view()->get_view_offset();
     double view = ( current_aircraft.fdm_state->get_Psi() + view_off)
        * RAD_TO_DEG;
     
index 2ef45b6075d5600597ee5847c86ef3a7f5fb6775..5127aea01f60dfcb21196d7d104ff0bd6adcf960 100644 (file)
@@ -276,8 +276,8 @@ void HudLadder :: draw( void )
        //  velocity vector
        glBegin(GL_LINE_LOOP);  // Use polygon to approximate a circle 
         for(count=0; count<50; count++) {             
-           cosine = 6 * cos(count * 2 * SG_PI/50.0); 
-            sine =   6 * sin(count * 2 * SG_PI/50.0); 
+           cosine = 6 * cos(count * 2 * SGD_PI/50.0); 
+            sine =   6 * sin(count * 2 * SGD_PI/50.0); 
             glVertex2f(cosine+vel_x, sine+vel_y);
        }     
        glEnd(); 
index 25db5111c35fb0b2426f1f713d441f86ea9a3f03..0ddeaf95431cce213de2015f13a98e64994197ec 100644 (file)
@@ -68,18 +68,18 @@ operator = (const fgTBI_instr & rhs )
 
      bank_angle     = current_ch2();  // Roll limit +/- 30 degrees
      
-     if( bank_angle < -SG_PI_2/3 ) {
-         bank_angle = -SG_PI_2/3;
-     } else if( bank_angle > SG_PI_2/3 ) {
-             bank_angle = SG_PI_2/3;
+     if( bank_angle < -SGD_PI_2/3 ) {
+         bank_angle = -SGD_PI_2/3;
+     } else if( bank_angle > SGD_PI_2/3 ) {
+             bank_angle = SGD_PI_2/3;
      }
      
      sideslip_angle = current_ch1(); // Sideslip limit +/- 20 degrees
      
-     if( sideslip_angle < -SG_PI/9 ) {
-         sideslip_angle = -SG_PI/9;
-     } else if( sideslip_angle > SG_PI/9 ) {
-             sideslip_angle = SG_PI/9;
+     if( sideslip_angle < -SGD_PI/9 ) {
+         sideslip_angle = -SGD_PI/9;
+     } else if( sideslip_angle > SGD_PI/9 ) {
+             sideslip_angle = SGD_PI/9;
      }
 
      cen_x = centroid.x;
@@ -88,7 +88,7 @@ operator = (const fgTBI_instr & rhs )
      tee   = -tee_height;
      fspan = span;
      hole  = scr_hole;
-     ss_const = 2 * sideslip_angle * fspan/(SG_2PI/9);  // width represents 40 degrees
+     ss_const = 2 * sideslip_angle * fspan/(SGD_2PI/9);  // width represents 40 degrees
      
 //   printf("side_slip: %f   fspan: %f\n", sideslip_angle, fspan);
 //   printf("ss_const: %f   hole: %f\n", ss_const, hole);
index 697fcd62b379d28c0c503e9e27b15d331a1ec6d7..10c1642f2a7c155621237accc4cfaf67cd7ca28f 100644 (file)
@@ -78,10 +78,10 @@ balloon::balloon()
     /* size for hot air balloons                                           */
     /************************************************************************/
 
-    balloon_envelope_area = 4.0 * (8.8 * 8.8) * SG_PI; 
-    balloon_envelope_volume = (4.0/3.0) * (8.8 * 8.8 * 8.8) * SG_PI;
+    balloon_envelope_area = 4.0 * (8.8 * 8.8) * SGD_PI; 
+    balloon_envelope_volume = (4.0/3.0) * (8.8 * 8.8 * 8.8) * SGD_PI;
 
-    wind_facing_area_of_balloon = SG_PI * (8.8 * 8.8);
+    wind_facing_area_of_balloon = SGD_PI * (8.8 * 8.8);
     wind_facing_area_of_basket = 2.0;  //guessed: 2 m^2
     
     cw_envelope=0.45;                  //a sphere in this case
index 1f0aa12ab51b96ef20e7431972bdc503d51d4506..07c86c0b0c3e79c6918eabb797e5f28b3d21703f 100644 (file)
@@ -69,7 +69,7 @@ enum eParam {
   FG_ALPHADOT,
   FG_BETA,
   FG_BETADOT,
-  SG_PITCHRATE,
+  SGD_PITCHRATE,
   FG_ROLLRATE,
   FG_YAWRATE,
   FG_MACH,
@@ -91,7 +91,7 @@ enum eParam {
   FG_THROTTLE_CMD,
   FG_THROTTLE_POS,
   FG_HOVERB,
-  SG_PITCH_TRIM_CMD
+  SGD_PITCH_TRIM_CMD
 };
 
 /******************************************************************************/
index c9d033c7e2e9061f8b7c81718ad53aa891805c53..4643e1c357c2787ef2eb9e827017fd4a4e13d9fb 100644 (file)
@@ -89,7 +89,7 @@ CLASS DOCUMENTATION
     &lt COMPONENT NAME="Pitch Trim Sum" TYPE="SUMMER"&gt
       ID            0
       INPUT        FG_ELEVATOR_CMD
-      INPUT        SG_PITCH_TRIM_CMD
+      INPUT        SGD_PITCH_TRIM_CMD
       CLIPTO       -1 1
     &lt/COMPONENT&gt
 
index 26e1d372ba0454dc5d342d9bac599e00be8ef742..c6741290eae9ce4d5b45451f29af4909afe8d4cb 100644 (file)
@@ -69,7 +69,7 @@ INCLUDES
 
 #ifndef M_PI
 #  include <simgear/constants.h>
-#  define M_PI SG_PI
+#  define M_PI SGD_PI
 #endif
 
 #include "FGModel.h"
index 06284619512d368fc44aa0d029391900b1478d5d..d0ab74ab7af0ab69c3576d75658473f063173cbc 100644 (file)
@@ -49,7 +49,7 @@ INCLUDES
 
 #ifndef M_PI 
 #  include <simgear/constants.h>
-#  define M_PI SG_PI
+#  define M_PI SGD_PI
 #endif
 
 #include "FGState.h"
@@ -102,7 +102,7 @@ FGState::FGState(FGFDMExec* fdex) : mTb2l(3,3),
   RegisterVariable(FG_ALPHADOT,       " alphadot "       );
   RegisterVariable(FG_BETA,           " beta "           );
   RegisterVariable(FG_BETADOT,        " betadot "        );
-  RegisterVariable(SG_PITCHRATE,      " pitch_rate "     );
+  RegisterVariable(SGD_PITCHRATE,      " pitch_rate "     );
   RegisterVariable(FG_ROLLRATE,       " roll_rate "      );
   RegisterVariable(FG_YAWRATE,        " yaw_rate "       );
   RegisterVariable(FG_MACH,           " mach "           );
@@ -124,7 +124,7 @@ FGState::FGState(FGFDMExec* fdex) : mTb2l(3,3),
   RegisterVariable(FG_THROTTLE_CMD,   " throttle_cmd "   );
   RegisterVariable(FG_THROTTLE_POS,   " throttle_pos "   );
   RegisterVariable(FG_HOVERB,         " height/span "    );
-  RegisterVariable(SG_PITCH_TRIM_CMD, " pitch_trim_cmd " );
+  RegisterVariable(SGD_PITCH_TRIM_CMD, " pitch_trim_cmd " );
 }
 
 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -151,7 +151,7 @@ float FGState::GetParameter(eParam val_idx) {
     return FDMExec->GetTranslation()->Getbeta();
   case FG_BETADOT:
     return FDMExec->GetTranslation()->Getbdot();
-  case SG_PITCHRATE:
+  case SGD_PITCHRATE:
     return (FDMExec->GetRotation()->GetPQR())(2);
   case FG_ROLLRATE:
     return (FDMExec->GetRotation()->GetPQR())(1);
@@ -201,7 +201,7 @@ float FGState::GetParameter(eParam val_idx) {
     return FDMExec->GetFCS()->GetThrottlePos(0);
   case FG_HOVERB:
     return FDMExec->GetPosition()->GetHOverB();
-  case SG_PITCH_TRIM_CMD:
+  case SGD_PITCH_TRIM_CMD:
     return FDMExec->GetFCS()->GetPitchTrimCmd();
   default:
     cerr << "FGState::GetParameter() - No handler for parameter " << val_idx << endl;
index 8583bdf1ef44e3fb1e54778c1070f84fbae1fa0a..5bc3f407a09388641be90815fdbd1088be006664 100644 (file)
@@ -189,7 +189,7 @@ void FGTrim::ReportState(void) {
   cout << out;                  
   sprintf(out, "    Normal Load Factor: %4.2f g's  Pitch Rate: %5.2f deg/s\n",
                     fdmex->GetAircraft()->GetNlf(),
-                    fdmex->GetState()->GetParameter(SG_PITCHRATE)*RADTODEG );
+                    fdmex->GetState()->GetParameter(SGD_PITCHRATE)*RADTODEG );
   cout << out;
   sprintf(out, "    Heading: %3.0f deg true  Sideslip: %5.2f deg\n",
                     fdmex->GetRotation()->Getpsi()*RADTODEG,
index d4975bf2c0a104a8774d843f93c79eb1fbaad7f1..209bd345f31b87fdc68123a83d90d51211080e21 100644 (file)
@@ -474,12 +474,12 @@ bool FGLaRCsim::copy_from_LaRCsim() {
            << " radius_to_vehicle = " << Radius_to_vehicle );
 
     double tmp_lon_geoc = Lon_geocentric;
-    while ( tmp_lon_geoc < -SG_PI ) { tmp_lon_geoc += SG_2PI; }
-    while ( tmp_lon_geoc > SG_PI ) { tmp_lon_geoc -= SG_2PI; }
+    while ( tmp_lon_geoc < -SGD_PI ) { tmp_lon_geoc += SG_2PI; }
+    while ( tmp_lon_geoc > SGD_PI ) { tmp_lon_geoc -= SG_2PI; }
 
     double tmp_lon = Longitude;
-    while ( tmp_lon < -SG_PI ) { tmp_lon += SG_2PI; }
-    while ( tmp_lon > SG_PI ) { tmp_lon -= SG_2PI; }
+    while ( tmp_lon < -SGD_PI ) { tmp_lon += SG_2PI; }
+    while ( tmp_lon > SGD_PI ) { tmp_lon -= SG_2PI; }
 
     // Positions
     _set_Geocentric_Position( Lat_geocentric, tmp_lon_geoc, 
index 01c82a079e2d4f727d9a3836e7210917baf03447..46816061f0d9663148025c3ab679b1faa41e2b3b 100644 (file)
@@ -62,11 +62,12 @@ bool FGMagicCarpet::update( int multiloop ) {
     _set_V_ground_speed( kts );
 
     // angle of turn
-    double turn_rate = controls.get_aileron() * SG_PI_4; // radians/sec
+    double turn_rate = controls.get_aileron() * SGD_PI_4; // radians/sec
     double turn = turn_rate * time_step;
 
     // update euler angles
-    _set_Euler_Angles( get_Phi(), get_Theta(), fmod(get_Psi() + turn, SG_2PI) );
+    _set_Euler_Angles( get_Phi(), get_Theta(),
+                       fmod(get_Psi() + turn, SGD_2PI) );
     _set_Euler_Rates(0,0,0);
 
     // update (lon/lat) position
index 1c28a46aa62b419dff48a58c88cd78bbc3d7f2c8..258b619f4f061c62a4071b42c3ef90b3b7a980ca 100644 (file)
@@ -349,7 +349,7 @@ void guiMotionFunc ( int x, int y )
                     need_warp = 1;
                     x = 1;
                 }
-                // try to get SG_PI movement in each half of screen
+                // try to get SGD_PI movement in each half of screen
                 // do spherical pan
                 W = ww;
                 H = wh;
index 6b5d950540b1455777abb345b9d00ac3952726a1..ed96a39cd1816f5acad8fd7e19788e76eaa14740 100644 (file)
@@ -152,28 +152,28 @@ void GLUTkey(unsigned char k, int x, int y) {
            }
            return;
        case 49: // numeric keypad 1
-           v->set_goal_view_offset( SG_PI * 0.75 );
+           v->set_goal_view_offset( SGD_PI * 0.75 );
            return;
        case 50: // numeric keypad 2
-           v->set_goal_view_offset( SG_PI );
+           v->set_goal_view_offset( SGD_PI );
            return;
        case 51: // numeric keypad 3
-           v->set_goal_view_offset( SG_PI * 1.25 );
+           v->set_goal_view_offset( SGD_PI * 1.25 );
            return;
        case 52: // numeric keypad 4
-           v->set_goal_view_offset( SG_PI * 0.50 );
+           v->set_goal_view_offset( SGD_PI * 0.50 );
            return;
        case 54: // numeric keypad 6
-           v->set_goal_view_offset( SG_PI * 1.50 );
+           v->set_goal_view_offset( SGD_PI * 1.50 );
            return;
        case 55: // numeric keypad 7
-           v->set_goal_view_offset( SG_PI * 0.25 );
+           v->set_goal_view_offset( SGD_PI * 0.25 );
            return;
        case 56: // numeric keypad 8
            v->set_goal_view_offset( 0.00 );
            return;
        case 57: // numeric keypad 9
-           v->set_goal_view_offset( SG_PI * 1.75 );
+           v->set_goal_view_offset( SGD_PI * 1.75 );
            return;
        case 65: // A key
            speed = fgGetInt("/sim/speed-up");
@@ -497,28 +497,28 @@ void GLUTspecialkey(int k, int x, int y) {
          return;
        }
        case GLUT_KEY_END: // numeric keypad 1
-           v->set_goal_view_offset( SG_PI * 0.75 );
+           v->set_goal_view_offset( SGD_PI * 0.75 );
            return;
        case GLUT_KEY_DOWN: // numeric keypad 2
-           v->set_goal_view_offset( SG_PI );
+           v->set_goal_view_offset( SGD_PI );
            return;
        case GLUT_KEY_PAGE_DOWN: // numeric keypad 3
-           v->set_goal_view_offset( SG_PI * 1.25 );
+           v->set_goal_view_offset( SGD_PI * 1.25 );
            return;
        case GLUT_KEY_LEFT: // numeric keypad 4
-           v->set_goal_view_offset( SG_PI * 0.50 );
+           v->set_goal_view_offset( SGD_PI * 0.50 );
            return;
        case GLUT_KEY_RIGHT: // numeric keypad 6
-           v->set_goal_view_offset( SG_PI * 1.50 );
+           v->set_goal_view_offset( SGD_PI * 1.50 );
            return;
        case GLUT_KEY_HOME: // numeric keypad 7
-           v->set_goal_view_offset( SG_PI * 0.25 );
+           v->set_goal_view_offset( SGD_PI * 0.25 );
            return;
        case GLUT_KEY_UP: // numeric keypad 8
            v->set_goal_view_offset( 0.00 );
            return;
        case GLUT_KEY_PAGE_UP: // numeric keypad 9
-           v->set_goal_view_offset( SG_PI * 1.75 );
+           v->set_goal_view_offset( SGD_PI * 1.75 );
            return;
        }
     } else {
index ea9caccaf830cefbb5a01c175c0c09b851057bbd..69291af598f46505660d278df21549906a57e8af 100644 (file)
@@ -802,13 +802,13 @@ void fgUpdateTimeDepCalcs() {
            // current_view.goal_view_offset
            if ( v->get_goal_view_offset() > v->get_view_offset() )
             {
-               if ( v->get_goal_view_offset() - v->get_view_offset() < SG_PI ){
+               if ( v->get_goal_view_offset() - v->get_view_offset() < SGD_PI ){
                    v->inc_view_offset( 0.01 );
                } else {
                    v->inc_view_offset( -0.01 );
                }
            } else {
-               if ( v->get_view_offset() - v->get_goal_view_offset() < SG_PI ){
+               if ( v->get_view_offset() - v->get_goal_view_offset() < SGD_PI ){
                    v->inc_view_offset( -0.01 );
                } else {
                    v->inc_view_offset( 0.01 );
@@ -822,7 +822,7 @@ void fgUpdateTimeDepCalcs() {
        }
     }
 
-    double tmp = -(l->sun_rotation + SG_PI) 
+    double tmp = -(l->sun_rotation + SGD_PI) 
        - (cur_fdm_state->get_Psi() -
           globals->get_current_view()->get_view_offset() );
     while ( tmp < 0.0 ) {
@@ -833,7 +833,7 @@ void fgUpdateTimeDepCalcs() {
     }
     /* printf("Psi = %.2f, viewoffset = %.2f sunrot = %.2f rottosun = %.2f\n",
           FG_Psi * RAD_TO_DEG, current_view.view_offset * RAD_TO_DEG, 
-          -(l->sun_rotation+SG_PI) * RAD_TO_DEG, tmp * RAD_TO_DEG); */
+          -(l->sun_rotation+SGD_PI) * RAD_TO_DEG, tmp * RAD_TO_DEG); */
     l->UpdateAdjFog();
 
     // Update solar system
index 959f64c7bf642d6f7564a174759516d5bde16a95..b64ebfd718f7bede931d62f6ad01ea2f25f6ca58 100644 (file)
@@ -820,9 +820,9 @@ parse_option (const string& arg)
        string woffset = arg.substr( 14 );
        double default_view_offset = 0.0;
        if ( woffset == "LEFT" ) {
-              default_view_offset = SG_PI * 0.25;
+              default_view_offset = SGD_PI * 0.25;
        } else if ( woffset == "RIGHT" ) {
-           default_view_offset = SG_PI * 1.75;
+           default_view_offset = SGD_PI * 1.75;
        } else if ( woffset == "CENTER" ) {
            default_view_offset = 0.00;
        } else {
index 9518bc01927f0f3813c10cadcd09eca9c49c802b..312ba3fa1decf90808eb085303a947fd2d46b89f 100644 (file)
@@ -33,7 +33,7 @@ main() {
 
     // Yaw Matrix
     MAT3_SET_HVEC(vec, 0.0, -1.0, 0.0, 1.0);
-    MAT3rotate(R_Psi, vec, SG_PI + FG_Psi);
+    MAT3rotate(R_Psi, vec, SGD_PI + FG_Psi);
     printf("\nYaw matrix (Psi)\n");
     MAT3print(R_Psi, stdout);
 
@@ -47,7 +47,7 @@ main() {
     // Longitude
     MAT3_SET_HVEC(vec, 0.0, 0.0, 1.0, 1.0);
     // R_Lon = rotate about Z axis
-    MAT3rotate(R_Lon, vec, FG_Longitude - SG_PI_2 );
+    MAT3rotate(R_Lon, vec, FG_Longitude - SGD_PI_2 );
     printf("\nLongitude matrix\n");
     MAT3print(R_Lon, stdout);
 
index 511bded4343d45f122631dc133ccc849cf46e80d..37f8748fe1f0ab0cecf2681509e8bacd95e97bfe 100644 (file)
@@ -200,7 +200,7 @@ void FGViewerLookAt::update() {
     sgNegateVec3(world_down, world_up);
     sgVectorProductVec3(surface_east, surface_south, world_down);
 #else
-    sgMakeRotMat4( TMP, SG_PI_2 * RAD_TO_DEG, world_up );
+    sgMakeRotMat4( TMP, SGD_PI_2 * RAD_TO_DEG, world_up );
     // cout << "sgMat4 TMP" << endl;
     // print_sgMat4( TMP );
     sgXformVec3(surface_east, surface_south, TMP);
index 83db4916fa2c3cb63c89844f3f3e0bdc6952f2a8..04d131ca75a0a9ef5e574873e1c29e7ae2d83bfc 100644 (file)
@@ -326,7 +326,7 @@ void FGViewerRPH::update() {
     sgNegateVec3(world_down, world_up);
     sgVectorProductVec3(surface_east, surface_south, world_down);
 #else
-    sgMakeRotMat4( TMP, SG_PI_2 * RAD_TO_DEG, world_up );
+    sgMakeRotMat4( TMP, SGD_PI_2 * RAD_TO_DEG, world_up );
     // cout << "sgMat4 TMP" << endl;
     // print_sgMat4( TMP );
     sgXformVec3(surface_east, surface_south, TMP);
index 2644e705789427c480d68d7cd38a6503c68548bd..ece2b67fc0559f34be147988775d9409edeb5be7 100644 (file)
@@ -104,11 +104,11 @@ bool FGRAY::gen_message() {
        /* Make sure the angles are reasonable onscale */
        /* We use an asymmetric mapping so that the chair behaves
           reasonably when upside down.  Otherwise it oscillates. */
-       while ( ang_pos < -2*SG_PI/3 ) {
-               ang_pos += 2 * SG_PI;
+       while ( ang_pos < -2*SGD_PI/3 ) {
+               ang_pos += 2 * SGD_PI;
        }
-       while ( ang_pos >  4*SG_PI/3 ) {
-               ang_pos -= 2 * SG_PI;
+       while ( ang_pos >  4*SGD_PI/3 ) {
+               ang_pos -= 2 * SGD_PI;
        }
 
        /* Tell interested parties what the situation is */
@@ -131,11 +131,11 @@ bool FGRAY::gen_message() {
 
        /* yaw */
                /* Make sure that we walk through North cleanly */
-               if ( fabs ( ang_pos - chair_heading ) > SG_PI )
+               if ( fabs ( ang_pos - chair_heading ) > SGD_PI )
                {       /* Need to swing chair by 360 degrees */
                        if ( ang_pos < chair_heading )
-                               chair_heading -= 2 * SG_PI;
-                       else    chair_heading += 2 * SG_PI;
+                               chair_heading -= 2 * SGD_PI;
+                       else    chair_heading += 2 * SGD_PI;
                }
                /* Remove the chair heading from the true heading */
                ang_pos -= chair_heading;
@@ -144,7 +144,7 @@ bool FGRAY::gen_message() {
                   can just about represent 30 degrees full scale.  */
                chair_heading += ang_pos * dt * 0.2;
                /* If they turn fast, at 90 deg error subtract 30 deg */
-               if ( fabs(ang_pos) > SG_PI / 2 )
+               if ( fabs(ang_pos) > SGD_PI / 2 )
                        chair_heading += ang_pos / 3;
 
        } else
@@ -178,8 +178,8 @@ bool FGRAY::gen_message() {
                /* Scale to the hardware's full scale range */
                propose /= fullscale [ subaxis ];
                /* Use a sine shaped washout on all axes */
-               if ( propose < -SG_PI / 2 ) *dac = 0x0000; else
-               if ( propose >  SG_PI / 2 ) *dac = 0xFFFF; else
+               if ( propose < -SGD_PI / 2 ) *dac = 0x0000; else
+               if ( propose >  SGD_PI / 2 ) *dac = 0xFFFF; else
                   *dac = (unsigned short) ( 32767 * 
                                ( 1.0 + sin ( propose ) ) );
        }
index 0e134fbf5f031db584b99059d95dbda30f0b3a7b..50f58ab99ae5eb604581b982e2c1de7ed3e1a9c3 100644 (file)
@@ -71,7 +71,7 @@ bool FGMorse::init() {
 
     // Make Low DIT
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                              / (8000.0 / LO_FREQUENCY) ) )
            * ((double)i / TRANSITION_BYTES)
            / 2.0 + 0.5;
@@ -82,7 +82,7 @@ bool FGMorse::init() {
 
     for ( i = TRANSITION_BYTES;
          i < DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE; ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / LO_FREQUENCY) ) )
            / 2.0 + 0.5;
 
@@ -93,7 +93,7 @@ bool FGMorse::init() {
     for ( i = DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DIT_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / LO_FREQUENCY) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
@@ -107,7 +107,7 @@ bool FGMorse::init() {
 
     // Make High DIT
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / HI_FREQUENCY)) )
            * ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
 
@@ -117,7 +117,7 @@ bool FGMorse::init() {
 
     for ( i = TRANSITION_BYTES;
          i < DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE; ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / HI_FREQUENCY) ) )
            / 2.0 + 0.5;
 
@@ -128,7 +128,7 @@ bool FGMorse::init() {
     for ( i = DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DIT_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / HI_FREQUENCY) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
@@ -142,7 +142,7 @@ bool FGMorse::init() {
 
     // Make Low DAH
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / LO_FREQUENCY) ) )
            * ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
 
@@ -153,7 +153,7 @@ bool FGMorse::init() {
     for ( i = TRANSITION_BYTES;
          i < DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / LO_FREQUENCY) ) )
            / 2.0 + 0.5;
 
@@ -164,7 +164,7 @@ bool FGMorse::init() {
     for ( i = DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DAH_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / LO_FREQUENCY) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
@@ -178,7 +178,7 @@ bool FGMorse::init() {
 
     // Make High DAH
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / HI_FREQUENCY) ) )
            * ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
 
@@ -189,7 +189,7 @@ bool FGMorse::init() {
     for ( i = TRANSITION_BYTES;
          i < DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / HI_FREQUENCY) ) )
            / 2.0 + 0.5;
 
@@ -200,7 +200,7 @@ bool FGMorse::init() {
     for ( i = DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DAH_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI
+       float level = ( sin( (double) i * 2.0 * SGD_PI
                             / (8000.0 / HI_FREQUENCY) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
@@ -227,7 +227,7 @@ bool FGMorse::cust_init(const int freq ) {
 
     // Make DIT
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq)) )
+       float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq)) )
            * ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
 
        /* Convert to unsigned byte */
@@ -236,7 +236,7 @@ bool FGMorse::cust_init(const int freq ) {
 
     for ( i = TRANSITION_BYTES;
          i < DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE; ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
+       float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq) ) )
            / 2.0 + 0.5;
 
        /* Convert to unsigned byte */
@@ -246,7 +246,7 @@ bool FGMorse::cust_init(const int freq ) {
     for ( i = DIT_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DIT_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
+       float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
 
@@ -259,7 +259,7 @@ bool FGMorse::cust_init(const int freq ) {
 
     // Make DAH
     for ( i = 0; i < TRANSITION_BYTES; ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
+       float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq) ) )
            * ((double)i / TRANSITION_BYTES) / 2.0 + 0.5;
 
        /* Convert to unsigned byte */
@@ -269,7 +269,7 @@ bool FGMorse::cust_init(const int freq ) {
     for ( i = TRANSITION_BYTES;
          i < DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
+       float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq) ) )
            / 2.0 + 0.5;
 
        /* Convert to unsigned byte */
@@ -279,7 +279,7 @@ bool FGMorse::cust_init(const int freq ) {
     for ( i = DAH_SIZE - TRANSITION_BYTES - COUNT_SIZE;
          i < DAH_SIZE - COUNT_SIZE;
          ++i ) {
-       float level = ( sin( (double) i * 2.0 * SG_PI / (8000.0 / freq) ) )
+       float level = ( sin( (double) i * 2.0 * SGD_PI / (8000.0 / freq) ) )
            * ((double)j / TRANSITION_BYTES) / 2.0 + 0.5;
        --j;
 
index d2567a13d47fc76a580445e4c2e9f0c6299cc8c9..fc145b480a99954b2a37e9ea61ee960bccc67183 100644 (file)
@@ -167,10 +167,10 @@ void fgLIGHT::UpdateAdjFog( void ) {
 
     // first determine the difference between our view angle and local
     // direction to the sun
-    rotation = -(sun_rotation + SG_PI) 
+    rotation = -(sun_rotation + SGD_PI) 
        - (f->get_Psi() - globals->get_current_view()->get_view_offset());
     if ( globals->get_current_view()->get_reverse_view_offset() ) {
-       rotation += SG_PI;
+       rotation += SGD_PI;
     }
     while ( rotation < 0 ) {
        rotation += SG_2PI;
index fd63cd69ff01def26b908fb2ae96afe14c9f0ca0..e038c21cdf59812872ed36e0c688e720571148c2 100644 (file)
@@ -284,12 +284,12 @@ void fgMoonPosition(time_t ssue, double *lon, double *lat) {
     ecliptic_to_equatorial( globals->get_ephem()->get_moon()->getLon(),
                            0.0, &alpha, &delta );
     tmp = alpha - (SG_2PI/24)*GST(ssue);
-    if (tmp < -SG_PI) {
+    if (tmp < -SGD_PI) {
        do tmp += SG_2PI;
-       while (tmp < -SG_PI);
-    } else if (tmp > SG_PI) {
+       while (tmp < -SGD_PI);
+    } else if (tmp > SGD_PI) {
        do tmp -= SG_2PI;
-       while (tmp < -SG_PI);
+       while (tmp < -SGD_PI);
     }
 
     *lon = tmp;
@@ -319,12 +319,12 @@ static void fgMoonPositionGST(double gst, double *lon, double *lat) {
 
 //    tmp = alpha - (SG_2PI/24)*GST(ssue);
     tmp = alpha - (SG_2PI/24)*gst;     
-    if (tmp < -SG_PI) {
+    if (tmp < -SGD_PI) {
        do tmp += SG_2PI;
-       while (tmp < -SG_PI);
-    } else if (tmp > SG_PI) {
+       while (tmp < -SGD_PI);
+    } else if (tmp > SGD_PI) {
        do tmp -= SG_2PI;
-       while (tmp < -SG_PI);
+       while (tmp < -SGD_PI);
     }
 
     *lon = tmp;
index e693757f1cb48093bb76269ac1e217b95990d42c..49a1f8aafa304f3d66ef583b699dfa5af0f22115 100644 (file)
@@ -192,12 +192,12 @@ void fgSunPosition(time_t ssue, double *lon, double *lat) {
     ecliptic_to_equatorial( globals->get_ephem()->get_sun()->getLon(),
                            0.0, &alpha, &delta );
     tmp = alpha - (SG_2PI/24)*GST(ssue);
-    if (tmp < -SG_PI) {
+    if (tmp < -SGD_PI) {
        do tmp += SG_2PI;
-       while (tmp < -SG_PI);
-    } else if (tmp > SG_PI) {
+       while (tmp < -SGD_PI);
+    } else if (tmp > SGD_PI) {
        do tmp -= SG_2PI;
-       while (tmp < -SG_PI);
+       while (tmp < -SGD_PI);
     }
 
     *lon = tmp;
@@ -227,12 +227,12 @@ static void fgSunPositionGST(double gst, double *lon, double *lat) {
 
 //    tmp = alpha - (SG_2PI/24)*GST(ssue);
     tmp = alpha - (SG_2PI/24)*gst;     
-    if (tmp < -SG_PI) {
+    if (tmp < -SGD_PI) {
        do tmp += SG_2PI;
-       while (tmp < -SG_PI);
-    } else if (tmp > SG_PI) {
+       while (tmp < -SGD_PI);
+    } else if (tmp > SGD_PI) {
        do tmp -= SG_2PI;
-       while (tmp < -SG_PI);
+       while (tmp < -SGD_PI);
     }
 
     *lon = tmp;