Loading [MathJax]/extensions/tex2jax.js
A reimplementation of Mario Kart Wii's physics engine in C++
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages Concepts
MapdataGeoObj.cc
1#include "MapdataGeoObj.hh"
2
3namespace System {
4
5MapdataGeoObj::MapdataGeoObj(const SData *data) : m_rawData(data) {
6 EGG::RamStream stream = EGG::RamStream(data, sizeof(SData));
7 read(stream);
8}
9
10void MapdataGeoObj::read(EGG::Stream &stream) {
11 m_id = stream.read_u16();
12 stream.skip(2);
13 m_pos.read(stream);
14 m_rot.read(stream);
15 m_scale.read(stream);
16 m_pathId = stream.read_s16();
17
18 for (auto &setting : m_settings) {
19 setting = stream.read_u16();
20 }
21
22 m_presenceFlag = stream.read_u16();
23}
24
25MapdataGeoObjAccessor::MapdataGeoObjAccessor(const MapSectionHeader *header)
26 : MapdataAccessorBase<MapdataGeoObj, MapdataGeoObj::SData>(header) {
27 init(reinterpret_cast<const MapdataGeoObj::SData *>(m_sectionHeader + 1),
28 parse<u16>(m_sectionHeader->count));
29}
30
31MapdataGeoObjAccessor::~MapdataGeoObjAccessor() = default;
32
33} // namespace System
A stream of data stored in memory.
Definition Stream.hh:64
A stream of data, abstracted to allow for continuous seeking.
Definition Stream.hh:10
High-level handling for generic system operations, such as input reading, race configuration,...
Definition CourseMap.cc:5