From be0949fa933f04495caa8987a024ce2bd6f1761a Mon Sep 17 00:00:00 2001 From: Inter-Raptor Date: Fri, 10 Apr 2026 01:24:43 +0200 Subject: [PATCH] Load boot and home background assets with fallback names --- RaptorLauncher_V0.9/RaptorLauncher_V0.9.ino | 4 +++ RaptorLauncher_V0.9/launcher_ui.cpp | 36 ++++++++++++++++++++- 2 files changed, 39 insertions(+), 1 deletion(-) diff --git a/RaptorLauncher_V0.9/RaptorLauncher_V0.9.ino b/RaptorLauncher_V0.9/RaptorLauncher_V0.9.ino index b5d55ff..60e9ef0 100644 --- a/RaptorLauncher_V0.9/RaptorLauncher_V0.9.ino +++ b/RaptorLauncher_V0.9/RaptorLauncher_V0.9.ino @@ -22,6 +22,10 @@ void setup() { displayInit(); storageInit(); + if (!displayDrawRAW("/boot.raw", 0, 0, 320, 240)) { + displayDrawRAW("/boot.bg.raw", 0, 0, 320, 240); + } + settingsInit(); touchInit(); diff --git a/RaptorLauncher_V0.9/launcher_ui.cpp b/RaptorLauncher_V0.9/launcher_ui.cpp index 06d6c78..3570b8b 100644 --- a/RaptorLauncher_V0.9/launcher_ui.cpp +++ b/RaptorLauncher_V0.9/launcher_ui.cpp @@ -124,6 +124,9 @@ static const int INFO_BACK_Y = 202; static const int INFO_BACK_W = 90; static const int INFO_BACK_H = 34; +static const int SCREEN_RAW_W = 320; +static const int SCREEN_RAW_H = 240; + // -------------------------------------------------- // Settings fixed layout // -------------------------------------------------- @@ -463,11 +466,42 @@ static void launchGameFromIndex(int index) { } } + +static bool drawHomeBackground() { + struct BgCandidate { + const char* path; + bool isRaw; + }; + + static const BgCandidate CANDIDATES[] = { + {"/home_bg.raw", true}, + {"/home.bg.raw", true}, + {"/home_bg.bmp", false}, + {"/home.bg.bmp", false} + }; + + for (const BgCandidate& c : CANDIDATES) { + bool ok = c.isRaw + ? displayDrawRAW(c.path, 0, 0, SCREEN_RAW_W, SCREEN_RAW_H) + : displayDrawBMP(c.path, 0, 0); + if (ok) { + Serial.print("[UI] fond home charge: "); + Serial.println(c.path); + return true; + } + } + + Serial.println("[UI] fond home absent, fond uni utilise"); + return false; +} + // -------------------------------------------------- // Draw // -------------------------------------------------- static void drawHomeScreen() { - displayClear(); + if (!drawHomeBackground()) { + displayClear(); + } int pageCount = totalPages();