A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Context.hh
1#pragma once
2
3#include "Common.hh"
4
5#include <filesystem>
6#include <functional>
7#include <optional>
8
9namespace Kinoko {
10
11class KSystem;
12
13namespace Abstract::g3d {
14class FrameCtrl;
15class ResAnmChr;
16} // namespace Abstract::g3d
17
18namespace Abstract::Memory {
19class MEMList;
20} // namespace Abstract::Memory
21
22namespace EGG {
23class Archive;
24class Heap;
25class SceneManager;
26} // namespace EGG
27
28namespace Field {
29class BoxColManager;
30class CollisionDirector;
31class CourseColMgr;
32class ObjectCollisionBase;
33class ObjectDirector;
34class ObjectDrivableDirector;
35class JugemDirector;
36class RailManager;
37} // namespace Field
38
39namespace Item {
40class ItemDirector;
41} // namespace Item
42
43namespace Kart {
44class KartObjectManager;
45class KartParamFileManager;
46} // namespace Kart
47
48namespace Render {
49class KartCamera;
50} // namespace Render
51
52namespace System {
53class CourseMap;
54class KPadDirector;
55class KPadHostController;
56class RaceConfig;
57typedef std::function<void(RaceConfig *, void *)> InitCallback;
58class RaceInputState;
59class RaceManager;
60class ResourceManager;
61class KSystem;
62} // namespace System
63
64namespace Host {
65
71class Context {
72public:
73 Context();
74 Context(const Context &c);
75 Context(Context &&c);
76 ~Context();
77
78 Context &operator=(const Context &rhs);
79 Context &operator=(Context &&rhs);
80
81 bool operator==(const Context &rhs) const;
82
83 static void SetActiveContext(const Context &rhs);
84
85private:
86 struct Statics {
88 Abstract::Memory::MEMList m_archiveList;
90 EGG::Heap *m_currentHeap;
91 EGG::Heap *m_allocatableHeap;
92 EGG::Heap *m_heapForCreateScene;
93 u16 m_heapOptionFlg;
94 EGG::Heap *m_rootHeap;
95 Field::BoxColManager *m_boxColMgr;
97 Field::CourseColMgr *m_courseColMgr;
98 Field::JugemDirector *m_jugemDir;
99 Field::ObjectDirector *m_objDir;
100 Field::ObjectDrivableDirector *m_objDrivableDir;
101 Field::RailManager *m_railMgr;
102 Item::ItemDirector *m_itemDir;
103 Kart::KartObjectManager *m_kartObjMgr;
104 Kart::KartParamFileManager *m_paramFileMgr;
105 System::CourseMap *m_courseMap;
106 System::KPadDirector *m_padDir;
107 System::RaceConfig *m_raceConfig;
108 System::InitCallback m_onInitCallback;
109 void *m_onInitCallbackArg;
110 System::RaceManager *m_raceMgr;
111 System::ResourceManager *m_resMgr;
112 Render::KartCamera *m_kartCamera;
113 Abstract::g3d::ResAnmChr *m_thunderScaleUpAnmChr;
114 Abstract::g3d::ResAnmChr *m_thunderScaleDownAnmChr;
115 Abstract::g3d::ResAnmChr *m_pressScaleUpAnmChr;
116 f32 m_frameCtrlBaseUpdateRate;
117 std::array<std::array<f32, 4>, 4> m_dotProductCache;
118 f32 m_wanwanMaxPitch;
119 f32 m_basabasaInitialXRange;
120 f32 m_basabasaInitialYRange;
121 u32 m_flamePoleCount;
122 };
123
124 void *m_contextMemory;
125 Statics m_statics;
126};
127
128} // namespace Host
129
130} // namespace Kinoko
This header houses common data types such as our integral types and enums.
Represents the CHR0 file format, which pertains to model movement animations.
Definition ResAnmChr.hh:46
A high-level representation of a memory heap for managing dynamic memory allocation....
Definition Heap.hh:24
Spatial indexing manager for entities with dynamic collision.
Manages the caching of colliding KCL triangles and exposes queries for collision checks.
Manager for course KCL interactions.
Manager class for the lifecycle of Jugem objects for players.
Contexts can be used to restore a previous memory state for the current session.
Definition Context.hh:71
Responsible for the lifecycle and calculation of KartObjects.
Abstraction for the process of retrieving kart parameters from files.
Manager class for the forward and backwards cameras.
Definition KartCamera.hh:43
Contains course metadata, notably the starting position.
Definition CourseMap.hh:35
The highest level abstraction for controller processing.
Initializes the player with parameters specified in the provided ghost file.
Definition RaceConfig.hh:23
Manages the timers that track the stages of a race. Also acts as the interface between the physics en...
Highest level abstraction for archive management and subsequent file retrieval.
Intrusive doubly-linked list. Links are placed within the corresponding object.
Definition List.hh:14