Skip to content

Commit

Permalink
Renderer/HorizonRenderer: more elaborate artificial horizon
Browse files Browse the repository at this point in the history
  • Loading branch information
lordfolken committed May 21, 2024
1 parent febb2c1 commit f10ff9c
Show file tree
Hide file tree
Showing 5 changed files with 405 additions and 37 deletions.
1 change: 1 addition & 0 deletions NEWS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Version 7.43 - not yet released
- Vario center gross label
- Vario use AutoFonts for lables and values
- Replace eventOrientation by two new events: eventOrientationCruise and eventOrientationCircling
- New artificial horizon
* devices
- add Larus driver
* windows
Expand Down
14 changes: 11 additions & 3 deletions src/Look/HorizonLook.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,24 @@
// Copyright The XCSoar Project

#include "HorizonLook.hpp"
#include "FontDescription.hpp"
#include "Screen/Layout.hpp"

void
HorizonLook::Initialise()
{
aircraft_pen.Create(Layout::Scale(2), COLOR_BLACK);
aircraft_pen.Create(Layout::Scale(1), aircraft_color);
aircraft_brush.Create(aircraft_color);

mark_pen.Create(Layout::Scale(1), COLOR_WHITE);
mark_brush.Create(COLOR_WHITE);
mark_font.Load(FontDescription(Layout::FontScale(12)));

horizon_pen.Create(Layout::Scale(1), COLOR_WHITE);

sky_brush.Create(sky_color);
sky_pen.Create(Layout::Scale(1), DarkColor(sky_color));
sky_pen.Create(Layout::Scale(1), sky_color);

terrain_brush.Create(terrain_color);
terrain_pen.Create(Layout::Scale(1), DarkColor(terrain_color));
terrain_pen.Create(Layout::Scale(1), terrain_color);
}
18 changes: 14 additions & 4 deletions src/Look/HorizonLook.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,29 @@

#pragma once

#include "ui/canvas/Pen.hpp"
#include "ui/canvas/Brush.hpp"
#include "ui/canvas/Font.hpp"
#include "ui/canvas/Pen.hpp"

struct HorizonLook {
Pen aircraft_pen;

static constexpr Color sky_color{0x0a, 0xb9, 0xf3};
static constexpr Color sky_color{0x13, 0x9c, 0xff};
Brush sky_brush;
Pen sky_pen;

static constexpr Color terrain_color{0x80, 0x45, 0x15};
static constexpr Color terrain_color{0x78, 0x51, 0x2a};
Brush terrain_brush;
Pen terrain_pen;

static constexpr Color aircraft_color{0xf2, 0xf2, 0x19};
Pen aircraft_pen;
Brush aircraft_brush;

Pen mark_pen;
Brush mark_brush;
Font mark_font;

Pen horizon_pen;

void Initialise();
};
Loading

0 comments on commit f10ff9c

Please sign in to comment.