tr2/stats: add background picture to final stats

Resolves #1584.
This commit is contained in:
Marcin Kurczewski 2024-12-13 19:13:10 +01:00
parent 4a45a5103d
commit a6c3bba6b8
3 changed files with 28 additions and 7 deletions

View file

@ -25,6 +25,7 @@
- added optional automatic key/puzzle inventory item pre-selection (#1884)
- added a search feature to the config tool (#1889)
- added an option to fix rotation on some pickup items to better suit 3D pickup mode (#1613)
- added background for the final game stats (#1584)
- added the ability to turn fade effects on/off (#1623)
- fixed a crash when trying to draw too many rooms at once (#1998)
- fixed Lara getting stuck in her hit animation if she is hit while mounting the boat or skidoo (#1606)

View file

@ -426,7 +426,7 @@ void __cdecl DisplayCredits(void)
Music_Play(MX_SKIDOO_THEME, MPM_ALWAYS);
FADER fader;
for (int32_t i = 0; i < 9; i++) {
for (int32_t i = 0; i < 8; i++) {
char file_name[60];
sprintf(file_name, "data/credit0%d.pcx", i + 1);

View file

@ -3,6 +3,7 @@
#include "decomp/decomp.h"
#include "decomp/savegame.h"
#include "game/console/common.h"
#include "game/fader.h"
#include "game/input.h"
#include "game/music.h"
#include "game/output.h"
@ -364,10 +365,18 @@ int32_t __cdecl GameStats(const int32_t level_num)
Overlay_HideGameInfo();
while (g_Input.any) {
Shell_ProcessEvents();
Input_Update();
Shell_ProcessInput();
FADER fader;
Fader_InitBlackToTransparent(&fader, FRAMES_PER_SECOND / 2);
Output_LoadBackgroundFromFile("data/end.pcx");
while (Fader_Control(&fader)) {
Output_BeginScene();
Output_DrawBackground();
ShowEndStatsText();
Console_Draw();
Text_Draw();
Output_DrawPolyList();
Output_DrawBlackRectangle(fader.current.value);
Output_EndScene();
}
while (true) {
@ -391,14 +400,25 @@ int32_t __cdecl GameStats(const int32_t level_num)
Output_EndScene();
}
Requester_Shutdown(&g_StatsRequester);
g_SaveGame.bonus_flag = 1;
for (int32_t level = LV_FIRST; level <= g_GameFlow.num_levels; level++) {
ModifyStartInfo(level);
}
g_SaveGame.current_level = LV_FIRST;
Fader_InitTransparentToBlack(&fader, FRAMES_PER_SECOND / 2);
while (Fader_Control(&fader)) {
Output_BeginScene();
Output_DrawBackground();
ShowEndStatsText();
Console_Draw();
Text_Draw();
Output_DrawPolyList();
Output_DrawBlackRectangle(fader.current.value);
Output_EndScene();
}
Requester_Shutdown(&g_StatsRequester);
Output_UnloadBackground();
return 0;
}