1
0
Fork 0

White space changes.

This commit is contained in:
curt 2001-09-20 22:10:45 +00:00
parent 1dfe83dfd4
commit f77877ffa8
3 changed files with 1518 additions and 1636 deletions

View file

@ -173,7 +173,7 @@ static instr_item * readTBI( const SGPropertyNode * node);
void fgHUDalphaInit( void ); void fgHUDalphaInit( void );
class locRECT { class locRECT {
public: public:
RECT rect; RECT rect;
locRECT( UINT left, UINT top, UINT right, UINT bottom); locRECT( UINT left, UINT top, UINT right, UINT bottom);
@ -210,14 +210,13 @@ void drawOneLine( RECT &rect)
// //
// The following code deals with painting the "instrument" on the display // The following code deals with painting the "instrument" on the display
// //
/* textString - Bitmap font string */ /* textString - Bitmap font string */
void textString( int x, int y, char *msg, void *font,int digit) //suma void textString( int x, int y, char *msg, void *font,int digit) //suma
{ {
if(*msg) if(*msg) {
{ // puDrawString ( NULL, msg, x, y );
// puDrawString ( NULL, msg, x, y );
glRasterPos2f(x, y); glRasterPos2f(x, y);
while (*msg) { while (*msg) {
glutBitmapCharacter(font, *msg); glutBitmapCharacter(font, *msg);
@ -236,8 +235,7 @@ void strokeString(int x, int y, char *msg, void *font, float theta)
float sintheta,costheta; float sintheta,costheta;
if(*msg) if(*msg) {
{
glPushMatrix(); glPushMatrix();
glRotatef(theta * SGD_RADIANS_TO_DEGREES, 0.0, 0.0, 1.0); glRotatef(theta * SGD_RADIANS_TO_DEGREES, 0.0, 0.0, 1.0);
sintheta = sin(theta); sintheta = sin(theta);
@ -255,8 +253,7 @@ void strokeString(int x, int y, char *msg, void *font, float theta)
int getStringWidth ( char *str ) int getStringWidth ( char *str )
{ {
if ( HUDtext && str ) if ( HUDtext && str ) {
{
float r, l ; float r, l ;
guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ; guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
return FloatToInt( r - l ); return FloatToInt( r - l );
@ -369,44 +366,35 @@ readCard(const SGPropertyNode * node)
SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name); SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name);
if(type=="gauge") if(type=="gauge") {
span_units = maxValue - minValue; span_units = maxValue - minValue;
}
if(loadfn=="anzg") if (loadfn=="anzg") {
load_fn = get_anzg; load_fn = get_anzg;
else } else if (loadfn=="heading") {
if(loadfn=="heading")
load_fn = get_heading; load_fn = get_heading;
else } else if (loadfn=="aoa") {
if(loadfn=="aoa")
load_fn = get_aoa; load_fn = get_aoa;
else } else if (loadfn=="climb") {
if(loadfn=="climb")
load_fn = get_climb_rate; load_fn = get_climb_rate;
else } else if (loadfn=="altitude") {
if(loadfn=="altitude")
load_fn = get_altitude; load_fn = get_altitude;
else } else if (loadfn=="agl") {
if(loadfn=="agl")
load_fn = get_agl; load_fn = get_agl;
else } else if (loadfn=="speed") {
if(loadfn=="speed")
load_fn = get_speed; load_fn = get_speed;
else } else if (loadfn=="view_direction") {
if(loadfn=="view_direction")
load_fn = get_view_direction; load_fn = get_view_direction;
else } else if (loadfn=="aileronval") {
if(loadfn=="aileronval")
load_fn = get_aileronval; load_fn = get_aileronval;
else } else if (loadfn=="elevatorval") {
if(loadfn=="elevatorval")
load_fn = get_elevatorval; load_fn = get_elevatorval;
else } else if (loadfn=="rudderval") {
if(loadfn=="rudderval")
load_fn = get_rudderval; load_fn = get_rudderval;
else } else if (loadfn=="throttleval") {
if(loadfn=="throttleval")
load_fn = get_throttleval; load_fn = get_throttleval;
}
if ( (type == "dial") | (type == "tape") ) { if ( (type == "dial") | (type == "tape") ) {
@ -778,13 +766,10 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
path.append(hud_path); path.append(hud_path);
ifstream input(path.c_str()); ifstream input(path.c_str());
if (!input.good()) if (!input.good()) {
{
SG_LOG(SG_INPUT, SG_ALERT, SG_LOG(SG_INPUT, SG_ALERT,
"Cannot read Hud configuration from " << path.str()); "Cannot read Hud configuration from " << path.str());
} } else {
else
{
readHud(input); readHud(input);
input.close(); input.close();
} }
@ -811,8 +796,7 @@ int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ )
if (!input.good()) { if (!input.good()) {
SG_LOG(SG_INPUT, SG_ALERT, SG_LOG(SG_INPUT, SG_ALERT,
"Cannot read Hud configuration from " << path.str()); "Cannot read Hud configuration from " << path.str());
} } else {
else {
readHud(input); readHud(input);
input.close(); input.close();
} }
@ -1101,7 +1085,7 @@ void fgUpdateHUD( GLfloat x_start, GLfloat y_start,
if( antialiased_node->getBoolValue() ) { if( antialiased_node->getBoolValue() ) {
glEnable(GL_LINE_SMOOTH); glEnable(GL_LINE_SMOOTH);
// glEnable(GL_BLEND); // glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA);
glHint(GL_LINE_SMOOTH_HINT,GL_DONT_CARE); glHint(GL_LINE_SMOOTH_HINT,GL_DONT_CARE);
glLineWidth(1.5); glLineWidth(1.5);

View file

@ -70,13 +70,13 @@ SG_USING_NAMESPACE(std);
// some of Norman's crazy optimizations. :-) // some of Norman's crazy optimizations. :-)
#ifndef WIN32 #ifndef WIN32
typedef struct { typedef struct {
int x, y; int x, y;
} POINT; } POINT;
typedef struct { typedef struct {
int top, bottom, left, right; int top, bottom, left, right;
} RECT; } RECT;
#endif #endif
// View mode definitions // View mode definitions
@ -248,7 +248,7 @@ enum hudinstype{ HUDno_instr,
HUDdual_inst, HUDdual_inst,
HUDmoving_scale, HUDmoving_scale,
HUDtbi HUDtbi
}; };
typedef struct gltagRGBTRIPLE { // rgbt typedef struct gltagRGBTRIPLE { // rgbt
GLfloat Blue; GLfloat Blue;
@ -309,8 +309,7 @@ public:
int getStringWidth ( char *str ) int getStringWidth ( char *str )
{ {
if ( HUDtext && str ) if ( HUDtext && str ) {
{
float r, l ; float r, l ;
guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ; guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
return FloatToInt( r - l ); return FloatToInt( r - l );
@ -320,8 +319,7 @@ public:
int StringWidth (void ) int StringWidth (void )
{ {
if ( HUDtext && strlen( msg )) if ( HUDtext && strlen( msg )) {
{
float r, l ; float r, l ;
guiFntHandle->getBBox ( msg, HUD_TextSize, 0, &l, &r, NULL, NULL ) ; guiFntHandle->getBBox ( msg, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
return FloatToInt( r - l ); return FloatToInt( r - l );
@ -339,9 +337,9 @@ public:
char *t=msg; char *t=msg;
int p=4; int p=4;
if(t[0]=='-') //if negative value then increase the c and p values for '-' sign. if(t[0]=='-') {
{ //if negative value then increase the c and p values
c++; //for '-' sign. c++;
p++; p++;
} }
char *tmp=msg; char *tmp=msg;
@ -404,7 +402,7 @@ public:
} }
glEnd(); glEnd();
} }
/* void draw( void ) { /* void draw( void ) {
vector < fgLineSeg2D > :: iterator curSeg; vector < fgLineSeg2D > :: iterator curSeg;
vector < fgLineSeg2D > :: iterator lastSeg; vector < fgLineSeg2D > :: iterator lastSeg;
curSeg = List.begin(); curSeg = List.begin();
@ -475,7 +473,7 @@ extern fgLineList HUD_StippleLineList;
class instr_item { // An Abstract Base Class (ABC) class instr_item { // An Abstract Base Class (ABC)
private: private:
static UINT instances; // More than 64K instruments? Nah! static UINT instances; // More than 64K instruments? Nah!
static int brightness; static int brightness;
static glRGBTRIPLE color; static glRGBTRIPLE color;
@ -492,7 +490,7 @@ class instr_item { // An Abstract Base Class (ABC)
POINT mid_span; // POINT mid_span; //
int digits; //suma int digits; //suma
public: public:
instr_item( int x, instr_item( int x,
int y, int y,
UINT height, UINT height,
@ -524,7 +522,9 @@ class instr_item { // An Abstract Base Class (ABC)
UINT huds_vert (UINT options) { return( options & HUDS_VERT ); } UINT huds_vert (UINT options) { return( options & HUDS_VERT ); }
UINT huds_left (UINT options) { return( options & HUDS_LEFT ); } UINT huds_left (UINT options) { return( options & HUDS_LEFT ); }
UINT huds_right (UINT options) { return( options & HUDS_RIGHT ); } UINT huds_right (UINT options) { return( options & HUDS_RIGHT ); }
UINT huds_both (UINT options) { return( (options & HUDS_BOTH) == HUDS_BOTH ); } UINT huds_both (UINT options) {
return( (options & HUDS_BOTH) == HUDS_BOTH );
}
UINT huds_noticks (UINT options) { return( options & HUDS_NOTICKS ); } UINT huds_noticks (UINT options) { return( options & HUDS_NOTICKS ); }
UINT huds_notext (UINT options) { return( options & HUDS_NOTEXT ); } UINT huds_notext (UINT options) { return( options & HUDS_NOTEXT ); }
UINT huds_top (UINT options) { return( options & HUDS_TOP ); } UINT huds_top (UINT options) { return( options & HUDS_TOP ); }
@ -553,8 +553,7 @@ class instr_item { // An Abstract Base Class (ABC)
} }
int getStringWidth ( char *str ) int getStringWidth ( char *str )
{ {
if ( HUDtext && str ) if ( HUDtext && str ) {
{
float r, l ; float r, l ;
guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ; guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
return FloatToInt( r - l ); return FloatToInt( r - l );
@ -591,7 +590,7 @@ extern int HUD_style;
class instr_label : public instr_item { class instr_label : public instr_item {
private: private:
const char *pformat; const char *pformat;
const char *pre_str; const char *pre_str;
const char *post_str; const char *post_str;
@ -603,7 +602,7 @@ class instr_label : public instr_item {
bool lon; bool lon;
bool lbox; bool lbox;
public: public:
instr_label( int x, instr_label( int x,
int y, int y,
UINT width, UINT width,
@ -634,7 +633,7 @@ typedef instr_label * pInstlabel;
class lat_label : public instr_item { class lat_label : public instr_item {
private: private:
const char *pformat; const char *pformat;
const char *pre_str; const char *pre_str;
const char *post_str; const char *post_str;
@ -643,7 +642,7 @@ class lat_label : public instr_item {
int blink; int blink;
char format_buffer[80]; char format_buffer[80];
public: public:
lat_label( int x, lat_label( int x,
int y, int y,
UINT width, UINT width,
@ -670,7 +669,7 @@ class lat_label : public instr_item {
typedef lat_label * pLatlabel; typedef lat_label * pLatlabel;
class lon_label : public instr_item { class lon_label : public instr_item {
private: private:
const char *pformat; const char *pformat;
const char *pre_str; const char *pre_str;
const char *post_str; const char *post_str;
@ -679,7 +678,7 @@ class lon_label : public instr_item {
int blink; int blink;
char format_buffer[80]; char format_buffer[80];
public: public:
lon_label( int x, lon_label( int x,
int y, int y,
UINT width, UINT width,
@ -713,7 +712,7 @@ typedef lon_label * pLonlabel;
// //
class instr_scale : public instr_item { class instr_scale : public instr_item {
private: private:
float range_shown; // Width Units. float range_shown; // Width Units.
float Maximum_value; // ceiling. float Maximum_value; // ceiling.
float Minimum_value; // Representation floor. float Minimum_value; // Representation floor.
@ -723,7 +722,7 @@ class instr_scale : public instr_item {
UINT Modulo; // Roll over point UINT Modulo; // Roll over point
int signif_digits; // digits to show to the right. int signif_digits; // digits to show to the right.
public: public:
instr_scale( int x, instr_scale( int x,
int y, int y,
UINT width, UINT width,
@ -760,7 +759,7 @@ class instr_scale : public instr_item {
// line. // line.
class hud_card : public instr_scale { class hud_card : public instr_scale {
private: private:
float val_span; float val_span;
string type; string type;
float half_width_units; float half_width_units;
@ -786,7 +785,7 @@ class hud_card : public instr_scale {
UINT Min_div; //suma UINT Min_div; //suma
public: public:
hud_card( int x, hud_card( int x,
int y, int y,
UINT width, UINT width,
@ -824,7 +823,7 @@ class hud_card : public instr_scale {
~hud_card(); ~hud_card();
hud_card( const hud_card & image); hud_card( const hud_card & image);
hud_card & operator = (const hud_card & rhs ); hud_card & operator = (const hud_card & rhs );
// virtual void display_enable( bool setting ); // virtual void display_enable( bool setting );
virtual void draw( void ); // Required method in base class virtual void draw( void ); // Required method in base class
void circles(float,float,float); // suma void circles(float,float,float); // suma
void fixed(float,float,float,float,float,float); //suma void fixed(float,float,float,float,float,float); //suma
@ -834,7 +833,7 @@ class hud_card : public instr_scale {
typedef hud_card * pCardScale; typedef hud_card * pCardScale;
class gauge_instr : public instr_scale { class gauge_instr : public instr_scale {
public: public:
gauge_instr( int x, gauge_instr( int x,
int y, int y,
UINT width, UINT width,
@ -862,10 +861,10 @@ typedef gauge_instr * pGaugeInst;
// for both panel and HUD Turn Bank Indicators. // for both panel and HUD Turn Bank Indicators.
class dual_instr_item : public instr_item { class dual_instr_item : public instr_item {
private: private:
FLTFNPTR alt_data_source; FLTFNPTR alt_data_source;
public: public:
dual_instr_item ( int x, dual_instr_item ( int x,
int y, int y,
UINT width, UINT width,
@ -886,14 +885,14 @@ class dual_instr_item : public instr_item {
class fgTBI_instr : public dual_instr_item class fgTBI_instr : public dual_instr_item
{ {
private: private:
UINT BankLimit; UINT BankLimit;
UINT SlewLimit; UINT SlewLimit;
UINT scr_hole; UINT scr_hole;
bool tsi; //suma bool tsi; //suma
float rad; //suma float rad; //suma
public: public:
fgTBI_instr( int x, fgTBI_instr( int x,
int y, int y,
UINT width, UINT width,
@ -921,7 +920,7 @@ class fgTBI_instr : public dual_instr_item
typedef fgTBI_instr * pTBI; typedef fgTBI_instr * pTBI;
class HudLadder : public dual_instr_item { class HudLadder : public dual_instr_item {
private: private:
UINT width_units; UINT width_units;
int div_units; int div_units;
UINT minor_div; UINT minor_div;
@ -951,7 +950,7 @@ class HudLadder : public dual_instr_item {
fgLineList LineList; fgLineList LineList;
fgLineList StippleLineList; fgLineList StippleLineList;
public: public:
HudLadder( string name, HudLadder( string name,
int x, int x,
int y, int y,

View file

@ -82,14 +82,14 @@ hud_card( int x,
divisions=divs; //suma divisions=divs; //suma
zoom = zooms; //suma zoom = zooms; //suma
// UINT options = get_options(); // UINT options = get_options();
// huds_both = (options & HUDS_BOTH) == HUDS_BOTH; // huds_both = (options & HUDS_BOTH) == HUDS_BOTH;
// huds_right = options & HUDS_RIGHT; // huds_right = options & HUDS_RIGHT;
// huds_left = options & HUDS_LEFT; // huds_left = options & HUDS_LEFT;
// huds_vert = options & HUDS_VERT; // huds_vert = options & HUDS_VERT;
// huds_notext = options & HUDS_NOTEXT; // huds_notext = options & HUDS_NOTEXT;
// huds_top = options & HUDS_TOP; // huds_top = options & HUDS_TOP;
// huds_bottom = options & HUDS_BOTTOM; // huds_bottom = options & HUDS_BOTTOM;
} }
hud_card :: hud_card ::
@ -118,14 +118,14 @@ hud_card( const hud_card & image):
Min_div(image.Min_div)//suma Min_div(image.Min_div)//suma
{ {
// UINT options = get_options(); // UINT options = get_options();
// huds_both = (options & HUDS_BOTH) == HUDS_BOTH; // huds_both = (options & HUDS_BOTH) == HUDS_BOTH;
// huds_right = options & HUDS_RIGHT; // huds_right = options & HUDS_RIGHT;
// huds_left = options & HUDS_LEFT; // huds_left = options & HUDS_LEFT;
// huds_vert = options & HUDS_VERT; // huds_vert = options & HUDS_VERT;
// huds_notext = options & HUDS_NOTEXT; // huds_notext = options & HUDS_NOTEXT;
// huds_top = options & HUDS_TOP; // huds_top = options & HUDS_TOP;
// huds_bottom = options & HUDS_BOTTOM; // huds_bottom = options & HUDS_BOTTOM;
} }
hud_card & hud_card :: hud_card & hud_card ::
@ -191,8 +191,7 @@ draw( void ) // (HUD_scale * pscale )
//begin suma //begin suma
// if type=gauge then display dial // if type=gauge then display dial
if(type=="gauge") if(type=="gauge") {
{
float x,y; float x,y;
float i; float i;
int decimal, sign; int decimal, sign;
@ -202,8 +201,8 @@ draw( void ) // (HUD_scale * pscale )
glPointSize(3.0); glPointSize(3.0);
float incr= 360.0/divisions; float incr= 360.0/divisions;
for(i=0.0;i<360.0;i+=incr) for(i=0.0;i<360.0;i+=incr) {
{ float i1=i*SGD_DEGREES_TO_RADIANS; float i1=i*SGD_DEGREES_TO_RADIANS;
float x1=x+radius*cos(i1); float x1=x+radius*cos(i1);
float y1=y+radius*sin(i1); float y1=y+radius*sin(i1);
@ -215,8 +214,7 @@ draw( void ) // (HUD_scale * pscale )
glDisable(GL_POINT_SMOOTH); glDisable(GL_POINT_SMOOTH);
if(data_available()) if(data_available()) {
{
float offset = 90.0*SGD_DEGREES_TO_RADIANS; float offset = 90.0*SGD_DEGREES_TO_RADIANS;
float r1=10.0; //size of carrot float r1=10.0; //size of carrot
float theta= get_value(); float theta= get_value();
@ -245,19 +243,15 @@ draw( void ) // (HUD_scale * pscale )
} }
} //end type=gauge //end type=gauge
else // if its not explicitly a gauge default to tape } else {
{ // if its not explicitly a gauge default to tape
if(pointer) if(pointer) {
{ if(pointer_type=="moving") {
if(pointer_type=="moving")
{
vmin = minValue; vmin = minValue;
vmax = maxValue; vmax = maxValue;
} } else {
else // default to fixed // default to fixed
{
vmin = cur_value - half_width_units; // width units == needle travel vmin = cur_value - half_width_units; // width units == needle travel
vmax = cur_value + half_width_units; // or picture unit span. vmax = cur_value + half_width_units; // or picture unit span.
text_x = mid_scr.x; text_x = mid_scr.x;
@ -270,7 +264,6 @@ draw( void ) // (HUD_scale * pscale )
text_y = mid_scr.y; text_y = mid_scr.y;
} }
// Draw the basic markings for the scale... // Draw the basic markings for the scale...
if( huds_vert(options) ) { // Vertical scale if( huds_vert(options) ) { // Vertical scale
@ -325,12 +318,9 @@ draw( void ) // (HUD_scale * pscale )
// marker_xe, mid_scr.y - scrn_rect.right / 6); // marker_xe, mid_scr.y - scrn_rect.right / 6);
// draw pointer // draw pointer
if(pointer) if(pointer) {
{ if(pointer_type=="moving") {
if(pointer_type=="moving") if(zoom == 0) {
{
if(zoom == 0)
{
//Code for Moving Type Pointer included by suma. //Code for Moving Type Pointer included by suma.
static float ycentre, ypoint,xpoint; static float ycentre, ypoint,xpoint;
static int range,wth; static int range,wth;
@ -357,8 +347,8 @@ draw( void ) // (HUD_scale * pscale )
drawOneLine(xpoint-marker_offset,ypoint,xpoint-5.0,ypoint+5.0); drawOneLine(xpoint-marker_offset,ypoint,xpoint-5.0,ypoint+5.0);
drawOneLine(xpoint-marker_offset,ypoint,xpoint-5.0,ypoint-5.0); drawOneLine(xpoint-marker_offset,ypoint,xpoint-5.0,ypoint-5.0);
}//zoom=0 }//zoom=0
} else // default to fixed } else {
{ // default to fixed
fixed(marker_offset+marker_xe, text_y + scrn_rect.right / 6, fixed(marker_offset+marker_xe, text_y + scrn_rect.right / 6,
marker_offset+marker_xs, text_y,marker_offset+marker_xe, marker_offset+marker_xs, text_y,marker_offset+marker_xe,
text_y - scrn_rect.right / 6); text_y - scrn_rect.right / 6);
@ -383,12 +373,10 @@ draw( void ) // (HUD_scale * pscale )
// marker_xe, mid_scr.y); // marker_xe, mid_scr.y);
// draw pointer // draw pointer
if(pointer) if(pointer) {
{ if(pointer_type=="moving") {
if(pointer_type=="moving") if(zoom == 0) {
{ //type-fixed & zoom=1, behaviour to be defined
if(zoom == 0) //type-fixed & zoom=1, behaviour to be defined
{
// Code for Moving Type Pointer included by suma. // Code for Moving Type Pointer included by suma.
static float ycentre, ypoint,xpoint; static float ycentre, ypoint,xpoint;
static int range,wth; static int range,wth;
@ -414,14 +402,13 @@ draw( void ) // (HUD_scale * pscale )
drawOneLine(xpoint+marker_offset,ypoint,xpoint+5.0,ypoint+5.0); drawOneLine(xpoint+marker_offset,ypoint,xpoint+5.0,ypoint+5.0);
drawOneLine(xpoint+marker_offset,ypoint,xpoint+5.0,ypoint-5.0); drawOneLine(xpoint+marker_offset,ypoint,xpoint+5.0,ypoint-5.0);
} }
} } else {
else // default to fixed // default to fixed
{
fixed( -marker_offset+scrn_rect.left, text_y + scrn_rect.right / 6, fixed( -marker_offset+scrn_rect.left, text_y + scrn_rect.right / 6,
-marker_offset+marker_xe, text_y,-marker_offset+scrn_rect.left, -marker_offset+marker_xe, text_y,-marker_offset+scrn_rect.left,
text_y - scrn_rect.right / 6); text_y - scrn_rect.right / 6);
} }
}//if pointer } //if pointer
} //end vertical/right } //end vertical/right
// At this point marker x_start and x_end values are transposed. // At this point marker x_start and x_end values are transposed.
@ -440,15 +427,10 @@ draw( void ) // (HUD_scale * pscale )
last = FloatToInt(vmax)+1; last = FloatToInt(vmax)+1;
i = FloatToInt(vmin); i = FloatToInt(vmin);
if(zoom ==1) if(zoom ==1) {
{
zoomed_scale(vmin,vmax); //suma zoomed_scale(vmin,vmax); //suma
} } else {
else for( ; i <last ; i++ ) {
{
for( ; i <last ; i++ )
{
condition = true; condition = true;
if( !modulo()) { if( !modulo()) {
if( i < min_val()) { if( i < min_val()) {
@ -476,39 +458,31 @@ draw( void ) // (HUD_scale * pscale )
k = i; k = i;
// Minor ticks // Minor ticks
if( div_min()) if( div_min()) {
{
// if( (i%div_min()) == 0) { // if( (i%div_min()) == 0) {
if( !(k%(int)div_min())) if( !(k%(int)div_min())) {
{
/* if((( marker_ys - 5) > scrn_rect.top ) && /* if((( marker_ys - 5) > scrn_rect.top ) &&
(( marker_ys + 5) < (height))){ */ (( marker_ys + 5) < (height))){ */
//vertical/left OR vertical/right //vertical/left OR vertical/right
if( huds_both(options) ) if( huds_both(options) ) {
{ if(tick_type=="line") {
if(tick_type=="line") if(tick_length=="variable") {
{ drawOneLine( scrn_rect.left, marker_ys,
if(tick_length=="variable") marker_xs, marker_ys );
{ drawOneLine( marker_xe, marker_ys,
width, marker_ys );
} else {
drawOneLine( scrn_rect.left, marker_ys, drawOneLine( scrn_rect.left, marker_ys,
marker_xs, marker_ys ); marker_xs, marker_ys );
drawOneLine( marker_xe, marker_ys, drawOneLine( marker_xe, marker_ys,
width, marker_ys ); width, marker_ys );
} }
else } else if(tick_type=="circle") // begin suma this func. is written below
{
drawOneLine( scrn_rect.left, marker_ys,
marker_xs, marker_ys );
drawOneLine( marker_xe, marker_ys,
width, marker_ys );
}
}
else if(tick_type=="circle") // begin suma this func. is written below
circles(scrn_rect.left,(float)marker_ys,3.0); //end suma circles(scrn_rect.left,(float)marker_ys,3.0); //end suma
else // if neither line nor circle draw default as line else {
{ // if neither line nor circle draw default as line
drawOneLine( scrn_rect.left, marker_ys, drawOneLine( scrn_rect.left, marker_ys,
marker_xs, marker_ys ); marker_xs, marker_ys );
drawOneLine( marker_xe, marker_ys, drawOneLine( marker_xe, marker_ys,
@ -523,45 +497,33 @@ draw( void ) // (HUD_scale * pscale )
// anything other than huds_both // anything other than huds_both
} else { } else {
if( huds_left(options) ) { if( huds_left(options) ) {
if(tick_type=="line") if(tick_type=="line") {
{ if(tick_length=="variable") {
if(tick_length=="variable")
{
drawOneLine( marker_xs + 4, marker_ys, drawOneLine( marker_xs + 4, marker_ys,
marker_xe, marker_ys ); marker_xe, marker_ys );
} } else {
else
{
drawOneLine( marker_xs , marker_ys, drawOneLine( marker_xs , marker_ys,
marker_xe, marker_ys ); marker_xe, marker_ys );
} }
} } else if(tick_type=="circle") // begin suma
else if(tick_type=="circle") // begin suma
circles((float)marker_xs + 4, (float)marker_ys,3.0); //end suma circles((float)marker_xs + 4, (float)marker_ys,3.0); //end suma
else else {
{
drawOneLine( marker_xs + 4, marker_ys, drawOneLine( marker_xs + 4, marker_ys,
marker_xe, marker_ys ); marker_xe, marker_ys );
} }
} else { } else {
if(tick_type=="line") if(tick_type=="line") {
{ if(tick_length=="variable") {
if(tick_length=="variable")
{
drawOneLine( marker_xs, marker_ys, drawOneLine( marker_xs, marker_ys,
marker_xe - 4, marker_ys ); marker_xe - 4, marker_ys );
} } else {
else
{
drawOneLine( marker_xs, marker_ys, drawOneLine( marker_xs, marker_ys,
marker_xe , marker_ys ); marker_xe , marker_ys );
} }
} } else if(tick_type=="circle") //begin suma
else if(tick_type=="circle") //begin suma
circles((float)marker_xe - 4, (float)marker_ys,3.0); //end suma circles((float)marker_xe - 4, (float)marker_ys,3.0); //end suma
else else {
{
drawOneLine( marker_xs, marker_ys, drawOneLine( marker_xs, marker_ys,
marker_xe - 4, marker_ys ); marker_xe - 4, marker_ys );
} }
@ -571,8 +533,7 @@ draw( void ) // (HUD_scale * pscale )
} //end minor ticks } //end minor ticks
// Major ticks // Major ticks
if( div_max() ) if( div_max() ) {
{
if( !(k%(int)div_max()) ) { if( !(k%(int)div_max()) ) {
if(modulo()) { if(modulo()) {
@ -591,25 +552,21 @@ draw( void ) // (HUD_scale * pscale )
/* if(( (marker_ys - 8 ) > scrn_rect.top ) && /* if(( (marker_ys - 8 ) > scrn_rect.top ) &&
( (marker_ys + 8) < (height))){ */ //suma ( (marker_ys + 8) < (height))){ */ //suma
// huds_both // huds_both
if( huds_both(options) ) if( huds_both(options) ) {
{
// drawOneLine( scrn_rect.left, marker_ys, // drawOneLine( scrn_rect.left, marker_ys,
// marker_xs, marker_ys); // marker_xs, marker_ys);
// drawOneLine( marker_xs, marker_ys, // drawOneLine( marker_xs, marker_ys,
// scrn_rect.left + scrn_rect.right, // scrn_rect.left + scrn_rect.right,
// marker_ys); // marker_ys);
if(tick_type=="line") if(tick_type=="line") {
{
glBegin(GL_LINE_STRIP); glBegin(GL_LINE_STRIP);
glVertex2f( scrn_rect.left, marker_ys ); glVertex2f( scrn_rect.left, marker_ys );
glVertex2f( marker_xs, marker_ys); glVertex2f( marker_xs, marker_ys);
glVertex2f( width, marker_ys); glVertex2f( width, marker_ys);
glEnd(); glEnd();
} } else if(tick_type=="circle") //begin suma
else if(tick_type=="circle") //begin suma
circles(scrn_rect.left, (float)marker_ys,5.0); //end suma circles(scrn_rect.left, (float)marker_ys,5.0); //end suma
else else {
{
glBegin(GL_LINE_STRIP); glBegin(GL_LINE_STRIP);
glVertex2f( scrn_rect.left, marker_ys ); glVertex2f( scrn_rect.left, marker_ys );
glVertex2f( marker_xs, marker_ys); glVertex2f( marker_xs, marker_ys);
@ -621,32 +578,23 @@ draw( void ) // (HUD_scale * pscale )
textString ( marker_xs + 2, marker_ys, textString ( marker_xs + 2, marker_ys,
TextScale, GLUT_BITMAP_8_BY_13,0 ); TextScale, GLUT_BITMAP_8_BY_13,0 );
} }
} } else {
//begin suma //begin suma
/* Changes are made to draw a circle when tick_type="circle" */ /* Changes are made to draw a circle when tick_type="circle" */
// anything other than huds_both // anything other than huds_both
else if(tick_type=="line") {
{
if(tick_type=="line")
{
drawOneLine( marker_xs, marker_ys, marker_xe, marker_ys ); drawOneLine( marker_xs, marker_ys, marker_xe, marker_ys );
} } else if(tick_type=="circle")
else if(tick_type=="circle")
circles((float)marker_xs + 4, (float)marker_ys,5.0);//end suma circles((float)marker_xs + 4, (float)marker_ys,5.0);//end suma
else else {
{
drawOneLine( marker_xs, marker_ys, marker_xe, marker_ys ); drawOneLine( marker_xs, marker_ys, marker_xe, marker_ys );
} }
if( !huds_notext(options) ) if( !huds_notext(options) ) {
{ if( huds_left(options) ) {
if( huds_left(options) )
{
textString( marker_xs - 8 * lenstr - 2, textString( marker_xs - 8 * lenstr - 2,
marker_ys - 4, marker_ys - 4,
TextScale, GLUT_BITMAP_8_BY_13,0 ); TextScale, GLUT_BITMAP_8_BY_13,0 );
} } else {
else
{
textString( marker_xe + 3 * lenstr, textString( marker_xe + 3 * lenstr,
marker_ys - 4, marker_ys - 4,
TextScale, GLUT_BITMAP_8_BY_13,0 ); TextScale, GLUT_BITMAP_8_BY_13,0 );
@ -658,8 +606,9 @@ draw( void ) // (HUD_scale * pscale )
} // End condition } // End condition
} // End for } // End for
} //end of zoom } //end of zoom
} // End if VERTICAL SCALE TYPE (tape loop yet to be closed) // End if VERTICAL SCALE TYPE (tape loop yet to be closed)
else { // Horizontal scale by default } else {
// Horizontal scale by default
// left tick bar // left tick bar
if (draw_tick_left) { if (draw_tick_left) {
drawOneLine( scrn_rect.left, scrn_rect.top, drawOneLine( scrn_rect.left, scrn_rect.top,
@ -705,12 +654,9 @@ draw( void ) // (HUD_scale * pscale )
// drawOneLine( mid_scr.x, marker_ye, // drawOneLine( mid_scr.x, marker_ye,
// mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top); // mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top);
// draw pointer // draw pointer
if(pointer) if(pointer) {
{ if(pointer_type=="moving") {
if(pointer_type=="moving") if (zoom ==0) {
{
if (zoom ==0)
{
//Code for Moving Type Pointer included by suma. //Code for Moving Type Pointer included by suma.
static float xcentre,xpoint,ypoint; static float xcentre,xpoint,ypoint;
static int range; static int range;
@ -725,9 +671,8 @@ draw( void ) // (HUD_scale * pscale )
drawOneLine(xpoint,ypoint+marker_offset,xpoint+5.0,ypoint+5.0); drawOneLine(xpoint,ypoint+marker_offset,xpoint+5.0,ypoint+5.0);
drawOneLine(xpoint,ypoint+marker_offset,xpoint-5.0,ypoint+5.0); drawOneLine(xpoint,ypoint+marker_offset,xpoint-5.0,ypoint+5.0);
} }
} } else {
else //default to fixed //default to fixed
{
fixed( marker_xs - scrn_rect.bottom / 4, scrn_rect.top, fixed( marker_xs - scrn_rect.bottom / 4, scrn_rect.top,
marker_xs, marker_ye, marker_xs + scrn_rect.bottom / 4,scrn_rect.top); marker_xs, marker_ye, marker_xs + scrn_rect.bottom / 4,scrn_rect.top);
} }
@ -752,12 +697,9 @@ draw( void ) // (HUD_scale * pscale )
// mid_scr.x , marker_ys ); // mid_scr.x , marker_ys );
// draw pointer // draw pointer
if(pointer) if(pointer) {
{ if(pointer_type=="moving") {
if(pointer_type=="moving") if(zoom == 0) {
{
if(zoom == 0)
{
//Code for Moving Type Pointer included by suma. //Code for Moving Type Pointer included by suma.
static float xcentre,xpoint,ypoint; static float xcentre,xpoint,ypoint;
static int range,hgt; static int range,hgt;
@ -773,9 +715,7 @@ draw( void ) // (HUD_scale * pscale )
drawOneLine(xpoint,ypoint-marker_offset,xpoint+5.0,ypoint-5.0); drawOneLine(xpoint,ypoint-marker_offset,xpoint+5.0,ypoint-5.0);
drawOneLine(xpoint,ypoint-marker_offset,xpoint-5.0,ypoint-5.0); drawOneLine(xpoint,ypoint-marker_offset,xpoint-5.0,ypoint-5.0);
} }
} } else {
else
{
fixed( marker_xs + scrn_rect.bottom / 4, height, marker_xs, marker_ys, fixed( marker_xs + scrn_rect.bottom / 4, height, marker_xs, marker_ys,
marker_xs - scrn_rect.bottom / 4, height); marker_xs - scrn_rect.bottom / 4, height);
} }
@ -793,13 +733,10 @@ draw( void ) // (HUD_scale * pscale )
// last = FloatToInt(vmax)+1; // last = FloatToInt(vmax)+1;
// i = FloatToInt(vmin); // i = FloatToInt(vmin);
if(zoom ==1) if(zoom ==1) {
{
zoomed_scale(vmin,vmax); //suma zoomed_scale(vmin,vmax); //suma
} } else {
else //default to zoom=0 //default to zoom=0
{
last = (int)vmax + 1; last = (int)vmax + 1;
i = (int)vmin; i = (int)vmin;
for(; i <last ; i++ ) { for(; i <last ; i++ ) {
@ -821,7 +758,7 @@ draw( void ) // (HUD_scale * pscale )
else else
k = i; k = i;
if( div_min()){ if( div_min()) {
// if( (i%(int)div_min()) == 0 ) { // if( (i%(int)div_min()) == 0 ) {
//draw minor ticks //draw minor ticks
if( !(k%(int)div_min() )) { if( !(k%(int)div_min() )) {
@ -829,17 +766,13 @@ draw( void ) // (HUD_scale * pscale )
/*if((( marker_xs - 5) > scrn_rect.left ) && /*if((( marker_xs - 5) > scrn_rect.left ) &&
(( marker_xs + 5 )< (scrn_rect.left + scrn_rect.right))){ */ //suma (( marker_xs + 5 )< (scrn_rect.left + scrn_rect.right))){ */ //suma
if( huds_both(options) ) if( huds_both(options) ) {
{ if(tick_length=="variable") {
if(tick_length=="variable")
{
drawOneLine( marker_xs, scrn_rect.top, drawOneLine( marker_xs, scrn_rect.top,
marker_xs, marker_ys - 4); marker_xs, marker_ys - 4);
drawOneLine( marker_xs, marker_ye + 4, drawOneLine( marker_xs, marker_ye + 4,
marker_xs, height); marker_xs, height);
} } else {
else
{
drawOneLine( marker_xs, scrn_rect.top, drawOneLine( marker_xs, scrn_rect.top,
marker_xs, marker_ys); marker_xs, marker_ys);
drawOneLine( marker_xs, marker_ye, drawOneLine( marker_xs, marker_ye,
@ -852,8 +785,8 @@ draw( void ) // (HUD_scale * pscale )
// glVertex2f( marker_xs, scrn_rect.top + scrn_rect.bottom); // glVertex2f( marker_xs, scrn_rect.top + scrn_rect.bottom);
// glEnd(); // glEnd();
} else { } else {
if( huds_top(options)) if( huds_top(options)) {
{ //draw minor ticks //draw minor ticks
if(tick_length=="variable") if(tick_length=="variable")
drawOneLine(marker_xs,marker_ys,marker_xs,marker_ye-4); drawOneLine(marker_xs,marker_ys,marker_xs,marker_ye-4);
else else
@ -976,10 +909,8 @@ zoomed_scale(int first, int last)
int a=0; int a=0;
while(first <= last) while(first <= last) {
{ if((first % (int)Maj_div) == 0) {
if((first % (int)Maj_div) == 0)
{
data[a] = first; data[a] = first;
a++ ; a++ ;
} }
@ -988,8 +919,7 @@ zoomed_scale(int first, int last)
int centre =a/2; int centre =a/2;
if( huds_vert(options) ) if( huds_vert(options) ) {
{
x=scrn_rect.left; x=scrn_rect.left;
y=scrn_rect.top; y=scrn_rect.top;
@ -1024,20 +954,17 @@ zoomed_scale(int first, int last)
wth=scrn_rect.left+scrn_rect.right; wth=scrn_rect.left+scrn_rect.right;
if(cur_value <= data[centre+1]) if(cur_value <= data[centre+1])
if(cur_value > data[centre]) if(cur_value > data[centre]) {
{
ypoint = ycent + ((cur_value - data[centre]) * hgt/Maj_div); ypoint = ycent + ((cur_value - data[centre]) * hgt/Maj_div);
} }
if(cur_value >= data[centre-1]) if(cur_value >= data[centre-1])
if(cur_value <= data[centre]) if(cur_value <= data[centre]) {
{
ypoint = ycent - ((data[centre]-cur_value) * hgt/Maj_div); ypoint = ycent - ((data[centre]-cur_value) * hgt/Maj_div);
} }
if(cur_value < data[centre-1]) if(cur_value < data[centre-1])
if(cur_value >= minValue) if(cur_value >= minValue) {
{
float diff = minValue - data[centre-1]; float diff = minValue - data[centre-1];
float diff1 = cur_value - data[centre-1]; float diff1 = cur_value - data[centre-1];
float val = (diff1 * hgt1) / diff; float val = (diff1 * hgt1) / diff;
@ -1047,8 +974,7 @@ zoomed_scale(int first, int last)
if(cur_value > data[centre+1]) if(cur_value > data[centre+1])
if(cur_value <= maxValue) if(cur_value <= maxValue) {
{
float diff = maxValue - data[centre+1]; float diff = maxValue - data[centre+1];
float diff1 = cur_value - data[centre+1]; float diff1 = cur_value - data[centre+1];
float val = (diff1 * hgt1) / diff; float val = (diff1 * hgt1) / diff;
@ -1056,21 +982,18 @@ zoomed_scale(int first, int last)
ypoint = ycent + hgt + val; ypoint = ycent + hgt + val;
} }
if(huds_left(options)) if(huds_left(options)) {
{
xstart = w; xstart = w;
drawOneLine( xstart, ycentre, xstart - 5.0, ycentre); //centre tick drawOneLine( xstart, ycentre, xstart - 5.0, ycentre); //centre tick
sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling())); sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling()));
if( !huds_notext(options)) if( !huds_notext(options)) {
{
textString (x, ycentre, TextScale, GLUT_BITMAP_8_BY_13,0 ); textString (x, ycentre, TextScale, GLUT_BITMAP_8_BY_13,0 );
} }
for(i=1;i<5;i++) for(i=1;i<5;i++) {
{
yfirst += factor; yfirst += factor;
ycentre += factor; ycentre += factor;
circles(xstart-2.5,yfirst, 3.0); circles(xstart-2.5,yfirst, 3.0);
@ -1079,8 +1002,7 @@ zoomed_scale(int first, int last)
yfirst = mid_scr.y - hgt; yfirst = mid_scr.y - hgt;
for(i=0;i<=incr;i++) for(i=0;i<=incr;i++) {
{
drawOneLine( xstart, yfirst, xstart - 5.0, yfirst); drawOneLine( xstart, yfirst, xstart - 5.0, yfirst);
drawOneLine( xstart,ysecond, xstart - 5.0,ysecond); drawOneLine( xstart,ysecond, xstart - 5.0,ysecond);
@ -1103,8 +1025,7 @@ zoomed_scale(int first, int last)
//begin //begin
xpoint = wth + 10.0; xpoint = wth + 10.0;
if(pointer_type == "moving") if(pointer_type == "moving") {
{
drawOneLine(xpoint,ycent,xpoint,ypoint); drawOneLine(xpoint,ycent,xpoint,ypoint);
drawOneLine(xpoint,ypoint,xpoint-10.0,ypoint); drawOneLine(xpoint,ypoint,xpoint-10.0,ypoint);
drawOneLine(xpoint-10.0,ypoint,xpoint-5.0,ypoint+5.0); drawOneLine(xpoint-10.0,ypoint,xpoint-5.0,ypoint+5.0);
@ -1112,23 +1033,19 @@ zoomed_scale(int first, int last)
} }
//end //end
} } else {
else //huds_right //huds_right
{
xstart = (x+w)/2; xstart = (x+w)/2;
drawOneLine( xstart, ycentre, xstart + 5.0, ycentre); //centre tick drawOneLine( xstart, ycentre, xstart + 5.0, ycentre); //centre tick
sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling())); sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling()));
if( !huds_notext(options)) if( !huds_notext(options)) {
{
textString (w, ycentre, TextScale, GLUT_BITMAP_8_BY_13,0 ); textString (w, ycentre, TextScale, GLUT_BITMAP_8_BY_13,0 );
} }
for(i=1;i<5;i++) for(i=1;i<5;i++) {
{
yfirst += factor; yfirst += factor;
ycentre += factor; ycentre += factor;
circles(xstart+2.5,yfirst, 3.0); circles(xstart+2.5,yfirst, 3.0);
@ -1137,8 +1054,7 @@ zoomed_scale(int first, int last)
yfirst = mid_scr.y - hgt; yfirst = mid_scr.y - hgt;
for(i=0;i<=incr;i++) for(i=0;i<=incr;i++) {
{
drawOneLine( xstart, yfirst, xstart + 5.0, yfirst); drawOneLine( xstart, yfirst, xstart + 5.0, yfirst);
drawOneLine( xstart,ysecond, xstart + 5.0,ysecond); drawOneLine( xstart,ysecond, xstart + 5.0,ysecond);
@ -1161,8 +1077,7 @@ zoomed_scale(int first, int last)
//begin //begin
xpoint = scrn_rect.left; xpoint = scrn_rect.left;
if(pointer_type == "moving") if(pointer_type == "moving") {
{
drawOneLine(xpoint,ycent,xpoint,ypoint); drawOneLine(xpoint,ycent,xpoint,ypoint);
drawOneLine(xpoint,ypoint,xpoint+10.0,ypoint); drawOneLine(xpoint,ypoint,xpoint+10.0,ypoint);
drawOneLine(xpoint+10.0,ypoint,xpoint+5.0,ypoint+5.0); drawOneLine(xpoint+10.0,ypoint,xpoint+5.0,ypoint+5.0);
@ -1170,9 +1085,9 @@ zoomed_scale(int first, int last)
} }
//end //end
}//end huds_right /left }//end huds_right /left
} //end of vertical scale //end of vertical scale
else //horizontal scale } else {
{ //horizontal scale
x=scrn_rect.left; x=scrn_rect.left;
y=scrn_rect.top; y=scrn_rect.top;
w=scrn_rect.left+scrn_rect.right; w=scrn_rect.left+scrn_rect.right;
@ -1203,20 +1118,17 @@ zoomed_scale(int first, int last)
xcent = mid_scr.x; xcent = mid_scr.x;
if(cur_value <= data[centre+1]) if(cur_value <= data[centre+1])
if(cur_value > data[centre]) if(cur_value > data[centre]) {
{
xpoint = xcent + ((cur_value - data[centre]) * hgt/Maj_div); xpoint = xcent + ((cur_value - data[centre]) * hgt/Maj_div);
} }
if(cur_value >= data[centre-1]) if(cur_value >= data[centre-1])
if(cur_value <= data[centre]) if(cur_value <= data[centre]) {
{
xpoint = xcent - ((data[centre]-cur_value) * hgt/Maj_div); xpoint = xcent - ((data[centre]-cur_value) * hgt/Maj_div);
} }
if(cur_value < data[centre-1]) if(cur_value < data[centre-1])
if(cur_value >= minValue) if(cur_value >= minValue) {
{
float diff = minValue - data[centre-1]; float diff = minValue - data[centre-1];
float diff1 = cur_value - data[centre-1]; float diff1 = cur_value - data[centre-1];
float val = (diff1 * hgt1) / diff; float val = (diff1 * hgt1) / diff;
@ -1226,8 +1138,7 @@ zoomed_scale(int first, int last)
if(cur_value > data[centre+1]) if(cur_value > data[centre+1])
if(cur_value <= maxValue) if(cur_value <= maxValue) {
{
float diff = maxValue - data[centre+1]; float diff = maxValue - data[centre+1];
float diff1 = cur_value - data[centre+1]; float diff1 = cur_value - data[centre+1];
float val = (diff1 * hgt1) / diff; float val = (diff1 * hgt1) / diff;
@ -1236,8 +1147,7 @@ zoomed_scale(int first, int last)
} }
//end //end
if(huds_top(options)) if(huds_top(options)) {
{
ystart =h; ystart =h;
@ -1245,13 +1155,11 @@ zoomed_scale(int first, int last)
sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling())); sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling()));
if( !huds_notext(options)) if( !huds_notext(options)) {
{
textString (xcentre-10.0, y, TextScale, GLUT_BITMAP_8_BY_13,0 ); textString (xcentre-10.0, y, TextScale, GLUT_BITMAP_8_BY_13,0 );
} }
for(i=1;i<5;i++) for(i=1;i<5;i++) {
{
xfirst += factor; xfirst += factor;
xcentre += factor; xcentre += factor;
circles(xfirst, ystart-2.5, 3.0); circles(xfirst, ystart-2.5, 3.0);
@ -1260,8 +1168,7 @@ zoomed_scale(int first, int last)
xfirst = mid_scr.x - hgt; xfirst = mid_scr.x - hgt;
for(i=0;i<=incr;i++) for(i=0;i<=incr;i++) {
{
drawOneLine( xfirst, ystart, xfirst, ystart - 5.0); drawOneLine( xfirst, ystart, xfirst, ystart - 5.0);
drawOneLine( xsecond, ystart, xsecond, ystart - 5.0); drawOneLine( xsecond, ystart, xsecond, ystart - 5.0);
@ -1285,19 +1192,15 @@ zoomed_scale(int first, int last)
ypoint = scrn_rect.top + scrn_rect.bottom + 10.0; ypoint = scrn_rect.top + scrn_rect.bottom + 10.0;
if(pointer_type == "moving") if(pointer_type == "moving") {
{
drawOneLine(xcent, ypoint,xpoint,ypoint); drawOneLine(xcent, ypoint,xpoint,ypoint);
drawOneLine(xpoint,ypoint,xpoint,ypoint-10.0); drawOneLine(xpoint,ypoint,xpoint,ypoint-10.0);
drawOneLine(xpoint,ypoint-10.0,xpoint+5.0,ypoint-5.0); drawOneLine(xpoint,ypoint-10.0,xpoint+5.0,ypoint-5.0);
drawOneLine(xpoint,ypoint-10.0,xpoint-5.0,ypoint-5.0); drawOneLine(xpoint,ypoint-10.0,xpoint-5.0,ypoint-5.0);
} }
//end //end of top option
} else {
} //end of top option //else huds_bottom
else //else huds_bottom
{
ystart = (y+h)/2; ystart = (y+h)/2;
//drawOneLine( xstart, yfirst, xstart - 5.0, yfirst ); //drawOneLine( xstart, yfirst, xstart - 5.0, yfirst );
@ -1305,13 +1208,11 @@ zoomed_scale(int first, int last)
sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling())); sprintf(TextScale,"%3.0f\n",(float)(data[centre] * data_scaling()));
if( !huds_notext(options)) if( !huds_notext(options)) {
{
textString (xcentre-10.0, h, TextScale, GLUT_BITMAP_8_BY_13,0 ); textString (xcentre-10.0, h, TextScale, GLUT_BITMAP_8_BY_13,0 );
} }
for(i=1;i<5;i++) for(i=1;i<5;i++) {
{
xfirst += factor; xfirst += factor;
xcentre += factor; xcentre += factor;
circles(xfirst, ystart+2.5, 3.0); circles(xfirst, ystart+2.5, 3.0);
@ -1320,8 +1221,7 @@ zoomed_scale(int first, int last)
xfirst = mid_scr.x - hgt; xfirst = mid_scr.x - hgt;
for(i=0;i<=incr;i++) for(i=0;i<=incr;i++) {
{
drawOneLine( xfirst, ystart, xfirst, ystart + 5.0); drawOneLine( xfirst, ystart, xfirst, ystart + 5.0);
drawOneLine( xsecond,ystart, xsecond,ystart + 5.0); drawOneLine( xsecond,ystart, xsecond,ystart + 5.0);
@ -1344,8 +1244,7 @@ zoomed_scale(int first, int last)
//begin //begin
ypoint = scrn_rect.top - 10.0; ypoint = scrn_rect.top - 10.0;
if(pointer_type == "moving") if(pointer_type == "moving") {
{
drawOneLine(xcent, ypoint,xpoint,ypoint); drawOneLine(xcent, ypoint,xpoint,ypoint);
drawOneLine(xpoint,ypoint,xpoint,ypoint+10.0); drawOneLine(xpoint,ypoint,xpoint,ypoint+10.0);
drawOneLine(xpoint,ypoint+10.0,xpoint+5.0,ypoint+5.0); drawOneLine(xpoint,ypoint+10.0,xpoint+5.0,ypoint+5.0);