2016-04-12 23:07:23 -07:00
|
|
|
#ifndef __URDE_TYPES_HPP__
|
|
|
|
#define __URDE_TYPES_HPP__
|
2015-08-17 13:33:58 -07:00
|
|
|
|
2015-08-19 19:52:07 -07:00
|
|
|
#include <vector>
|
2015-08-17 22:54:43 -07:00
|
|
|
#include <utility>
|
2015-08-21 18:58:41 -07:00
|
|
|
#include <string>
|
2015-08-17 13:33:58 -07:00
|
|
|
#include "GCNTypes.hpp"
|
2015-08-21 18:58:41 -07:00
|
|
|
#include "rstl.hpp"
|
|
|
|
#include "DataSpec/DNACommon/DNACommon.hpp"
|
2016-04-11 00:10:28 -07:00
|
|
|
#include "IOStreams.hpp"
|
2015-08-17 13:33:58 -07:00
|
|
|
|
2016-03-04 15:04:53 -08:00
|
|
|
namespace urde
|
2015-08-17 15:05:00 -07:00
|
|
|
{
|
|
|
|
|
2016-03-04 15:04:53 -08:00
|
|
|
using FourCC = hecl::FourCC;
|
2016-04-14 14:42:47 -07:00
|
|
|
using ResId = s64;
|
2015-08-22 23:42:29 -07:00
|
|
|
|
2015-08-21 18:58:41 -07:00
|
|
|
struct SObjectTag
|
|
|
|
{
|
|
|
|
FourCC type;
|
2016-04-14 14:42:47 -07:00
|
|
|
ResId id = -1;
|
2016-03-25 17:51:59 -07:00
|
|
|
operator bool() const {return id != -1;}
|
2015-08-22 23:42:29 -07:00
|
|
|
bool operator!=(const SObjectTag& other) const {return id != other.id;}
|
|
|
|
bool operator==(const SObjectTag& other) const {return id == other.id;}
|
2016-02-16 19:42:27 -08:00
|
|
|
SObjectTag() = default;
|
2016-04-14 14:42:47 -07:00
|
|
|
SObjectTag(FourCC tp, ResId rid) : type(tp), id(rid) {}
|
2016-04-11 00:10:28 -07:00
|
|
|
SObjectTag(CInputStream& in)
|
|
|
|
{
|
|
|
|
in.readBytesToBuf(&type, 4);
|
|
|
|
id = in.readUint32Big();
|
|
|
|
}
|
2016-04-18 17:17:49 -07:00
|
|
|
void readMLVL(CInputStream& in)
|
|
|
|
{
|
|
|
|
id = in.readUint32Big();
|
|
|
|
in.readBytesToBuf(&type, 4);
|
|
|
|
}
|
2015-08-21 18:58:41 -07:00
|
|
|
};
|
|
|
|
|
2016-04-16 14:49:47 -07:00
|
|
|
using TUniqueId = s16;
|
|
|
|
using TEditorId = s32;
|
|
|
|
using TAreaId = s32;
|
2016-04-17 15:38:05 -07:00
|
|
|
using TGameScriptId = s32;
|
2015-08-18 22:48:57 -07:00
|
|
|
|
2015-08-19 19:52:07 -07:00
|
|
|
#define kInvalidEditorId TEditorId(-1)
|
|
|
|
#define kInvalidUniqueId TUniqueId(-1)
|
|
|
|
#define kInvalidAreaId TAreaId(-1)
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2015-08-22 23:42:29 -07:00
|
|
|
namespace std
|
|
|
|
{
|
|
|
|
template<>
|
2016-03-04 15:04:53 -08:00
|
|
|
struct hash<urde::SObjectTag>
|
2015-08-22 23:42:29 -07:00
|
|
|
{
|
2016-03-04 15:04:53 -08:00
|
|
|
inline size_t operator()(const urde::SObjectTag& tag) const
|
2015-08-22 23:42:29 -07:00
|
|
|
{return tag.id;}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2016-04-12 23:07:23 -07:00
|
|
|
#endif // __URDE_TYPES_HPP__
|