prime/include/Kyoto/Audio/CSfxHandle.hpp

26 lines
631 B
C++
Raw Normal View History

#ifndef _CSFXHANDLE
#define _CSFXHANDLE
2022-08-15 04:51:06 +00:00
#include "types.h"
class CSfxHandle {
public:
CSfxHandle() : mID(0) {}
2022-09-16 03:24:27 +00:00
CSfxHandle(uint value);
2022-08-15 04:51:06 +00:00
2022-09-16 03:24:27 +00:00
uint GetIndex() const { return mID & 0xFFF; }
2022-09-16 03:37:46 +00:00
static CSfxHandle NullHandle() { return CSfxHandle(); }
void operator=(const CSfxHandle& other) { mID = other.mID; }
2022-09-16 03:24:27 +00:00
bool operator==(const CSfxHandle& other) { return mID == other.mID; }
bool operator!=(const CSfxHandle& other) { return mID != other.mID; }
operator bool() const { return mID != 0; }
void Clear() { mID = 0; }
2022-08-15 04:51:06 +00:00
private:
2022-09-16 03:24:27 +00:00
uint mID;
static uint mRefCount;
2022-08-15 04:51:06 +00:00
};
CHECK_SIZEOF(CSfxHandle, 0x4)
#endif // _CSFXHANDLE