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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Codechange: rename sound ids to make more sense. #8701

Merged
merged 3 commits into from Feb 20, 2021

Conversation

frosch123
Copy link
Member

@frosch123 frosch123 commented Feb 20, 2021

Motivation / Problem

The enum items in SoundFx roughly reflected, what the sound effects sounded like, when someone heard them without context.
Many sound effects were mislabeled, like "plane crashing" for the "toyland plane takeoff"-effect, or attributing "truck" sounds to "busses". Many sounds had arbitrary names like "another jet overhead".

Description

This PR renames almost all items in SoundFx, and adds comments, how/where they are used in the source.
Similar used sounds get similar names:

  • DEPARTURE_ vehicle type
  • BREAKDOWN_ vehicle type
  • TAKEOFF_ aircraft type
  • CONSTRUCTION_ type
  • industry type _ animation/effect
  • climate zone _ effect

Limitations

Poor NML people who copied the non-sensical names 馃槩

The separation into two commits is just for reviewing. This PR is intended to be squashed.

Checklist for review

Some things are not automated, and forgotten often. This list is a reminder for the reviewers.

  • The bug fix is important enough to be backported? (label: 'backport requested')
  • This PR affects the save game format? (label 'savegame upgrade')
  • This PR affects the GS/AI API? (label 'needs review: Script API')
    • ai_changelog.hpp, gs_changelog.hpp need updating.
    • The compatibility wrappers (compat_*.nut) need updating.
  • This PR affects the NewGRF API? (label 'needs review: NewGRF')

src/sound_type.h Outdated Show resolved Hide resolved
Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the value in keeping the numbers in the sound names? They already (mostly) don't match the actual enum value...

@frosch123
Copy link
Member Author

In general: read the comment above the SoundFx enum. There is a historical off-by-two by CS.
In purpose of this PR: with preserving the IDs, it's super-easy to see that I did not mess up when replacing :)

Copy link
Member

@LordAro LordAro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure.

@frosch123 frosch123 merged commit d9b4413 into OpenTTD:master Feb 20, 2021
This was referenced Feb 20, 2021
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.

None yet

3 participants