Skip to content

Change: Allow embedding any file into a .cat file.#3

Merged
PeterN merged 2 commits intoOpenTTD:masterfrom
PeterN:any-format
Apr 15, 2026
Merged

Change: Allow embedding any file into a .cat file.#3
PeterN merged 2 commits intoOpenTTD:masterfrom
PeterN:any-format

Conversation

@PeterN
Copy link
Copy Markdown
Member

@PeterN PeterN commented Nov 4, 2024

To support OpenTTD/OpenTTD#13055, catcodec needs to be extended to allow Ogg Opus files to be included.

To properly test for a valid Ogg Opus files would require additional dependencies and complicated code to test each file, so this PR takes the approach of allowing any file to be packed into the .cat file and it's up to the user to ensure the files are correct.

This allows file types other than WAV to be embedded. File types not supported by OpenTTD will be ignored.

Comment thread src/sample.cpp Outdated
@PeterN
Copy link
Copy Markdown
Member Author

PeterN commented Apr 15, 2026

Basically rewritten, the WAV file header validation and writing now stays intact, which means that the original sample.cats can still have their data fixed when decoding.

rubidium42
rubidium42 previously approved these changes Apr 15, 2026
@PeterN PeterN dismissed rubidium42’s stale review April 15, 2026 20:13

The merge-base changed after approval.

@PeterN PeterN merged commit 9bdb0e1 into OpenTTD:master Apr 15, 2026
7 checks passed
@PeterN PeterN deleted the any-format branch April 15, 2026 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants