Guest User

Untitled

a guest
Jul 23rd, 2020
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.27 KB | None | 0 0
  1. std::map<string, Sound> AssetManager::sounds;
  2.  
  3. void AssetManager::playSound(string path)
  4. {
  5.     if (sounds.find(path) != sounds.end())
  6.     {
  7.         sounds[path].play();
  8.     }
  9.     else
  10.     {
  11.         SoundBuffer x;
  12.         x.loadFromFile(path);
  13.         sounds[path].setBuffer(x);
  14.         sounds[path].play();
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment