Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libtrx/anims/common: move changes, ranges and commands to TRX #2236

Merged

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented Jan 8, 2025

Checklist

  • I have read the coding conventions
  • I have added a changelog entry about what my pull request accomplishes, or it is an internal change
  • I have added a readme entry about my new feature or OG bug fix, or it is a different change

Description

This migrates animation change, range and command storage to libtrx and introduces common accessors rather than using globals. These types are only used in Lara_Animate and Item_Animate and are related so I bundled them together in this PR. Same separate commit process as before with anims and bones.

I would like to structure commands, but will defer this for the time being. As they are of variable size, and aren't needed for savegame state, I'm thinking we could add them directly to ANIM rather than using a single list. But that's a future improvement I'd say.

Next up will be frames.

lahm86 added 13 commits January 8, 2025 21:59
This makes a common accessor function to retrieve animation changes,
although a temporary global g_AnimChanges remains until all calls are
migrated.
This replaces all direct references to g_AnimChanges (other than level
loading) to use Anim_GetChange.
This replaces all direct references to g_AnimChanges (other than level
loading) to use Anim_GetChange.
This eliminates the g_AnimChanges global for both games and moves
reading from level/injection files to libtrx.
This makes a common accessor function to retrieve animation changes,
although a temporary global g_AnimRanges remains until all calls are
migrated.
This replaces all direct references to g_AnimRanges (other than level
loading) to use Anim_GetRange.
This replaces all direct references to g_AnimRanges (other than level
loading) to use Anim_GetRange.
This eliminates the g_AnimRanges global for both games and moves
reading from level/injection files to libtrx.
This moves the duplicated Item_GetAnimChange function to libtrx for
both games.
This makes a common accessor function to retrieve animation commands,
although a temporary global g_AnimCommands remains until all calls are
migrated.
This replaces all direct references to g_AnimCommands (other than level
loading) to use Anim_GetCommand.
This replaces all direct references to g_AnimCommands (other than level
loading) to use Anim_GetCommand.
This eliminates the g_AnimCommands global for both games and moves
reading from level/injection files to libtrx.
@lahm86 lahm86 added Internal The invisible stuff TR2 TR1 labels Jan 8, 2025
@lahm86 lahm86 self-assigned this Jan 8, 2025
@lahm86 lahm86 requested review from a team as code owners January 8, 2025 22:11
@lahm86 lahm86 requested review from rr-, walkawayy and aredfan and removed request for a team January 8, 2025 22:11
@lahm86 lahm86 merged commit 2d7bb81 into LostArtefacts:develop Jan 9, 2025
7 checks passed
@lahm86 lahm86 deleted the libtrx-anim-changes-ranges-commands branch January 9, 2025 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Internal The invisible stuff TR1 TR2
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants