Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions RaptorLauncher_V0.9/RaptorLauncher_V0.9.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
36 changes: 35 additions & 1 deletion RaptorLauncher_V0.9/launcher_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
// --------------------------------------------------
Expand Down Expand Up @@ -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();

Expand Down