prime/include/Kyoto/Audio/CSfxHandle.hpp

25 lines
596 B
C++
Raw Normal View History

2022-08-15 04:51:06 +00:00
#ifndef _CSFXHANDLE_HPP
#define _CSFXHANDLE_HPP
#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; }
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)
2022-09-16 03:24:27 +00:00
#endif