Use std::atomic enum for SFXStatus

This commit is contained in:
Benau
2020-02-28 19:53:13 +08:00
parent a2f72a0d13
commit e6deaabcf1
2 changed files with 3 additions and 2 deletions

View File

@@ -43,7 +43,7 @@ class SFXBase : public NoCopy
{
public:
/** Status of a sound effect. */
enum SFXStatus
enum SFXStatus : int
{
SFX_UNKNOWN = -1, SFX_STOPPED = 0, SFX_PAUSED = 1, SFX_PLAYING = 2,
SFX_NOT_INITIALISED = 3

View File

@@ -22,6 +22,7 @@
#ifdef ENABLE_SOUND
#include <assert.h>
#include <atomic>
#ifdef __APPLE__
# define OPENAL_DEPRECATED
# include <OpenAL/al.h>
@@ -48,7 +49,7 @@ private:
ALuint m_sound_source;
/** The status of this SFX. */
SFXStatus m_status;
std::atomic<SFXStatus> m_status;
/** If the sfx is positional. */
bool m_positional;