New Super Mario Bros. U Headers
Loading...
Searching...
No Matches
Bg Class Reference

#include <Bg.h>

Classes

struct  DecorationInfo
struct  Gust

Public Types

enum  GustType : u8 {
  cGustType_Invalid = 0 , cGustType_1 = 1 , cGustType_2 = 2 , cGustType_Spin = 3 ,
  cGustType_Run = 4
}

Public Member Functions

 Bg ()
virtual ~Bg ()
u64 getBgCheckData (u16 x, u16 y, u8 layer, bool with_p_sw=true)
u64 getBgCheckData (f32 x, f32 y, u8 layer, bool with_p_sw=true)
BgUnitCode::HitType getUnitHitType (u16 x, u16 y, u8 layer)
BgUnitCode::HitType getUnitHitType (f32 x, f32 y, u8 layer)
BgUnitCode::Type getUnitType (u16 x, u16 y, u8 layer)
BgUnitCode::Type getUnitType (f32 x, f32 y, u8 layer)
BgUnitCode::TypeInfo getUnitTypeInfo (u16 x, u16 y, u8 layer)
BgUnitCode::TypeInfo getUnitTypeInfo (f32 x, f32 y, u8 layer)
void setUnit (u16 x, u16 y, u32 file, u8 layer, u16 unit)
void setUnitCurrentCdFile (u16 x, u16 y, u8 layer, u16 unit)
void setWaterInWave (const sead::Vector2f &pos, u8 wave_scale)
u8 getNextFlowerIndex ()
void registerGrass (f32 x, f32 y, f32 z, u8, u8 index, u8)
void registerFlower (f32 x, f32 y, f32 z, u8 color, u8 index, u8)
void registerButterfly (f32 x, f32 y, f32 z, u8, u8 index, u8)
void updateFlower (f32 x, f32 y, u8 index, bool enabled)
void deleteFlower (u8 index)
void registerGust (GustType type, const sead::Vector3f &pos, u8, s8 direction)
s8 checkGust (GustType type, const sead::Vector3f &pos, f32 *dist)
 Checks for gusts of wind caused by players affecting grass/flowers.
f32 getWaveSurfaceX (s32 index) const
f32 getWaveSurfaceY (s32 index) const
DecorationInfo & getGrassDecorationInfo (u32 index)
DecorationInfo & getFlowerDecorationInfo (u32 index)
DecorationInfo & getButterflyDecorationInfo (u32 index)
u32 getFlowerCount () const
u8 getFlowerType () const
void setFlowerType (u8 type)
BgDeco & getBgDeco ()

Static Public Member Functions

static u16 * getUnit (u16 x, u16 y, u32 file, u8 layer, s32 *block_idx=nullptr)
static u16 * getUnitCurrentCdFile (u16 x, u16 y, u8 layer, s32 *block_idx=nullptr)

Private Attributes

u32 _10
f32 _14
f32 _18
f32 mWaveSurfaceX [1280]
f32 mWaveSurfaceY [1280]
bool mHasLavaWaves
bool mHasTerrain
u32 _2820
u8 _2824 [0x558]
u8 _2d7c [0x558]
u8 _32d4 [0x88]
u8 _335c [800]
u8 _367c [100]
u8 _36e0 [100]
u32 _3744 [100]
DecorationInfo * mGrassDecorationInfo
DecorationInfo * mFlowerDecorationInfo
DecorationInfo * mButterflyDecorationInfo
u32 mFlowerNo
Gust mGust [40]
sead::Vector2f mFlowerPositions [100]
u8 _3f24 [100]
u32 _3f88
u8 mFlowerType
bool mHasFlowers
BgDeco mBgDeco
u8 _7e20 [0x1D64]

Member Enumeration Documentation

◆ GustType

enum Bg::GustType : u8
Enumerator
cGustType_Invalid 
cGustType_1 
cGustType_2 
cGustType_Spin 
cGustType_Run 

Constructor & Destructor Documentation

◆ Bg()

Bg::Bg ( )

◆ ~Bg()

virtual Bg::~Bg ( )
virtual

Member Function Documentation

◆ getUnit()

u16 * Bg::getUnit ( u16 x,
u16 y,
u32 file,
u8 layer,
s32 * block_idx = nullptr )
static

◆ getUnitCurrentCdFile()

u16 * Bg::getUnitCurrentCdFile ( u16 x,
u16 y,
u8 layer,
s32 * block_idx = nullptr )
static

◆ getBgCheckData() [1/2]

u64 Bg::getBgCheckData ( u16 x,
u16 y,
u8 layer,
bool with_p_sw = true )

◆ getBgCheckData() [2/2]

u64 Bg::getBgCheckData ( f32 x,
f32 y,
u8 layer,
bool with_p_sw = true )
inline

◆ getUnitHitType() [1/2]

BgUnitCode::HitType Bg::getUnitHitType ( u16 x,
u16 y,
u8 layer )

◆ getUnitHitType() [2/2]

BgUnitCode::HitType Bg::getUnitHitType ( f32 x,
f32 y,
u8 layer )
inline

◆ getUnitType() [1/2]

BgUnitCode::Type Bg::getUnitType ( u16 x,
u16 y,
u8 layer )

◆ getUnitType() [2/2]

BgUnitCode::Type Bg::getUnitType ( f32 x,
f32 y,
u8 layer )
inline

◆ getUnitTypeInfo() [1/2]

BgUnitCode::TypeInfo Bg::getUnitTypeInfo ( u16 x,
u16 y,
u8 layer )

◆ getUnitTypeInfo() [2/2]

BgUnitCode::TypeInfo Bg::getUnitTypeInfo ( f32 x,
f32 y,
u8 layer )
inline

◆ setUnit()

void Bg::setUnit ( u16 x,
u16 y,
u32 file,
u8 layer,
u16 unit )

◆ setUnitCurrentCdFile()

void Bg::setUnitCurrentCdFile ( u16 x,
u16 y,
u8 layer,
u16 unit )

◆ setWaterInWave()

void Bg::setWaterInWave ( const sead::Vector2f & pos,
u8 wave_scale )

◆ getNextFlowerIndex()

u8 Bg::getNextFlowerIndex ( )

◆ registerGrass()

void Bg::registerGrass ( f32 x,
f32 y,
f32 z,
u8 ,
u8 index,
u8  )

◆ registerFlower()

void Bg::registerFlower ( f32 x,
f32 y,
f32 z,
u8 color,
u8 index,
u8  )

◆ registerButterfly()

void Bg::registerButterfly ( f32 x,
f32 y,
f32 z,
u8 ,
u8 index,
u8  )

◆ updateFlower()

void Bg::updateFlower ( f32 x,
f32 y,
u8 index,
bool enabled )

◆ deleteFlower()

void Bg::deleteFlower ( u8 index)

◆ registerGust()

void Bg::registerGust ( GustType type,
const sead::Vector3f & pos,
u8 ,
s8 direction )

◆ checkGust()

s8 Bg::checkGust ( GustType type,
const sead::Vector3f & pos,
f32 * dist )

Checks for gusts of wind caused by players affecting grass/flowers.

Returns
0 for nothing, otherwise -1 or 1 for left and right respectively.
Address: 0x02685FB0

◆ getWaveSurfaceX()

f32 Bg::getWaveSurfaceX ( s32 index) const
inline

◆ getWaveSurfaceY()

f32 Bg::getWaveSurfaceY ( s32 index) const
inline

◆ getGrassDecorationInfo()

DecorationInfo & Bg::getGrassDecorationInfo ( u32 index)
inline

◆ getFlowerDecorationInfo()

DecorationInfo & Bg::getFlowerDecorationInfo ( u32 index)
inline

◆ getButterflyDecorationInfo()

DecorationInfo & Bg::getButterflyDecorationInfo ( u32 index)
inline

◆ getFlowerCount()

u32 Bg::getFlowerCount ( ) const
inline

◆ getFlowerType()

u8 Bg::getFlowerType ( ) const
inline

◆ setFlowerType()

void Bg::setFlowerType ( u8 type)
inline

◆ getBgDeco()

BgDeco & Bg::getBgDeco ( )
inline

Member Data Documentation

◆ _10

u32 Bg::_10
private

◆ _14

f32 Bg::_14
private

◆ _18

f32 Bg::_18
private

◆ mWaveSurfaceX

f32 Bg::mWaveSurfaceX[1280]
private

◆ mWaveSurfaceY

f32 Bg::mWaveSurfaceY[1280]
private

◆ mHasLavaWaves

bool Bg::mHasLavaWaves
private

◆ mHasTerrain

bool Bg::mHasTerrain
private

◆ _2820

u32 Bg::_2820
private

◆ _2824

u8 Bg::_2824[0x558]
private

◆ _2d7c

u8 Bg::_2d7c[0x558]
private

◆ _32d4

u8 Bg::_32d4[0x88]
private

◆ _335c

u8 Bg::_335c[800]
private

◆ _367c

u8 Bg::_367c[100]
private

◆ _36e0

u8 Bg::_36e0[100]
private

◆ _3744

u32 Bg::_3744[100]
private

◆ mGrassDecorationInfo

DecorationInfo* Bg::mGrassDecorationInfo
private

◆ mFlowerDecorationInfo

DecorationInfo* Bg::mFlowerDecorationInfo
private

◆ mButterflyDecorationInfo

DecorationInfo* Bg::mButterflyDecorationInfo
private

◆ mFlowerNo

u32 Bg::mFlowerNo
private

◆ mGust

Gust Bg::mGust[40]
private

◆ mFlowerPositions

sead::Vector2f Bg::mFlowerPositions[100]
private

◆ _3f24

u8 Bg::_3f24[100]
private

◆ _3f88

u32 Bg::_3f88
private

◆ mFlowerType

u8 Bg::mFlowerType
private

◆ mHasFlowers

bool Bg::mHasFlowers
private

◆ mBgDeco

BgDeco Bg::mBgDeco
private

◆ _7e20

u8 Bg::_7e20[0x1D64]
private