A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
ResourceManager.hh
1#pragma once
2
3#include "game/system/MultiDvdArchive.hh"
4
5namespace System {
6
7enum class ArchiveId {
8 Core = 0,
9 Course = 1,
10};
11
17public:
18 void *getFile(const char *filename, size_t *size, ArchiveId id);
19 void *getBsp(Vehicle vehicle, size_t *size);
20 [[nodiscard]] MultiDvdArchive *load(Course courseId);
21 [[nodiscard]] MultiDvdArchive *load(s32 idx, const char *filename);
22 void unmount(MultiDvdArchive *archive);
23
25 [[nodiscard]] static const char *GetVehicleName(Vehicle vehicle) {
26 return vehicle < Vehicle::Max ? VEHICLE_NAMES[static_cast<u8>(vehicle)] : nullptr;
27 }
28
29 static ResourceManager *CreateInstance();
30 static void DestroyInstance();
31
32 [[nodiscard]] static ResourceManager *Instance() {
33 return s_instance;
34 }
35
36private:
38 ~ResourceManager() override;
39
40 // 0: Core archive
41 // 1: Course archive
42 MultiDvdArchive **m_archives;
43
44 [[nodiscard]] static MultiDvdArchive *Create(u8 i);
45 static ResourceManager *s_instance;
46};
47
48} // namespace System
An interface for ensuring certain structures and classes are destroyed with the heap.
Definition Disposer.hh:11
Highest level abstraction for archive management and subsequent file retrieval.
High-level handling for generic system operations, such as input reading, race configuration,...
Definition CourseMap.cc:5