mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 16:34:06 +00:00
Separate MxCore counter (#663)
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#include "mxsoundmanager.h"
|
||||
|
||||
#include "define.h"
|
||||
#include "mxautolock.h"
|
||||
#include "mxmisc.h"
|
||||
#include "mxomni.h"
|
||||
@@ -10,6 +9,17 @@
|
||||
|
||||
DECOMP_SIZE_ASSERT(MxSoundManager, 0x3c);
|
||||
|
||||
// GLOBAL LEGO1 0x10101420
|
||||
MxS32 g_volumeAttenuation[100] = {-6643, -5643, -5058, -4643, -4321, -4058, -3836, -3643, -3473, -3321, -3184, -3058,
|
||||
-2943, -2836, -2736, -2643, -2556, -2473, -2395, -2321, -2251, -2184, -2120, -2058,
|
||||
-2000, -1943, -1888, -1836, -1785, -1736, -1689, -1643, -1599, -1556, -1514, -1473,
|
||||
-1434, -1395, -1358, -1321, -1286, -1251, -1217, -1184, -1152, -1120, -1089, -1058,
|
||||
-1029, -1000, -971, -943, -915, -888, -862, -836, -810, -785, -761, -736,
|
||||
-713, -689, -666, -643, -621, -599, -577, -556, -535, -514, -494, -473,
|
||||
-454, -434, -415, -395, -377, -358, -340, -321, -304, -286, -268, -251,
|
||||
-234, -217, -200, -184, -168, -152, -136, -120, -104, -89, -74, -58,
|
||||
-43, -29, -14, 0};
|
||||
|
||||
// FUNCTION: LEGO1 0x100ae740
|
||||
MxSoundManager::MxSoundManager()
|
||||
{
|
||||
@@ -184,12 +194,15 @@ MxPresenter* MxSoundManager::FUN_100aebd0(const MxAtomId& p_atomId, MxU32 p_obje
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100aecf0
|
||||
MxS32 MxSoundManager::FUN_100aecf0(MxU32 p_undefined)
|
||||
MxS32 MxSoundManager::GetAttenuation(MxU32 p_volume)
|
||||
{
|
||||
if (!p_undefined) {
|
||||
return -10000;
|
||||
// The unit for p_volume is percent, rounded to integer.
|
||||
// Convert to DSOUND attenuation units: -10000 (silent) to 0 (loudest).
|
||||
if (p_volume == 0) {
|
||||
return DSBVOLUME_MIN;
|
||||
}
|
||||
return g_mxcoreCount[p_undefined];
|
||||
|
||||
return g_volumeAttenuation[p_volume - 1];
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x100aed10
|
||||
|
||||
Reference in New Issue
Block a user