dethrace-labs / dethrace

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

Ensure initial volume for CD music is properly set. #406

Open b-kurczynski opened 3 months ago

b-kurczynski commented 3 months ago

First intention was to do a fix in a similar way like it has been fixed for effects volume. However, the "set-volume" request does not reach S3SetCDAVolume() function where caching of requested volume level could take place because it's stopped at if (c->active) >>here<<.

As the fix enforced a change in original code, I decided to put it in a place where it's easier to understand. Other option was to do a fix in mentioned spot of S3.c file together with an implementation of deferred volume set in S3SetCDAVolume(), but that would change two files compared to one in proposed solution.

dethrace-labs commented 1 month ago

When you say "initial volume" do you mean the volume as set when the game starts and loads the music volume from config file, or when changing the music volume from the sound options screen?

b-kurczynski commented 1 month ago

I meant the game can't set a proper volume to the music as it's stored in the config. Let say you set the Music Volume to 0 in the Settings menu, quit the game, and then start again. Music will be at full volume even though in Settings menu 0 will be shown.