Fixed playsound event. Added remove sounds OnComponentsRemove only when stopped playing.
This commit is contained in:
+10
-11
@@ -26,26 +26,25 @@ public:
|
||||
void Initialize() override;
|
||||
void Update(double dt) override;
|
||||
void UpdateEntity(double dt, EntityID entity, EntityID parent) override;
|
||||
void OnComponentRemoved(std::string type, Component* component);
|
||||
|
||||
private:
|
||||
// Events
|
||||
EventRelay<SoundSystem, Events::ComponentCreated> m_EComponentCreated;
|
||||
bool OnComponentCreated(const Events::ComponentCreated &event);
|
||||
EventRelay<SoundSystem, Events::PlaySound> m_EPlaySound;
|
||||
bool PlayASound(const Events::PlaySound &event);
|
||||
|
||||
FMOD_RESULT LoadSound(FMOD_SOUND*&, std::string, float, float, bool, float, float);
|
||||
void LoadSound(FMOD_SOUND*&, std::string, float, float);
|
||||
void PlaySound(FMOD_CHANNEL*, FMOD_SOUND*, float volume, bool loop);
|
||||
void RemoveEmitter(EntityID ent);
|
||||
std::vector<EntityID> m_Listeners;
|
||||
FMOD_SYSTEM* m_System;
|
||||
FMOD_CHANNELGROUP* m_ChannelGruoup;
|
||||
//std::map<EntityID, FMOD_CHANNEL*> m_Channels;
|
||||
std::map<EntityID, FMOD_CHANNEL*> m_Channels;
|
||||
std::map<EntityID, FMOD_SOUND*> m_Sounds;
|
||||
FMOD::System *m_FmodSystem;
|
||||
|
||||
FMOD_SOUND* m_Sound; //Temp
|
||||
bool m_Playing; //TEMP
|
||||
FMOD_SYSTEM* m_System;
|
||||
std::vector<EntityID> m_Listeners;
|
||||
std::map<EntityID, FMOD_CHANNEL*> m_Channels;
|
||||
std::map<EntityID, FMOD_CHANNEL*> m_DeleteChannels;
|
||||
std::map<EntityID, FMOD_SOUND*> m_Sounds;
|
||||
std::map<EntityID, FMOD_SOUND*> m_DeleteSounds;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user