dethrace-labs / dethrace

Reverse engineering the 1997 game "Carmageddon"
https://twitter.com/dethrace_labs
GNU General Public License v3.0
673 stars 38 forks source link

Fix 399: Game does not obey sound effects volume level set in sound settings. #400

Closed b-kurczynski closed 1 month ago

b-kurczynski commented 1 month ago

Incorporated the following changes:

  1. Moved calls to S3SyncSampleVolumeAndPan() and S3SyncSampleRate() to follow call to AudioBackend_PlaySample(). This is required because the later one initializes the object on which S3Sync...() functions operate.
  2. Removed a call to ma_volume_db_to_linear() as it expects input volume to be in exponential scale where volume_db is in linear scale. The call has been replaced with explicit transformation using reverse formula of the one found in S3SyncSampleVolumeAndPan() function.

Fixes #399