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 Host {
6
7class Context;
8
9} // namespace Host
10
11namespace System {
12
13enum class ArchiveId {
14 Core = 0,
15 Course = 1,
16};
17
23 friend class Host::Context;
24
25public:
26 void *getFile(const char *filename, size_t *size, ArchiveId id);
27 void *getBsp(Vehicle vehicle, size_t *size);
28 [[nodiscard]] MultiDvdArchive *load(Course courseId);
29 [[nodiscard]] MultiDvdArchive *load(s32 idx, const char *filename);
30 void unmount(MultiDvdArchive *archive);
31
33 [[nodiscard]] static const char *GetVehicleName(Vehicle vehicle) {
34 return vehicle < Vehicle::Max ? VEHICLE_NAMES[static_cast<u8>(vehicle)] : nullptr;
35 }
36
37 static ResourceManager *CreateInstance();
38 static void DestroyInstance();
39
40 [[nodiscard]] static ResourceManager *Instance() {
41 return s_instance;
42 }
43
44private:
46 ~ResourceManager() override;
47
48 // 0: Core archive
49 // 1: Course archive
50 MultiDvdArchive **m_archives;
51
52 [[nodiscard]] static MultiDvdArchive *Create(u8 i);
53 static ResourceManager *s_instance;
54};
55
56} // namespace System
An interface for ensuring certain structures and classes are destroyed with the heap.
Definition Disposer.hh:11
Contexts can be used to restore a previous memory state for the current session.
Definition Context.hh:59
Highest level abstraction for archive management and subsequent file retrieval.
Represents the host application.
Definition HeapCommon.hh:9
High-level handling for generic system operations, such as input reading, race configuration,...
Definition CourseMap.cc:5