Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- std::map<string, Sound> AssetManager::sounds;
- void AssetManager::playSound(string path)
- {
- if (sounds.find(path) != sounds.end())
- {
- sounds[path].play();
- }
- else
- {
- SoundBuffer x;
- x.loadFromFile(path);
- sounds[path].setBuffer(x);
- sounds[path].play();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment