1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Use ResourcePath for audio files

This commit is contained in:
Ivan Savenko
2023-09-04 13:03:15 +03:00
parent 97b7d44c88
commit 8dfdfffd87
59 changed files with 195 additions and 192 deletions

View File

@@ -123,9 +123,9 @@ void MapAudioPlayer::removeObject(const CGObjectInstance * obj)
vstd::erase(objects[z][x][y], obj->id);
}
std::vector<std::string> MapAudioPlayer::getAmbientSounds(const int3 & tile)
std::vector<AudioPath> MapAudioPlayer::getAmbientSounds(const int3 & tile)
{
std::vector<std::string> result;
std::vector<AudioPath> result;
for(auto & objectID : objects[tile.z][tile.x][tile.y])
{
@@ -147,8 +147,8 @@ std::vector<std::string> MapAudioPlayer::getAmbientSounds(const int3 & tile)
void MapAudioPlayer::updateAmbientSounds()
{
std::map<std::string, int> currentSounds;
auto updateSounds = [&](const std::string& soundId, int distance) -> void
std::map<AudioPath, int> currentSounds;
auto updateSounds = [&](const AudioPath& soundId, int distance) -> void
{
if(vstd::contains(currentSounds, soundId))
currentSounds[soundId] = std::min(currentSounds[soundId], distance);