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

@@ -58,6 +58,7 @@ namespace Defaults::Game {
constexpr int PIRAMIDE_INICIAL = 255;
constexpr int VIDES = 5;
constexpr int DIAMANTS_INICIAL = 0;
constexpr int DINERS_INICIAL = 0;
constexpr bool USE_NEW_LOGO = true;
constexpr bool SHOW_TITLE_CREDITS = true;
} // namespace Defaults::Game

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)

View File

@@ -23,7 +23,7 @@ class ModuleSequence {
// doMenu() → migrat a scenes::MenuScene
// doSlides() → migrat a scenes::SlidesScene
// doBanner() → migrat a scenes::BannerScene
void doSecreta();
// doSecreta() → migrat a scenes::SecretaScene
// doCredits() → migrat a scenes::CreditsScene
// doMort() → migrat a scenes::MortScene

View File

@@ -146,6 +146,8 @@ namespace Options {
game.vides = node["vides"].get_value<int>();
if (node.contains("diamants_inicial"))
game.diamants_inicial = node["diamants_inicial"].get_value<int>();
if (node.contains("diners_inicial"))
game.diners_inicial = node["diners_inicial"].get_value<int>();
if (node.contains("use_new_logo"))
game.use_new_logo = node["use_new_logo"].get_value<bool>();
if (node.contains("show_title_credits"))
@@ -281,6 +283,7 @@ namespace Options {
file << " piramide_inicial: " << game.piramide_inicial << "\n";
file << " vides: " << game.vides << "\n";
file << " diamants_inicial: " << game.diamants_inicial << "\n";
file << " diners_inicial: " << game.diners_inicial << "\n";
file << " use_new_logo: " << (game.use_new_logo ? "true" : "false") << "\n";
file << " show_title_credits: " << (game.show_title_credits ? "true" : "false") << "\n";
file << "\n";

View File

@@ -84,6 +84,7 @@ namespace Options {
int piramide_inicial{Defaults::Game::PIRAMIDE_INICIAL};
int vides{Defaults::Game::VIDES};
int diamants_inicial{Defaults::Game::DIAMANTS_INICIAL};
int diners_inicial{Defaults::Game::DINERS_INICIAL};
bool use_new_logo{Defaults::Game::USE_NEW_LOGO};
bool show_title_credits{Defaults::Game::SHOW_TITLE_CREDITS};
};