White space changes.
This commit is contained in:
parent
1dfe83dfd4
commit
f77877ffa8
3 changed files with 1518 additions and 1636 deletions
|
@ -215,8 +215,7 @@ void drawOneLine( RECT &rect)
|
|||
void textString( int x, int y, char *msg, void *font,int digit) //suma
|
||||
{
|
||||
|
||||
if(*msg)
|
||||
{
|
||||
if(*msg) {
|
||||
// puDrawString ( NULL, msg, x, y );
|
||||
glRasterPos2f(x, y);
|
||||
while (*msg) {
|
||||
|
@ -236,8 +235,7 @@ void strokeString(int x, int y, char *msg, void *font, float theta)
|
|||
float sintheta,costheta;
|
||||
|
||||
|
||||
if(*msg)
|
||||
{
|
||||
if(*msg) {
|
||||
glPushMatrix();
|
||||
glRotatef(theta * SGD_RADIANS_TO_DEGREES, 0.0, 0.0, 1.0);
|
||||
sintheta = sin(theta);
|
||||
|
@ -255,8 +253,7 @@ void strokeString(int x, int y, char *msg, void *font, float theta)
|
|||
|
||||
int getStringWidth ( char *str )
|
||||
{
|
||||
if ( HUDtext && str )
|
||||
{
|
||||
if ( HUDtext && str ) {
|
||||
float r, l ;
|
||||
guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
|
||||
return FloatToInt( r - l );
|
||||
|
@ -369,44 +366,35 @@ readCard(const SGPropertyNode * node)
|
|||
SG_LOG(SG_INPUT, SG_INFO, "Done reading instrument " << name);
|
||||
|
||||
|
||||
if(type=="gauge")
|
||||
if(type=="gauge") {
|
||||
span_units = maxValue - minValue;
|
||||
}
|
||||
|
||||
if(loadfn=="anzg")
|
||||
if (loadfn=="anzg") {
|
||||
load_fn = get_anzg;
|
||||
else
|
||||
if(loadfn=="heading")
|
||||
} else if (loadfn=="heading") {
|
||||
load_fn = get_heading;
|
||||
else
|
||||
if(loadfn=="aoa")
|
||||
} else if (loadfn=="aoa") {
|
||||
load_fn = get_aoa;
|
||||
else
|
||||
if(loadfn=="climb")
|
||||
} else if (loadfn=="climb") {
|
||||
load_fn = get_climb_rate;
|
||||
else
|
||||
if(loadfn=="altitude")
|
||||
} else if (loadfn=="altitude") {
|
||||
load_fn = get_altitude;
|
||||
else
|
||||
if(loadfn=="agl")
|
||||
} else if (loadfn=="agl") {
|
||||
load_fn = get_agl;
|
||||
else
|
||||
if(loadfn=="speed")
|
||||
} else if (loadfn=="speed") {
|
||||
load_fn = get_speed;
|
||||
else
|
||||
if(loadfn=="view_direction")
|
||||
} else if (loadfn=="view_direction") {
|
||||
load_fn = get_view_direction;
|
||||
else
|
||||
if(loadfn=="aileronval")
|
||||
} else if (loadfn=="aileronval") {
|
||||
load_fn = get_aileronval;
|
||||
else
|
||||
if(loadfn=="elevatorval")
|
||||
} else if (loadfn=="elevatorval") {
|
||||
load_fn = get_elevatorval;
|
||||
else
|
||||
if(loadfn=="rudderval")
|
||||
} else if (loadfn=="rudderval") {
|
||||
load_fn = get_rudderval;
|
||||
else
|
||||
if(loadfn=="throttleval")
|
||||
} else if (loadfn=="throttleval") {
|
||||
load_fn = get_throttleval;
|
||||
}
|
||||
|
||||
|
||||
if ( (type == "dial") | (type == "tape") ) {
|
||||
|
@ -778,13 +766,10 @@ int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ )
|
|||
path.append(hud_path);
|
||||
|
||||
ifstream input(path.c_str());
|
||||
if (!input.good())
|
||||
{
|
||||
if (!input.good()) {
|
||||
SG_LOG(SG_INPUT, SG_ALERT,
|
||||
"Cannot read Hud configuration from " << path.str());
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
readHud(input);
|
||||
input.close();
|
||||
}
|
||||
|
@ -811,8 +796,7 @@ int fgHUDInit2( fgAIRCRAFT * /* current_aircraft */ )
|
|||
if (!input.good()) {
|
||||
SG_LOG(SG_INPUT, SG_ALERT,
|
||||
"Cannot read Hud configuration from " << path.str());
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
readHud(input);
|
||||
input.close();
|
||||
}
|
||||
|
|
|
@ -309,8 +309,7 @@ public:
|
|||
|
||||
int getStringWidth ( char *str )
|
||||
{
|
||||
if ( HUDtext && str )
|
||||
{
|
||||
if ( HUDtext && str ) {
|
||||
float r, l ;
|
||||
guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
|
||||
return FloatToInt( r - l );
|
||||
|
@ -320,8 +319,7 @@ public:
|
|||
|
||||
int StringWidth (void )
|
||||
{
|
||||
if ( HUDtext && strlen( msg ))
|
||||
{
|
||||
if ( HUDtext && strlen( msg )) {
|
||||
float r, l ;
|
||||
guiFntHandle->getBBox ( msg, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
|
||||
return FloatToInt( r - l );
|
||||
|
@ -339,9 +337,9 @@ public:
|
|||
char *t=msg;
|
||||
int p=4;
|
||||
|
||||
if(t[0]=='-') //if negative value then increase the c and p values for '-' sign.
|
||||
{
|
||||
c++;
|
||||
if(t[0]=='-') {
|
||||
//if negative value then increase the c and p values
|
||||
//for '-' sign. c++;
|
||||
p++;
|
||||
}
|
||||
char *tmp=msg;
|
||||
|
@ -524,7 +522,9 @@ class instr_item { // An Abstract Base Class (ABC)
|
|||
UINT huds_vert (UINT options) { return( options & HUDS_VERT ); }
|
||||
UINT huds_left (UINT options) { return( options & HUDS_LEFT ); }
|
||||
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_notext (UINT options) { return( options & HUDS_NOTEXT ); }
|
||||
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 )
|
||||
{
|
||||
if ( HUDtext && str )
|
||||
{
|
||||
if ( HUDtext && str ) {
|
||||
float r, l ;
|
||||
guiFntHandle->getBBox ( str, HUD_TextSize, 0, &l, &r, NULL, NULL ) ;
|
||||
return FloatToInt( r - l );
|
||||
|
|
|
@ -191,8 +191,7 @@ draw( void ) // (HUD_scale * pscale )
|
|||
|
||||
//begin suma
|
||||
// if type=gauge then display dial
|
||||
if(type=="gauge")
|
||||
{
|
||||
if(type=="gauge") {
|
||||
float x,y;
|
||||
float i;
|
||||
int decimal, sign;
|
||||
|
@ -202,8 +201,8 @@ draw( void ) // (HUD_scale * pscale )
|
|||
glPointSize(3.0);
|
||||
|
||||
float incr= 360.0/divisions;
|
||||
for(i=0.0;i<360.0;i+=incr)
|
||||
{ float i1=i*SGD_DEGREES_TO_RADIANS;
|
||||
for(i=0.0;i<360.0;i+=incr) {
|
||||
float i1=i*SGD_DEGREES_TO_RADIANS;
|
||||
float x1=x+radius*cos(i1);
|
||||
float y1=y+radius*sin(i1);
|
||||
|
||||
|
@ -215,8 +214,7 @@ draw( void ) // (HUD_scale * pscale )
|
|||
glDisable(GL_POINT_SMOOTH);
|
||||
|
||||
|
||||
if(data_available())
|
||||
{
|
||||
if(data_available()) {
|
||||
float offset = 90.0*SGD_DEGREES_TO_RADIANS;
|
||||
float r1=10.0; //size of carrot
|
||||
float theta= get_value();
|
||||
|
@ -245,19 +243,15 @@ draw( void ) // (HUD_scale * pscale )
|
|||
|
||||
}
|
||||
|
||||
} //end type=gauge
|
||||
else // if its not explicitly a gauge default to tape
|
||||
{
|
||||
if(pointer)
|
||||
{
|
||||
if(pointer_type=="moving")
|
||||
{
|
||||
//end type=gauge
|
||||
} else {
|
||||
// if its not explicitly a gauge default to tape
|
||||
if(pointer) {
|
||||
if(pointer_type=="moving") {
|
||||
vmin = minValue;
|
||||
vmax = maxValue;
|
||||
}
|
||||
else // default to fixed
|
||||
{
|
||||
|
||||
} else {
|
||||
// default to fixed
|
||||
vmin = cur_value - half_width_units; // width units == needle travel
|
||||
vmax = cur_value + half_width_units; // or picture unit span.
|
||||
text_x = mid_scr.x;
|
||||
|
@ -270,7 +264,6 @@ draw( void ) // (HUD_scale * pscale )
|
|||
text_y = mid_scr.y;
|
||||
}
|
||||
|
||||
|
||||
// Draw the basic markings for the 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);
|
||||
|
||||
// draw pointer
|
||||
if(pointer)
|
||||
{
|
||||
if(pointer_type=="moving")
|
||||
{
|
||||
if(zoom == 0)
|
||||
{
|
||||
if(pointer) {
|
||||
if(pointer_type=="moving") {
|
||||
if(zoom == 0) {
|
||||
//Code for Moving Type Pointer included by suma.
|
||||
static float ycentre, ypoint,xpoint;
|
||||
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);
|
||||
}//zoom=0
|
||||
} else // default to fixed
|
||||
{
|
||||
} else {
|
||||
// default to fixed
|
||||
fixed(marker_offset+marker_xe, text_y + scrn_rect.right / 6,
|
||||
marker_offset+marker_xs, text_y,marker_offset+marker_xe,
|
||||
text_y - scrn_rect.right / 6);
|
||||
|
@ -383,12 +373,10 @@ draw( void ) // (HUD_scale * pscale )
|
|||
// marker_xe, mid_scr.y);
|
||||
|
||||
// draw pointer
|
||||
if(pointer)
|
||||
{
|
||||
if(pointer_type=="moving")
|
||||
{
|
||||
if(zoom == 0) //type-fixed & zoom=1, behaviour to be defined
|
||||
{
|
||||
if(pointer) {
|
||||
if(pointer_type=="moving") {
|
||||
if(zoom == 0) {
|
||||
//type-fixed & zoom=1, behaviour to be defined
|
||||
// Code for Moving Type Pointer included by suma.
|
||||
static float ycentre, ypoint,xpoint;
|
||||
static int range,wth;
|
||||
|
@ -414,9 +402,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);
|
||||
}
|
||||
}
|
||||
else // default to fixed
|
||||
{
|
||||
} else {
|
||||
// default to fixed
|
||||
fixed( -marker_offset+scrn_rect.left, text_y + scrn_rect.right / 6,
|
||||
-marker_offset+marker_xe, text_y,-marker_offset+scrn_rect.left,
|
||||
text_y - scrn_rect.right / 6);
|
||||
|
@ -440,15 +427,10 @@ draw( void ) // (HUD_scale * pscale )
|
|||
last = FloatToInt(vmax)+1;
|
||||
i = FloatToInt(vmin);
|
||||
|
||||
if(zoom ==1)
|
||||
{
|
||||
if(zoom ==1) {
|
||||
zoomed_scale(vmin,vmax); //suma
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
for( ; i <last ; i++ )
|
||||
{
|
||||
} else {
|
||||
for( ; i <last ; i++ ) {
|
||||
condition = true;
|
||||
if( !modulo()) {
|
||||
if( i < min_val()) {
|
||||
|
@ -476,39 +458,31 @@ draw( void ) // (HUD_scale * pscale )
|
|||
k = i;
|
||||
|
||||
// Minor ticks
|
||||
if( div_min())
|
||||
{
|
||||
if( div_min()) {
|
||||
// if( (i%div_min()) == 0) {
|
||||
if( !(k%(int)div_min()))
|
||||
{
|
||||
if( !(k%(int)div_min())) {
|
||||
/* if((( marker_ys - 5) > scrn_rect.top ) &&
|
||||
(( marker_ys + 5) < (height))){ */
|
||||
|
||||
//vertical/left OR vertical/right
|
||||
if( huds_both(options) )
|
||||
{
|
||||
if(tick_type=="line")
|
||||
{
|
||||
if(tick_length=="variable")
|
||||
{
|
||||
if( huds_both(options) ) {
|
||||
if(tick_type=="line") {
|
||||
if(tick_length=="variable") {
|
||||
drawOneLine( scrn_rect.left, marker_ys,
|
||||
marker_xs, marker_ys );
|
||||
drawOneLine( marker_xe, marker_ys,
|
||||
width, marker_ys );
|
||||
} else {
|
||||
drawOneLine( scrn_rect.left, marker_ys,
|
||||
marker_xs, marker_ys );
|
||||
drawOneLine( marker_xe, marker_ys,
|
||||
width, marker_ys );
|
||||
}
|
||||
else
|
||||
{
|
||||
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
|
||||
} else if(tick_type=="circle") // begin suma this func. is written below
|
||||
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,
|
||||
marker_xs, marker_ys );
|
||||
drawOneLine( marker_xe, marker_ys,
|
||||
|
@ -523,45 +497,33 @@ draw( void ) // (HUD_scale * pscale )
|
|||
// anything other than huds_both
|
||||
} else {
|
||||
if( huds_left(options) ) {
|
||||
if(tick_type=="line")
|
||||
{
|
||||
if(tick_length=="variable")
|
||||
{
|
||||
if(tick_type=="line") {
|
||||
if(tick_length=="variable") {
|
||||
drawOneLine( marker_xs + 4, marker_ys,
|
||||
marker_xe, marker_ys );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
drawOneLine( marker_xs , 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
|
||||
|
||||
else
|
||||
{
|
||||
else {
|
||||
drawOneLine( marker_xs + 4, marker_ys,
|
||||
marker_xe, marker_ys );
|
||||
}
|
||||
} else {
|
||||
if(tick_type=="line")
|
||||
{
|
||||
if(tick_length=="variable")
|
||||
{
|
||||
if(tick_type=="line") {
|
||||
if(tick_length=="variable") {
|
||||
drawOneLine( marker_xs, marker_ys,
|
||||
marker_xe - 4, marker_ys );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
drawOneLine( marker_xs, 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
|
||||
else
|
||||
{
|
||||
else {
|
||||
drawOneLine( marker_xs, marker_ys,
|
||||
marker_xe - 4, marker_ys );
|
||||
}
|
||||
|
@ -571,8 +533,7 @@ draw( void ) // (HUD_scale * pscale )
|
|||
} //end minor ticks
|
||||
|
||||
// Major ticks
|
||||
if( div_max() )
|
||||
{
|
||||
if( div_max() ) {
|
||||
|
||||
if( !(k%(int)div_max()) ) {
|
||||
if(modulo()) {
|
||||
|
@ -591,25 +552,21 @@ draw( void ) // (HUD_scale * pscale )
|
|||
/* if(( (marker_ys - 8 ) > scrn_rect.top ) &&
|
||||
( (marker_ys + 8) < (height))){ */ //suma
|
||||
// huds_both
|
||||
if( huds_both(options) )
|
||||
{
|
||||
if( huds_both(options) ) {
|
||||
// drawOneLine( scrn_rect.left, marker_ys,
|
||||
// marker_xs, marker_ys);
|
||||
// drawOneLine( marker_xs, marker_ys,
|
||||
// scrn_rect.left + scrn_rect.right,
|
||||
// marker_ys);
|
||||
if(tick_type=="line")
|
||||
{
|
||||
if(tick_type=="line") {
|
||||
glBegin(GL_LINE_STRIP);
|
||||
glVertex2f( scrn_rect.left, marker_ys );
|
||||
glVertex2f( marker_xs, marker_ys);
|
||||
glVertex2f( width, marker_ys);
|
||||
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
|
||||
else
|
||||
{
|
||||
else {
|
||||
glBegin(GL_LINE_STRIP);
|
||||
glVertex2f( scrn_rect.left, marker_ys );
|
||||
glVertex2f( marker_xs, marker_ys);
|
||||
|
@ -621,32 +578,23 @@ draw( void ) // (HUD_scale * pscale )
|
|||
textString ( marker_xs + 2, marker_ys,
|
||||
TextScale, GLUT_BITMAP_8_BY_13,0 );
|
||||
}
|
||||
}
|
||||
} else {
|
||||
//begin suma
|
||||
/* Changes are made to draw a circle when tick_type="circle" */
|
||||
// anything other than huds_both
|
||||
else
|
||||
{
|
||||
if(tick_type=="line")
|
||||
{
|
||||
if(tick_type=="line") {
|
||||
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
|
||||
else
|
||||
{
|
||||
else {
|
||||
drawOneLine( marker_xs, marker_ys, marker_xe, marker_ys );
|
||||
}
|
||||
if( !huds_notext(options) )
|
||||
{
|
||||
if( huds_left(options) )
|
||||
{
|
||||
if( !huds_notext(options) ) {
|
||||
if( huds_left(options) ) {
|
||||
textString( marker_xs - 8 * lenstr - 2,
|
||||
marker_ys - 4,
|
||||
TextScale, GLUT_BITMAP_8_BY_13,0 );
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
textString( marker_xe + 3 * lenstr,
|
||||
marker_ys - 4,
|
||||
TextScale, GLUT_BITMAP_8_BY_13,0 );
|
||||
|
@ -658,8 +606,9 @@ draw( void ) // (HUD_scale * pscale )
|
|||
} // End condition
|
||||
} // End for
|
||||
} //end of zoom
|
||||
} // End if VERTICAL SCALE TYPE (tape loop yet to be closed)
|
||||
else { // Horizontal scale by default
|
||||
// End if VERTICAL SCALE TYPE (tape loop yet to be closed)
|
||||
} else {
|
||||
// Horizontal scale by default
|
||||
// left tick bar
|
||||
if (draw_tick_left) {
|
||||
drawOneLine( scrn_rect.left, scrn_rect.top,
|
||||
|
@ -705,12 +654,9 @@ draw( void ) // (HUD_scale * pscale )
|
|||
// drawOneLine( mid_scr.x, marker_ye,
|
||||
// mid_scr.x + scrn_rect.bottom / 4, scrn_rect.top);
|
||||
// draw pointer
|
||||
if(pointer)
|
||||
{
|
||||
if(pointer_type=="moving")
|
||||
{
|
||||
if (zoom ==0)
|
||||
{
|
||||
if(pointer) {
|
||||
if(pointer_type=="moving") {
|
||||
if (zoom ==0) {
|
||||
//Code for Moving Type Pointer included by suma.
|
||||
static float xcentre,xpoint,ypoint;
|
||||
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);
|
||||
}
|
||||
}
|
||||
else //default to fixed
|
||||
{
|
||||
} else {
|
||||
//default to fixed
|
||||
fixed( 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 );
|
||||
|
||||
// draw pointer
|
||||
if(pointer)
|
||||
{
|
||||
if(pointer_type=="moving")
|
||||
{
|
||||
if(zoom == 0)
|
||||
{
|
||||
if(pointer) {
|
||||
if(pointer_type=="moving") {
|
||||
if(zoom == 0) {
|
||||
//Code for Moving Type Pointer included by suma.
|
||||
static float xcentre,xpoint,ypoint;
|
||||
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);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
fixed( marker_xs + scrn_rect.bottom / 4, height, marker_xs, marker_ys,
|
||||
marker_xs - scrn_rect.bottom / 4, height);
|
||||
}
|
||||
|
@ -793,13 +733,10 @@ draw( void ) // (HUD_scale * pscale )
|
|||
// last = FloatToInt(vmax)+1;
|
||||
// i = FloatToInt(vmin);
|
||||
|
||||
if(zoom ==1)
|
||||
{
|
||||
if(zoom ==1) {
|
||||
zoomed_scale(vmin,vmax); //suma
|
||||
}
|
||||
else //default to zoom=0
|
||||
{
|
||||
|
||||
} else {
|
||||
//default to zoom=0
|
||||
last = (int)vmax + 1;
|
||||
i = (int)vmin;
|
||||
for(; i <last ; i++ ) {
|
||||
|
@ -829,17 +766,13 @@ draw( void ) // (HUD_scale * pscale )
|
|||
/*if((( marker_xs - 5) > scrn_rect.left ) &&
|
||||
(( marker_xs + 5 )< (scrn_rect.left + scrn_rect.right))){ */ //suma
|
||||
|
||||
if( huds_both(options) )
|
||||
{
|
||||
if(tick_length=="variable")
|
||||
{
|
||||
if( huds_both(options) ) {
|
||||
if(tick_length=="variable") {
|
||||
drawOneLine( marker_xs, scrn_rect.top,
|
||||
marker_xs, marker_ys - 4);
|
||||
drawOneLine( marker_xs, marker_ye + 4,
|
||||
marker_xs, height);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
drawOneLine( marker_xs, scrn_rect.top,
|
||||
marker_xs, marker_ys);
|
||||
drawOneLine( marker_xs, marker_ye,
|
||||
|
@ -852,8 +785,8 @@ draw( void ) // (HUD_scale * pscale )
|
|||
// glVertex2f( marker_xs, scrn_rect.top + scrn_rect.bottom);
|
||||
// glEnd();
|
||||
} else {
|
||||
if( huds_top(options))
|
||||
{ //draw minor ticks
|
||||
if( huds_top(options)) {
|
||||
//draw minor ticks
|
||||
if(tick_length=="variable")
|
||||
drawOneLine(marker_xs,marker_ys,marker_xs,marker_ye-4);
|
||||
else
|
||||
|
@ -976,10 +909,8 @@ zoomed_scale(int first, int last)
|
|||
|
||||
int a=0;
|
||||
|
||||
while(first <= last)
|
||||
{
|
||||
if((first % (int)Maj_div) == 0)
|
||||
{
|
||||
while(first <= last) {
|
||||
if((first % (int)Maj_div) == 0) {
|
||||
data[a] = first;
|
||||
a++ ;
|
||||
}
|
||||
|
@ -988,8 +919,7 @@ zoomed_scale(int first, int last)
|
|||
int centre =a/2;
|
||||
|
||||
|
||||
if( huds_vert(options) )
|
||||
{
|
||||
if( huds_vert(options) ) {
|
||||
|
||||
x=scrn_rect.left;
|
||||
y=scrn_rect.top;
|
||||
|
@ -1024,20 +954,17 @@ zoomed_scale(int first, int last)
|
|||
wth=scrn_rect.left+scrn_rect.right;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if(cur_value < data[centre-1])
|
||||
if(cur_value >= minValue)
|
||||
{
|
||||
if(cur_value >= minValue) {
|
||||
float diff = minValue - data[centre-1];
|
||||
float diff1 = cur_value - data[centre-1];
|
||||
float val = (diff1 * hgt1) / diff;
|
||||
|
@ -1047,8 +974,7 @@ zoomed_scale(int first, int last)
|
|||
|
||||
|
||||
if(cur_value > data[centre+1])
|
||||
if(cur_value <= maxValue)
|
||||
{
|
||||
if(cur_value <= maxValue) {
|
||||
float diff = maxValue - data[centre+1];
|
||||
float diff1 = cur_value - data[centre+1];
|
||||
float val = (diff1 * hgt1) / diff;
|
||||
|
@ -1056,21 +982,18 @@ zoomed_scale(int first, int last)
|
|||
ypoint = ycent + hgt + val;
|
||||
}
|
||||
|
||||
if(huds_left(options))
|
||||
{
|
||||
if(huds_left(options)) {
|
||||
xstart = w;
|
||||
|
||||
drawOneLine( xstart, ycentre, xstart - 5.0, ycentre); //centre tick
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
for(i=1;i<5;i++)
|
||||
{
|
||||
for(i=1;i<5;i++) {
|
||||
yfirst += factor;
|
||||
ycentre += factor;
|
||||
circles(xstart-2.5,yfirst, 3.0);
|
||||
|
@ -1079,8 +1002,7 @@ zoomed_scale(int first, int last)
|
|||
|
||||
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,ysecond, xstart - 5.0,ysecond);
|
||||
|
||||
|
@ -1103,8 +1025,7 @@ zoomed_scale(int first, int last)
|
|||
//begin
|
||||
xpoint = wth + 10.0;
|
||||
|
||||
if(pointer_type == "moving")
|
||||
{
|
||||
if(pointer_type == "moving") {
|
||||
drawOneLine(xpoint,ycent,xpoint,ypoint);
|
||||
drawOneLine(xpoint,ypoint,xpoint-10.0,ypoint);
|
||||
drawOneLine(xpoint-10.0,ypoint,xpoint-5.0,ypoint+5.0);
|
||||
|
@ -1112,23 +1033,19 @@ zoomed_scale(int first, int last)
|
|||
}
|
||||
//end
|
||||
|
||||
}
|
||||
else //huds_right
|
||||
{
|
||||
|
||||
} else {
|
||||
//huds_right
|
||||
xstart = (x+w)/2;
|
||||
|
||||
drawOneLine( xstart, ycentre, xstart + 5.0, ycentre); //centre tick
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
for(i=1;i<5;i++)
|
||||
{
|
||||
for(i=1;i<5;i++) {
|
||||
yfirst += factor;
|
||||
ycentre += factor;
|
||||
circles(xstart+2.5,yfirst, 3.0);
|
||||
|
@ -1137,8 +1054,7 @@ zoomed_scale(int first, int last)
|
|||
|
||||
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,ysecond, xstart + 5.0,ysecond);
|
||||
|
||||
|
@ -1161,8 +1077,7 @@ zoomed_scale(int first, int last)
|
|||
//begin
|
||||
xpoint = scrn_rect.left;
|
||||
|
||||
if(pointer_type == "moving")
|
||||
{
|
||||
if(pointer_type == "moving") {
|
||||
drawOneLine(xpoint,ycent,xpoint,ypoint);
|
||||
drawOneLine(xpoint,ypoint,xpoint+10.0,ypoint);
|
||||
drawOneLine(xpoint+10.0,ypoint,xpoint+5.0,ypoint+5.0);
|
||||
|
@ -1170,9 +1085,9 @@ zoomed_scale(int first, int last)
|
|||
}
|
||||
//end
|
||||
}//end huds_right /left
|
||||
} //end of vertical scale
|
||||
else //horizontal scale
|
||||
{
|
||||
//end of vertical scale
|
||||
} else {
|
||||
//horizontal scale
|
||||
x=scrn_rect.left;
|
||||
y=scrn_rect.top;
|
||||
w=scrn_rect.left+scrn_rect.right;
|
||||
|
@ -1203,20 +1118,17 @@ zoomed_scale(int first, int last)
|
|||
xcent = mid_scr.x;
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
if(cur_value < data[centre-1])
|
||||
if(cur_value >= minValue)
|
||||
{
|
||||
if(cur_value >= minValue) {
|
||||
float diff = minValue - data[centre-1];
|
||||
float diff1 = cur_value - data[centre-1];
|
||||
float val = (diff1 * hgt1) / diff;
|
||||
|
@ -1226,8 +1138,7 @@ zoomed_scale(int first, int last)
|
|||
|
||||
|
||||
if(cur_value > data[centre+1])
|
||||
if(cur_value <= maxValue)
|
||||
{
|
||||
if(cur_value <= maxValue) {
|
||||
float diff = maxValue - data[centre+1];
|
||||
float diff1 = cur_value - data[centre+1];
|
||||
float val = (diff1 * hgt1) / diff;
|
||||
|
@ -1236,8 +1147,7 @@ zoomed_scale(int first, int last)
|
|||
}
|
||||
|
||||
//end
|
||||
if(huds_top(options))
|
||||
{
|
||||
if(huds_top(options)) {
|
||||
|
||||
ystart =h;
|
||||
|
||||
|
@ -1245,13 +1155,11 @@ zoomed_scale(int first, int last)
|
|||
|
||||
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 );
|
||||
}
|
||||
|
||||
for(i=1;i<5;i++)
|
||||
{
|
||||
for(i=1;i<5;i++) {
|
||||
xfirst += factor;
|
||||
xcentre += factor;
|
||||
circles(xfirst, ystart-2.5, 3.0);
|
||||
|
@ -1260,8 +1168,7 @@ zoomed_scale(int first, int last)
|
|||
|
||||
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( 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;
|
||||
|
||||
if(pointer_type == "moving")
|
||||
{
|
||||
if(pointer_type == "moving") {
|
||||
drawOneLine(xcent, ypoint,xpoint,ypoint);
|
||||
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);
|
||||
}
|
||||
//end
|
||||
|
||||
} //end of top option
|
||||
else //else huds_bottom
|
||||
{
|
||||
|
||||
//end of top option
|
||||
} else {
|
||||
//else huds_bottom
|
||||
ystart = (y+h)/2;
|
||||
|
||||
//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()));
|
||||
|
||||
if( !huds_notext(options))
|
||||
{
|
||||
if( !huds_notext(options)) {
|
||||
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;
|
||||
xcentre += factor;
|
||||
circles(xfirst, ystart+2.5, 3.0);
|
||||
|
@ -1320,8 +1221,7 @@ zoomed_scale(int first, int last)
|
|||
|
||||
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( xsecond,ystart, xsecond,ystart + 5.0);
|
||||
|
||||
|
@ -1344,8 +1244,7 @@ zoomed_scale(int first, int last)
|
|||
//begin
|
||||
|
||||
ypoint = scrn_rect.top - 10.0;
|
||||
if(pointer_type == "moving")
|
||||
{
|
||||
if(pointer_type == "moving") {
|
||||
drawOneLine(xcent, ypoint,xpoint,ypoint);
|
||||
drawOneLine(xpoint,ypoint,xpoint,ypoint+10.0);
|
||||
drawOneLine(xpoint,ypoint+10.0,xpoint+5.0,ypoint+5.0);
|
||||
|
|
Loading…
Reference in a new issue