refactor: JD8_* a namespace Jd8::

This commit is contained in:
2026-05-16 14:24:22 +02:00
parent 1ce0d9c56c
commit f37308a5f0
41 changed files with 394 additions and 396 deletions
+16 -16
View File
@@ -14,12 +14,12 @@ namespace scenes {
// Pintat inicial (congelat durant el fade-in de paleta). El loop
// d'animació repintarà tot des de zero en el primer tick de Showing.
JD8_Blit(fondo_);
JD8_BlitCK(100, 25, gfx_, 0, 74, 124, 68, 255); // logo
JD8_BlitCK(130, 100, gfx_, 0, 0, 80, 74, 255); // camell (frame 0)
JD8_BlitCK(0, 150, gfx_, 0, 150, 320, 50, 255); // base "jdes"
Jd8::blit(fondo_);
Jd8::blitCK(100, 25, gfx_, 0, 74, 124, 68, 255); // logo
Jd8::blitCK(130, 100, gfx_, 0, 0, 80, 74, 255); // camell (frame 0)
Jd8::blitCK(0, 150, gfx_, 0, 150, 320, 50, 255); // base "jdes"
JD8_Palette pal = JD8_LoadPalette("gfx/menu2.gif");
Jd8::Palette pal = Jd8::loadPalette("gfx/menu2.gif");
fade_.startFadeTo(pal);
delete[] pal;
@@ -28,32 +28,32 @@ namespace scenes {
void MenuScene::render() {
// Cel estàtic (els primers 100 pixels verticals)
JD8_Blit(0, 0, fondo_, 0, 0, 320, 100);
Jd8::blit(0, 0, fondo_, 0, 0, 320, 100);
// Fondo mòvil (horitzó) amb wrap a 320
JD8_BlitCK(horitzo_, 100, fondo_, 0, 100, 320 - horitzo_, 100, 255);
JD8_BlitCK(0, 100, fondo_, 320 - horitzo_, 100, horitzo_, 100, 255);
Jd8::blitCK(horitzo_, 100, fondo_, 0, 100, 320 - horitzo_, 100, 255);
Jd8::blitCK(0, 100, fondo_, 320 - horitzo_, 100, horitzo_, 100, 255);
// Logo i camell animat
JD8_BlitCK(100, 25, gfx_, 0, 74, 124, 68, 255);
JD8_BlitCK(130, 100, gfx_, camello_.frame() * 80, 0, 80, 74, 255);
Jd8::blitCK(100, 25, gfx_, 0, 74, 124, 68, 255);
Jd8::blitCK(130, 100, gfx_, camello_.frame() * 80, 0, 80, 74, 255);
// Palmeres mòvils amb wrap a 320
JD8_BlitCK(palmeres_, 150, gfx_, 0, 150, 320 - palmeres_, 50, 255);
JD8_BlitCK(0, 150, gfx_, 320 - palmeres_, 150, palmeres_, 50, 255);
Jd8::blitCK(palmeres_, 150, gfx_, 0, 150, 320 - palmeres_, 50, 255);
Jd8::blitCK(0, 150, gfx_, 320 - palmeres_, 150, palmeres_, 50, 255);
// "jdes" estàtic (davant dels scrollers) i versió a la cantonada
JD8_BlitCK(87, 167, gfx_, 127, 124, 150, 24, 255);
JD8_BlitCK(303, 193, gfx_, 305, 143, 15, 5, 255);
Jd8::blitCK(87, 167, gfx_, 127, 124, 150, 24, 255);
Jd8::blitCK(303, 193, gfx_, 305, 143, 15, 5, 255);
// "Polsa tecla" parpallejant. Al vell `contador % 100 > 30` amb
// updateTicks=20 ms, el cicle són 2000 ms amb un llindar de 600 ms:
// amagat els primers 600 ms, visible els següents 1400 ms.
const bool blink_on = (blink_ms_ % 2000) > 600;
if (blink_on) {
JD8_BlitCK(98, 130, gfx_, 161, 92, 127, 9, 255);
Jd8::blitCK(98, 130, gfx_, 161, 92, 127, 9, 255);
if (info::ctx.nou_personatge) {
JD8_BlitCK(68, 141, gfx_, 128, 105, 189, 9, 255);
Jd8::blitCK(68, 141, gfx_, 128, 105, 189, 9, 255);
}
}
}