android/GlueIOIOPort: fix spurious errors after IOIO baud rate change
[xcsoar.git] / src / Look / VarioLook.cpp
blob051166a0a257c8e2570c8dc42ccc57af18431e0b
1 /*
2 Copyright_License {
4 XCSoar Glide Computer - http://www.xcsoar.org/
5 Copyright (C) 2000-2013 The XCSoar Project
6 A detailed list of copyright holders can be found in the file "AUTHORS".
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License
10 as published by the Free Software Foundation; either version 2
11 of the License, or (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 #include "VarioLook.hpp"
25 #include "Screen/Layout.hpp"
26 #include "Units/Units.hpp"
27 #include "resource.h"
29 void
30 VarioLook::Initialise(bool _inverse, bool _colors,
31 const Font &_text_font, const Font &_value_font)
33 inverse = _inverse;
34 colors = _colors;
36 if (inverse) {
37 background_color = COLOR_BLACK;
38 text_color = COLOR_WHITE;
39 dimmed_text_color = Color(0xa0, 0xa0, 0xa0);
40 sink_color = Color(0xc4, 0x80, 0x1e);
41 lift_color = Color(0x1e, 0xf1, 0x73);
42 } else {
43 background_color = COLOR_WHITE;
44 text_color = COLOR_BLACK;
45 dimmed_text_color = Color((uint8_t)~0xa0, (uint8_t)~0xa0, (uint8_t)~0xa0);
46 sink_color = Color(0xa3,0x69,0x0d);
47 lift_color = Color(0x19,0x94,0x03);
50 sink_brush.Set(sink_color);
51 lift_brush.Set(lift_color);
53 thick_background_pen.Set(Layout::Scale(5), background_color);
54 thick_sink_pen.Set(Layout::Scale(5), sink_color);
55 thick_lift_pen.Set(Layout::Scale(5), lift_color);
57 background_bitmap.Load(Units::GetUserVerticalSpeedUnit() == Unit::KNOTS
58 ? IDB_VARIOSCALEC : IDB_VARIOSCALEA);
59 background_x = inverse ? 58 : 0;
61 climb_bitmap.Load(inverse ? IDB_CLIMBSMALLINV : IDB_CLIMBSMALL);
63 text_font = &_text_font;
64 value_font = &_value_font;