diff --git a/source/exhumed/src/2d.cpp b/source/exhumed/src/2d.cpp index 870877956..44ef25f7e 100644 --- a/source/exhumed/src/2d.cpp +++ b/source/exhumed/src/2d.cpp @@ -898,6 +898,33 @@ bool TextOverlay::AdvanceCinemaText(double clock) // //--------------------------------------------------------------------------- +enum EScenes +{ + CINEMA_BEFORE_LEVEL_5, + CINEMA_AFTER_LEVEL_10, + CINEMA_BEFORE_LEVEL_11, + CINEMA_AFTER_LEVEL_15, + CINEMA_LOSE_SCENE, + CINEMA_AFTER_LEVEL_20, +}; + +struct CinemaDef +{ + short tile; + short palette; + short text; + short track; +}; + +static CinemaDef cinemas[] = { + { 3449, 3, 2, 2}, + { 3451, 5, 4, 3}, + { 3454, 1, 3, 4}, + { 3446, 7, 6, 6}, + { 3445, 4, 7, 7}, + { 3448, 6, 8, 8} +}; + static const char * const cinpalfname[] = { "3454.pal", "3452.pal", @@ -948,17 +975,13 @@ class DCinema : public DScreenJob public: DCinema(int nVal, int checklevel = -1) : DScreenJob(fadein|fadeout) { - static const short cinematiles[] = { 3454, 3452, 3449, 3445, 3451, 3448, 3446}; - static const int8_t bxvals[] = { 4, 0, 2, 7, 3, 8, 6 }; - static const int8_t dxvals[] = { 4, -1, 2, -1, 3, 8, 6 }; - - if (nVal < 1 || nVal >7) return; - cinematile = cinematiles[nVal-1]; - currentCinemaPalette = nVal; - edx = dxvals[nVal - 1]; + if (nVal < 0 || nVal >5) return; + cinematile = cinemas[nVal].tile; + currentCinemaPalette = cinemas[nVal].palette; text.Start(0); - text.ReadyCinemaText(bxvals[nVal - 1]); - text.SetPalette(nVal); + text.ReadyCinemaText(cinemas[nVal].text); + text.SetPalette(currentCinemaPalette); + edx = cinemas[nVal].track; check = checklevel; } @@ -1273,9 +1296,7 @@ void DoGameOverScene(bool finallevel) if (finallevel) { - playCDtrack(9, false); - //FadeToWhite(); - job = { Create(4) }; + job = { Create(CINEMA_LOSE_SCENE) }; } else { @@ -1289,15 +1310,19 @@ void DoGameOverScene(bool finallevel) void DoAfterCinemaScene(int nLevel, TArray& jobs) { - static const uint8_t nAfterScene[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 5, 0, 0, 0, 0, 7, 0, 0, 0, 0, 6 }; - if (nAfterScene[nLevel]) jobs.Push({ Create(nAfterScene[nLevel]) }); + int scene = -1; + if (nLevel == 10) scene = CINEMA_AFTER_LEVEL_10; + if (nLevel == 15) scene = CINEMA_AFTER_LEVEL_15; + if (nLevel == 20) scene = CINEMA_AFTER_LEVEL_20; + if (scene > 0) jobs.Push({ Create(scene) }); + if (nLevel == 19) jobs.Push({ Create() }); if (nLevel == 20) jobs.Push({ Create() }); } void DoBeforeCinemaScene(int nLevel, TArray& jobs) { - if (nLevel == 5) jobs.Push({ Create(3) }); - else if (nLevel == 11) jobs.Push({ Create(1, 11) }); + if (nLevel == 5) jobs.Push({ Create(CINEMA_BEFORE_LEVEL_5) }); + else if (nLevel == 11) jobs.Push({ Create(CINEMA_BEFORE_LEVEL_11, 11) }); } END_PS_NS diff --git a/source/exhumed/src/gameloop.cpp b/source/exhumed/src/gameloop.cpp index 253569074..c838686c9 100644 --- a/source/exhumed/src/gameloop.cpp +++ b/source/exhumed/src/gameloop.cpp @@ -86,7 +86,7 @@ static void FinishLevel(int lnum, TArray &jobs) } else nPlayerLives[0] = 0; - DoAfterCinemaScene(lnum, jobs); + DoAfterCinemaScene(lnum-1, jobs); } diff --git a/source/exhumed/src/object.cpp b/source/exhumed/src/object.cpp index da52fdf36..c9aeecd84 100644 --- a/source/exhumed/src/object.cpp +++ b/source/exhumed/src/object.cpp @@ -2706,3 +2706,8 @@ static SavegameHelper sgh("objects", nullptr); END_PS_NS + +CCMD(endit) +{ + Powerslave::EndLevel = 13; +}