A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ResFile.hh
1#pragma once
2
3#include "abstract/g3d/ResAnmChr.hh"
4#include "abstract/g3d/ResDic.hh"
5
6// Credit: kiwi515/ogws
7
8namespace Kinoko::Abstract::g3d {
9
14class ResFile {
15public:
18 ResBlockHeaderData header;
19 ResDic::Data topLevel;
20 };
21
22 struct Data {
23 ResFileHeaderData header;
25 };
26
27 ResFile(const void *data) : m_data(reinterpret_cast<const Data *>(data)) {}
28
31 [[nodiscard]] ResAnmChr resAnmChr(const char *pName) const {
32 ResDic dic = ResDic(&m_data->dict.topLevel);
33 void *dicData = dic["AnmChr(NW4R)"];
34 ASSERT(dicData);
35 void *anmChrData = ResDic(dicData)[pName];
36 ASSERT(anmChrData);
37 return ResAnmChr(anmChrData);
38 }
39
40private:
41 const Data *m_data;
42};
43
44} // namespace Kinoko::Abstract::g3d
Represents the CHR0 file format, which pertains to model movement animations.
Definition ResAnmChr.hh:46
Essentially a lookup table to find different sections within the resource file.
Definition ResDic.hh:12
Represents a binary resource file which contains object models, textures, and animations.
Definition ResFile.hh:14
ResAnmChr resAnmChr(const char *pName) const
Retrieves the AnmChr section from the binary file.
Definition ResFile.hh:31
The "root" section of the file.
Definition ResFile.hh:17