mirror of
https://github.com/Nimac0/SDL_Minigame
synced 2026-01-12 23:33:41 +00:00
35 lines
597 B
C++
35 lines
597 B
C++
#pragma once
|
|
|
|
#include <SDL_mixer.h>
|
|
#include <map>
|
|
#include <vector>
|
|
|
|
#include "ECS.h"
|
|
#include "TextureManager.h"
|
|
|
|
enum SoundTypes
|
|
{
|
|
STEPS,
|
|
THROW_EGG,
|
|
};
|
|
|
|
class GameInternal;
|
|
class SoundManager
|
|
{
|
|
public:
|
|
SoundManager() {}
|
|
~SoundManager() {
|
|
for (auto& it : this->sound_cache) {
|
|
Mix_FreeChunk(it.second);
|
|
}
|
|
}
|
|
|
|
SoundManager(SoundManager const&) = delete;
|
|
void operator=(SoundManager const&) = delete;
|
|
|
|
std::map<const char*, Mix_Chunk*> sound_cache;
|
|
|
|
Mix_Chunk* loadSound(const char* fileName);
|
|
static void playSound(GameInternal* game, SoundTypes sound);
|
|
private:
|
|
}; |