Kinoko
A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
KartParamFileManager.hh
1
#pragma once
2
3
#include "game/kart/KartParam.hh"
4
5
#include "game/system/ResourceManager.hh"
6
7
namespace
Kart
{
8
12
class
KartParamFileManager
:
EGG::Disposer
{
13
public
:
14
void
clear();
15
void
init
();
16
[[nodiscard]]
EGG::RamStream
getDriverStream(Character character)
const
;
17
[[nodiscard]]
EGG::RamStream
getVehicleStream(Vehicle vehicle)
const
;
18
[[nodiscard]]
EGG::RamStream
getHitboxStream(Vehicle vehicle)
const
;
19
[[nodiscard]]
EGG::RamStream
getBikeDispParamsStream(Vehicle vehicle)
const
;
20
21
static
KartParamFileManager
*CreateInstance();
22
static
void
DestroyInstance();
23
24
[[nodiscard]]
static
KartParamFileManager
*Instance() {
25
return
s_instance;
26
}
27
28
private
:
29
template
<
typename
T>
30
struct
ParamFile
{
31
u32 count;
32
T params[];
33
};
34
35
struct
FileInfo
{
36
void
clear() {
37
file =
nullptr
;
38
size = 0;
39
}
40
41
void
load(
const
char
*filename) {
42
auto
*resourceManager = System::ResourceManager::Instance();
43
file = resourceManager->getFile(filename, &size, System::ArchiveId::Core);
44
}
45
46
void
*file;
47
size_t
size;
48
};
49
50
KartParamFileManager
();
51
~KartParamFileManager
()
override
;
52
53
[[nodiscard]]
bool
validate
()
const
;
54
55
FileInfo
m_kartParam;
// kartParam.bin
56
FileInfo
m_driverParam;
// driverParam.bin
57
FileInfo
m_bikeDispParam;
// bikePartsDispParam.bin
58
59
static
KartParamFileManager
*s_instance;
60
};
61
62
}
// namespace Kart
EGG::Disposer
An interface for ensuring certain structures and classes are destroyed with the heap.
Definition
Disposer.hh:11
EGG::RamStream
A stream of data stored in memory.
Definition
Stream.hh:64
Kart::KartParamFileManager
Abstraction for the process of retrieving kart parameters from files.
Definition
KartParamFileManager.hh:12
Kart::KartParamFileManager::init
void init()
Loads and validates the kart parameter files.
Definition
KartParamFileManager.cc:14
Kart::KartParamFileManager::validate
bool validate() const
Performs a few checks to make sure the files were loaded successfully.
Definition
KartParamFileManager.cc:131
Kart
Pertains to kart-related functionality.
Definition
BoxColManager.hh:6
Kart::KartParamFileManager::FileInfo
Definition
KartParamFileManager.hh:35
Kart::KartParamFileManager::ParamFile
Definition
KartParamFileManager.hh:30
game
kart
KartParamFileManager.hh
Made by
Malleo
. Logo by
vabold
. Website generated by
Doxygen
1.12.0