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

Convert audio .cfg files to JSON #3722

Merged
merged 2 commits into from
Apr 4, 2024
Merged

Conversation

KJeff01
Copy link
Member

@KJeff01 KJeff01 commented Mar 31, 2024

We do a little code deletion.

  • Massive cleanup of lexer/parser code for audio sound effect file loading.
  • This is done by passing information straight to audio_setTrackVals() from a JSON file.

To keep it modder friendly I put "comments" in the JSON files and copied the ones that were already there to begin with from the old .cfg files.


I didn't touch the cmake file for lib/gamelib which may need a tweak now that I deleted these. That directory is also almost empty now. Other than that everything loads and plays just fine from my tests.

KJeff01 added 2 commits March 31, 2024 18:03
Massive cleanup of lexer/parser code for audio sound effect file loading.

This is done by passing information straight to `audio_setTrackVals()` from a JSON file.
@ManManson
Copy link
Member

ManManson commented Apr 3, 2024

Is there a reason to underscore-prefix some attributes? I understand that some of these are not actually used in the code and serve only as a means to add some structure to the file. But I think it would be nicer if we had no underscore prefixes at all.

@KJeff01
Copy link
Member Author

KJeff01 commented Apr 3, 2024

I think I've come across JSON linters/beautifiers out there that may alphabetically sort key-value pairs. There isn't a standard for denoting comments in JSON as it's not technically supported, but using underscores is one of them that I've seen others suggest and seems the most legible.

@KJeff01 KJeff01 added this to the 4.5.0-beta1 milestone Apr 4, 2024
@KJeff01 KJeff01 merged commit 0594ed9 into Warzone2100:master Apr 4, 2024
37 checks passed
@KJeff01 KJeff01 deleted the soundFix3 branch April 4, 2024 14:37
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