added wubs to the game, also FMOD

This commit is contained in:
Stiffly
2014-05-19 00:49:57 +02:00
parent 542ad075ea
commit 73afc8dad4
20 changed files with 4441 additions and 165 deletions
+4 -24
View File
@@ -1,7 +1,7 @@
#ifndef SoundEmitter_h__
#define SoundEmitter_h__
#include <AL/al.h>
#include <AL/alc.h>
#include <fmod.hpp>
#include <fmod_errors.h>
#include <vector>
#include "System.h"
@@ -22,33 +22,13 @@ public:
void RegisterComponents(ComponentFactory* cf) override;
void RegisterResourceTypes(ResourceManager* rm) override;
void Initialize() override;
void Update(double dt) override;
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
void OnComponentCreated(std::string type, std::shared_ptr<Component> component) override;
void OnComponentRemoved(std::string type, Component* component) override;
void PlaySound(Components::SoundEmitter* emitter, std::string path); // Use if you want to play a temporary .wav file not from component
void PlaySound(std::shared_ptr<Components::SoundEmitter> emitter); // Use if you want to play .wav file from component // imon no hate plx T.T
void StopSound(std::shared_ptr<Components::SoundEmitter> emitter);
FMOD::System *m_FmodSystem;
private:
ALuint LoadFile(std::string fileName);
ALuint CreateSource();
//File-info
//char type[4];
//unsigned long size, chunkSize;
//short formatType, channels;
//unsigned long sampleRate, avgBytesPerSec;
//short bytesPerSample, bitsPerSample;
//unsigned long dataSize;
// Events
EventRelay<Events::PlaySound> m_EPlaySound;
bool OnPlaySound(const Events::PlaySound &event);
std::map<Component*, ALuint> m_Sources;
std::map<std::string, ALuint> m_BufferCache; // string = fileName
};
}