5 UINT instr_item :: instances = 0; // Initial value of zero
6 int instr_item :: brightness = HUD_BRT_MEDIUM;
7 //glRGBTRIPLE instr_item :: color = {0.1, 0.7, 0.0};
8 glRGBTRIPLE instr_item :: color = {0.0, 1.0, 0.0};
10 // constructor ( No default provided )
21 handle ( ++instances ),
22 load_value_fn ( data_source ),
23 disp_factor ( data_scaling ),
25 is_enabled ( working ),
27 digits ( digit ) //suma
31 scrn_pos.right = width;
32 scrn_pos.bottom = height;
34 // Set up convenience values for centroid of the box and
35 // the span values according to orientation
37 if( opts & HUDS_VERT) { // Vertical style
38 // Insure that the midpoint marker will fall exactly at the
40 if( !(scrn_pos.bottom % 2)) {
43 scr_span = scrn_pos.bottom;
46 // Insure that the midpoint marker will fall exactly at the
48 if( !(scrn_pos.right % 2)) {
51 scr_span = scrn_pos.right;
53 // Here we work out the centroid for the corrected box.
54 mid_span.x = scrn_pos.left + (scrn_pos.right >> 1);
55 mid_span.y = scrn_pos.top + (scrn_pos.bottom >> 1);
61 instr_item ( const instr_item & image ):
62 handle ( ++instances ),
63 scrn_pos ( image.scrn_pos ),
64 load_value_fn( image.load_value_fn),
65 disp_factor ( image.disp_factor ),
67 is_enabled ( image.is_enabled ),
68 broken ( image.broken ),
69 scr_span ( image.scr_span ),
70 mid_span ( image.mid_span )
74 // assignment operator
76 instr_item & instr_item :: operator = ( const instr_item & rhs )
78 if( !(this == &rhs )) { // Not an identity assignment
79 scrn_pos = rhs.scrn_pos;
80 load_value_fn = rhs.load_value_fn;
81 disp_factor = rhs.disp_factor;
83 is_enabled = rhs.is_enabled;
91 instr_item :: ~instr_item ()
103 // break_display This is emplaced to provide hooks for making
104 // instruments unreliable. The default behavior is
105 // to simply not display, but more sophisticated behavior is available
106 // by over riding the function which is virtual in this class.
109 break_display ( bool bad )
116 SetBrightness ( int level )
118 brightness = level; // This is all we will do for now. Later the
119 // brightness levels will be sensitive both to
120 // the control knob and the outside light levels
121 // to emulated night vision effects.
124 UINT instr_item :: get_Handle( void )