]> git.mxchange.org Git - flightgear.git/commitdiff
Fixes to remove dependencies on depricated plib code (that just happened to
authorcurt <curt>
Wed, 24 Oct 2001 21:24:53 +0000 (21:24 +0000)
committercurt <curt>
Wed, 24 Oct 2001 21:24:53 +0000 (21:24 +0000)
be removed in the latest plib CVS.)

src/Autopilot/auto_gui.cxx
src/Cockpit/hud.cxx
src/Cockpit/hud.hxx
src/GUI/apt_dlg.cxx
src/GUI/gui.cxx
src/GUI/sgVec3Slider.cxx

index c8aefa19c10dd9acfad1a6816e69fa0bfe63f8ca..43c63b84aa9d4056f6119a0d44cad88d7127bc32 100644 (file)
@@ -220,7 +220,7 @@ void NewHeadingInit(void)
 
     float heading = fgGetDouble("/orientation/heading-deg");
     int len = 260/2 -
-       (puGetStringWidth( puGetDefaultLabelFont(), NewHeadingLabel ) /2 );
+       (puGetDefaultLabelFont().getStringWidth( NewHeadingLabel ) / 2 );
 
     ApHeadingDialog = new puDialogBox (150, 50);
     {
@@ -297,7 +297,7 @@ void NewAltitudeInit(void)
     }
 
     int len = 260/2 -
-       (puGetStringWidth( puGetDefaultLabelFont(), NewAltitudeLabel )/2);
+       (puGetDefaultLabelFont().getStringWidth( NewAltitudeLabel ) / 2);
 
     // ApAltitudeDialog = new puDialogBox (150, 50);
     ApAltitudeDialog = new puDialogBox (150, 200);
@@ -439,7 +439,7 @@ void fgAPAdjustInit( void ) {
     char *s;
 
     int labelX = (DialogWidth / 2) -
-       (puGetStringWidth( puGetDefaultLabelFont(), Label ) / 2);
+       (puGetDefaultLabelFont().getStringWidth( Label ) / 2);
     labelX -= 30;  // KLUDGEY
 
     int nSliders = 4;
@@ -468,8 +468,8 @@ void fgAPAdjustInit( void ) {
 
     puGetDefaultFonts (  &APAdjustLegendFont,  &APAdjustLabelFont );
     APAdjustDialog = new puDialogBox ( DialogX, DialogY ); {
-       int horiz_slider_height = puGetStringHeight (APAdjustLabelFont) +
-           puGetStringDescender (APAdjustLabelFont) +
+       int horiz_slider_height = APAdjustLabelFont.getStringHeight() +
+           APAdjustLabelFont.getStringDescender() +
            PUSTR_TGAP + PUSTR_BGAP + 5;
 
        APAdjustFrame = new puFrame ( 0, 0,
@@ -677,8 +677,8 @@ void NewTgtAirportInit(void)
     sprintf( NewTgtAirportId, "%s",
              fgGetString("/sim/startup/airport-id").c_str() );
     SG_LOG( SG_AUTOPILOT, SG_INFO, " NewTgtAirportId " << NewTgtAirportId );
-    int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
-                                      NewTgtAirportLabel ) / 2;
+    int len = 150
+        - puGetDefaultLabelFont().getStringWidth( NewTgtAirportLabel ) / 2;
     
     TgtAptDialog = new puDialogBox (150, 50);
     {
index 92183ba1855ec54280175f27e18c0f2deb76b6ea..4b6933e7655a467013b4b6474aa906e7874bb9d4 100644 (file)
@@ -931,7 +931,7 @@ void fgHUDalphaInit( void ) {
     char *s;
 
     int labelX = (DialogWidth / 2) -
-        (puGetStringWidth( puGetDefaultLabelFont(), Label ) / 2);
+        ( puGetDefaultLabelFont().getStringWidth( Label ) / 2);
        
     int nSliders = 1;
     int slider_x = 10;
@@ -946,8 +946,8 @@ void fgHUDalphaInit( void ) {
     puGetDefaultFonts ( &HUDalphaLegendFont, &HUDalphaLabelFont );
        
     HUDalphaDialog = new puDialogBox ( DialogX, DialogY ); {
-        int horiz_slider_height = puGetStringHeight (HUDalphaLabelFont) +
-            puGetStringDescender (HUDalphaLabelFont) +
+        int horiz_slider_height = HUDalphaLabelFont.getStringHeight() +
+            HUDalphaLabelFont.getStringDescender() +
             PUSTR_TGAP + PUSTR_BGAP + 5;
 
         /* puFrame *
index 336a4497bb4866dc989534e338a593fff7e65a5a..a5ccd24bfa233bb265ece731c6b6897d1cd32ae1 100644 (file)
@@ -358,7 +358,7 @@ public:
                 fnt->puts(tmp1);
 
                 fnt->setPointSize(12);
-                char tmp2[p1+1];
+                char tmp2[64];
                 strncpy(tmp2,msg,p1);
                 tmp2[p1]='\0';
                         
@@ -380,7 +380,7 @@ public:
 
     void Draw()
     {
-        puDrawString ( guiFnt, msg, FloatToInt(x), FloatToInt(y) );
+        guiFnt.drawString( msg, FloatToInt(x), FloatToInt(y) );
     }
 };
 
@@ -566,8 +566,8 @@ public:
     {
         glBegin(GL_LINE_LOOP);  // Use polygon to approximate a circle 
         for(int count=0; count<25; count++) {             
-            float cosine = r * cos(count * 2 * M_PI/10.0); 
-            float sine =   r * sin(count * 2 * M_PI/10.0); 
+            float cosine = r * cos(count * 2 * SG_PI/10.0); 
+            float sine =   r * sin(count * 2 * SG_PI/10.0); 
             glVertex2f(cosine+x1, sine+y1);
         }     
         glEnd(); 
index da16ba6cb92af548039c410f2d530b03ae7f0939..e064e390a41eed4a3ef07e962cb31c46f1a8199a 100644 (file)
@@ -131,8 +131,8 @@ void NewAirport(puObject *cb)
 void NewAirportInit(void)
 {
     sprintf( NewAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() );
-    int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
-                                      NewAirportLabel ) / 2;
+    int len = 150
+        - puGetDefaultLabelFont().getStringWidth( NewAirportLabel ) / 2;
 
     AptDialog = new puDialogBox (150, 50);
     {
index 6d4e28168919a7e9ab611dd1f59ab4d1a0104fc5..7c62c3f562ac3f24bcd8428a36314a76fe620f3d 100644 (file)
@@ -249,8 +249,8 @@ static void saveFlight(puObject *cv) {
     SaveDialog = new puDialogBox (150, 50);
     {
         SaveDialogFrame   = new puFrame           (0,0,350, 150);
-        SaveDialogMessage = new puText            (
-                       (150 - puGetStringWidth( puGetDefaultLabelFont(), "File Name:" ) / 2), 110);
+        SaveDialogMessage
+            = new puText( (150 - puGetDefaultLabelFont().getStringWidth( "File Name:" ) / 2), 110 );
         SaveDialogMessage ->    setLabel          ("File Name:");
 
         SaveDialogInput   = new puInput           (50, 70, 300, 100);
@@ -314,8 +314,8 @@ static void loadFlight(puObject *cb)
     LoadDialog = new puDialogBox (150, 50);
     {
         LoadDialogFrame   = new puFrame           (0,0,350, 150);
-        LoadDialogMessage = new puText            (
-                       (150 - puGetStringWidth( puGetDefaultLabelFont(), "File Name:" ) / 2), 110);
+        LoadDialogMessage
+            = new puText( (150 - puGetDefaultLabelFont().getStringWidth( "File Name:" ) / 2), 110 );
         LoadDialogMessage ->    setLabel          ("File Name:");
 
         LoadDialogInput   = new puInput           (50, 70, 300, 100);
@@ -412,7 +412,7 @@ void ConfirmExitDialogInit(void)
     char *s;
 
     //  printf("ConfirmExitDialogInit\n");
-    int len = 200 - puGetStringWidth( puGetDefaultLabelFont(), msg )/2;
+    int len = 200 - puGetDefaultLabelFont().getStringWidth ( msg ) / 2;
 
     int x = (fgGetInt("/sim/startup/xsize")/2 - 400/2);
     int y = (fgGetInt("/sim/startup/ysize")/2 - 100/2);
index 89204ac1cb2a847aa978d9eb91a25667f3de2c36..769ae628b05679c404a1ac4db031e2d7bbe3ebb9 100644 (file)
@@ -164,9 +164,9 @@ sgVec3Slider::sgVec3Slider ( int x, int y, sgVec3 vec, const char *title,
        int slider_y = 55;
        int slider_width = 240;
 
-       int horiz_slider_height = puGetStringHeight    (&LabelFont) +
-                                                         puGetStringDescender (&LabelFont) +
-                                                         PUSTR_TGAP + PUSTR_BGAP + 5;
+       int horiz_slider_height = LabelFont.getStringHeight()
+            + LabelFont.getStringDescender()
+            + PUSTR_TGAP + PUSTR_BGAP + 5;
 
        // HACKS
        setUserData( this );