step 5: slides_scene amb wipe suau per easing (substituix doSlides)

This commit is contained in:
2026-04-15 23:50:59 +02:00
parent ad38fc09cf
commit 605c273173
11 changed files with 323 additions and 98 deletions

View File

@@ -39,10 +39,7 @@ int ModuleSequence::Go() {
doIntro();
break;
// case 0 (Menú) → migrat a scenes::MenuScene.
case 1: // Slides
case 7:
doSlides();
break;
// case 1 i 7 (Slides) → migrat a scenes::SlidesScene.
// case 2..5 (Pre-piràmide) → migrat a scenes::BannerScene.
case 6: // Pre-Secreta
doSecreta();
@@ -823,85 +820,7 @@ void ModuleSequence::doIntroSprites(JD8_Surface gfx) {
// doMenu() — migrat a scenes::MenuScene (source/scenes/menu_scene.cpp)
void ModuleSequence::doSlides() {
JG_SetUpdateTicks(20);
const char* arxiu;
if (info::ctx.num_piramide == 7) {
play_music("00000005.ogg", 1);
if (info::ctx.diners < 200) {
arxiu = "intro2.gif";
} else {
arxiu = "intro3.gif";
}
} else {
arxiu = "intro.gif";
}
JD8_Surface gfx = JD8_LoadSurface(arxiu);
JD8_Palette pal_aux = JD8_LoadPalette(arxiu);
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(320 - (contador * 4), 65, gfx, 0, 0, contador * 4, 65);
JD8_Flip();
contador++;
if (contador == 80) step++;
break;
case 3:
JD8_Blit(0, 65, gfx, 320 - (contador * 4), 65, contador * 4, 65);
JD8_Flip();
contador++;
if (contador == 80) step++;
break;
case 6:
JD8_Blit(320 - (contador * 4), 65, gfx, 0, 130, contador * 4, 65);
JD8_Flip();
contador++;
if (contador == 80) step++;
break;
case 1:
case 4:
case 7:
contador--;
if (contador == -150) {
contador = 0;
step++;
}
break;
case 2:
case 5:
JD8_FadeOut();
memcpy(pal, pal_aux, 768);
JD8_ClearScreen(255);
step++;
break;
case 8:
if (info::ctx.num_piramide != 7) JA_FadeOutMusic(250);
exit = true;
break;
}
}
}
JD8_FreeSurface(gfx);
free(pal_aux);
}
// doSlides() — migrat a scenes::SlidesScene (source/scenes/slides_scene.cpp)
// doBanner() — migrat a scenes::BannerScene (source/scenes/banner_scene.cpp)

View File

@@ -21,7 +21,7 @@ class ModuleSequence {
void doIntro();
void doIntroNewLogo();
// doMenu() → migrat a scenes::MenuScene
void doSlides();
// doSlides() → migrat a scenes::SlidesScene
// doBanner() → migrat a scenes::BannerScene
void doSecreta();
void doCredits();