config: add/improve enable_legal option

Resolves #2740. Resolves #2741.
This commit is contained in:
Marcin Kurczewski 2025-04-12 16:23:32 +02:00
parent 34da7a31ad
commit 72c67d7973
19 changed files with 48 additions and 35 deletions

View file

@ -28,7 +28,7 @@
"music_track": 2,
"inherit_injections": false,
"sequence": [
{"type": "display_picture", "path": "data/images/eidos.webp", "display_time": 1, "fade_in_time": 1.0, "fade_out_time": 1.0},
{"type": "display_picture", "path": "data/images/eidos.webp", "legal": true, "display_time": 1, "fade_in_time": 1.0, "fade_out_time": 1.0},
{"type": "play_fmv", "fmv_id": 0},
{"type": "play_fmv", "fmv_id": 1},
{"type": "play_fmv", "fmv_id": 2},
@ -502,8 +502,8 @@
// FMVs
"fmvs": [
{"path": "fmv/core.avi"},
{"path": "fmv/escape.avi"},
{"path": "fmv/core.avi", "legal": true},
{"path": "fmv/escape.avi", "legal": true},
{"path": "fmv/cafe.avi"},
{"path": "fmv/mansion.avi"},
{"path": "fmv/snow.avi"},

View file

@ -34,7 +34,7 @@
"data/injections/pda_model.bin",
],
"sequence": [
{"type": "display_picture", "path": "data/images/eidos.webp", "display_time": 1, "fade_in_time": 1.0, "fade_out_time": 1.0},
{"type": "display_picture", "path": "data/images/eidos.webp", "legal": true, "display_time": 1, "fade_in_time": 1.0, "fade_out_time": 1.0},
{"type": "play_fmv", "fmv_id": 0},
{"type": "play_fmv", "fmv_id": 1},
{"type": "exit_to_title"},
@ -132,7 +132,7 @@
],
"fmvs": [
{"path": "fmv/core.avi"},
{"path": "fmv/escape.avi"},
{"path": "fmv/core.avi", "legal": true},
{"path": "fmv/escape.avi", "legal": true},
],
}

View file

@ -28,7 +28,7 @@
"path": "data/title.tr2",
"music_track": 64,
"sequence": [
{"type": "display_picture", "path": "data/images/legal.png"},
{"type": "display_picture", "path": "data/images/legal.png", "legal": true},
{"type": "play_fmv", "fmv_id": 0},
{"type": "play_fmv", "fmv_id": 1},
{"type": "exit_to_title"},
@ -493,7 +493,7 @@
],
"fmvs": [
{"path": "fmv/LOGO.RPL"},
{"path": "fmv/LOGO.RPL", "legal": true},
{"path": "fmv/ANCIENT.RPL"},
{"path": "fmv/MODERN.RPL"},
{"path": "fmv/LANDING.RPL"},

View file

@ -28,7 +28,7 @@
"path": "data/title_gm.tr2",
"music_track": 64,
"sequence": [
{"type": "display_picture", "path": "data/images/legal.png"},
{"type": "display_picture", "path": "data/images/legal.png", "legal": true},
{"type": "exit_to_title"},
],
},

View file

@ -11,6 +11,7 @@
- changed the `draw_distance_min` and `draw_distance_max` to `fog_start` and `fog_end`
- changed `Select Detail` dialog title to `Graphic Options`
- changed the number of static mesh slots from 50 to 256 (#2734)
- changed the "enable EIDOS logo" option to disable the Core Design and Bink Video Codec FMVs as well; renamed to "enable legal" (#2741)
- fixed the bilinear filter to not readjust the UVs (#2258)
- fixed anisotropy filter causing black lines on certain GPUs (#902)
- fixed mesh faces not being drawn under some circumstances (#2452, #2438)

View file

@ -1,5 +1,6 @@
## [Unreleased](https://github.com/LostArtefacts/TRX/compare/tr2-0.10...develop) - ××××-××-××
- added support for The Golden Mask (#1621)
- added ability to turn off legal screen and FMVs (#2740)
- added sunglasses for graphic options (#1615)
- added control over the fog distances for players and level builders (#1622)
- added control over the water color for players and level builders (#1619)

View file

@ -42,7 +42,7 @@ CFG_INT32(g_Config, rendering.resolution_width, -1)
CFG_INT32(g_Config, rendering.resolution_height, -1)
CFG_BOOL(g_Config, gameplay.enable_demo, true)
CFG_BOOL(g_Config, gameplay.enable_fmv, true)
CFG_BOOL(g_Config, gameplay.enable_eidos_logo, true)
CFG_BOOL(g_Config, gameplay.enable_legal, true)
CFG_BOOL(g_Config, gameplay.enable_loading_screens, false)
CFG_BOOL(g_Config, gameplay.enable_cine, true)
CFG_BOOL(g_Config, audio.enable_music_in_menu, true)

View file

@ -11,6 +11,7 @@ CFG_BOOL(g_Config, gameplay.fix_bear_ai, 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_legal, true)
CFG_BOOL(g_Config, input.enable_tr3_sidesteps, true)
CFG_BOOL(g_Config, input.enable_responsive_passport, true)
CFG_BOOL(g_Config, gameplay.enable_auto_item_selection, true)

View file

@ -117,6 +117,9 @@ static void M_LoadLegacyOptions(JSON_OBJECT *const parent_obj)
READ_FALLBACK_INT(g_Config.window.height, "window_height");
READ_FALLBACK_INT(g_Config.input.keyboard_layout, "layout");
READ_FALLBACK_INT(g_Config.input.controller_layout, "cntlr_layout");
// ..4.9
READ_FALLBACK_BOOL(g_Config.gameplay.enable_legal, "enable_eidos_logo");
}
static void M_DumpKeyboardLayout(

View file

@ -173,6 +173,7 @@ static DECLARE_SEQUENCE_EVENT_HANDLER_FUNC(M_HandlePictureEvent)
if (event != nullptr) {
GF_DISPLAY_PICTURE_DATA *const event_data = extra_data;
event_data->path = (char *)extra_data + sizeof(GF_DISPLAY_PICTURE_DATA);
event_data->is_legal = JSON_ObjectGetBool(event_obj, "legal", false);
event_data->display_time =
JSON_ObjectGetDouble(event_obj, "display_time", 5.0);
event_data->fade_in_time =
@ -527,6 +528,7 @@ static void M_LoadFMV(
Shell_ExitSystemFmt("Missing FMV path");
}
fmv->path = Memory_DupStr(path);
fmv->is_legal = JSON_ObjectGetBool(obj, "legal", false);
}
static void M_LoadFMVs(JSON_OBJECT *const obj, GAME_FLOW *const gf)

View file

@ -50,13 +50,18 @@ static DECLARE_GF_EVENT_HANDLER(M_HandlePlayFMV)
{
GF_COMMAND gf_cmd = { .action = GF_NOOP };
const int16_t fmv_id = (int16_t)(intptr_t)event->data;
if (seq_ctx != GFSC_SAVED) {
if (seq_ctx == GFSC_SAVED) {
return gf_cmd;
}
if (fmv_id < 0 || fmv_id >= g_GameFlow.fmv_count) {
LOG_ERROR("Invalid FMV number: %d", fmv_id);
} else {
FMV_Play(g_GameFlow.fmvs[fmv_id].path);
return gf_cmd;
}
const GF_FMV *const fmv = &g_GameFlow.fmvs[fmv_id];
if (fmv->is_legal && !g_Config.gameplay.enable_legal) {
return gf_cmd;
}
FMV_Play(fmv->path);
return gf_cmd;
}
@ -73,14 +78,11 @@ static DECLARE_GF_EVENT_HANDLER(M_HandlePicture)
return gf_cmd;
}
#if TR_VERSION == 1
if (Game_GetCurrentLevel() == nullptr
&& !g_Config.gameplay.enable_eidos_logo) {
GF_DISPLAY_PICTURE_DATA *data = event->data;
if (data->is_legal && !g_Config.gameplay.enable_legal) {
return gf_cmd;
}
#endif
GF_DISPLAY_PICTURE_DATA *data = event->data;
PHASE *const phase = Phase_Picture_Create((PHASE_PICTURE_ARGS) {
.file_name = data->path,
.display_time = data->display_time,

View file

@ -152,11 +152,11 @@ typedef struct {
bool enable_cheats;
bool enable_console;
bool enable_fmv;
bool enable_legal;
bool enable_compass_stats;
bool enable_total_stats;
bool enable_timer_in_inventory;
bool enable_demo;
bool enable_eidos_logo;
bool enable_loading_screens;
bool enable_cine;
STAT_DETAIL_MODE stat_detail_mode;

View file

@ -84,6 +84,7 @@ typedef struct {
bool enable_cheats;
bool enable_console;
bool enable_fmv;
bool enable_legal;
bool enable_auto_item_selection;
int32_t turbo_speed;
bool enable_game_modes;

View file

@ -29,6 +29,7 @@ typedef struct {
typedef struct {
char *path;
bool is_legal;
float display_time;
float fade_in_time;
float fade_out_time;
@ -75,6 +76,7 @@ typedef struct {
typedef struct {
const char *path;
bool is_legal;
} GF_FMV;
typedef struct {

View file

@ -250,9 +250,9 @@
"Title": "Enable FMVs",
"Description": "Enables FMVs playing."
},
"enable_eidos_logo": {
"Title": "Enable EIDOS logo",
"Description": "Enables EIDOS logo at the game start."
"enable_legal": {
"Title": "Enable legal",
"Description": "Enables EIDOS logo, Core Design FMV and bink video codec FMV at the game start."
},
"enable_loading_screens": {
"Title": "Enable loading screens",

View file

@ -197,9 +197,9 @@
"Title": "Habilitar FMV",
"Description": "Habilita la reproducción de vídeos FMV."
},
"enable_eidos_logo": {
"Title": "Habilitar el logo de EIDOS",
"Description": "Habilita el logo de EIDOS al comienzo del juego."
"enable_legal": {
"Title": "Habilitar el contenido legal",
"Description": "Habilita el logo de EIDOS, el FMV de Core Design y el FMV de códec de video bink al inicio del juego."
},
"enable_loading_screens": {
"Title": "Habilitar pantallas de carga",

View file

@ -261,9 +261,9 @@
"Title": "Activer les FMV",
"Description": "Active les FMV en jeu."
},
"enable_eidos_logo": {
"Title": "Activer le logo EIDOS",
"Description": "Active le logo EIDOS au début du jeu."
"enable_legal": {
"Title": "Activer le contenu légal",
"Description": "Active le logo EIDOS, la vidéo FMV de Core Design et la vidéo FMV avec le codec Bink au début du jeu."
},
"enable_loading_screens": {
"Title": "Activer les écrans de chargement",

View file

@ -261,9 +261,9 @@
"Title": "Abilita gli FMV",
"Description": "Abilita la riproduzione dei filmati."
},
"enable_eidos_logo": {
"Title": "Abilita il logo EIDOS",
"Description": "Abilita il logo EIDOS all'avvio del gioco."
"enable_legal": {
"Title": "Abilita il contenuto legale",
"Description": "Abilita il logo EIDOS, il FMV di Core Design e il FMV del codec video Bink all'avvio del gioco."
},
"enable_loading_screens": {
"Title": "Abilita le schermate di caricamento",

View file

@ -329,7 +329,7 @@
"DefaultValue": true
},
{
"Field": "enable_eidos_logo",
"Field": "enable_legal",
"DataType": "Bool",
"DefaultValue": true
},