A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
Common.hh File Reference

Detailed Description

This header houses common data types such as our integral types and enums.

Definition in file Common.hh.

Go to the source code of this file.

Classes

struct  Kinoko::is_derived_from_template< Base, Derived >
 Helper template which uses function overloading and implicit up-casting to determine whether or not a class is derived from a templated base class (i.e. MapdataPointInfoAccessor derives from MapdataAccessorBase). See: https://en.cppreference.com/w/cpp/language/sfinae. More...
 

Concepts

concept  Kinoko::IntegralType
 
concept  Kinoko::ParseableType
 

Enumerations

enum class  Course {
  Mario_Circuit = 0 ,
  Moo_Moo_Meadows = 1 ,
  Mushroom_Gorge = 2 ,
  Grumble_Volcano = 3 ,
  Toads_Factory = 4 ,
  Coconut_Mall = 5 ,
  DK_Summit = 6 ,
  Wario_Gold_Mine = 7 ,
  Luigi_Circuit = 8 ,
  Daisy_Circuit = 9 ,
  Moonview_Highway = 10 ,
  Maple_Treeway = 11 ,
  Bowsers_Castle = 12 ,
  Rainbow_Road = 13 ,
  Dry_Dry_Ruins = 14 ,
  Koopa_Cape = 15 ,
  GCN_Peach_Beach = 16 ,
  GCN_Mario_Circuit = 17 ,
  GCN_Waluigi_Stadium = 18 ,
  GCN_DK_Mountain = 19 ,
  DS_Yoshi_Falls = 20 ,
  DS_Desert_Hills = 21 ,
  DS_Peach_Gardens = 22 ,
  DS_Delfino_Square = 23 ,
  SNES_Mario_Circuit_3 = 24 ,
  SNES_Ghost_Valley_2 = 25 ,
  N64_Mario_Raceway = 26 ,
  N64_Sherbet_Land = 27 ,
  N64_Bowsers_Castle = 28 ,
  N64_DKs_Jungle_Parkway = 29 ,
  GBA_Bowser_Castle_3 = 30 ,
  GBA_Shy_Guy_Beach = 31 ,
  Delfino_Pier = 32 ,
  Block_Plaza = 33 ,
  Chain_Chomp_Roulette = 34 ,
  Funky_Stadium = 35 ,
  Thwomp_Desert = 36 ,
  GCN_Cookie_Land = 37 ,
  DS_Twilight_House = 38 ,
  SNES_Battle_Course_4 = 39 ,
  GBA_Battle_Course_3 = 40 ,
  N64_Skyscraper = 41 ,
  Galaxy_Colosseum = 54 ,
  Win_Demo = 55 ,
  Lose_Demo = 56 ,
  Draw_Demo = 57 ,
  Ending_Demo = 58
}
 
enum class  Vehicle {
  Standard_Kart_S = 0 ,
  Standard_Kart_M = 1 ,
  Standard_Kart_L = 2 ,
  Baby_Booster = 3 ,
  Classic_Dragster = 4 ,
  Offroader = 5 ,
  Mini_Beast = 6 ,
  Wild_Wing = 7 ,
  Flame_Flyer = 8 ,
  Cheep_Charger = 9 ,
  Super_Blooper = 10 ,
  Piranha_Prowler = 11 ,
  Tiny_Titan = 12 ,
  Daytripper = 13 ,
  Jetsetter = 14 ,
  Blue_Falcon = 15 ,
  Sprinter = 16 ,
  Honeycoupe = 17 ,
  Standard_Bike_S = 18 ,
  Standard_Bike_M = 19 ,
  Standard_Bike_L = 20 ,
  Bullet_Bike = 21 ,
  Mach_Bike = 22 ,
  Flame_Runner = 23 ,
  Bit_Bike = 24 ,
  Sugarscoot = 25 ,
  Wario_Bike = 26 ,
  Quacker = 27 ,
  Zip_Zip = 28 ,
  Shooting_Star = 29 ,
  Magikruiser = 30 ,
  Sneakster = 31 ,
  Spear = 32 ,
  Jet_Bubble = 33 ,
  Dolphin_Dasher = 34 ,
  Phantom = 35 ,
  Max = 36
}
 
enum class  Character {
  Mario = 0 ,
  Baby_Peach = 1 ,
  Waluigi = 2 ,
  Bowser = 3 ,
  Baby_Daisy = 4 ,
  Dry_Bones = 5 ,
  Baby_Mario = 6 ,
  Luigi = 7 ,
  Toad = 8 ,
  Donkey_Kong = 9 ,
  Yoshi = 10 ,
  Wario = 11 ,
  Baby_Luigi = 12 ,
  Toadette = 13 ,
  Koopa_Troopa = 14 ,
  Daisy = 15 ,
  Peach = 16 ,
  Birdo = 17 ,
  Diddy_Kong = 18 ,
  King_Boo = 19 ,
  Bowser_Jr = 20 ,
  Dry_Bowser = 21 ,
  Funky_Kong = 22 ,
  Rosalina = 23 ,
  Small_Mii_Outfit_A_Male = 24 ,
  Small_Mii_Outfit_A_Female = 25 ,
  Small_Mii_Outfit_B_Male = 26 ,
  Small_Mii_Outfit_B_Female = 27 ,
  Small_Mii_Outfit_C_Male = 28 ,
  Small_Mii_Outfit_C_Female = 29 ,
  Medium_Mii_Outfit_A_Male = 30 ,
  Medium_Mii_Outfit_A_Female = 31 ,
  Medium_Mii_Outfit_B_Male = 32 ,
  Medium_Mii_Outfit_B_Female = 33 ,
  Medium_Mii_Outfit_C_Male = 34 ,
  Medium_Mii_Outfit_C_Female = 35 ,
  Large_Mii_Outfit_A_Male = 36 ,
  Large_Mii_Outfit_A_Female = 37 ,
  Large_Mii_Outfit_B_Male = 38 ,
  Large_Mii_Outfit_B_Female = 39 ,
  Large_Mii_Outfit_C_Male = 40 ,
  Large_Mii_Outfit_C_Female = 41 ,
  Medium_Mii = 42 ,
  Small_Mii = 43 ,
  Large_Mii = 44 ,
  Peach_Biker_Outfit = 45 ,
  Daisy_Biker_Outfit = 46 ,
  Rosalina_Biker_Outfit = 47 ,
  Max = 48
}
 
enum class  WeightClass {
  Invalid = -1 ,
  Light = 0 ,
  Medium = 1 ,
  Heavy = 2
}
 
enum class  GroupID : u16 {
  None = 0 ,
  Race = 1 ,
  Gfx = 2 ,
  Kart = 3 ,
  Object = 4 ,
  Course = 5 ,
  UI = 6 ,
  Effect = 7 ,
  Sound = 8 ,
  Resource = 10 ,
  HomeMenu = 11 ,
  Item = 12 ,
  Net = 13
}
 

Functions

static constexpr WeightClass Kinoko::CharacterToWeight (Character character)
 
static constexpr WeightClass Kinoko::VehicleToWeight (Vehicle vehicle)
 
 Kinoko::STATIC_ASSERT (std::numeric_limits< f32 >::epsilon()==1.0f/8388608.0f)
 
 Kinoko::STATIC_ASSERT (std::endian::native==std::endian::big||std::endian::native==std::endian::little)
 
template<IntegralType T>
static T Kinoko::form (const u8 *data)
 
template<ParseableType T>
static constexpr T Kinoko::parse (T val, std::endian endian=std::endian::big)
 
static constexpr u32 Kinoko::f2u (f32 val)
 

Variables

static constexpr const char * Kinoko::COURSE_NAMES [59]
 
static constexpr const char * Kinoko::VEHICLE_NAMES [36]
 
template<template< typename... > class Base, typename Derived >
constexpr bool Kinoko::is_derived_from_template_v = is_derived_from_template<Base, Derived>::value
 
static constexpr size_t Kinoko::MEMORY_SPACE_SIZE = 0x1000000
 
static constexpr auto Kinoko::DEFAULT_OPT
 

Enumeration Type Documentation

◆ Character

enum class Kinoko::Character
strong

Definition at line 106 of file Common.hh.

◆ Course

enum class Kinoko::Course
strong

Definition at line 16 of file Common.hh.

◆ GroupID

enum class Kinoko::GroupID : u16
strong

Definition at line 165 of file Common.hh.

◆ Vehicle

enum class Kinoko::Vehicle
strong

Definition at line 66 of file Common.hh.

◆ WeightClass

enum class Kinoko::WeightClass
strong

Definition at line 158 of file Common.hh.

Function Documentation

◆ CharacterToWeight()

static constexpr WeightClass Kinoko::CharacterToWeight ( Character character)
staticconstexpr

Definition at line 181 of file Common.hh.

◆ f2u()

static constexpr u32 Kinoko::f2u ( f32 val)
inlinestaticconstexpr

Definition at line 416 of file Common.hh.

◆ form()

template<IntegralType T>
static T Kinoko::form ( const u8 * data)
inlinestatic

Definition at line 393 of file Common.hh.

◆ parse()

template<ParseableType T>
static constexpr T Kinoko::parse ( T val,
std::endian endian = std::endian::big )
inlinestaticconstexpr

Definition at line 403 of file Common.hh.

◆ VehicleToWeight()

static constexpr WeightClass Kinoko::VehicleToWeight ( Vehicle vehicle)
staticconstexpr

Definition at line 215 of file Common.hh.

Variable Documentation

◆ COURSE_NAMES

const char* Kinoko::COURSE_NAMES[59]
staticconstexpr

Definition at line 261 of file Common.hh.

◆ DEFAULT_OPT

auto Kinoko::DEFAULT_OPT
staticconstexpr
Initial value:
= Abstract::Memory::MEMiHeapHead::OptFlag().setBit(
Abstract::Memory::MEMiHeapHead::eOptFlag::ZeroFillAlloc)

Definition at line 427 of file Common.hh.

◆ is_derived_from_template_v

template<template< typename... > class Base, typename Derived >
bool Kinoko::is_derived_from_template_v = is_derived_from_template<Base, Derived>::value
inlineconstexpr

Definition at line 382 of file Common.hh.

◆ MEMORY_SPACE_SIZE

size_t Kinoko::MEMORY_SPACE_SIZE = 0x1000000
staticconstexpr

Definition at line 421 of file Common.hh.

◆ VEHICLE_NAMES

const char* Kinoko::VEHICLE_NAMES[36]
staticconstexpr

Definition at line 323 of file Common.hh.