A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Kinoko::System Namespace Reference

Detailed Description

High-level handling for generic system operations, such as input reading, race configuration, and resource management.

Based off https://github.com/em-eight/mkw/blob/master/source/game/util/Random.cpp.

Concepts

concept  MapdataDerived

Classes

class  CourseMap
 Contains course metadata, notably the starting position. More...
class  DvdArchive
class  GhostFile
 Parsed representation of a binary ghost file. More...
class  KPad
class  KPadController
 An abstraction for a controller object. It is associated with an input state. More...
class  KPadDirector
 The highest level abstraction for controller processing. More...
struct  KPadGhostButtonsStream
 Represents a stream of button inputs from a ghost file. More...
class  KPadGhostController
 The abstraction of a controller object but for ghost playback. More...
struct  KPadGhostDirectionButtonsStream
 A specialized stream for the analog stick. Direction tuples take the following form: More...
struct  KPadGhostFaceButtonsStream
 A specialized stream for button presses (not tricks). More...
struct  KPadGhostTrickButtonsStream
 A specialized stream for D-Pad inputs for tricking and wheeling. Trick tuples take the following form: More...
class  KPadHostController
 The abstraction of a controller object but for external usage. More...
class  KPadPlayer
 A specialized KPad for player input, as opposed to CPU players for example. More...
struct  LinkedCheckpoint
class  MapdataAccessorBase
class  MapdataAreaAccessor
class  MapdataAreaBase
class  MapdataAreaBox
class  MapdataAreaCylinder
class  MapdataCannonPoint
class  MapdataCannonPointAccessor
class  MapdataCheckPath
class  MapdataCheckPathAccessor
class  MapdataCheckPoint
class  MapdataCheckPointAccessor
class  MapdataFileAccessor
class  MapdataGeoObj
class  MapdataGeoObjAccessor
class  MapdataJugemPoint
 This class represents the course's respawn positions. More...
class  MapdataJugemPointAccessor
class  MapdataPointInfo
class  MapdataPointInfoAccessor
class  MapdataStageInfo
class  MapdataStageInfoAccessor
class  MapdataStartPoint
class  MapdataStartPointAccessor
struct  MapSectionHeader
class  MultiDvdArchive
class  RaceConfig
 Initializes the player with parameters specified in the provided ghost file. More...
struct  RaceInputState
 Represents a set of controller inputs. More...
class  RaceManager
 Manages the timers that track the stages of a race. Also acts as the interface between the physics engine and CourseMap. More...
class  Random
class  RawGhostFile
 The binary data of a ghost saved to a file. More...
class  ResourceManager
 Highest level abstraction for archive management and subsequent file retrieval. More...
struct  Timer
 A simple struct to represent a lap or race finish time. More...
class  TimerManager
 Manages the race timer to create lap splits and final times. More...

Typedefs

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

Enumerations

enum class  ControlSource {
  Unknown = -1 ,
  Core = 0 ,
  Freestyle = 1 ,
  Classic = 2 ,
  Gamecube = 3 ,
  Ghost = 4 ,
  AI = 5 ,
  Host = 6
}
enum class  Trick {
  None = 0 ,
  Up = 1 ,
  Down = 2 ,
  Left = 3 ,
  Right = 4
}
enum class  ArchiveId {
  Core = 0 ,
  Course = 1
}

Functions

 STATIC_ASSERT (sizeof(RawGhostFile)==0x2800)
static constexpr f32 RawStickToState (u8 rawStick)
 Converts a raw stick input into an input usable by the state.

Variables

static constexpr size_t RKG_HEADER_SIZE = 0x88
static constexpr size_t RKG_UNCOMPRESSED_INPUT_DATA_SECTION_SIZE = 0x2774
static constexpr s8 X_TRANSLATION_TABLE [12][12]
static constexpr s8 Z_TRANSLATION_TABLE [12][12]
static size_t SUFFIX_SIZE = 8
static const char *const RESOURCE_PATHS []

Typedef Documentation

◆ InitCallback

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

Definition at line 57 of file Context.hh.

Enumeration Type Documentation

◆ ArchiveId

enum class Kinoko::System::ArchiveId
strong

Definition at line 15 of file ResourceManager.hh.

◆ ControlSource

enum class Kinoko::System::ControlSource
strong

Definition at line 16 of file KPadController.hh.

◆ Trick

enum class Kinoko::System::Trick
strong

Definition at line 27 of file KPadController.hh.

Function Documentation

◆ RawStickToState()

constexpr f32 Kinoko::System::RawStickToState ( u8 rawStick)
staticnodiscardconstexpr

Converts a raw stick input into an input usable by the state.

Parameters
rawStickThe raw stick input to convert.
Returns
The converted input.

Definition at line 12 of file KPadController.hh.

Variable Documentation

◆ RESOURCE_PATHS

const char* const Kinoko::System::RESOURCE_PATHS[]
static
Initial value:
= {
"/Race/Common",
nullptr,
}

Definition at line 9 of file ResourceManager.cc.

◆ RKG_HEADER_SIZE

size_t Kinoko::System::RKG_HEADER_SIZE = 0x88
staticconstexpr

Definition at line 11 of file GhostFile.hh.

◆ RKG_UNCOMPRESSED_INPUT_DATA_SECTION_SIZE

size_t Kinoko::System::RKG_UNCOMPRESSED_INPUT_DATA_SECTION_SIZE = 0x2774
staticconstexpr

Definition at line 12 of file GhostFile.hh.

◆ SUFFIX_SIZE

size_t Kinoko::System::SUFFIX_SIZE = 8
static

Definition at line 7 of file MultiDvdArchive.cc.

◆ X_TRANSLATION_TABLE

s8 Kinoko::System::X_TRANSLATION_TABLE[12][12]
staticconstexpr
Initial value:
= {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{-5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{-10, 0, 10, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{-10, 5, -5, 10, 0, 0, 0, 0, 0, 0, 0, 0},
{-10, 0, 10, -5, 5, 0, 0, 0, 0, 0, 0, 0},
{-10, -2, 6, -6, 2, 10, 0, 0, 0, 0, 0, 0},
{-5, 5, -10, 0, 10, -5, 5, 0, 0, 0, 0, 0},
{-10, 0, 10, -5, 5, -10, 0, 10, 0, 0, 0, 0},
{-10, -2, 6, -6, 2, 10, -10, -2, 6, 0, 0, 0},
{-10, 0, 10, -5, 5, -10, 0, 10, -5, 5, 0, 0},
{-10, -2, 6, -6, 2, 10, -10, -2, 6, -6, 2, 0},
{-10, -2, 6, -6, 2, 10, -10, -2, 6, -6, 2, 10},
}

Definition at line 12 of file MapdataStartPoint.cc.

◆ Z_TRANSLATION_TABLE

s8 Kinoko::System::Z_TRANSLATION_TABLE[12][12]
staticconstexpr
Initial value:
= {
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0},
{0, 0, 1, 1, 1, 2, 2, 0, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 2, 2, 2, 0, 0, 0, 0},
{0, 0, 0, 1, 1, 1, 2, 2, 2, 0, 0, 0},
{0, 0, 0, 1, 1, 2, 2, 2, 3, 3, 0, 0},
{0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 0},
{0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3},
}

Definition at line 27 of file MapdataStartPoint.cc.