fix end of level freeze

This commit is contained in:
rr- 2021-02-09 22:23:33 +01:00
parent 8a1d1b64d3
commit e6525e3c21
4 changed files with 28 additions and 8 deletions

View file

@ -26,6 +26,8 @@ Currently the following configuration options are supported:
- `disable_medpacks`: hides all the medpacks (for No Meds challenge runs).
- `disable_healing_between_levels`: disables healing Lara between level reloads
(for No Heal challenge runs).
- `fix_end_of_level_freeze`: fix game freeze when ending the level with the
Action key held
## Building

View file

@ -281,16 +281,30 @@ void __cdecl LevelStats(int level_id) {
T_CentreH(txt, 1);
T_CentreV(txt, 1);
// wait till action key
while (InputStatus & IN_SELECT) {
// wait till action key release
if (TR1MConfig.fix_end_of_level_freeze) {
while (InputStatus & IN_SELECT) {
S_UpdateInput();
S_InitialisePolyList();
S_CopyBufferToScreen();
S_UpdateInput();
T_DrawText();
S_OutputPolyList();
S_DumpScreen();
}
} else {
while (InputStatus & IN_SELECT) {
S_UpdateInput();
}
S_InitialisePolyList();
S_CopyBufferToScreen();
S_UpdateInput();
T_DrawText();
S_OutputPolyList();
S_DumpScreen();
}
S_InitialisePolyList();
S_CopyBufferToScreen();
S_UpdateInput();
T_DrawText();
S_OutputPolyList();
S_DumpScreen();
// wait till action key press
while (!(InputStatus & IN_SELECT)) {
if (IsResetFlag) {
break;

View file

@ -55,6 +55,9 @@ static int tr1m_read_config() {
TR1MConfig.disable_medpacks = tr1m_json_get_boolean_value(
json, "disable_medpacks"
);
TR1MConfig.fix_end_of_level_freeze = tr1m_json_get_boolean_value(
json, "fix_end_of_level_freeze"
);
json_value_free(json);
free(cfg_data);

View file

@ -6,6 +6,7 @@
struct {
int disable_healing_between_levels;
int disable_medpacks;
int fix_end_of_level_freeze;
} TR1MConfig;
struct {