X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FCockpit%2Fhud_scal.cxx;h=694a0ea3aa861ab5ddf27d769d8ff85f88c9f420;hb=8e5f3ac8a333a971d7f8104a387426c3bc47a014;hp=d4cc564e4bfdee136b231fc3a6b8d7a747fac091;hpb=215491546530f79d49351a4c89f76eceaafef572;p=flightgear.git diff --git a/src/Cockpit/hud_scal.cxx b/src/Cockpit/hud_scal.cxx index d4cc564e4..694a0ea3a 100644 --- a/src/Cockpit/hud_scal.cxx +++ b/src/Cockpit/hud_scal.cxx @@ -14,73 +14,40 @@ // 2. This class was not intended to be instanciated. See moving_scale // and gauge_instr classes. //============================================================================ -instr_scale :: -instr_scale ( int x, - int y, - UINT width, - UINT height, - FLTFNPTR load_fn, - UINT options, - float show_range, - float maxValue, - float minValue, - float disp_scale, - UINT major_divs, - UINT minor_divs, - UINT rollover, - int dp_showing, - bool working ) : - instr_item( x, y, width, height, - load_fn, disp_scale, options, working), - range_shown ( show_range ), - Maximum_value( maxValue ), - Minimum_value( minValue ), - Maj_div ( major_divs ), - Min_div ( minor_divs ), - Modulo ( rollover ), - signif_digits( dp_showing ) +instr_scale::instr_scale( + int x, + int y, + UINT width, + UINT height, + FLTFNPTR load_fn, + UINT options, + float show_range, + float maxValue, + float minValue, + float disp_scale, + UINT major_divs, + UINT minor_divs, + UINT rollover, + int dp_showing, + bool working) : + instr_item( x, y, width, height, load_fn, disp_scale, options, working), + range_shown ( show_range ), + Maximum_value( maxValue ), + Minimum_value( minValue ), + Maj_div ( major_divs ), + Min_div ( minor_divs ), + Modulo ( rollover ), + signif_digits( dp_showing ) { -int temp; + int temp; - scale_factor = (float)get_span() / range_shown; - if( show_range < 0 ) { - range_shown = -range_shown; - } - temp = FloatToInt(Maximum_value - Minimum_value) / 100; - if( range_shown < temp ) { - range_shown = temp; - } -} + scale_factor = (float)get_span() / range_shown; + if (show_range < 0) + range_shown = -range_shown; -instr_scale :: - instr_scale( const instr_scale & image ) : - instr_item( (const instr_item &) image), - range_shown ( image.range_shown ), - Maximum_value( image.Maximum_value ), - Minimum_value( image.Minimum_value ), - scale_factor ( image.scale_factor ), - Maj_div ( image.Maj_div ), - Min_div ( image.Min_div ), - Modulo ( image.Modulo ), - signif_digits( image.signif_digits ) -{ -} - -instr_scale & instr_scale :: operator = (const instr_scale & rhs ) -{ - if( !(this == &rhs)) { - instr_item::operator = (rhs); - range_shown = rhs.range_shown; - scale_factor = rhs.scale_factor; - Maximum_value = rhs.Maximum_value; - Minimum_value = rhs.Minimum_value; - Maj_div = rhs.Maj_div; - Min_div = rhs.Min_div; - Modulo = rhs.Modulo; - signif_digits = rhs.signif_digits; - } - return *this; + temp = float_to_int(Maximum_value - Minimum_value) / 100; + if (range_shown < temp) + range_shown = temp; } -instr_scale :: ~ instr_scale () {}