centrat correctament el logo de jailgames (el nou)

This commit is contained in:
2026-04-16 20:18:28 +02:00
parent 5956d874c3
commit 5cda8fc3f9

View File

@@ -10,14 +10,20 @@
namespace { namespace {
// Coordenades mesurades del wordmark "Jailgames" dins gfx/logo_new.gif. // Coordenades mesurades del wordmark "Jailgames" dins gfx/logo_new.gif.
// Idèntiques a les del doIntroNewLogo vell — si canvies el logo, aquí i // Si canvies el logo, aquí i al GIF són els únics llocs a tocar.
// al GIF són els únics llocs a tocar.
constexpr int LOGO_SRC_X = 60; constexpr int LOGO_SRC_X = 60;
constexpr int LOGO_SRC_Y = 158; constexpr int LOGO_SRC_Y = 158;
constexpr int LOGO_DST_Y = 78; constexpr int LOGO_DST_Y = 78;
constexpr int LOGO_HEIGHT = 28; constexpr int LOGO_HEIGHT = 28;
constexpr int LETTER_WIDTHS[9] = {16, 39, 50, 69, 92, 115, 146, 169, 188}; constexpr int LETTER_WIDTHS[9] = {16, 39, 50, 69, 92, 115, 146, 169, 188};
constexpr int CURSOR_X[9] = {77, 100, 111, 130, 153, 176, 207, 230, 249}; // El logo vell es pintava a dst_x == LOGO_SRC_X = 60, cosa que el deixava
// 6 px fora de centre (320 188) / 2 = 66. Ho corregim amb un shift
// comú aplicat tant al blit del logo com als CURSOR_X de sota.
constexpr int LOGO_DST_X = (320 - LETTER_WIDTHS[8]) / 2; // 66
constexpr int CENTER_SHIFT = LOGO_DST_X - LOGO_SRC_X; // +6
constexpr int CURSOR_X[9] = {77 + CENTER_SHIFT, 100 + CENTER_SHIFT, 111 + CENTER_SHIFT,
130 + CENTER_SHIFT, 153 + CENTER_SHIFT, 176 + CENTER_SHIFT,
207 + CENTER_SHIFT, 230 + CENTER_SHIFT, 249 + CENTER_SHIFT};
constexpr int CURSOR_W = 12; constexpr int CURSOR_W = 12;
constexpr int CURSOR_H = 3; constexpr int CURSOR_H = 3;
constexpr int CURSOR_Y = LOGO_DST_Y + LOGO_HEIGHT - CURSOR_H; // y = 103 constexpr int CURSOR_Y = LOGO_DST_Y + LOGO_HEIGHT - CURSOR_H; // y = 103
@@ -72,7 +78,7 @@ namespace scenes {
case Phase::Revealing: { case Phase::Revealing: {
JD8_ClearScreen(0); JD8_ClearScreen(0);
JD8_Blit(LOGO_SRC_X, LOGO_DST_Y, gfx_, LOGO_SRC_X, LOGO_SRC_Y, LETTER_WIDTHS[reveal_letter_], LOGO_HEIGHT); JD8_Blit(LOGO_DST_X, LOGO_DST_Y, gfx_, LOGO_SRC_X, LOGO_SRC_Y, LETTER_WIDTHS[reveal_letter_], LOGO_HEIGHT);
if (reveal_cursor_visible_) { if (reveal_cursor_visible_) {
JD8_Blit(CURSOR_X[reveal_letter_], CURSOR_Y, cursor_surf_, 0, 0, CURSOR_W, CURSOR_H); JD8_Blit(CURSOR_X[reveal_letter_], CURSOR_Y, cursor_surf_, 0, 0, CURSOR_W, CURSOR_H);
} }
@@ -81,7 +87,7 @@ namespace scenes {
case Phase::FullLogoFlash: case Phase::FullLogoFlash:
JD8_ClearScreen(0); JD8_ClearScreen(0);
JD8_Blit(LOGO_SRC_X, LOGO_DST_Y, gfx_, LOGO_SRC_X, LOGO_SRC_Y, LETTER_WIDTHS[8], LOGO_HEIGHT); JD8_Blit(LOGO_DST_X, LOGO_DST_Y, gfx_, LOGO_SRC_X, LOGO_SRC_Y, LETTER_WIDTHS[8], LOGO_HEIGHT);
JD8_Blit(CURSOR_X[8], CURSOR_Y, cursor_surf_, 0, 0, CURSOR_W, CURSOR_H); JD8_Blit(CURSOR_X[8], CURSOR_Y, cursor_surf_, 0, 0, CURSOR_W, CURSOR_H);
break; break;
@@ -90,7 +96,7 @@ namespace scenes {
// Logo complet sense cursor — els pixels del cursor // Logo complet sense cursor — els pixels del cursor
// ciclarien de color durant el cicle de paleta. // ciclarien de color durant el cicle de paleta.
JD8_ClearScreen(0); JD8_ClearScreen(0);
JD8_Blit(LOGO_SRC_X, LOGO_DST_Y, gfx_, LOGO_SRC_X, LOGO_SRC_Y, LETTER_WIDTHS[8], LOGO_HEIGHT); JD8_Blit(LOGO_DST_X, LOGO_DST_Y, gfx_, LOGO_SRC_X, LOGO_SRC_Y, LETTER_WIDTHS[8], LOGO_HEIGHT);
break; break;
case Phase::Sprites: case Phase::Sprites: