Use memmove instead of memcpy as the blocks overlap.
This commit is contained in:
parent
30e1871d3f
commit
c731eedeaf
@ -433,7 +433,7 @@ void Voice::update(float dt, PositionalAttenuationFunction positionalAttenuation
|
|||||||
speaker->channelVolumes = Vec2F::filled(1.0f);
|
speaker->channelVolumes = Vec2F::filled(1.0f);
|
||||||
|
|
||||||
auto& dbHistory = speaker->dbHistory;
|
auto& dbHistory = speaker->dbHistory;
|
||||||
memcpy(&dbHistory[1], &dbHistory[0], (dbHistory.size() - 1) * sizeof(float));
|
memmove(&dbHistory[1], &dbHistory[0], (dbHistory.size() - 1) * sizeof(float));
|
||||||
dbHistory[0] = speaker->decibelLevel;
|
dbHistory[0] = speaker->decibelLevel;
|
||||||
float smoothDb = 0.0f;
|
float smoothDb = 0.0f;
|
||||||
for (float dB : dbHistory)
|
for (float dB : dbHistory)
|
||||||
|
Loading…
Reference in New Issue
Block a user