File tree Expand file tree Collapse file tree
src/OpenSHC/Audio/mss/SoundSystem Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -14,10 +14,12 @@ namespace Audio {
1414 // FUNCTION: STRONGHOLDCRUSADER 0x0047A1B0
1515 void SoundSystem::setupVolumeAndSoundID (eMusicIDsInt soundID)
1616 {
17- // NOTE: Is this certain that these ids fit to the original game?
17+ // Indicator to handle as mission sound (?)
1818 if (soundID == DE::SHCDE::MUSIC_TUNE_NARR1) {
1919 // missionNumber1to20 might be unsigned, but found signs inconclusive
2020 if (DAT_GameCore::ptr->missionNumber1to20 - 1U <= 19 ) {
21+ // This makes the soundID "missionNumber1to20 + 46", which would use the enums 47 to 66.
22+ // These are only filled by 4 enums for 4 mission intros, so this space could be made for 20.
2123 soundID = DAT_GameCore::ptr->missionNumber1to20 + 46 ;
2224 } else {
2325 soundID = DE::SHCDE::MUSIC_TUNE_OFF;
@@ -30,6 +32,7 @@ namespace Audio {
3032 this ->currentSoundID_0x3278 = soundID;
3133 int const fileVolume = MACRO_CALL_MEMBER (SFX::SFXState_Func::getSoundVolumeForFilename, DAT_SFXState::ptr)(
3234 DAT_SFXDefinedData::ptr->DAT_SFX_Pointers [soundID].musicFile );
35+ // 0x7f is the maximum volume of the MSS32 volume API.
3336 this ->currentSoundIDVolumeUnk_0x327c = (fileVolume * 100 ) / 0x7f ;
3437 this ->mbr_0x3280 = 0 ;
3538 }
Original file line number Diff line number Diff line change @@ -14,10 +14,12 @@ namespace Audio {
1414 // FUNCTION: STRONGHOLDCRUSADER 0x0047A220
1515 void SoundSystem::setupVolumeAndSoundIDWithMultiplier (eMusicIDsInt soundID, int soundMultiplier)
1616 {
17- // NOTE: Is this certain that these ids fit to the original game?
17+ // Indicator to handle as mission sound (?)
1818 if (soundID == DE::SHCDE::MUSIC_TUNE_NARR1) {
1919 // missionNumber1to20 might be unsigned, but found signs inconclusive
2020 if (DAT_GameCore::ptr->missionNumber1to20 - 1U <= 19 ) {
21+ // This makes the soundID "missionNumber1to20 + 46", which would use the enums 47 to 66.
22+ // These are only filled by 4 enums for 4 mission intros, so this space could be made for 20.
2123 soundID = DAT_GameCore::ptr->missionNumber1to20 + 46 ;
2224 } else {
2325 soundID = DE::SHCDE::MUSIC_TUNE_OFF;
@@ -30,6 +32,7 @@ namespace Audio {
3032 this ->currentSoundID_0x3278 = soundID;
3133 int const fileVolume = MACRO_CALL_MEMBER (SFX::SFXState_Func::getSoundVolumeForFilename, DAT_SFXState::ptr)(
3234 DAT_SFXDefinedData::ptr->DAT_SFX_Pointers [soundID].musicFile );
35+ // 0x7f is the maximum volume of the MSS32 volume API.
3336 this ->currentSoundIDVolumeUnk_0x327c = (fileVolume * soundMultiplier) / 0x7f ;
3437 this ->mbr_0x3280 = 0 ;
3538 }
You can’t perform that action at this time.
0 commit comments