A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
KReplaySystem.hh
1#pragma once
2
3#include "host/KSystem.hh"
4
5#include <egg/core/SceneManager.hh>
6
7#include <game/system/RaceConfig.hh>
8
9namespace Kinoko {
10
12class KReplaySystem : public KSystem {
13public:
14 void init() override;
15 void calc() override;
16 bool run() override;
17 void parseOptions(int argc, char **argv) override;
18
19 static KReplaySystem *CreateInstance();
20 static void DestroyInstance();
21
22 static KReplaySystem *Instance() {
23 return static_cast<KReplaySystem *>(s_instance);
24 }
25
26private:
27 typedef std::pair<const System::Timer &, const System::Timer &> DesyncingTimerPair;
28
29 KReplaySystem();
30 KReplaySystem(const KReplaySystem &) = delete;
31 KReplaySystem(KReplaySystem &&) = delete;
32 ~KReplaySystem() override;
33
34 bool calcEnd() const;
35 void reportFail(const std::string &msg) const;
36
37 bool success() const;
38 s32 getDesyncingTimerIdx() const;
39 DesyncingTimerPair getDesyncingTimer(s32 i) const;
40
41 static void OnInit(System::RaceConfig *config, void *arg);
42
43 EGG::SceneManager *m_sceneMgr;
44
45 const char *m_currentGhostFileName;
46 const System::GhostFile *m_currentGhost;
47 const u8 *m_currentRawGhost;
48 size_t m_currentRawGhostSize;
49};
50
51} // namespace Kinoko
Manages the scene stack and transitions between scenes.
s32 getDesyncingTimerIdx() const
Finds the desyncing timer index, if one exists.
void parseOptions(int argc, char **argv) override
Parses non-generic command line options.
void reportFail(const std::string &msg) const
Reports failure to file.
bool calcEnd() const
Determines whether or not the ghost simulation should end.
bool run() override
Executes a run.
static void OnInit(System::RaceConfig *config, void *arg)
Initializes the race configuration as needed for replays.
DesyncingTimerPair getDesyncingTimer(s32 i) const
Gets the desyncing timer according to the index.
bool success() const
Determines whether the simulation was a success or not.
void calc() override
Executes a frame.
void init() override
Initializes the system.
Base interface for a Kinoko system.
Definition KSystem.hh:10
Parsed representation of a binary ghost file.
Definition GhostFile.hh:77
Initializes the player with parameters specified in the provided ghost file.
Definition RaceConfig.hh:23