1
0
Fork 0

Fixes to remove dependencies on depricated plib code (that just happened to

be removed in the latest plib CVS.)
This commit is contained in:
curt 2001-10-24 21:24:53 +00:00
parent b6a259dc90
commit 33854d9f6a
6 changed files with 24 additions and 24 deletions

View 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);
{

View 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 *

View 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();

View 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);
{

View 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);

View 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 );