sead
Loading...
Searching...
No Matches
sead::ControllerBase Class Reference

#include <seadControllerBase.h>

Inherited by sead::Controller, and sead::ControllerWrapperBase.

Public Member Functions

 ControllerBase (s32 padBitMax, s32 leftStickCrossStartBit, s32 rightStickCrossStartBit, s32 touchKeyBit)
u32 getHoldMask () const
u32 getTrigMask () const
u32 getReleaseMask () const
u32 getRepeatMask () const
u32 getTrigMaskWithRepeat () const
u32 getPadHoldCount (s32 bit) const
const Vector2fgetLeftStick () const
const Vector2fgetRightStick () const
f32 getLeftAnalogTrigger () const
f32 getRightAnalogTrigger () const
const Vector2fgetPointer () const
const Vector2igetPointerPrev () const
bool isPointerOn () const
bool isPointerOnNow () const
bool isPointerOffNow () const
bool isPointerUnkFlag3 () const
bool isHold (u32 mask) const
bool isTrig (u32 mask) const
bool isHoldAll (u32 mask) const
bool isRelease (u32 mask) const
bool isRepeat (u32 mask) const
bool isTrigWithRepeat (u32 mask) const
void setPadRepeat (u32 mask, u8 delay_frame, u8 pulse_frame)
void setLeftStickCrossThreshold (f32 hold, f32 release)
void setRightStickCrossThreshold (f32 hold, f32 release)
void setPointerBound (const BoundBox2f &bound)
const BoundBox2fgetPointerBound () const

Static Public Attributes

static const f32 cStickHoldThresholdDefault = 0.5f
static const f32 cStickReleaseThresholdDefault = 0.25f
static const Vector2f cInvalidPointer
static const Vector2i cInvalidPointerS32

Protected Types

enum  { cPadIdx_MaxBase = 32 }
enum  PointerFlagMask { cPointerOn = 1 << 0 , cPointerOnNow = 1 << 1 , cPointerOffNow = 1 << 2 , cPointerUnkFlag3 = 1 << 3 }
enum  { cCrossUp , cCrossDown , cCrossLeft , cCrossRight }

Protected Member Functions

bool isIdleBase_ ()
void setIdleBase_ ()
void setPointerWithBound_ (bool is_on, bool touchkey_hold, const Vector2f &pos)
void updateDerivativeParams_ (u32 prev_hold, bool prev_pointer_on)
u32 getStickHold_ (u32 prev_hold, const Vector2f &stick, f32 hold_threshold, f32 release_threshold, s32 start_bit)
u32 createStickCrossMask_ ()

Protected Attributes

BitFlag32 mPadTrig
BitFlag32 mPadRelease
BitFlag32 mPadRepeat
BitFlag32 mPointerFlag
Vector2i mPointerS32
BoundBox2f mPointerBound
u32 mPadHoldCounts [cPadIdx_MaxBase]
u8 mPadRepeatDelays [cPadIdx_MaxBase]
u8 mPadRepeatPulses [cPadIdx_MaxBase]
f32 mLeftStickHoldThreshold
f32 mRightStickHoldThreshold
f32 mLeftStickReleaseThreshold
f32 mRightStickReleaseThreshold
s32 mPadBitMax
s32 mLeftStickCrossStartBit
s32 mRightStickCrossStartBit
s32 mTouchKeyBit
s32 mIdleFrame
BitFlag32 mPadHold
Vector2f mPointer
Vector2f mLeftStick
Vector2f mRightStick
f32 mLeftAnalogTrigger
f32 mRightAnalogTrigger

Friends

class ControllerWrapper

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
cPadIdx_MaxBase 

◆ PointerFlagMask

Enumerator
cPointerOn 
cPointerOnNow 
cPointerOffNow 
cPointerUnkFlag3 

◆ anonymous enum

anonymous enum
protected
Enumerator
cCrossUp 
cCrossDown 
cCrossLeft 
cCrossRight 

Constructor & Destructor Documentation

◆ ControllerBase()

sead::ControllerBase::ControllerBase ( s32 padBitMax,
s32 leftStickCrossStartBit,
s32 rightStickCrossStartBit,
s32 touchKeyBit )

Member Function Documentation

◆ getHoldMask()

u32 sead::ControllerBase::getHoldMask ( ) const
inline

◆ getTrigMask()

u32 sead::ControllerBase::getTrigMask ( ) const
inline

◆ getReleaseMask()

u32 sead::ControllerBase::getReleaseMask ( ) const
inline

◆ getRepeatMask()

u32 sead::ControllerBase::getRepeatMask ( ) const
inline

◆ getTrigMaskWithRepeat()

u32 sead::ControllerBase::getTrigMaskWithRepeat ( ) const
inline

◆ getPadHoldCount()

u32 sead::ControllerBase::getPadHoldCount ( s32 bit) const

◆ getLeftStick()

const Vector2f & sead::ControllerBase::getLeftStick ( ) const
inline

◆ getRightStick()

const Vector2f & sead::ControllerBase::getRightStick ( ) const
inline

◆ getLeftAnalogTrigger()

f32 sead::ControllerBase::getLeftAnalogTrigger ( ) const
inline

◆ getRightAnalogTrigger()

f32 sead::ControllerBase::getRightAnalogTrigger ( ) const
inline

◆ getPointer()

const Vector2f & sead::ControllerBase::getPointer ( ) const
inline

◆ getPointerPrev()

const Vector2i & sead::ControllerBase::getPointerPrev ( ) const
inline

◆ isPointerOn()

bool sead::ControllerBase::isPointerOn ( ) const
inline

◆ isPointerOnNow()

bool sead::ControllerBase::isPointerOnNow ( ) const
inline

◆ isPointerOffNow()

bool sead::ControllerBase::isPointerOffNow ( ) const
inline

◆ isPointerUnkFlag3()

bool sead::ControllerBase::isPointerUnkFlag3 ( ) const
inline

◆ isHold()

bool sead::ControllerBase::isHold ( u32 mask) const
inline

◆ isTrig()

bool sead::ControllerBase::isTrig ( u32 mask) const
inline

◆ isHoldAll()

bool sead::ControllerBase::isHoldAll ( u32 mask) const
inline

◆ isRelease()

bool sead::ControllerBase::isRelease ( u32 mask) const
inline

◆ isRepeat()

bool sead::ControllerBase::isRepeat ( u32 mask) const
inline

◆ isTrigWithRepeat()

bool sead::ControllerBase::isTrigWithRepeat ( u32 mask) const
inline

◆ setPadRepeat()

void sead::ControllerBase::setPadRepeat ( u32 mask,
u8 delay_frame,
u8 pulse_frame )

◆ setLeftStickCrossThreshold()

void sead::ControllerBase::setLeftStickCrossThreshold ( f32 hold,
f32 release )

◆ setRightStickCrossThreshold()

void sead::ControllerBase::setRightStickCrossThreshold ( f32 hold,
f32 release )

◆ setPointerBound()

void sead::ControllerBase::setPointerBound ( const BoundBox2f & bound)

◆ getPointerBound()

const BoundBox2f & sead::ControllerBase::getPointerBound ( ) const
inline

◆ isIdleBase_()

bool sead::ControllerBase::isIdleBase_ ( )
protected

◆ setIdleBase_()

void sead::ControllerBase::setIdleBase_ ( )
protected

◆ setPointerWithBound_()

void sead::ControllerBase::setPointerWithBound_ ( bool is_on,
bool touchkey_hold,
const Vector2f & pos )
protected

◆ updateDerivativeParams_()

void sead::ControllerBase::updateDerivativeParams_ ( u32 prev_hold,
bool prev_pointer_on )
protected

◆ getStickHold_()

u32 sead::ControllerBase::getStickHold_ ( u32 prev_hold,
const Vector2f & stick,
f32 hold_threshold,
f32 release_threshold,
s32 start_bit )
protected

◆ createStickCrossMask_()

u32 sead::ControllerBase::createStickCrossMask_ ( )
protected

◆ ControllerWrapper

friend class ControllerWrapper
friend

Member Data Documentation

◆ cStickHoldThresholdDefault

const f32 sead::ControllerBase::cStickHoldThresholdDefault = 0.5f
static

◆ cStickReleaseThresholdDefault

const f32 sead::ControllerBase::cStickReleaseThresholdDefault = 0.25f
static

◆ cInvalidPointer

const Vector2f sead::ControllerBase::cInvalidPointer
static

◆ cInvalidPointerS32

const Vector2i sead::ControllerBase::cInvalidPointerS32
static

◆ mPadTrig

BitFlag32 sead::ControllerBase::mPadTrig
protected

◆ mPadRelease

BitFlag32 sead::ControllerBase::mPadRelease
protected

◆ mPadRepeat

BitFlag32 sead::ControllerBase::mPadRepeat
protected

◆ mPointerFlag

BitFlag32 sead::ControllerBase::mPointerFlag
protected

◆ mPointerS32

Vector2i sead::ControllerBase::mPointerS32
protected

◆ mPointerBound

BoundBox2f sead::ControllerBase::mPointerBound
protected

◆ mPadHoldCounts

u32 sead::ControllerBase::mPadHoldCounts[cPadIdx_MaxBase]
protected

◆ mPadRepeatDelays

u8 sead::ControllerBase::mPadRepeatDelays[cPadIdx_MaxBase]
protected

◆ mPadRepeatPulses

u8 sead::ControllerBase::mPadRepeatPulses[cPadIdx_MaxBase]
protected

◆ mLeftStickHoldThreshold

f32 sead::ControllerBase::mLeftStickHoldThreshold
protected

◆ mRightStickHoldThreshold

f32 sead::ControllerBase::mRightStickHoldThreshold
protected

◆ mLeftStickReleaseThreshold

f32 sead::ControllerBase::mLeftStickReleaseThreshold
protected

◆ mRightStickReleaseThreshold

f32 sead::ControllerBase::mRightStickReleaseThreshold
protected

◆ mPadBitMax

s32 sead::ControllerBase::mPadBitMax
protected

◆ mLeftStickCrossStartBit

s32 sead::ControllerBase::mLeftStickCrossStartBit
protected

◆ mRightStickCrossStartBit

s32 sead::ControllerBase::mRightStickCrossStartBit
protected

◆ mTouchKeyBit

s32 sead::ControllerBase::mTouchKeyBit
protected

◆ mIdleFrame

s32 sead::ControllerBase::mIdleFrame
protected

◆ mPadHold

BitFlag32 sead::ControllerBase::mPadHold
protected

◆ mPointer

Vector2f sead::ControllerBase::mPointer
protected

◆ mLeftStick

Vector2f sead::ControllerBase::mLeftStick
protected

◆ mRightStick

Vector2f sead::ControllerBase::mRightStick
protected

◆ mLeftAnalogTrigger

f32 sead::ControllerBase::mLeftAnalogTrigger
protected

◆ mRightAnalogTrigger

f32 sead::ControllerBase::mRightAnalogTrigger
protected