Wrote access functions for current fgOPTIONS.
double get_frame_rate( void )
{
- fgGENERAL *g;
+ fgGENERAL *pgeneral;
- g = &general;
+ pgeneral = &general;
- return g->frame_rate;
+ return pgeneral->frame_rate;
}
double get_fov( void )
{
- fgOPTIONS *o;
-
- o = ¤t_options;
-
- return o->fov;
+ return (current_options.get_fov());
}
double get_vfc_ratio( void )
{
- fgVIEW *v;
+ fgVIEW *pview;
- v = ¤t_view;
+ pview = ¤t_view;
- return v->vfc_ratio;
+ return pview->vfc_ratio;
}
bool fgCockpitInit( fgAIRCRAFT *cur_aircraft )
void fgCockpitUpdate( void ) {
- fgOPTIONS *o;
- fgVIEW *v;
+ fgVIEW *pview;
- o = ¤t_options;
- v = ¤t_view;
+ pview = ¤t_view;
fgPrintf( FG_COCKPIT, FG_DEBUG,
"Cockpit: code %d status %d\n",
ac_cockpit->code(), ac_cockpit->status() );
- if ( o->hud_status ) {
+ if ( current_options.get_hud_status() ) {
// This will check the global hud linked list pointer.
// If these is anything to draw it will.
fgUpdateHUD();
}
- if ( o->panel_status && (fabs(v->view_offset) < 0.2) ) {
+ if ( current_options.get_panel_status() &&
+ (fabs(pview->view_offset) < 0.2) ) {
fgPanelUpdate();
}
}
/* $Log$
-/* Revision 1.10 1998/07/08 14:41:08 curt
-/* Renamed polar3d.h to polar3d.hxx
+/* Revision 1.11 1998/07/13 21:00:45 curt
+/* Integrated Charlies latest HUD updates.
+/* Wrote access functions for current fgOPTIONS.
/*
+ * Revision 1.10 1998/07/08 14:41:08 curt
+ * Renamed polar3d.h to polar3d.hxx
+ *
* Revision 1.9 1998/06/27 16:47:53 curt
* Incorporated Friedemann Reinhard's <mpt218@faupt212.physik.uni-erlangen.de>
* first pass at an isntrument panel.
#define _COCKPIT_HXX
-#include "hud.hxx"
-#include "panel.hxx"
-
-
-#ifndef __cplusplus
+#ifndef __cplusplus
# error This library requires C++
-#endif
+#endif
-//typedef struct {
-// int code;
-// Hptr hud;
-// // As above.
-// // PANEL *panel;
-// int status;
-//}fgCOCKPIT, *pfgCockpit;
+#include "hud.hxx"
+#include "panel.hxx"
-// And in the future (near future i hope).
-// #include <Cockpit/panel.h>
// Class fg_Cockpit This class is a holder for the heads up display
// and is initialized with a
class fg_Cockpit {
/* $Log$
-/* Revision 1.3 1998/06/27 16:47:54 curt
-/* Incorporated Friedemann Reinhard's <mpt218@faupt212.physik.uni-erlangen.de>
-/* first pass at an isntrument panel.
+/* Revision 1.4 1998/07/13 21:00:46 curt
+/* Integrated Charlies latest HUD updates.
+/* Wrote access functions for current fgOPTIONS.
/*
+ * Revision 1.3 1998/06/27 16:47:54 curt
+ * Incorporated Friedemann Reinhard's <mpt218@faupt212.physik.uni-erlangen.de>
+ * first pass at an isntrument panel.
+ *
* Revision 1.2 1998/05/11 18:13:10 curt
* Complete C++ rewrite of all cockpit code by Charlie Hotchkiss.
*
#include <Aircraft/aircraft.h>
#include <Debug/fg_debug.h>
#include <Include/fg_constants.h>
+#include <Main/options.hxx>
#include <Math/fg_random.h>
#include <Math/mat3.h>
#include <Math/polar3d.hxx>
do {
switch ( index ) {
case 0: // TBI
- HIptr = (instr_item *) new fgTBI_instr( 300, 100, 60, 10 );
+ HIptr = (instr_item *) new fgTBI_instr( 270, 100, 60, 10 );
break;
case 1: // Artificial Horizon
- HIptr = (instr_item *) new HudLadder( 270, 195, 120, 180 );
+ HIptr = (instr_item *) new HudLadder( 240, 195, 120, 180 );
break;
case 2: // KIAS
- HIptr = (instr_item *) new hud_card( 160,
+ HIptr = (instr_item *) new hud_card( 130,
170,
- 35,
+ 28,
200,
get_speed,
HUDS_LEFT | HUDS_VERT,
break;
case 3: // Angle of Attack
- HIptr = (instr_item *) new hud_card( 450,
+ HIptr = (instr_item *) new hud_card( 420,
195,
- 30,
+ 25,
150,
get_aoa,
HUDS_LEFT | HUDS_VERT,
50, -40,
1.0,
- 5, 1,
+ 2, 1,
0,
1,
- 21.0,
+ 5.0,
true);
break;
case 4: // GYRO COMPASS
HIptr = (instr_item *) new hud_card( 200,
375,
- 260,
- 32,
+ 200,
+ 28,
get_heading,
HUDS_TOP,
360, 0,
- 1.0,
- 10, 5,
+ 1.0,
+ 5, 1,
360,
- 0,
- 50,
+ 0,
+ 25,
true);
break;
case 5: // AMSL
- HIptr = (instr_item *) new hud_card( 490,
+ HIptr = (instr_item *) new hud_card( 460,
170,
35,
200,
true);
break;
- case 6: // Digital KIAS
- HIptr = (instr_item *) new instr_label ( 160,
+ case 6:
+ HIptr = (instr_item *) new guage_instr( 250, // x
+ 350, // y
+ 100, // width
+ 20, // height
+ get_aileronval, // data source
+ HUDS_BOTTOM | HUDS_NOTEXT,
+ 100.0,
+ +1.0,
+ -1.0);
+ break;
+
+ case 7:
+ HIptr = (instr_item *) new guage_instr( 170, // x
+ 225, // y
+ 20, // width
+ 100, // height
+ get_elevatorval, // data source
+ HUDS_RIGHT | HUDS_VERT | HUDS_NOTEXT,
+ -100.0, // Scale data
+ +1.0, // Data Range
+ -1.0);
+ break;
+
+ case 8:
+ HIptr = (instr_item *) new guage_instr( 250, // x
+ 200, // y
+ 100, // width
+ 20, // height
+ get_rudderval, // data source
+ HUDS_TOP | HUDS_NOTEXT,
+ 100.0,
+ +1.0,
+ -1.0);
+ break;
+
+ case 9:
+ HIptr = (instr_item *) new guage_instr( 100, // x
+ 190,
+ 20,
+ 160, // height
+ get_throttleval, // data source
+ HUDS_VERT | HUDS_RIGHT | HUDS_NOTEXT,
+ 100.0,
+ 1.0,
+ 0.0);
+ break;
+
+ case 10: // Digital KIAS
+ HIptr = (instr_item *) new instr_label ( 110,
150,
40,
30,
"%5.0f",
NULL,
" Kts",
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
TRUE );
break;
- case 7: // Digital Altimeter
- HIptr = (instr_item *) new instr_label ( 160,
+ case 11: // Digital Altimeter
+ HIptr = (instr_item *) new instr_label ( 110,
135,
40,
10,
"MSL %5.0f",
NULL,
" m",
+ 1.0,
HUDS_TOP,
LEFT_JUST,
SMALL,
TRUE );
break;
- case 8: // Roll indication diagnostic
- HIptr = (instr_item *) new instr_label ( 160,
+ case 12: // Roll indication diagnostic
+ HIptr = (instr_item *) new instr_label ( 110,
120,
40,
10,
"%5.2f",
" Roll",
" Deg",
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
TRUE );
break;
- case 9: // Angle of attack diagnostic
+ case 13: // Angle of attack diagnostic
HIptr = (instr_item *) new instr_label ( 440,
150,
60,
" %5.2f",
"AOA",
" Deg",
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
TRUE );
break;
- case 10:
+ case 14:
HIptr = (instr_item *) new instr_label ( 440,
135,
60,
10,
get_heading,
- " %5.0f",
+ " %5.1f",
"Heading ",
" Deg",
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
TRUE );
break;
- case 11:
+ case 15:
HIptr = (instr_item *) new instr_label ( 440,
120,
60,
"%5.2f",
"Sideslip ",
NULL,
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
TRUE );
break;
- case 12:
+ case 16:
HIptr = (instr_item *) new instr_label( 440,
100,
60,
"%5.2f",
"Throttle ",
NULL,
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
TRUE );
break;
- case 13:
+ case 17:
HIptr = (instr_item *) new instr_label( 440,
85,
60,
"%5.2f",
"Elevator ",
NULL,
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
TRUE );
break;
- case 14:
+ case 18:
HIptr = (instr_item *) new instr_label( 440,
60,
60,
"%5.2f",
"Aileron ",
NULL,
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
break;
- case 15:
+ case 19:
HIptr = (instr_item *) new instr_label( 10,
10,
60,
"%.1f",
"Frame rate = ",
NULL,
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
TRUE );
break;
- case 16:
+ case 20:
HIptr = (instr_item *) new instr_label( 10,
25,
90,
"%.2f",
"VFC Ratio = ",
NULL,
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
TRUE );
break;
- case 17:
+ case 21:
HIptr = (instr_item *) new instr_label( 10,
40,
90,
"%.1f",
"FOV = ",
NULL,
+ 1.0,
HUDS_TOP,
RIGHT_JUST,
SMALL,
0,
TRUE );
break;
- case 18:
- HIptr = (instr_item *) new guage_instr( 50, // x
- 200, // y
- 100, // width
- 20, // height
- get_aileronval, // data source
- HUDS_BOTTOM,
- 100.0,
- +1.0,
- -1.0);
- break;
-
- case 19:
- HIptr = (instr_item *) new guage_instr( 90, // x
- 225, // y
- 20, // width
- 100, // height
- get_elevatorval, // data source
- HUDS_BOTH | HUDS_VERT,
- 100.0, // Scale data
- +1.0, // Data Range
- -1.0);
- break;
-
- case 20:
- HIptr = (instr_item *) new guage_instr( 50, // x
- 350, // y
- 100, // width
- 20, // height
- get_rudderval, // data source
- HUDS_TOP,
- 100.0,
- +1.0,
- -1.0);
- break;
default:
HIptr = 0;;
return 0; // For now. Later we may use this for an error code.
}
+int global_day_night_switch = DAY;
+
+void HUD_brightkey( bool incr_bright )
+{
+instr_item *pHUDInstr = HUD_deque[0];
+int brightness = pHUDInstr->get_brightness();
+
+ if( current_options.get_hud_status() ) {
+ if( incr_bright ) {
+ switch (brightness) {
+ case BRT_LIGHT:
+ current_options.set_hud_status(0);
+ break;
+
+ case BRT_MEDIUM:
+ brightness = BRT_LIGHT;
+ break;
+
+ case BRT_DARK:
+ brightness = BRT_MEDIUM;
+ break;
+
+ case BRT_BLACK:
+ brightness = BRT_DARK;
+ break;
+
+ default:
+ brightness = BRT_BLACK;
+ }
+ }
+ else {
+ switch (brightness) {
+ case BRT_LIGHT:
+ brightness = BRT_MEDIUM;
+ break;
+
+ case BRT_MEDIUM:
+ brightness = BRT_DARK;
+ break;
+
+ case BRT_DARK:
+ brightness = BRT_BLACK;
+ break;
+
+ case BRT_BLACK:
+ default:
+ current_options.set_hud_status(0);
+ }
+ }
+ }
+ else {
+ current_options.set_hud_status(1);
+ if( incr_bright ) {
+ if( DAY == global_day_night_switch ) {
+ brightness = BRT_BLACK;
+ }
+ else {
+ brightness = BRT_DARK;
+ global_day_night_switch = DAY;
+ }
+ }
+ else {
+ if( NIGHT == global_day_night_switch ) {
+ brightness = BRT_DARK;
+ }
+ else {
+ brightness = BRT_MEDIUM;
+ global_day_night_switch = NIGHT;
+ }
+ }
+ }
+ pHUDInstr->SetBrightness( brightness );
+}
// fgUpdateHUD
//
// the HUD object with requests for redraw. Kinda. It will when this is
// all C++.
//
-int global_day_night_switch = DAY;
-
void fgUpdateHUD( void ) {
int i;
int brightness;
case BRT_DARK:
glColor3f (0.0, 0.5, 0.0);
+ break;
+
+ case BRT_BLACK:
+ glColor3f( 0.0, 0.0, 0.0);
+ break;
+
+ default:;
}
}
else {
}
/* $Log$
-/* Revision 1.15 1998/07/08 14:41:08 curt
-/* Renamed polar3d.h to polar3d.hxx
+/* Revision 1.16 1998/07/13 21:00:47 curt
+/* Integrated Charlies latest HUD updates.
+/* Wrote access functions for current fgOPTIONS.
/*
+ * Revision 1.15 1998/07/08 14:41:08 curt
+ * Renamed polar3d.h to polar3d.hxx
+ *
* Revision 1.14 1998/07/06 21:31:20 curt
* Removed an extraneous ^M.
*
// Hud general constants
#define DAY 1
#define NIGHT 2
-#define BRT_DARK 3
-#define BRT_MEDIUM 4
-#define BRT_LIGHT 5
-#define SIZE_SMALL 6
-#define SIZE_LARGE 7
+#define BRT_BLACK 3
+#define BRT_DARK 4
+#define BRT_MEDIUM 5
+#define BRT_LIGHT 6
+#define SIZE_SMALL 7
+#define SIZE_LARGE 8
// Label constants
#define SMALL 1
HUDtbi
};
+typedef struct gltagRGBTRIPLE { // rgbt
+ GLfloat Blue;
+ GLfloat Green;
+ GLfloat Red;
+} glRGBTRIPLE;
+
class instr_item { // An Abstract Base Class (ABC)
private:
- static UINT instances; // More than 64K instruments? Nah!
- UINT handle;
- RECT scrn_pos; // Framing - affects scale dimensions
+ static UINT instances; // More than 64K instruments? Nah!
+ static int brightness;
+ static glRGBTRIPLE color;
+
+ UINT handle;
+ RECT scrn_pos; // Framing - affects scale dimensions
// and orientation. Vert vs Horz, etc.
- DBLFNPTR load_value_fn;
- UINT opts;
- bool is_enabled;
- bool broken;
- int brightness;
- UINT scr_span; // Working values for draw;
- POINT mid_span; //
+ DBLFNPTR load_value_fn;
+ double disp_factor; // Multiply by to get numbers shown on scale.
+ UINT opts;
+ bool is_enabled;
+ bool broken;
+ UINT scr_span; // Working values for draw;
+ POINT mid_span; //
public:
instr_item( int x,
UINT height,
UINT width,
DBLFNPTR data_source,
+ double data_scaling,
UINT options,
bool working = true);
RECT get_location ( void ) { return scrn_pos; }
bool is_broken ( void ) { return broken; }
bool enabled ( void ) { return is_enabled;}
- double get_value ( void ) { return load_value_fn();}
+ bool data_available ( void ) { return !!load_value_fn; }
+ double get_value ( void ) { return load_value_fn(); }
+ double data_scaling ( void ) { return disp_factor; }
UINT get_span ( void ) { return scr_span; }
POINT get_centroid ( void ) { return mid_span; }
UINT get_options ( void ) { return opts; }
const char *label_format,
const char *pre_label_string = 0,
const char *post_label_string = 0,
+ double scale_data = 1.0,
UINT options = HUDS_TOP,
fgLabelJust justification = CENTER_JUST,
int font_size = SMALL,
instr_label( const instr_label & image);
instr_label & operator = (const instr_label & rhs );
-
virtual void draw( void ); // Required method in base class
};
double scale_factor; // factor => screen units/range values.
UINT Maj_div; // major division marker units
UINT Min_div; // minor division marker units
- double disp_factor; // Multiply by to get numbers shown on scale.
UINT Modulo; // Roll over point
int signif_digits; // digits to show to the right.
//using namespace std;
//deque <instr_item> * Hdeque_ptr;
+extern void HUD_brightkey( bool incr_bright );
extern int fgHUDInit( fgAIRCRAFT * /* current_aircraft */ );
extern void fgUpdateHUD( void );
#endif // _HUD_H
/* $Log$
-/* Revision 1.8 1998/07/03 13:16:29 curt
-/* Added Charlie Hotchkiss's HUD updates and improvementes.
+/* Revision 1.9 1998/07/13 21:00:48 curt
+/* Integrated Charlies latest HUD updates.
+/* Wrote access functions for current fgOPTIONS.
/*
+ * Revision 1.8 1998/07/03 13:16:29 curt
+ * Added Charlie Hotchkiss's HUD updates and improvementes.
+ *
* Revision 1.6 1998/06/03 00:43:28 curt
* No .h when including stl stuff.
*
-#ifdef HAVE_CONFIG_H\r
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
int marker_xe;
int marker_ys;
int marker_ye;
- register i;
+ /* register */ int i;
char TextScale[80];
bool condition;
int disp_val;
}
if( div_min()) {
if( (i%div_min()) == 0) {
- if((( marker_ys + 5) > scrn_rect.top ) ||
- (( marker_ys - 5) < (scrn_rect.top + scrn_rect.bottom))){
+ if((( marker_ys - 5) > scrn_rect.top ) &&
+ (( marker_ys + 5) < (scrn_rect.top + scrn_rect.bottom))){
if( (options & HUDS_BOTH) == HUDS_BOTH ) {
drawOneLine( scrn_rect.left, marker_ys,
marker_xs, marker_ys );
else {
disp_val = i;
}
- sprintf( TextScale, "%d", disp_val );
- if(( (marker_ys - 5 ) > scrn_rect.top ) ||
- ( (marker_ys + 5) < (scrn_rect.top + scrn_rect.bottom))){
+ sprintf( TextScale, "%d", (int)(disp_val * data_scaling() +.5));
+ if(( (marker_ys - 8 ) > scrn_rect.top ) &&
+ ( (marker_ys + 8) < (scrn_rect.top + scrn_rect.bottom))){
if( (options & HUDS_BOTH) == HUDS_BOTH) {
drawOneLine( scrn_rect.left, marker_ys,
marker_xs, marker_ys);
TextScale, GLUT_BITMAP_8_BY_13 );
}
}
- }
+ }
} // Else read oriented right
} // End if modulo division by major interval is zero
} // End if major interval divisor non-zero
// marker_ye = marker_xe;
// }
+ // printf("vmin = %d vmax = %d\n", (int)vmin, (int)vmax);
for( i = (int)vmin; i <= (int)vmax; i++ ) {
+ // printf("<*> i = %d\n", i);
condition = true;
if( !modulo()) {
if( i < min_val()) {
condition = false;
}
}
+ // printf("<**> i = %d\n", i);
if( condition ) {
marker_xs = scrn_rect.left + (int)((i - vmin) * factor() + .5);
if( div_min()){
if( (i%(int)div_min()) == 0 ) {
// draw in ticks only if they aren't too close to the edge.
- if((( marker_xs + 5) > scrn_rect.left ) ||
- (( marker_xs - 5 )< (scrn_rect.left + scrn_rect.right))){
+ if((( marker_xs - 5) > scrn_rect.left ) &&
+ (( marker_xs + 5 )< (scrn_rect.left + scrn_rect.right))){
if( (options & HUDS_BOTH) == HUDS_BOTH ) {
drawOneLine( marker_xs, scrn_rect.top,
}
}
}
+ // printf("<***> i = %d\n", i);
if( div_max()) {
+ // printf("i = %d\n", i);
if( (i%(int)div_max())==0 ) {
if(modulo()) {
if( disp_val < 0) {
else {
disp_val = i;
}
- sprintf( TextScale, "%d", disp_val );
+ // printf("disp_val = %d\n", disp_val);
+ // printf("%d\n", (int)(disp_val * (double)data_scaling() + 0.5));
+ sprintf( TextScale, "%d", (int)(disp_val * data_scaling() +.5));
// Draw major ticks and text only if far enough from the edge.
if(( (marker_xs - 10)> scrn_rect.left ) &&
( (marker_xs + 10) < (scrn_rect.left + scrn_rect.right))){
}
}
}
- }
+ }
+ // printf("<****> i = %d\n", i);
}
}
}
-#ifdef HAVE_CONFIG_H\r
+#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
if( !(options & HUDS_NOTEXT)) {
disp_val = i;
- sprintf( TextScale, "%d", disp_val );
+ sprintf( TextScale, "%d",disp_val * (int)(data_scaling() +.5));
if((options & HUDS_LEFT) && (options && HUDS_RIGHT)) {
text_x = mid_scr.x - 2 - ((3 * strlen( TextScale ))>>1);
// text_x = marker_xs - scrn_rect.left;
if( options & HUDS_RIGHT ) {
- drawOneLine(scrn_rect.left, text_y,
- marker_xe, text_y + 5);
- drawOneLine(scrn_rect.left, text_y,
- marker_xe, text_y - 5);
+ drawOneLine(scrn_rect.left, text_y + 5,
+ marker_xe, text_y);
+ drawOneLine(scrn_rect.left, text_y - 5,
+ marker_xe, text_y);
}
if( options & HUDS_LEFT ) {
- drawOneLine(scrn_rect.left + scrn_rect.right, text_y,
- marker_xs, text_y + 5);
- drawOneLine(scrn_rect.left + scrn_rect.right, text_y,
- marker_xs, text_y - 5);
+ drawOneLine(scrn_rect.left + scrn_rect.right, text_y + 5,
+ marker_xs, text_y);
+ drawOneLine(scrn_rect.left + scrn_rect.right, text_y - 5,
+ marker_xs, text_y);
}
} // End if VERTICAL SCALE TYPE
else { // Horizontal scale by default
else {
disp_val = i;
}
- sprintf( TextScale, "%d", disp_val );
+ sprintf( TextScale, "%d", (int)(disp_val * data_scaling() +.5));
// Draw major ticks and text only if far enough from the edge.
if(( (marker_xs - 10)> scrn_rect.left ) &&
( (marker_xs + 10) < (scrn_rect.left + scrn_rect.right))){
#ifdef HAVE_WINDOWS_H
# include <windows.h>
#endif
+
#include <stdlib.h>
#include <string.h>
#include <Aircraft/aircraft.h>
#include "hud.hxx"
-UINT instr_item :: instances; // Initial value of zero
+UINT instr_item :: instances = 0; // Initial value of zero
+int instr_item :: brightness = BRT_MEDIUM;
+glRGBTRIPLE instr_item :: color = {0.1, 0.7, 0.0};
// constructor ( No default provided )
instr_item ::
UINT width,
UINT height,
DBLFNPTR data_source,
+ double data_scaling,
UINT options,
bool working) :
handle ( ++instances ),
load_value_fn ( data_source ),
+ disp_factor ( data_scaling ),
opts ( options ),
is_enabled ( working ),
- broken ( FALSE ),
- brightness ( BRT_MEDIUM )
+ broken ( FALSE )
{
scrn_pos.left = x;
scrn_pos.top = y;
handle ( ++instances ),
scrn_pos ( image.scrn_pos ),
load_value_fn( image.load_value_fn),
+ disp_factor ( image.disp_factor ),
opts ( image.opts ),
is_enabled ( image.is_enabled ),
broken ( image.broken ),
- brightness ( image.brightness ),
scr_span ( image.scr_span ),
mid_span ( image.mid_span )
{
if( !(this == &rhs )) { // Not an identity assignment
scrn_pos = rhs.scrn_pos;
load_value_fn = rhs.load_value_fn;
+ disp_factor = rhs.disp_factor;
opts = rhs.opts;
is_enabled = rhs.is_enabled;
broken = rhs.broken;
- brightness = rhs.brightness;
}
return *this;
}
const char *label_format,
const char *pre_label_string,
const char *post_label_string,
+ double scale_data,
UINT options,
fgLabelJust justification,
int font_size,
int blinking,
bool working ):
instr_item( x, y, width, height,
- data_source, options, working ),
+ data_source, scale_data,options, working ),
pformat ( label_format ),
pre_str ( pre_label_string ),
post_str ( post_label_string ),
return *this;
}
-
//
// draw Draws a label anywhere in the HUD
//
}
} // else do nothing if both pre and post strings are nulls. Interesting.
- sprintf( label_buffer, format_buffer, get_value() );
+ if( data_available() ) {
+ sprintf( label_buffer, format_buffer, get_value() );
+ }
+ else {
+ sprintf( label_buffer, format_buffer );
+ }
+
#ifdef DEBUGHUD
fgPrintf( FG_COCKPIT, FG_DEBUG, format_buffer );
fgPrintf( FG_COCKPIT, FG_DEBUG, "\n" );
UINT rollover,
int dp_showing,
bool working ) :
- instr_item( x, y, width, height, load_fn, options, working),
+ instr_item( x, y, width, height,
+ load_fn, disp_scale, options, working),
range_shown ( show_range ),
Maximum_value( maxValue ),
Minimum_value( minValue ),
- scale_factor ( disp_scale ),
Maj_div ( major_divs ),
Min_div ( minor_divs ),
Modulo ( rollover ),
#include "panel.hxx"
+ // Intriquing. Needs documentation.
#define IMAGIC 0x01da
#define IMAGIC_SWAP 0xda01
static GLubyte tex[512][256][4];
-static double get_speed( void )
-{
- fgFLIGHT *f;
-
- f = current_aircraft.flight;
- return( FG_V_equiv_kts ); // Make an explicit function call.
-}
+extern double get_speed( void );
/* image.c ,temporary hack, I know*/
void fgPanelInit ( void ) {
- fgOPTIONS *o;
char tpath[256];
int x, y;
- o = ¤t_options;
-
#ifdef GL_VERSION_1_1
xglGenTextures(1, &panel_tex_id);
xglBindTexture(GL_TEXTURE_2D, panel_tex_id);
xglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
/* load in the texture data */
- tpath[0] = '\0';
- strcat(tpath, o->fg_root);
+ current_options.get_fg_root(tpath);
strcat(tpath, "/Textures/");
strcat(tpath, "panel1.rgb");
/* $Log$
-/* Revision 1.2 1998/07/03 11:55:37 curt
-/* A few small rearrangements and tweaks.
+/* Revision 1.3 1998/07/13 21:00:52 curt
+/* Integrated Charlies latest HUD updates.
+/* Wrote access functions for current fgOPTIONS.
/*
+ * Revision 1.2 1998/07/03 11:55:37 curt
+ * A few small rearrangements and tweaks.
+ *
* Revision 1.1 1998/06/27 16:47:54 curt
* Incorporated Friedemann Reinhard's <mpt218@faupt212.physik.uni-erlangen.de>
* first pass at an isntrument panel.