void Application::Render() {
+ RenderBackground();
+ RenderGrid();
+ RenderShips();
+ RenderUI();
+}
+
+void Application::RenderBackground() {
constexpr Color background(0x00, 0x00, 0x00);
- constexpr Color univGrid(0xEE, 0xEE, 0xEE);
- constexpr Color secGrid(0x77, 0x77, 0x77);
- constexpr Color entityColor(0x00, 0xAA, 0xAA);
- constexpr Color focusColor(0xFA, 0xFA, 0x00);
canvas.SetColor(background);
canvas.Fill();
+}
+
+void Application::RenderGrid() {
+ constexpr Color univGrid(0xEE, 0xEE, 0xEE);
+ constexpr Color secGrid(0x77, 0x77, 0x77);
canvas.Grid2(
cam.ToScreen(Vector<float>(0, 0)),
univ.secSize,
secGrid,
univGrid);
+}
- canvas.SetColor(focusColor);
- canvas.Cross(cam.ToScreen(focus.Pos()), 15);
+void Application::RenderShips() {
+ constexpr Color shipColor(0x00, 0xAA, 0xAA);
- canvas.SetColor(entityColor);
+ canvas.SetColor(shipColor);
for (const Ship &s : univ.Ships()) {
const Vector<float> direction = s.Dir();
const Vector<int> position = cam.ToScreen(s.pos);
canvas.Line(position, nose);
canvas.Quad(nose, left, position, right);
}
+}
+
+void Application::RenderUI() {
+ constexpr Color focusColor(0xFA, 0xFA, 0x00);
autopilot.Render(canvas, cam);
linGauge.Render(canvas, controlled->linThrottle);
rotGauge.Render(canvas, controlled->rotThrottle);
+
+ canvas.SetColor(focusColor);
+ canvas.Cross(cam.ToScreen(focus.Pos()), 15);
}
}