prime/include/MetroidPrime/TGameTypes.hpp

65 lines
1.4 KiB
C++
Raw Normal View History

2022-07-18 22:42:58 +00:00
#ifndef _TGAMETYPES_HPP
#define _TGAMETYPES_HPP
#include "types.h"
2022-08-09 23:03:51 +00:00
struct TAreaId;
struct TEditorId;
struct TUniqueId;
2022-07-18 22:42:58 +00:00
extern TAreaId kInvalidAreaId;
extern TEditorId kInvalidEditorId;
extern TUniqueId kInvalidUniqueId;
2022-08-09 23:03:51 +00:00
struct TAreaId {
int value;
2022-08-09 23:03:51 +00:00
TAreaId() : value(-1) {}
TAreaId(int value) : value(value) {}
int Value() const { return value; }
2022-08-09 23:03:51 +00:00
bool operator==(const TAreaId& other) const { return value == other.value; }
bool operator!=(const TAreaId& other) const { return value != other.value; }
};
2022-08-13 01:26:00 +00:00
CHECK_SIZEOF(TAreaId, 0x4)
2022-08-11 02:33:46 +00:00
2022-08-09 23:03:51 +00:00
struct TEditorId {
uint value;
2022-08-09 23:03:51 +00:00
TEditorId() : value(-1) {}
TEditorId(uint value) : value(value) {}
uint Value() const { return value; }
2022-08-11 02:33:46 +00:00
bool operator==(const TEditorId& other) const { return value == other.value; }
bool operator!=(const TEditorId& other) const { return value != other.value; }
2022-08-09 23:03:51 +00:00
};
2022-08-13 01:26:00 +00:00
CHECK_SIZEOF(TEditorId, 0x4)
2022-08-11 02:33:46 +00:00
2022-08-09 23:03:51 +00:00
struct TUniqueId {
2022-08-11 02:33:46 +00:00
union {
struct {
u16 version : 6;
u16 id : 10;
};
u16 value;
};
2022-08-09 23:03:51 +00:00
TUniqueId() : value(-1) {}
TUniqueId(u16 value) : value(value) {}
2022-08-11 02:33:46 +00:00
u16 Value() const { return value; }
bool operator==(const TUniqueId& other) const { return value == other.value; }
bool operator!=(const TUniqueId& other) const { return value != other.value; }
2022-08-09 23:03:51 +00:00
};
2022-08-13 01:26:00 +00:00
CHECK_SIZEOF(TUniqueId, 0x2)
typedef u16 TSfxId;
static TSfxId InvalidSfxId = 0xFFFFu;
2022-08-09 23:03:51 +00:00
class CSegId {
private:
u8 x0_id;
};
2022-07-18 22:42:58 +00:00
#endif