tr2/fmv: add ability to turn fmvs off

Resolves #2110.
This commit is contained in:
Marcin Kurczewski 2024-12-25 13:07:27 +01:00
parent eb598f2b34
commit 00d6fea120
7 changed files with 28 additions and 22 deletions

View file

@ -1,5 +1,6 @@
## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr2-0.7.1...develop) - ××××-××-××
- completed decompilation efforts  TR2X.dll is gone, Tomb2.exe no longer needed (#1694)
- added the ability to turn FMVs off (#2110)
- added an option to use PS1 contrast levels, available under F8 (#1646)
- added an option to allow disabling the developer console (#2063)
- fixed Lara prioritising throwing a spent flare while mid-air, so to avoid missing ledge grabs (#1989)

View file

@ -107,6 +107,7 @@ game with new enhancements and features.
#### Mods
- added developer console (accessible with `/`, see [COMMANDS.md](COMMANDS.md) for details)
- added ability to disable FMVs
#### Miscellaneous
- added .jpeg/.png screenshots

View file

@ -22,6 +22,12 @@ typedef struct {
bool fix_item_rots;
} visuals;
struct {
int32_t sound_volume;
int32_t music_volume;
bool enable_lara_mic;
} audio;
struct {
bool fix_m16_accuracy;
bool fix_item_duplication_glitch;
@ -29,16 +35,11 @@ typedef struct {
bool fix_flare_throw_priority;
bool enable_cheats;
bool enable_console;
bool enable_fmv;
bool enable_auto_item_selection;
int32_t turbo_speed;
} gameplay;
struct {
int32_t sound_volume;
int32_t music_volume;
bool enable_lara_mic;
} audio;
struct {
bool is_fullscreen;
bool is_maximized;

View file

@ -4,6 +4,7 @@ CFG_BOOL(g_Config, gameplay.fix_floor_data_issues, true)
CFG_BOOL(g_Config, gameplay.fix_flare_throw_priority, true)
CFG_BOOL(g_Config, gameplay.enable_cheats, false)
CFG_BOOL(g_Config, gameplay.enable_console, true)
CFG_BOOL(g_Config, gameplay.enable_fmv, true)
CFG_BOOL(g_Config, gameplay.enable_auto_item_selection, true)
CFG_INT32(g_Config, gameplay.turbo_speed, 0)
CFG_BOOL(g_Config, visuals.enable_3d_pickups, true)

View file

@ -27,8 +27,6 @@ static void *M_LockSurface(void *surface, void *user_data);
static void M_UnlockSurface(void *surface, void *user_data);
static void M_UploadSurface(void *surface, void *user_data);
static void M_EnterFMVMode(void);
static void M_ExitFMVMode(void);
static void M_Play(const char *file_name);
static void *M_AllocateSurface(
@ -87,18 +85,6 @@ static void M_UploadSurface(void *const surface, void *const user_data)
GFX_2D_Renderer_Render(renderer_2d);
}
static void M_EnterFMVMode(void)
{
Music_Stop();
}
static void M_ExitFMVMode(void)
{
if (!g_IsGameToExit) {
Render_Reset(RENDER_RESET_ALL);
}
}
static void M_Play(const char *const file_name)
{
VIDEO *const video = Video_Open(file_name);
@ -165,9 +151,16 @@ static void M_Play(const char *const file_name)
void FMV_Play(const char *const file_name)
{
M_EnterFMVMode();
Music_Stop();
if (!g_Config.gameplay.enable_fmv) {
return;
}
M_Play(file_name);
M_ExitFMVMode();
if (!g_IsGameToExit) {
Render_Reset(RENDER_RESET_ALL);
}
}
bool FMV_IsPlaying(void)

View file

@ -30,6 +30,10 @@
"Title": "Console",
"Description": "Enables the developer console."
},
"enable_fmv": {
"Title": "Enable FMVs",
"Description": "Enables FMVs playing."
},
"fix_m16_accuracy": {
"Title": "Fix M16 accuracy",
"Description": "Fixes the accuracy of the M16 while Lara is running."

View file

@ -73,6 +73,11 @@
"Field": "enable_auto_item_selection",
"DataType": "Bool",
"DefaultValue": true
},
{
"Field": "enable_fmv",
"DataType": "Bool",
"DefaultValue": true
}
]
},