// $Id$
-#ifndef _HUD_HXX
-#define _HUD_HXX
+#ifndef _OLDHUD_HXX
+#define _OLDHUD_HXX
#ifndef __cplusplus
# error This library requires C++
#include <deque> // STL double ended queue
#include STL_FSTREAM
+#include <simgear/math/fastmath.hxx> // float_to_int()
#include <simgear/constants.h>
-//#include <simgear/props/props.hxx>
+#include <simgear/props/props.hxx>
#include <Include/fg_typedefs.h>
#include <Aircraft/aircraft.hxx>
#include <Main/viewmgr.hxx>
#include <Airports/runways.hxx>
-#include "hud_opts.hxx"
#include <plib/sg.h>
SG_USING_STD(deque);
fgLineSeg2D( const fgLineSeg2D & image )
: x0(image.x0), y0(image.y0), x1(image.x1), y1(image.y1) {}
- fgLineSeg2D& operator= ( const fgLineSeg2D & image ) {
+ fgLineSeg2D& operator= ( const fgLineSeg2D & image ) { // seems unused
x0 = image.x0; y0 = image.y0; x1 = image.x1; y1 = image.y1; return *this;
}
- ~fgLineSeg2D() {}
-
void draw() const
{
glVertex2f(x0, y0);
fgText( const fgText & image )
: x(image.x), y(image.y),digit(image.digit) { strcpy(msg,image.msg); }
- fgText& operator = ( const fgText & image ) {
+ fgText& operator = ( const fgText & image ) { // seems unused
strcpy(msg,image.msg); x = image.x; y = image.y;digit=image.digit;
return *this;
}
- ~fgText() { msg[0]='\0'; }
+ ~fgText() { msg[0]='\0'; } // used but useless
int getStringWidth ( char *str )
{
if ( HUDtext && str ) {
float r, l ;
HUD_Font->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
- return FloatToInt( r - l );
+ return float_to_int( r - l );
}
return 0 ;
}
if ( HUDtext && strlen( msg )) {
float r, l ;
HUD_Font->getBBox ( msg, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
- return FloatToInt( r - l );
+ return float_to_int( r - l );
}
return 0 ;
}
void Draw()
{
- guiFnt.drawString( msg, FloatToInt(x), FloatToInt(y) );
+ guiFnt.drawString( msg, float_to_int(x), float_to_int(y) );
}
};
vector < fgLineSeg2D > List;
public:
fgLineList( void ) {}
- ~fgLineList( void ) {}
void add( const fgLineSeg2D& seg ) { List.push_back(seg); }
void erase( void ) { List.erase( List.begin(), List.end() ); }
void draw( void ) {
vector< fgText > List;
public:
fgTextList ( void ) { Font = 0; }
- ~fgTextList( void ) {}
void setFont( fntRenderer *Renderer ) { Font = Renderer; }
void add( const fgText& String ) { List.push_back(String); }
bool working = true,
int digit = 0);
- instr_item( const instr_item & image );
-
virtual ~instr_item ();
void set_data_source ( FLTFNPTR fn ) { load_value_fn = fn; }
virtual void display_enable( bool working ) { is_enabled = working;}
- virtual void update( void );
virtual void break_display ( bool bad );
virtual void SetBrightness( int illumination_level ); // fgHUDSetBright...
void SetPosition ( int x, int y, UINT width, UINT height );
if ( HUDtext && str ) {
float r, l ;
HUD_Font->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
- return FloatToInt( r - l );
+ return float_to_int( r - l );
}
return 0 ;
}
public:
instr_label(const SGPropertyNode *);
- ~instr_label();
-
- instr_label(const instr_label& image);
virtual void draw(void);
};
-class lat_label : public instr_item {
-private:
- const char *pformat;
- const char *pre_str;
- const char *post_str;
- fgLabelJust justify;
- int fontSize;
- int blink;
- char format_buffer[80];
-
-public:
- lat_label( int x,
- int y,
- UINT width,
- UINT height,
- FLTFNPTR data_source,
- const char *label_format,
- const char *pre_label_string,
- const char *post_label_string,
- float scale_data,
- UINT options,
- fgLabelJust justification,
- int font_size,
- int blinking,
- bool working,
- int digits =0 );
-
- ~lat_label();
-
- lat_label( const lat_label & image);
- virtual void draw( void ); // Required method in base class
-};
-
-
-class lon_label : public instr_item {
-private:
- const char *pformat;
- const char *pre_str;
- const char *post_str;
- fgLabelJust justify;
- int fontSize;
- int blink;
- char format_buffer[80];
-
-public:
- lon_label( int x,
- int y,
- UINT width,
- UINT height,
- FLTFNPTR data_source,
- const char *label_format,
- const char *pre_label_string,
- const char *post_label_string,
- float scale_data,
- UINT options,
- fgLabelJust justification,
- int font_size,
- int blinking,
- bool working,
- int digit=0);
-
-
- ~lon_label();
-
- lon_label( const lon_label & image);
- virtual void draw( void ); // Required method in base class
-};
-
-
//
// fgRunway_instr This class is responsible for rendering the active runway
// in the hud (if visible).
void setArrowScale(double scale);
// Draws arrow when runway is not visible in HUD if draw=true
void setDrawArrow(bool draw);
- //Always draws arrow if draw=true;
+ // Always draws arrow if draw=true;
void setDrawArrowAlways(bool draw);
- //Sets the maximum line scale
+ // Sets the maximum line scale
void setLineScale(double scale);
- //Sets the distance where to start scaling the lines
+ // Sets the distance where to start scaling the lines
void setScaleDist(double dist_nm);
- //Sets the stipple pattern of the outline of the runway
+ // Sets the stipple pattern of the outline of the runway
void setStippleOutline(unsigned short stipple);
- //Sets the stipple patter of the center line of the runway
+ // Sets the stipple patter of the center line of the runway
void setStippleCenterline(unsigned short stipple);
};
int dp_showing,
bool working = true);
- virtual ~instr_scale();
- instr_scale( const instr_scale & image);
-
virtual void draw ( void ) {}; // No-op here. Defined in derived classes.
UINT div_min ( void ) { return Min_div;}
UINT div_max ( void ) { return Maj_div;}
bool working,
UINT options );
- virtual ~dual_instr_item() {};
- dual_instr_item( const dual_instr_item & image);
-
- float current_ch1( void ) { return (float)alt_data_source();}
- float current_ch2( void ) { return (float)get_value();}
- virtual void draw( void ) { }
+ float current_ch1( void ) { return (float)alt_data_source(); }
+ float current_ch2( void ) { return (float)get_value(); }
+ virtual void draw( void ) {}
};
public:
HudLadder(const SGPropertyNode *);
- ~HudLadder();
virtual void draw(void);
void drawZenith(float, float, float);
float _r, _g, _b, _a, _cl;
};
-#endif // _HUD_H
+#endif // _OLDHUD_H