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

Refactor sample index storage #675

Merged
merged 4 commits into from
May 17, 2024

Conversation

lahm86
Copy link
Collaborator

@lahm86 lahm86 commented May 17, 2024

Part of #653.

Checklist

Description

Fixes a bug with how TR2/3 sample indices were being stored. Although it worked for OG, starting to change things during randomization highlighted issues where the indices weren't being written back properly. We now only refer to the first sample for each sound effect and store the count, as this is what the engine does - the "next" ones always proceed the first. Writing back also enforces the required sorting, otherwise the game crashes due to the way it reads MAIN.SFX.

This change required a regeneration of the object cache, otherwise imported enemies would be silent.

TR1/4/5 are fine as they store the WAV data in the levels anyway, so when changing things we just move the sample data around.

lahm86 added 4 commits May 17, 2024 15:03
This wasn't working properly due to how the indices are calculated in game. We now sort by default on write and only reference the first sample, the rest are determined by the game.
Pickup was missed, so they were playing just by crossing the tile.
Required for change in TR2SoundEffect
Required for change in TR3SoundEffect
@lahm86 lahm86 added this to the 1.9.0 milestone May 17, 2024
@lahm86 lahm86 self-assigned this May 17, 2024
@lahm86 lahm86 requested review from rr- and chreden May 17, 2024 14:32
@lahm86 lahm86 merged commit e766d7c into LostArtefacts:master May 17, 2024
2 checks passed
@lahm86 lahm86 deleted the issue-653-tr23-audio-issues branch May 17, 2024 17:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants