From 8065e043675aaa402b087b5baa1b462a068be8bd Mon Sep 17 00:00:00 2001 From: Agent X <44549182+AgentXLP@users.noreply.github.com> Date: Fri, 21 Jun 2024 13:27:42 -0400 Subject: [PATCH] Increase main menu logo size and change loading screen --- src/pc/djui/djui_panel_main.c | 2 +- src/pc/loading.c | 26 ++++++++++---------------- src/pc/loading.h | 3 ++- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/src/pc/djui/djui_panel_main.c b/src/pc/djui/djui_panel_main.c index faa457bf..658469f0 100644 --- a/src/pc/djui/djui_panel_main.c +++ b/src/pc/djui/djui_panel_main.c @@ -30,7 +30,7 @@ void djui_panel_main_create(struct DjuiBase* caller) { struct DjuiBase* body = djui_three_panel_get_body(panel); { 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_location_type(&logo->base, DJUI_SVT_RELATIVE, DJUI_SVT_ABSOLUTE); djui_base_set_location(&logo->base, 0, -30); diff --git a/src/pc/loading.c b/src/pc/loading.c index f819cacd..c4ad3292 100644 --- a/src/pc/loading.c +++ b/src/pc/loading.c @@ -26,7 +26,7 @@ bool gIsThreaded = false; #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); } @@ -47,15 +47,9 @@ static bool loading_screen_on_render(struct DjuiBase* base) { windowWidth /= 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 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 char buffer[256] = ""; @@ -70,11 +64,11 @@ static bool loading_screen_on_render(struct DjuiBase* base) { sys_swap_backslashes(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 - 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_compute(base); @@ -99,9 +93,9 @@ void init_loading_screen(void) { { // splash image 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_alignment(&splashImage->base, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP); - djui_base_set_size(&splashImage->base, 740.0f, 364.0f); + djui_base_set_location(&splashImage->base, 0, -100); + djui_base_set_alignment(&splashImage->base, DJUI_HALIGN_CENTER, DJUI_VALIGN_CENTER); + djui_base_set_size(&splashImage->base, 1024, 512); load->splashImage = splashImage; } @@ -113,11 +107,11 @@ void init_loading_screen(void) { 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(&text->base, 1.0f, gDjuiFonts[0]->defaultFontScale * 3.0f); - djui_base_set_color(&text->base, 200, 200, 200, 255); + djui_base_set_size(&text->base, 1.0f, gDjuiFonts[0]->defaultFontScale * 6.0f); + djui_base_set_color(&text->base, 220, 220, 220, 255); djui_text_set_alignment(text, DJUI_HALIGN_CENTER, DJUI_VALIGN_TOP); 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; } @@ -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(&progressBar->base, 0, 0); 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; } diff --git a/src/pc/loading.h b/src/pc/loading.h index 1a5e08db..6267fcb3 100644 --- a/src/pc/loading.h +++ b/src/pc/loading.h @@ -4,6 +4,7 @@ #include #include "cliopts.h" +#include "djui/djui_hud_utils.h" struct LoadingSegment { char str[256]; @@ -33,7 +34,7 @@ extern pthread_mutex_t gLoadingThreadMutex; 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_rom_setup_screen(void);