2018-10-07 03:42:33 +00:00
|
|
|
#pragma once
|
2016-04-11 07:10:28 +00:00
|
|
|
|
|
|
|
#include "IOStreams.hpp"
|
|
|
|
#include "CCharAnimTime.hpp"
|
|
|
|
|
|
|
|
namespace urde
|
|
|
|
{
|
2016-08-27 21:16:44 +00:00
|
|
|
class IAnimSourceInfo;
|
2016-04-11 07:10:28 +00:00
|
|
|
|
2016-08-21 20:39:18 +00:00
|
|
|
enum class EPOIType : u16
|
|
|
|
{
|
|
|
|
Loop = 0,
|
|
|
|
EmptyBool = 1,
|
|
|
|
EmptyInt32 = 2,
|
2017-06-03 06:03:07 +00:00
|
|
|
SoundInt32 = 4,
|
2016-08-21 20:39:18 +00:00
|
|
|
Particle = 5,
|
|
|
|
UserEvent = 6,
|
|
|
|
RandRate = 7,
|
|
|
|
Sound = 8,
|
|
|
|
};
|
|
|
|
|
2016-04-11 07:10:28 +00:00
|
|
|
class CPOINode
|
|
|
|
{
|
2016-04-12 06:15:32 +00:00
|
|
|
protected:
|
2016-04-11 07:10:28 +00:00
|
|
|
u16 x4_ = 1;
|
|
|
|
std::string x8_name;
|
2016-08-21 20:39:18 +00:00
|
|
|
EPOIType x18_type;
|
2016-04-11 07:10:28 +00:00
|
|
|
CCharAnimTime x1c_time;
|
2018-05-26 21:30:19 +00:00
|
|
|
s32 x24_index;
|
2018-11-21 00:51:15 +00:00
|
|
|
bool x28_unique;
|
2016-04-28 04:52:41 +00:00
|
|
|
float x2c_weight;
|
2018-05-02 00:43:31 +00:00
|
|
|
s32 x30_charIdx = -1;
|
|
|
|
s32 x34_flags;
|
2016-04-11 07:10:28 +00:00
|
|
|
public:
|
2017-11-13 06:19:18 +00:00
|
|
|
CPOINode(std::string_view name, EPOIType type, const CCharAnimTime& time,
|
2018-11-21 00:51:15 +00:00
|
|
|
s32 index, bool unique, float weight, s32 charIdx, s32 flags);
|
2016-04-11 07:10:28 +00:00
|
|
|
CPOINode(CInputStream& in);
|
|
|
|
virtual ~CPOINode() = default;
|
2016-04-11 07:47:21 +00:00
|
|
|
|
2018-05-13 04:09:11 +00:00
|
|
|
std::string_view GetString() const { return x8_name; }
|
|
|
|
const CCharAnimTime& GetTime() const { return x1c_time; }
|
2016-09-11 18:40:33 +00:00
|
|
|
void SetTime(const CCharAnimTime& time) { x1c_time = time; }
|
2016-08-21 20:39:18 +00:00
|
|
|
EPOIType GetPoiType() const { return x18_type; }
|
2018-05-26 21:30:19 +00:00
|
|
|
s32 GetIndex() const { return x24_index; }
|
2018-11-21 00:51:15 +00:00
|
|
|
bool GetUnique() const { return x28_unique; }
|
2016-04-28 04:52:41 +00:00
|
|
|
float GetWeight() const { return x2c_weight; }
|
2018-05-02 00:43:31 +00:00
|
|
|
s32 GetCharacterIndex() const { return x30_charIdx; }
|
|
|
|
s32 GetFlags() const { return x34_flags; }
|
2016-09-11 18:40:33 +00:00
|
|
|
|
|
|
|
bool operator>(const CPOINode& other) const;
|
|
|
|
bool operator<(const CPOINode& other) const;
|
2016-04-11 07:10:28 +00:00
|
|
|
};
|
|
|
|
|
2016-08-27 21:16:44 +00:00
|
|
|
template <class T>
|
|
|
|
u32 _getPOIList(const CCharAnimTime& time,
|
|
|
|
T* listOut,
|
|
|
|
u32 capacity, u32 iterator, u32 unk1,
|
|
|
|
const std::vector<T>& stream,
|
|
|
|
const CCharAnimTime& curTime,
|
|
|
|
const IAnimSourceInfo& animInfo, u32 passedCount);
|
|
|
|
|
|
|
|
template <class T>
|
|
|
|
u32 _getPOIList(const CCharAnimTime& time,
|
|
|
|
T* listOut,
|
|
|
|
u32 capacity, u32 iterator, u32 unk1,
|
|
|
|
const std::vector<T>& stream,
|
|
|
|
const CCharAnimTime& curTime);
|
|
|
|
|
2016-04-11 07:10:28 +00:00
|
|
|
}
|
|
|
|
|