Increase main menu logo size and change loading screen

This commit is contained in:
Agent X 2024-06-21 13:27:42 -04:00
parent 807996c225
commit 8065e04367
3 changed files with 13 additions and 18 deletions

View File

@ -30,7 +30,7 @@ void djui_panel_main_create(struct DjuiBase* caller) {
struct DjuiBase* body = djui_three_panel_get_body(panel); struct DjuiBase* body = djui_three_panel_get_body(panel);
{ {
struct DjuiImage* logo = djui_image_create(body, texture_coopdx_logo, 2048, 1024, 32); struct DjuiImage* logo = djui_image_create(body, texture_coopdx_logo, 2048, 1024, 32);
djui_base_set_size(&logo->base, 400, 200); djui_base_set_size(&logo->base, 550, 275);
djui_base_set_alignment(&logo->base, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP); djui_base_set_alignment(&logo->base, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP);
djui_base_set_location_type(&logo->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_location_type(&logo->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_location(&logo->base, 0, -30); djui_base_set_location(&logo->base, 0, -30);

View File

@ -26,7 +26,7 @@ bool gIsThreaded = false;
#define RUN_THREADED if (gIsThreaded) #define RUN_THREADED if (gIsThreaded)
void loading_screen_set_segment_text(const char *text) { void loading_screen_set_segment_text(const char* text) {
snprintf(gCurrLoadingSegment.str, 256, text); snprintf(gCurrLoadingSegment.str, 256, text);
} }
@ -47,15 +47,9 @@ static bool loading_screen_on_render(struct DjuiBase* base) {
windowWidth /= scale; windowWidth /= scale;
windowHeight /= scale; windowHeight /= scale;
f32 loadingDescY1 = windowHeight * 0.5f - sLoading->loadingDesc->base.height.value * 0.5f;
f32 loadingDescY2 = windowHeight * 0.5f + sLoading->loadingDesc->base.height.value * 0.5f;
// fill the screen // fill the screen
djui_base_set_size(base, windowWidth, windowHeight); djui_base_set_size(base, windowWidth, windowHeight);
// splash logo
djui_base_set_location(&sLoading->splashImage->base, 0, loadingDescY1 - (sLoading->splashImage->base.height.value));
{ {
// loading text description // loading text description
char buffer[256] = ""; char buffer[256] = "";
@ -70,11 +64,11 @@ static bool loading_screen_on_render(struct DjuiBase* base) {
sys_swap_backslashes(buffer); sys_swap_backslashes(buffer);
} }
djui_text_set_text(sLoading->loadingDesc, buffer); djui_text_set_text(sLoading->loadingDesc, buffer);
djui_base_set_location(&sLoading->loadingDesc->base, 0, loadingDescY1); djui_base_set_location(&sLoading->loadingDesc->base, 0, windowHeight - 375);
} }
// loading bar // loading bar
djui_base_set_location(&sLoading->loadingBar->base, windowWidth / 4, loadingDescY2 + 64); djui_base_set_location(&sLoading->loadingBar->base, windowWidth / 4, windowHeight - 200);
djui_base_set_visible(&sLoading->loadingBar->base, gCurrLoadingSegment.percentage > 0 && strlen(gCurrLoadingSegment.str) > 0); djui_base_set_visible(&sLoading->loadingBar->base, gCurrLoadingSegment.percentage > 0 && strlen(gCurrLoadingSegment.str) > 0);
djui_base_compute(base); djui_base_compute(base);
@ -99,9 +93,9 @@ void init_loading_screen(void) {
{ {
// splash image // splash image
struct DjuiImage* splashImage = djui_image_create(base, texture_coopdx_logo, 2048, 1024, 32); struct DjuiImage* splashImage = djui_image_create(base, texture_coopdx_logo, 2048, 1024, 32);
djui_base_set_location_type(&splashImage->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_location(&splashImage->base, 0, -100);
djui_base_set_alignment(&splashImage->base, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP); djui_base_set_alignment(&splashImage->base, DJUI_HALIGN_CENTER, DJUI_VALIGN_CENTER);
djui_base_set_size(&splashImage->base, 740.0f, 364.0f); djui_base_set_size(&splashImage->base, 1024, 512);
load->splashImage = splashImage; load->splashImage = splashImage;
} }
@ -113,11 +107,11 @@ void init_loading_screen(void) {
djui_base_set_location(&text->base, 0, 0); djui_base_set_location(&text->base, 0, 0);
djui_base_set_size_type(&text->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_size_type(&text->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE);
djui_base_set_size(&text->base, 1.0f, gDjuiFonts[0]->defaultFontScale * 3.0f); djui_base_set_size(&text->base, 1.0f, gDjuiFonts[0]->defaultFontScale * 6.0f);
djui_base_set_color(&text->base, 200, 200, 200, 255); djui_base_set_color(&text->base, 220, 220, 220, 255);
djui_text_set_alignment(text, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP); djui_text_set_alignment(text, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP);
djui_text_set_font(text, gDjuiFonts[0]); djui_text_set_font(text, gDjuiFonts[0]);
djui_text_set_font_scale(text, gDjuiFonts[0]->defaultFontScale * 1); djui_text_set_font_scale(text, gDjuiFonts[0]->defaultFontScale * 2);
load->loadingDesc = text; load->loadingDesc = text;
} }
@ -128,7 +122,7 @@ void init_loading_screen(void) {
djui_base_set_location_type(&progressBar->base, DJUI_SVT_ABSOLUTE, DJUI_SVT_ABSOLUTE); djui_base_set_location_type(&progressBar->base, DJUI_SVT_ABSOLUTE, DJUI_SVT_ABSOLUTE);
djui_base_set_location(&progressBar->base, 0, 0); djui_base_set_location(&progressBar->base, 0, 0);
djui_base_set_visible(&progressBar->base, false); djui_base_set_visible(&progressBar->base, false);
progressBar->base.width.value = 0.5; djui_base_set_size(&progressBar->base, 0.5f, 32);
load->loadingBar = progressBar; load->loadingBar = progressBar;
} }

View File

@ -4,6 +4,7 @@
#include <pthread.h> #include <pthread.h>
#include "cliopts.h" #include "cliopts.h"
#include "djui/djui_hud_utils.h"
struct LoadingSegment { struct LoadingSegment {
char str[256]; char str[256];
@ -33,7 +34,7 @@ extern pthread_mutex_t gLoadingThreadMutex;
extern bool gIsThreaded; extern bool gIsThreaded;
void loading_screen_set_segment_text(const char *text); void loading_screen_set_segment_text(const char* text);
void render_loading_screen(void); void render_loading_screen(void);
void render_rom_setup_screen(void); void render_rom_setup_screen(void);