A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
KPadDirector.cc
1#include "KPadDirector.hh"
2
3namespace System {
4
6void KPadDirector::calc() {
7 calcPads();
8 m_playerInput.calc();
9}
10
12void KPadDirector::calcPads() {
13 m_ghostController->calc();
14 m_hostController->calc();
15}
16
18void KPadDirector::reset() {
19 m_playerInput.reset();
20}
21
23void KPadDirector::startGhostProxies() {
24 m_playerInput.startGhostProxy();
25}
26
28void KPadDirector::endGhostProxies() {
29 m_playerInput.endGhostProxy();
30}
31
33void KPadDirector::setGhostPad(const u8 *inputs, bool driftIsAuto) {
34 m_playerInput.setGhostController(m_ghostController, inputs, driftIsAuto);
35}
36
37void KPadDirector::setHostPad(bool driftIsAuto) {
38 m_playerInput.setHostController(m_hostController, driftIsAuto);
39}
40
42KPadDirector *KPadDirector::CreateInstance() {
43 ASSERT(!s_instance);
44 return s_instance = new KPadDirector;
45}
46
48void KPadDirector::DestroyInstance() {
49 ASSERT(s_instance);
50 auto *instance = s_instance;
51 s_instance = nullptr;
52 delete instance;
53}
54
56KPadDirector::KPadDirector() {
57 m_ghostController = new KPadGhostController;
58 m_hostController = new KPadHostController;
59}
60
62KPadDirector::~KPadDirector() {
63 if (s_instance) {
64 s_instance = nullptr;
65 WARN("KPadDirector instance not explicitly handled!");
66 }
67}
68
69KPadDirector *KPadDirector::s_instance = nullptr;
70
71} // namespace System
void startGhostProxy()
Signals to start reading ghost data after fade-in.
void endGhostProxy()
Signals to stop reading ghost data after race completion.
High-level handling for generic system operations, such as input reading, race configuration,...
Definition CourseMap.cc:5