From a7375e27a5742bcabed493c44d9478769c0fb4d9 Mon Sep 17 00:00:00 2001 From: Hominem te esse Date: Sun, 12 Feb 2012 23:02:04 +0100 Subject: [PATCH] load and use the internal LOGO before swapping theme (avoid flickering at startup) small fix with theme initialization (it is better to init textures before using them ;)) --- src/renderman.c | 12 ++++++------ src/themes.c | 14 +++++++------- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/renderman.c b/src/renderman.c index b752fbb..12ee664 100644 --- a/src/renderman.c +++ b/src/renderman.c @@ -34,15 +34,15 @@ static enum rm_vmode vmode = RM_VMODE_AUTO; // RM Vmode -> GS Vmode conversion table static int rm_mode_table[NUM_RM_VMODES] = { - -1, - GS_MODE_PAL, - GS_MODE_NTSC + -1, // AUTO + GS_MODE_PAL, // PAL + GS_MODE_NTSC // NTSC }; static int rm_height_table[] = { - -1, // Default + -1, // AUTO 512, // PAL - 448 // NTSC + 448, // NTSC }; static float aspectWidth; @@ -345,7 +345,7 @@ int rmSetMode(int force) { gsKit_clear(gsGlobal, gColBlack); gsKit_sync_flip(gsGlobal); - LOG("New vmode: %d x %d\n", gsGlobal->Width, gsGlobal->Height); + LOG("New vmode: %d, %d x %d\n", vmode, gsGlobal->Width, gsGlobal->Height); } return changed; } diff --git a/src/themes.c b/src/themes.c index 3ee732f..0c45ebd 100644 --- a/src/themes.c +++ b/src/themes.c @@ -1115,15 +1115,18 @@ static void thmLoad(char* themePath) { else rmSetShiftRatio((float) screenHeight / newT->usedHeight); - gTheme = newT; - thmFree(curT); - int i; // default all to not loaded... for (i = 0; i < TEXTURES_COUNT; i++) { - gTheme->textures[i].Mem = NULL; + newT->textures[i].Mem = NULL; } + // LOGO, loaded here to avoid flickering during startup with device in AUTO + theme set + texPngLoad(&newT->textures[LOGO_PICTURE], NULL, LOGO_PICTURE, GS_PSM_CT24); + + gTheme = newT; + thmFree(curT); + // First start with busy icon char* path = themePath; int customBusy = 0; @@ -1146,9 +1149,6 @@ static void thmLoad(char* themePath) { // Not customizable icons for (i = L1_ICON; i <= START_ICON; i++) thmLoadResource(i, NULL, GS_PSM_CT32, 1); - - // LOGO is hardcoded - thmLoadResource(LOGO_PICTURE, NULL, GS_PSM_CT24, 1); } static void thmRebuildGuiNames() { -- 2.11.4.GIT