manuals tidy tier 1: suffixes, params, switches, equals-default

This commit is contained in:
2026-05-14 18:58:29 +02:00
parent b7a551c158
commit 8676c0e773
15 changed files with 47 additions and 36 deletions
+6
View File
@@ -40,6 +40,8 @@ void Mapa::draw() {
case 3: // Left
JD8_BlitCKToSurface(sam->x + 8, sam->y, this->gfx, 45 + (14 - sam->frame_pejades), 125, 1, 15, this->fondo, 255);
break;
default:
break;
}
}
@@ -124,6 +126,8 @@ void Mapa::preparaFondoEstatic() {
case 6:
JD8_BlitToSurface(20 + (x * 15), 30 + (y * 15), this->gfx, 145, 80, 15, 15, this->fondo);
break;
default:
break;
}
}
}
@@ -284,6 +288,8 @@ void Mapa::comprovaCaixa(Uint8 num) {
this->farao = this->clau = true;
}
break;
default:
break;
}
this->comprovaPorta();
+2
View File
@@ -59,5 +59,7 @@ void Marcador::pintaNumero(Uint16 x, Uint16 y, Uint8 num) {
case 9:
JD8_BlitCK(x, y, this->gfx, 131, 193, 10, 7, 255);
break;
default:
break;
}
}
+2
View File
@@ -143,6 +143,8 @@ auto Momia::update() -> bool {
this->x--;
}
break;
default:
break;
}
if (JG_GetCycleCounter() % this->cycles_per_frame == 0) {
+3 -1
View File
@@ -150,6 +150,8 @@ auto Prota::update() -> Uint8 {
this->x--;
}
break;
default:
break;
}
if (dir == 4) {
@@ -166,7 +168,7 @@ auto Prota::update() -> Uint8 {
}
}
}
eixir = 0u;
eixir = 0U;
} else {
if (JG_GetCycleCounter() % this->cycles_per_frame == 0) {
this->cur_frame++;
+2 -3
View File
@@ -36,9 +36,8 @@ namespace {
namespace scenes {
CreditsScene::~CreditsScene() {
// No toquem la paleta activa: SetScreenPalette n'ha pres ownership.
}
// No toquem la paleta activa: SetScreenPalette n'ha pres ownership.
CreditsScene::~CreditsScene() = default;
void CreditsScene::onEnter() {
// El vell doCredits no tocava música — heretava la del doSlides
+4 -5
View File
@@ -41,11 +41,10 @@ namespace scenes {
IntroNewLogoScene::IntroNewLogoScene() = default;
IntroNewLogoScene::~IntroNewLogoScene() {
// No alliberem `pal_`: JD8_SetScreenPalette n'ha pres ownership i
// el proper SetScreenPalette / FadeToPal el lliurarà. Alliberar-lo
// ací provocaria double free.
}
// No alliberem `pal_`: JD8_SetScreenPalette n'ha pres ownership i el
// proper SetScreenPalette / FadeToPal el lliurarà. Alliberar-lo ací
// provocaria double free.
IntroNewLogoScene::~IntroNewLogoScene() = default;
void IntroNewLogoScene::onEnter() {
playMusic("music/menu.ogg");
+4 -5
View File
@@ -59,11 +59,10 @@ namespace scenes {
IntroScene::IntroScene() = default;
IntroScene::~IntroScene() {
// No alliberem `pal_`: JD8_SetScreenPalette n'ha pres ownership i el
// proper SetScreenPalette / FadeToPal la lliurarà. Alliberar-la ací
// provocaria double free.
}
// No alliberem `pal_`: JD8_SetScreenPalette n'ha pres ownership i el
// proper SetScreenPalette / FadeToPal la lliurarà. Alliberar-la ací
// provocaria double free.
IntroScene::~IntroScene() = default;
void IntroScene::onEnter() {
playMusic("music/menu.ogg");
+4 -2
View File
@@ -286,8 +286,9 @@ namespace {
return variant_1;
case 2:
return variant_2;
default:
return variant_0;
}
return variant_0;
}
auto variant_length(int variant) -> int {
@@ -298,8 +299,9 @@ namespace {
return sizeof(variant_1) / sizeof(variant_1[0]);
case 2:
return sizeof(variant_2) / sizeof(variant_2[0]);
default:
return 0;
}
return 0;
}
auto phase_step_count(const SpritePhase& p) -> int {