Skip to content

Commit 50cf43f

Browse files
Audit MMCE readiness workflow
1 parent ce98668 commit 50cf43f

3 files changed

Lines changed: 20 additions & 3 deletions

File tree

include/themes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,5 +143,6 @@ int thmGetGuiValue(void);
143143
int thmFindGuiID(const char *theme);
144144
const char **thmGetGuiList(void);
145145
char *thmGetFilePath(int themeID);
146+
void thmSetMmceMainPageBrowseOnly(int enabled);
146147

147148
#endif

src/menusys.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1080,6 +1080,8 @@ void menuRenderMain(void)
10801080
int allowItemConfig = !(list != NULL && list->mode == MMCE_MODE);
10811081
config_set_t *renderConfig = allowItemConfig ? itemConfig : NULL;
10821082

1083+
thmSetMmceMainPageBrowseOnly(list != NULL && list->mode == MMCE_MODE);
1084+
10831085
if (list->mode == APP_MODE) {
10841086
menuRenderElements(&gTheme->appsMainElems, allowItemConfig, renderConfig);
10851087
gTheme->itemsList = gTheme->appsItemsList;
@@ -1137,6 +1139,8 @@ void menuRenderInfo(void)
11371139
{
11381140
item_list_t *list = selected_item->item->userdata;
11391141

1142+
thmSetMmceMainPageBrowseOnly(0);
1143+
11401144
if (list->mode == APP_MODE) {
11411145
menuRenderElements(&gTheme->appsInfoElems, 1, itemConfig);
11421146
gTheme->itemsList = gTheme->appsItemsList;

src/themes.c

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ theme_t *gTheme;
2424
static int screenWidth;
2525
static int screenHeight;
2626
static int guiThemeID = 0;
27+
static int gMmceMainPageBrowseOnly = 0;
2728

2829
static int nThemes = 0;
2930
static theme_file_t themes[THM_MAX_FILES];
@@ -480,6 +481,8 @@ static mutable_image_t *initMutableImage(const char *themePath, config_set_t *th
480481
configGetStr(themeConfig, elemProp, &cachePattern);
481482
snprintf(elemProp, sizeof(elemProp), "%s_count", name);
482483
configGetInt(themeConfig, elemProp, &cacheCount);
484+
if (cachePattern != NULL && strcmp(cachePattern, "COV") == 0 && cacheCount < 2)
485+
cacheCount = 2;
483486
LOG("THEMES MutableImage %s: type: %s using cache pattern: %s count: %d\n", name, elementsType[type], cachePattern, cacheCount);
484487
}
485488

@@ -554,6 +557,11 @@ static GSTEXTURE *getGameImageTexture(image_cache_t *cache, void *support, struc
554557
return NULL;
555558
}
556559

560+
void thmSetMmceMainPageBrowseOnly(int enabled)
561+
{
562+
gMmceMainPageBrowseOnly = enabled;
563+
}
564+
557565
static int canPrefetchAdjacentGameImages(image_cache_t *cache, item_list_t *list, GSTEXTURE *selectedTexture)
558566
{
559567
if (cache == NULL || list == NULL || selectedTexture == NULL || selectedTexture->Mem == NULL)
@@ -610,9 +618,15 @@ static void drawGameImage(struct menu_list *menu, struct submenu_list *item, con
610618
mutable_image_t *gameImage = (mutable_image_t *)elem->extended;
611619
if (item) {
612620
item_list_t *list;
613-
GSTEXTURE *texture = getGameImageTexture(gameImage->cache, menu->item->userdata, &item->item);
621+
GSTEXTURE *texture;
614622
list = (item_list_t *)menu->item->userdata;
615623

624+
if (list != NULL && list->mode == MMCE_MODE && gMmceMainPageBrowseOnly && gameImage->cache != NULL &&
625+
gameImage->cache->suffix != NULL && strcmp(gameImage->cache->suffix, "COV") != 0) {
626+
texture = cacheGetTextureIfReady(gameImage->cache, &item->item.cache_id[gameImage->cache->userId], &item->item.cache_uid[gameImage->cache->userId]);
627+
} else
628+
texture = getGameImageTexture(gameImage->cache, menu->item->userdata, &item->item);
629+
616630
if (gameImage->cache != NULL && gameImage->cache->suffix != NULL && strcmp(gameImage->cache->suffix, "COV") == 0 &&
617631
canPrefetchAdjacentGameImages(gameImage->cache, list, texture)) {
618632
int prefetchInactiveFrames = (list != NULL && list->mode == APP_MODE) ? APP_PREFETCH_IDLE_FRAMES : MENU_MIN_INACTIVE_FRAMES;
@@ -1180,8 +1194,6 @@ static void clampSelectedCoverCaches(theme_t *theme, theme_elems_t *elems)
11801194
if (gameImage != NULL && gameImage->cache != NULL && gameImage->cache->suffix != NULL && strcmp(gameImage->cache->suffix, "COV") == 0 &&
11811195
!isDecoratorCoverCache(theme->gamesItemsList, gameImage->cache) && !isDecoratorCoverCache(theme->appsItemsList, gameImage->cache)) {
11821196
gameImage->cache->allowPrime = 0;
1183-
if (gameImage->cache->count < 2)
1184-
gameImage->cache->count = 2;
11851197
}
11861198
}
11871199

0 commit comments

Comments
 (0)