add sounds

This commit is contained in:
2025-11-09 00:56:26 -05:00
parent a88f527dd4
commit 767ef44175
4 changed files with 45 additions and 3 deletions
+8
View File
@@ -1,5 +1,6 @@
#include "ResourceManager.h"
#include "MazeMap.h"
#include <SFML/Audio/SoundBuffer.hpp>
#include <SFML/Graphics/Font.hpp>
#include <SFML/Graphics/RenderTexture.hpp>
#include <SFML/Graphics/Sprite.hpp>
@@ -44,6 +45,13 @@ bool ResourceManager::loadMap(const std::string& mapName, const std::filesystem:
return !mapData.empty();
};
bool ResourceManager::loadSound(const std::string& soundName, const std::filesystem::path& soundPath) {
sounds[soundName] = sf::SoundBuffer(soundPath);
return true;
};
void ResourceManager::resizeTexture(const std::string& textureName, unsigned int newTextureTileSize) {
auto it = textures.find(textureName);
if (it == textures.end()) return;