Fixes to remove dependencies on depricated plib code (that just happened to
be removed in the latest plib CVS.)
This commit is contained in:
parent
b6a259dc90
commit
33854d9f6a
6 changed files with 24 additions and 24 deletions
|
@ -220,7 +220,7 @@ void NewHeadingInit(void)
|
||||||
|
|
||||||
float heading = fgGetDouble("/orientation/heading-deg");
|
float heading = fgGetDouble("/orientation/heading-deg");
|
||||||
int len = 260/2 -
|
int len = 260/2 -
|
||||||
(puGetStringWidth( puGetDefaultLabelFont(), NewHeadingLabel ) /2 );
|
(puGetDefaultLabelFont().getStringWidth( NewHeadingLabel ) / 2 );
|
||||||
|
|
||||||
ApHeadingDialog = new puDialogBox (150, 50);
|
ApHeadingDialog = new puDialogBox (150, 50);
|
||||||
{
|
{
|
||||||
|
@ -297,7 +297,7 @@ void NewAltitudeInit(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
int len = 260/2 -
|
int len = 260/2 -
|
||||||
(puGetStringWidth( puGetDefaultLabelFont(), NewAltitudeLabel )/2);
|
(puGetDefaultLabelFont().getStringWidth( NewAltitudeLabel ) / 2);
|
||||||
|
|
||||||
// ApAltitudeDialog = new puDialogBox (150, 50);
|
// ApAltitudeDialog = new puDialogBox (150, 50);
|
||||||
ApAltitudeDialog = new puDialogBox (150, 200);
|
ApAltitudeDialog = new puDialogBox (150, 200);
|
||||||
|
@ -439,7 +439,7 @@ void fgAPAdjustInit( void ) {
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
int labelX = (DialogWidth / 2) -
|
int labelX = (DialogWidth / 2) -
|
||||||
(puGetStringWidth( puGetDefaultLabelFont(), Label ) / 2);
|
(puGetDefaultLabelFont().getStringWidth( Label ) / 2);
|
||||||
labelX -= 30; // KLUDGEY
|
labelX -= 30; // KLUDGEY
|
||||||
|
|
||||||
int nSliders = 4;
|
int nSliders = 4;
|
||||||
|
@ -468,8 +468,8 @@ void fgAPAdjustInit( void ) {
|
||||||
|
|
||||||
puGetDefaultFonts ( &APAdjustLegendFont, &APAdjustLabelFont );
|
puGetDefaultFonts ( &APAdjustLegendFont, &APAdjustLabelFont );
|
||||||
APAdjustDialog = new puDialogBox ( DialogX, DialogY ); {
|
APAdjustDialog = new puDialogBox ( DialogX, DialogY ); {
|
||||||
int horiz_slider_height = puGetStringHeight (APAdjustLabelFont) +
|
int horiz_slider_height = APAdjustLabelFont.getStringHeight() +
|
||||||
puGetStringDescender (APAdjustLabelFont) +
|
APAdjustLabelFont.getStringDescender() +
|
||||||
PUSTR_TGAP + PUSTR_BGAP + 5;
|
PUSTR_TGAP + PUSTR_BGAP + 5;
|
||||||
|
|
||||||
APAdjustFrame = new puFrame ( 0, 0,
|
APAdjustFrame = new puFrame ( 0, 0,
|
||||||
|
@ -677,8 +677,8 @@ void NewTgtAirportInit(void)
|
||||||
sprintf( NewTgtAirportId, "%s",
|
sprintf( NewTgtAirportId, "%s",
|
||||||
fgGetString("/sim/startup/airport-id").c_str() );
|
fgGetString("/sim/startup/airport-id").c_str() );
|
||||||
SG_LOG( SG_AUTOPILOT, SG_INFO, " NewTgtAirportId " << NewTgtAirportId );
|
SG_LOG( SG_AUTOPILOT, SG_INFO, " NewTgtAirportId " << NewTgtAirportId );
|
||||||
int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
|
int len = 150
|
||||||
NewTgtAirportLabel ) / 2;
|
- puGetDefaultLabelFont().getStringWidth( NewTgtAirportLabel ) / 2;
|
||||||
|
|
||||||
TgtAptDialog = new puDialogBox (150, 50);
|
TgtAptDialog = new puDialogBox (150, 50);
|
||||||
{
|
{
|
||||||
|
|
|
@ -931,7 +931,7 @@ void fgHUDalphaInit( void ) {
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
int labelX = (DialogWidth / 2) -
|
int labelX = (DialogWidth / 2) -
|
||||||
(puGetStringWidth( puGetDefaultLabelFont(), Label ) / 2);
|
( puGetDefaultLabelFont().getStringWidth( Label ) / 2);
|
||||||
|
|
||||||
int nSliders = 1;
|
int nSliders = 1;
|
||||||
int slider_x = 10;
|
int slider_x = 10;
|
||||||
|
@ -946,8 +946,8 @@ void fgHUDalphaInit( void ) {
|
||||||
puGetDefaultFonts ( &HUDalphaLegendFont, &HUDalphaLabelFont );
|
puGetDefaultFonts ( &HUDalphaLegendFont, &HUDalphaLabelFont );
|
||||||
|
|
||||||
HUDalphaDialog = new puDialogBox ( DialogX, DialogY ); {
|
HUDalphaDialog = new puDialogBox ( DialogX, DialogY ); {
|
||||||
int horiz_slider_height = puGetStringHeight (HUDalphaLabelFont) +
|
int horiz_slider_height = HUDalphaLabelFont.getStringHeight() +
|
||||||
puGetStringDescender (HUDalphaLabelFont) +
|
HUDalphaLabelFont.getStringDescender() +
|
||||||
PUSTR_TGAP + PUSTR_BGAP + 5;
|
PUSTR_TGAP + PUSTR_BGAP + 5;
|
||||||
|
|
||||||
/* puFrame *
|
/* puFrame *
|
||||||
|
|
|
@ -358,7 +358,7 @@ public:
|
||||||
fnt->puts(tmp1);
|
fnt->puts(tmp1);
|
||||||
|
|
||||||
fnt->setPointSize(12);
|
fnt->setPointSize(12);
|
||||||
char tmp2[p1+1];
|
char tmp2[64];
|
||||||
strncpy(tmp2,msg,p1);
|
strncpy(tmp2,msg,p1);
|
||||||
tmp2[p1]='\0';
|
tmp2[p1]='\0';
|
||||||
|
|
||||||
|
@ -380,7 +380,7 @@ public:
|
||||||
|
|
||||||
void Draw()
|
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
|
glBegin(GL_LINE_LOOP); // Use polygon to approximate a circle
|
||||||
for(int count=0; count<25; count++) {
|
for(int count=0; count<25; count++) {
|
||||||
float cosine = r * cos(count * 2 * M_PI/10.0);
|
float cosine = r * cos(count * 2 * SG_PI/10.0);
|
||||||
float sine = r * sin(count * 2 * M_PI/10.0);
|
float sine = r * sin(count * 2 * SG_PI/10.0);
|
||||||
glVertex2f(cosine+x1, sine+y1);
|
glVertex2f(cosine+x1, sine+y1);
|
||||||
}
|
}
|
||||||
glEnd();
|
glEnd();
|
||||||
|
|
|
@ -131,8 +131,8 @@ void NewAirport(puObject *cb)
|
||||||
void NewAirportInit(void)
|
void NewAirportInit(void)
|
||||||
{
|
{
|
||||||
sprintf( NewAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() );
|
sprintf( NewAirportId, "%s", fgGetString("/sim/startup/airport-id").c_str() );
|
||||||
int len = 150 - puGetStringWidth( puGetDefaultLabelFont(),
|
int len = 150
|
||||||
NewAirportLabel ) / 2;
|
- puGetDefaultLabelFont().getStringWidth( NewAirportLabel ) / 2;
|
||||||
|
|
||||||
AptDialog = new puDialogBox (150, 50);
|
AptDialog = new puDialogBox (150, 50);
|
||||||
{
|
{
|
||||||
|
|
|
@ -249,8 +249,8 @@ static void saveFlight(puObject *cv) {
|
||||||
SaveDialog = new puDialogBox (150, 50);
|
SaveDialog = new puDialogBox (150, 50);
|
||||||
{
|
{
|
||||||
SaveDialogFrame = new puFrame (0,0,350, 150);
|
SaveDialogFrame = new puFrame (0,0,350, 150);
|
||||||
SaveDialogMessage = new puText (
|
SaveDialogMessage
|
||||||
(150 - puGetStringWidth( puGetDefaultLabelFont(), "File Name:" ) / 2), 110);
|
= new puText( (150 - puGetDefaultLabelFont().getStringWidth( "File Name:" ) / 2), 110 );
|
||||||
SaveDialogMessage -> setLabel ("File Name:");
|
SaveDialogMessage -> setLabel ("File Name:");
|
||||||
|
|
||||||
SaveDialogInput = new puInput (50, 70, 300, 100);
|
SaveDialogInput = new puInput (50, 70, 300, 100);
|
||||||
|
@ -314,8 +314,8 @@ static void loadFlight(puObject *cb)
|
||||||
LoadDialog = new puDialogBox (150, 50);
|
LoadDialog = new puDialogBox (150, 50);
|
||||||
{
|
{
|
||||||
LoadDialogFrame = new puFrame (0,0,350, 150);
|
LoadDialogFrame = new puFrame (0,0,350, 150);
|
||||||
LoadDialogMessage = new puText (
|
LoadDialogMessage
|
||||||
(150 - puGetStringWidth( puGetDefaultLabelFont(), "File Name:" ) / 2), 110);
|
= new puText( (150 - puGetDefaultLabelFont().getStringWidth( "File Name:" ) / 2), 110 );
|
||||||
LoadDialogMessage -> setLabel ("File Name:");
|
LoadDialogMessage -> setLabel ("File Name:");
|
||||||
|
|
||||||
LoadDialogInput = new puInput (50, 70, 300, 100);
|
LoadDialogInput = new puInput (50, 70, 300, 100);
|
||||||
|
@ -412,7 +412,7 @@ void ConfirmExitDialogInit(void)
|
||||||
char *s;
|
char *s;
|
||||||
|
|
||||||
// printf("ConfirmExitDialogInit\n");
|
// 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 x = (fgGetInt("/sim/startup/xsize")/2 - 400/2);
|
||||||
int y = (fgGetInt("/sim/startup/ysize")/2 - 100/2);
|
int y = (fgGetInt("/sim/startup/ysize")/2 - 100/2);
|
||||||
|
|
|
@ -164,9 +164,9 @@ sgVec3Slider::sgVec3Slider ( int x, int y, sgVec3 vec, const char *title,
|
||||||
int slider_y = 55;
|
int slider_y = 55;
|
||||||
int slider_width = 240;
|
int slider_width = 240;
|
||||||
|
|
||||||
int horiz_slider_height = puGetStringHeight (&LabelFont) +
|
int horiz_slider_height = LabelFont.getStringHeight()
|
||||||
puGetStringDescender (&LabelFont) +
|
+ LabelFont.getStringDescender()
|
||||||
PUSTR_TGAP + PUSTR_BGAP + 5;
|
+ PUSTR_TGAP + PUSTR_BGAP + 5;
|
||||||
|
|
||||||
// HACKS
|
// HACKS
|
||||||
setUserData( this );
|
setUserData( this );
|
||||||
|
|
Loading…
Add table
Reference in a new issue