Skip to content

Commit

Permalink
inject: add PS1 crystal data (#1513)
Browse files Browse the repository at this point in the history
This allows injecting a savegame crystal model replacement to match the
PS1 style.

Resolves #1506.
  • Loading branch information
lahm86 authored Sep 15, 2024
1 parent 5750b06 commit a5b2fb9
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
## [Unreleased](https://github.com/LostArtefacts/TR1X/compare/stable...develop) - ××××-××-××
- added `/exit` command (#1462)
- added reflections to Midas Hand death animation and savegame crystals (#154)
- added an option to use PS1 tinted savegame crystals (#1506)
- changed the target change functionality from the look key to a new, standalone key (default `z` on keyboard, `left analog click` on controller) (#1503)
- fixed `/play`, `/load`, `/demo` and similar commands not working in stats, credits, cinematics and fmvs (#1477)
- fixed console commands being able to interfere with demos, cutscenes and the title screen (#1489, regression from 3.0)
Expand Down
8 changes: 8 additions & 0 deletions GAMEFLOW.md
Original file line number Diff line number Diff line change
Expand Up @@ -1425,6 +1425,14 @@ provided with the game achieves.
jumping, if that option is enabled.
</td>
</tr>
<tr valign="top">
<td>
<code>purple_crystal.bin</code>
</td>
<td>
Injects a replacement savegame crystal model to match the PS1 style.
</td>
</tr>
<tr valign="top">
<td>
<code>scion_collision.bin</code>
Expand Down
1 change: 1 addition & 0 deletions data/ship/cfg/TR1X_gameflow.json5
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"data/injections/braid.bin",
"data/injections/lara_animations.bin",
"data/injections/lara_jumping.bin",
"data/injections/purple_crystal.bin",
"data/injections/uzi_sfx.bin",
],
"convert_dropped_guns": false,
Expand Down
Binary file added data/ship/data/injections/purple_crystal.bin
Binary file not shown.
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ typedef struct {
bool enable_loading_screens;
bool fix_animated_sprites;
bool enable_skybox;
bool enable_ps1_crystals;

struct {
int32_t layout;
Expand Down
1 change: 1 addition & 0 deletions src/config_map.def
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,4 @@ CFG_DOUBLE(g_Config, ui.bar_scale, DEFAULT_UI_SCALE)
CFG_BOOL(g_Config, profile.new_game_plus_unlock, false)
CFG_BOOL(g_Config, fix_animated_sprites, true)
CFG_BOOL(g_Config, enable_skybox, true)
CFG_BOOL(g_Config, enable_ps1_crystals, true)
5 changes: 5 additions & 0 deletions src/game/inject.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ typedef enum INJECTION_TYPE {
INJ_PS1_ENEMY = 8,
INJ_DISABLE_ANIM_SPRITE = 9,
INJ_SKYBOX = 10,
INJ_PS1_CRYSTAL = 11,
} INJECTION_TYPE;

typedef struct INJECTION {
Expand Down Expand Up @@ -244,6 +245,10 @@ static void Inject_LoadFromFile(INJECTION *injection, const char *filename)
case INJ_SKYBOX:
injection->relevant = g_Config.enable_skybox;
break;
case INJ_PS1_CRYSTAL:
injection->relevant =
g_Config.enable_save_crystals && g_Config.enable_ps1_crystals;
break;
default:
LOG_WARNING("%s is of unknown type %d", filename, injection->type);
break;
Expand Down
4 changes: 4 additions & 0 deletions tools/config/TR1X_ConfigTool/Resources/Lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@
"Title": "3D pickups",
"Description": "Enables 3D models to be rendered in place of the sprites for pickup items."
},
"enable_ps1_crystals": {
"Title": "Enable PS1 save crystals",
"Description": "Save crystals will be drawn with a purple tint, more similar to the PS1 type."
},
"enable_round_shadow": {
"Title": "Rounded shadows",
"Description": "Enables round shadows instead of the default octagonal ones."
Expand Down
4 changes: 4 additions & 0 deletions tools/config/TR1X_ConfigTool/Resources/Lang/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@
"Title": "Recogidas en 3D",
"Description": "Permite que los modelos en 3D se representen en lugar de los sprites para los objetos a recoger."
},
"enable_ps1_crystals": {
"Title": "Habilitar cristales guardados de PS1",
"Description": "Los cristales guardados se dibujarán con un tinte púrpura, más similar al tipo PS1."
},
"enable_skybox": {
"Title": "Cielo",
"Description": "Habilita el cielo en niveles soportados."
Expand Down
4 changes: 4 additions & 0 deletions tools/config/TR1X_ConfigTool/Resources/Lang/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@
"Title": "Collectibles 3D",
"Description": "Active les collectibles en 3D au lieu des objets en 2D."
},
"enable_ps1_crystals": {
"Title": "Activer les cristaux de sauvegarde PS1",
"Description": "Les cristaux de sauvegarde seront dessinés avec une teinte violette, plus similaire au type PS1."
},
"enable_round_shadow": {
"Title": "Ombres rondes",
"Description": "Active les ombres rondes au lieu d'ombres octagonales."
Expand Down
4 changes: 4 additions & 0 deletions tools/config/TR1X_ConfigTool/Resources/Lang/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@
"Title": "Oggetti 3D",
"Description": "Sostituisce gli oggetti 2D con i rispettivi modelli 3D."
},
"enable_ps1_crystals": {
"Title": "Abilita i cristalli di salvataggio PS1",
"Description": "I cristalli di salvataggio verranno disegnati con una tinta viola, più simile al tipo PS1."
},
"enable_round_shadow": {
"Title": "Ombre rotonde",
"Description": "Abilita le ombre rotonde invece di quelle ottagonali predefinite."
Expand Down
5 changes: 5 additions & 0 deletions tools/config/TR1X_ConfigTool/Resources/specification.json
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,11 @@
"DataType": "Bool",
"DefaultValue": true
},
{
"Field": "enable_ps1_crystals",
"DataType": "Bool",
"DefaultValue": true
},
{
"Field": "enable_round_shadow",
"DataType": "Bool",
Expand Down

0 comments on commit a5b2fb9

Please sign in to comment.