A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
MapdataPointInfo.hh
Go to the documentation of this file.
1#pragma once
2
4
5#include <egg/math/Vector.hh>
6#include <egg/util/Stream.hh>
7
8#include <span>
9
10namespace Kinoko::System {
11
13public:
18
24
25 STATIC_ASSERT(sizeof(SData) == 0x4);
26
27 MapdataPointInfo(const SData *data);
29
30 void read(EGG::RamStream &stream);
31
32 [[nodiscard]] size_t pointCount() const {
33 return m_points.size();
34 }
35
36 [[nodiscard]] u8 setting(size_t idx) const {
37 ASSERT(idx < m_settings.size());
38 return m_settings[idx];
39 }
40
41 [[nodiscard]] const owning_span<Point> &points() const {
42 return m_points;
43 }
44
45private:
46 [[maybe_unused]] const SData *m_rawData;
47 std::array<u8, 2> m_settings;
49};
50
52 : public MapdataAccessorBase<MapdataPointInfo, MapdataPointInfo::SData> {
53public:
56
57 void init(const MapdataPointInfo::SData *start, u16 count);
58};
59
60} // namespace Kinoko::System
#define ASSERT(e)
Definition Logger.hh:25
#define STATIC_ASSERT(e)
Definition Logger.hh:15
A stream of data stored in memory.
Definition Stream.hh:81
MapdataPointInfoAccessor(const MapSectionHeader *header)
void init(const MapdataPointInfo::SData *start, u16 count)
void read(EGG::RamStream &stream)
const owning_span< Point > & points() const
A contiguous storage container that manages the lifecycle of a buffer of a given size.
Definition Types.hh:32
High-level handling for generic system operations, such as input reading, race configuration,...
Definition ObjectBase.hh:23
uint8_t u8
Definition Memory.hh:16
uint16_t u16
Definition Memory.hh:17
A 3D float vector.
Definition Vector.hh:108