metaforce/Runtime/Character/CPOINode.hpp

73 lines
1.9 KiB
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CPOINODE_HPP__
#define __URDE_CPOINODE_HPP__
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;
2016-04-11 07:10:28 +00:00
bool x28_;
2016-04-28 04:52:41 +00:00
float x2c_weight;
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-05-26 21:30:19 +00:00
s32 index, bool, 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
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; }
2016-04-28 04:52:41 +00:00
float GetWeight() const { return x2c_weight; }
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;
2018-06-08 01:15:46 +00:00
static int compare(const void* a, const void* b);
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
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_CPOINODE_HPP__