A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
System::RaceConfig Class Reference0x809BD728

#include <RaceConfig.hh>

Description

Initializes the player with parameters specified in the provided ghost file.

In the base game, this class is responsible for managing the race and menu scenarios. The menu scenario mostly pertains to character and vehicle selection in the menus prior to starting a race. In Kinoko, we don't have these menus, so we initialize the race directly through this class.

Definition at line 15 of file RaceConfig.hh.

Inheritance diagram for System::RaceConfig:

Classes

struct  Player
 
struct  Scenario
 

Public Types

typedef std::function< void(RaceConfig *, void *)> InitCallback
 

Public Member Functions

void init ()
 
void initRace ()
 
void initControllers ()
 Initializes the controllers.
 
void initGhost ()
 Initializes the ghost.
 
const ScenarioraceScenario () const
 
ScenarioraceScenario ()
 
void setGhost (const u8 *rkg)
 

Static Public Member Functions

static void RegisterInitCallback (const InitCallback &callback, void *arg)
 
static RaceConfigCreateInstance ()
 
static void DestroyInstance ()
 
static RaceConfigInstance ()
 

Private Attributes

Scenario m_raceScenario
 
RawGhostFile m_ghost
 

Static Private Attributes

static RaceConfigs_instance = nullptr
 
static InitCallback s_onInitCallback = nullptr
 Host-agnostic way of initializing RaceConfig. The type of the first player must be set to either Local or Ghost.
 
static void * s_onInitCallbackArg = nullptr
 The argument sent into the callback. This is expected to be reinterpret_casted.
 

Additional Inherited Members

- Private Member Functions inherited from EGG::Disposer
- Static Private Member Functions inherited from EGG::Disposer
static constexpr u16 getLinkOffset ()
 

Member Typedef Documentation

◆ InitCallback

std::function<void(RaceConfig *, void *)> System::RaceConfig::InitCallback

Definition at line 45 of file RaceConfig.hh.

Member Function Documentation

◆ ~RaceConfig()

System::RaceConfig::~RaceConfig ( )
overrideprivate0x80530038

Definition at line 78 of file RaceConfig.cc.

◆ CreateInstance()

RaceConfig * System::RaceConfig::CreateInstance ( )
static0x8052FE58

Definition at line 60 of file RaceConfig.cc.

◆ DestroyInstance()

void System::RaceConfig::DestroyInstance ( )
static0x8052FFE8

Definition at line 67 of file RaceConfig.cc.

◆ init()

void System::RaceConfig::init ( )
0x8052DD40

Definition at line 10 of file RaceConfig.cc.

◆ initControllers()

void System::RaceConfig::initControllers ( )
0x8052F4E8

Initializes the controllers.

This is normally scoped within RaceConfig::Scenario, but Kinoko doesn't support menus.

Definition at line 30 of file RaceConfig.cc.

◆ initGhost()

void System::RaceConfig::initGhost ( )
0x8052EEF0

Initializes the ghost.

This is normally scoped within RaceConfig::Scenario, but Kinoko doesn't support menus.

Definition at line 47 of file RaceConfig.cc.

◆ initRace()

void System::RaceConfig::initRace ( )
0x805302C4

Normally we copy the menu scenario into the race scenario. However, Kinoko doesn't support menus, so we use a callback.

Definition at line 17 of file RaceConfig.cc.

◆ Instance()

static RaceConfig * System::RaceConfig::Instance ( )
inlinestaticnodiscard

Definition at line 72 of file RaceConfig.hh.

◆ raceScenario() [1/2]

Scenario & System::RaceConfig::raceScenario ( )
inlinenodiscard

Definition at line 56 of file RaceConfig.hh.

◆ raceScenario() [2/2]

const Scenario & System::RaceConfig::raceScenario ( ) const
inlinenodiscard

Definition at line 52 of file RaceConfig.hh.

◆ RegisterInitCallback()

static void System::RaceConfig::RegisterInitCallback ( const InitCallback & callback,
void * arg )
inlinestatic

Definition at line 64 of file RaceConfig.hh.

◆ setGhost()

void System::RaceConfig::setGhost ( const u8 * rkg)
inline

Definition at line 60 of file RaceConfig.hh.

Member Data Documentation

◆ m_ghost

RawGhostFile System::RaceConfig::m_ghost
private

Definition at line 81 of file RaceConfig.hh.

◆ m_raceScenario

Scenario System::RaceConfig::m_raceScenario
private

Definition at line 80 of file RaceConfig.hh.

◆ s_instance

RaceConfig * System::RaceConfig::s_instance = nullptr
staticprivate0x809BD728

Definition at line 83 of file RaceConfig.hh.

◆ s_onInitCallback

RaceConfig::InitCallback System::RaceConfig::s_onInitCallback = nullptr
staticprivate

Host-agnostic way of initializing RaceConfig. The type of the first player must be set to either Local or Ghost.

  • If the type is Ghost, m_ghost must be set to a decompressed ghost file.
  • If the type is Local, the race scenario's course and the first player's character, vehicle, and driftIsAuto must be set.

Definition at line 84 of file RaceConfig.hh.

◆ s_onInitCallbackArg

void * System::RaceConfig::s_onInitCallbackArg = nullptr
staticprivate

The argument sent into the callback. This is expected to be reinterpret_casted.

Definition at line 85 of file RaceConfig.hh.