From b1db99ee8ba612cbe2ab33404ce297c13884be23 Mon Sep 17 00:00:00 2001 From: dylanbenzi Date: Sun, 15 Nov 2026 17:49:22 -0500 Subject: [PATCH] add logo render for ga, bbq, and ufos --- LEDMatrix.cpp | 26 +++----------------------- 1 file changed, 3 insertions(+), 23 deletions(-) diff --git a/LEDMatrix.cpp b/LEDMatrix.cpp index 4594814..7d5154c 100644 --- a/LEDMatrix.cpp +++ b/LEDMatrix.cpp @@ -46,27 +46,10 @@ private: Text track = {"", 40, 14, 0, WHITE}; Text vertical_speed = {"", 40, 21, 0, WHITE}; - const char *ga_logo_path = ""; - const char *ufo_logo_path = ""; - std::vector ga_logo; - std::vector ufo_logo; const uint8_t *current_logo = nullptr; TrackedAircraft *current_aircraft; - static std::vector load_logo(const char *path) { - std::vector data; - if (!path || !*path) { - return data; - } - std::ifstream f(path, std::ios::binary); - data.assign(std::istreambuf_iterator(f), {}); - if (data.size() != LOGO_SIZE * LOGO_SIZE * 3) { - data.clear(); - } - return data; - } - static const uint8_t *find_logo(const std::string &code) { for (int i = 0; i < LOGO_COUNT; i++) { if (code == LOGOS[i].code) { @@ -142,9 +125,6 @@ public: {"VS", 27, 21, 0, WHITE}, }; - ga_logo = load_logo(ga_logo_path); - ufo_logo = load_logo(ufo_logo_path); - current_aircraft = t; } @@ -181,15 +161,15 @@ public: if (op == "N") { flight_operator.text = "GA"; flight_number.text = num.substr(0, 4); - current_logo = ga_logo.empty() ? nullptr : ga_logo.data(); + current_logo = find_logo("GA"); // if other flight number } else { flight_operator.text = op; flight_number.text = num.substr(0, 4); current_logo = find_logo(op); - if (!current_logo && !ufo_logo.empty()) { - current_logo = ufo_logo.data(); + if (!current_logo) { + current_logo = find_logo("UFO"); } } }