tidy-fix automàtic (sense naming)

This commit is contained in:
2026-05-14 18:28:23 +02:00
parent 358e91ea30
commit b7a551c158
81 changed files with 1549 additions and 831 deletions
+29 -27
View File
@@ -146,17 +146,17 @@ namespace {
}
constexpr SpritePhase variant_0[] = {
{0, 200, v0_walk_right, true},
{0, 200, v0_pull_map_right, true},
{200, 0, v0_pull_map_right, true}, // guarda el mapa (reprodueix inversament)
{200, 80, v0_walk_left_to_80, true},
{0, 200, v0_pull_map_left, true},
{300, 95, v0_momia_left, true},
{0, 50, v0_turn, true},
{0, 49, v0_jump1, true},
{50, 99, v0_jump2, true},
{80, 0, v0_walk_final, true},
{0, 150, v0_final, true},
{.start_i = 0, .end_i = 200, .render = v0_walk_right, .skippable = true},
{.start_i = 0, .end_i = 200, .render = v0_pull_map_right, .skippable = true},
{.start_i = 200, .end_i = 0, .render = v0_pull_map_right, .skippable = true}, // guarda el mapa (reprodueix inversament)
{.start_i = 200, .end_i = 80, .render = v0_walk_left_to_80, .skippable = true},
{.start_i = 0, .end_i = 200, .render = v0_pull_map_left, .skippable = true},
{.start_i = 300, .end_i = 95, .render = v0_momia_left, .skippable = true},
{.start_i = 0, .end_i = 50, .render = v0_turn, .skippable = true},
{.start_i = 0, .end_i = 49, .render = v0_jump1, .skippable = true},
{.start_i = 50, .end_i = 99, .render = v0_jump2, .skippable = true},
{.start_i = 80, .end_i = 0, .render = v0_walk_final, .skippable = true},
{.start_i = 0, .end_i = 150, .render = v0_final, .skippable = true},
};
// =========================================================================
@@ -224,13 +224,13 @@ namespace {
}
constexpr SpritePhase variant_1[] = {
{0, 200, v1_walk_right, true},
{0, 300, v1_pull_map, true},
{0, 100, v1_interrogant, true},
{0, 200, v1_drop_map, true},
{0, 75, v1_stone_fall, true},
{0, 19, v1_stone_break, true},
{0, 200, v1_final, true},
{.start_i = 0, .end_i = 200, .render = v1_walk_right, .skippable = true},
{.start_i = 0, .end_i = 300, .render = v1_pull_map, .skippable = true},
{.start_i = 0, .end_i = 100, .render = v1_interrogant, .skippable = true},
{.start_i = 0, .end_i = 200, .render = v1_drop_map, .skippable = true},
{.start_i = 0, .end_i = 75, .render = v1_stone_fall, .skippable = true},
{.start_i = 0, .end_i = 19, .render = v1_stone_break, .skippable = true},
{.start_i = 0, .end_i = 200, .render = v1_final, .skippable = true},
};
// =========================================================================
@@ -268,17 +268,17 @@ namespace {
}
constexpr SpritePhase variant_2[] = {
{0, 145, v2_approach, true},
{0, 100, v2_still, true},
{0, 50, v2_horn, true},
{0, 800, v2_ball, true},
{.start_i = 0, .end_i = 145, .render = v2_approach, .skippable = true},
{.start_i = 0, .end_i = 100, .render = v2_still, .skippable = true},
{.start_i = 0, .end_i = 50, .render = v2_horn, .skippable = true},
{.start_i = 0, .end_i = 800, .render = v2_ball, .skippable = true},
};
// =========================================================================
// Dispatch per variant
// =========================================================================
const SpritePhase* variant_table(int variant) {
auto variant_table(int variant) -> const SpritePhase* {
switch (variant) {
case 0:
return variant_0;
@@ -290,7 +290,7 @@ namespace {
return variant_0;
}
int variant_length(int variant) {
auto variant_length(int variant) -> int {
switch (variant) {
case 0:
return sizeof(variant_0) / sizeof(variant_0[0]);
@@ -302,11 +302,11 @@ namespace {
return 0;
}
int phase_step_count(const SpritePhase& p) {
auto phase_step_count(const SpritePhase& p) -> int {
return std::abs(p.end_i - p.start_i) + 1;
}
int phase_current_i(const SpritePhase& p, int step) {
auto phase_current_i(const SpritePhase& p, int step) -> int {
return p.end_i >= p.start_i ? p.start_i + step : p.start_i - step;
}
@@ -334,7 +334,9 @@ namespace scenes {
}
void IntroSpritesScene::tick(int delta_ms) {
if (done_) return;
if (done_) {
return;
}
const SpritePhase* phases = variant_table(variant_);
const int num_phases = variant_length(variant_);