step 7: secreta_scene amb swap de tomba1→tomba2 i red pulse animat

This commit is contained in:
2026-04-16 00:13:02 +02:00
parent 829d7431c1
commit 6063b1c606
9 changed files with 283 additions and 91 deletions

View File

@@ -41,9 +41,7 @@ int ModuleSequence::Go() {
// case 0 (Menú) → migrat a scenes::MenuScene.
// case 1 i 7 (Slides) → migrat a scenes::SlidesScene.
// case 2..5 (Pre-piràmide) → migrat a scenes::BannerScene.
case 6: // Pre-Secreta
doSecreta();
break;
// case 6 (Pre-Secreta) → migrat a scenes::SecretaScene.
// case 8 (Credits) → migrat a scenes::CreditsScene.
// case 100 (Mort) → migrat a scenes::MortScene, dispatch via SceneRegistry.
}
@@ -822,92 +820,7 @@ void ModuleSequence::doIntroSprites(JD8_Surface gfx) {
// doBanner() — migrat a scenes::BannerScene (source/scenes/banner_scene.cpp)
void ModuleSequence::doSecreta() {
play_music("00000002.ogg");
JG_SetUpdateTicks(20);
JD8_FadeOut();
JD8_Surface gfx = JD8_LoadSurface("tomba1.gif");
JD8_Palette pal_aux = JD8_LoadPalette("tomba1.gif");
JD8_Palette pal = (JD8_Palette)malloc(768);
memcpy(pal, pal_aux, 768);
JD8_ClearScreen(255);
JD8_SetScreenPalette(pal);
bool exit = false;
int step = 0;
contador = 1;
while (!exit && !JG_Quitting()) {
if (JG_ShouldUpdate()) {
JI_Update();
if (JI_AnyKey()) {
exit = true;
}
switch (step) {
case 0:
JD8_Blit(70, 60, gfx, 0, contador, 178, 70); // Put_Sprite(from, where, 0 + (320 * i), 178, 70, 70, 60);
JD8_BlitCK(70, 60, gfx, 178, contador >> 1, 142, 70, 255); // Put_Sprite(from, where, 178 + (320 * (i div 2)), 142, 70, 70, 60);
JD8_Flip();
contador++;
if (contador == 128) step++;
break;
case 1:
case 4:
case 7:
case 9:
contador--;
if (contador == 0) step++;
break;
case 2:
JD8_ClearScreen(255);
JD8_Flip();
gfx = JD8_LoadSurface("tomba2.gif");
pal_aux = JD8_LoadPalette("tomba2.gif");
memcpy(pal, pal_aux, 768);
JD8_SetScreenPalette(pal);
step++;
break;
case 3:
JD8_Blit(55, 53, gfx, 0, 158 - contador, 211, contador); // Put_Sprite(from, where, 0 + ((158 - i) * 320), 211, i, 55, 53);
JD8_Flip();
contador++;
if (contador == 94) step++;
break;
case 5:
JD8_ClearScreen(0);
JD8_Flip();
JD8_SetPaletteColor(254, 12, 11, 11);
JD8_SetPaletteColor(253, 12, 11, 11);
step++;
break;
case 6:
JD8_Blit(80, 68, gfx, 160 - (contador * 2), 0, contador * 2, 64); // Put_Sprite(from, where, 160 - (i * 2), (i * 2), 64, 80, 68);
JD8_Flip();
contador++;
if (contador == 80) step++;
break;
case 8:
JD8_SetPaletteColor(254, contador + 12, 11, 11);
JD8_SetPaletteColor(253, (contador + 12) >> 1, 11, 11);
JD8_Flip();
contador++;
if (contador == 51) step++;
break;
case 10:
JD8_FadeOut();
memcpy(pal, pal_aux, 768);
JD8_ClearScreen(255);
JA_FadeOutMusic(250);
exit = true;
break;
}
}
}
JD8_FreeSurface(gfx);
free(pal_aux);
}
// doSecreta() — migrat a scenes::SecretaScene (source/scenes/secreta_scene.cpp)
// doCredits() — migrat a scenes::CreditsScene (source/scenes/credits_scene.cpp)