wavelength 1.0.0
Loading...
Searching...
No Matches
InputMgr Class Reference

Router of controller input to a running world. More...

#include <inputmgr.h>

Inheritance diagram for InputMgr:
Collaboration diagram for InputMgr:

Classes

class  ControllerData
 Input state of one controller. More...

Public Member Functions

 InputMgr (World *pWorld)
 Construct a router for one world.
void * operator new (size_t nSize)
 Allocate a router from the pool heaps under the tag "InputMgr".
 ~InputMgr () override
 Release the router.
void Poll ()
 Route the controller input of one frame to the world.
void RepeatRotation (int nPad)
 Repeat the rotation of a controller once each repeat interval after the initial delay.
bool HandleButton (JoypadInputMsg *pMsg)
 Turn a button of a controller into the input event of its bound action.
bool DispatchPriv (Message *pMsg) override
 Act on a message sent to the router.
Public Member Functions inherited from MsgSink
void * operator new (size_t nSize)
 Allocate a sink from the pool heaps under the tag "MsgSink".
void operator delete (void *pBlock)
 Return a sink to the pool heaps.
virtual ~MsgSink ()
virtual bool Dispatch (Message *pMsg)
 Accept a message.
void * operator new (size_t size)
 Allocate from the main heap under the name MsgSink.
void operator delete (void *mem)
 Return memory to its heap.
virtual ~MsgSink ()
 Destroy the sink.
virtual bool Dispatch (Message *msg)
 Handle a message.

Detailed Description

Router of controller input to a running world.

The RTTI records the class as deriving from MsgSink. The object is 0x34 bytes, and WorldMgr allocates it under the tag "InputMgr". The router turns each button of a controller into the input event of its bound action, repeats a rotation while its button is down, and passes the analogue sticks to the world every frame.

Constructor & Destructor Documentation

◆ InputMgr()

InputMgr::InputMgr ( World * pWorld)
explicit

Construct a router for one world.

Parameters
pWorldThe world input goes to.
Ghidra address:
NTSC-U/C: 0x00118068
Ghidra address:
PAL: 0x00119800

◆ ~InputMgr()

InputMgr::~InputMgr ( )
override

Release the router.

Ghidra address:
NTSC-U/C: 0x001185a8
Ghidra address:
PAL: 0x00119d40

Member Function Documentation

◆ operator new()

void * InputMgr::operator new ( size_t nSize)
inline

Allocate a router from the pool heaps under the tag "InputMgr".

No out-of-line body exists. WorldMgr::Start() inlines the call with the default alignment.

Parameters
nSizeThe object size the compiler supplies.
Returns
The block.

◆ Poll()

void InputMgr::Poll ( )

Route the controller input of one frame to the world.

Ghidra address:
NTSC-U/C: 0x00118730
Ghidra address:
PAL: 0x00119ec8

◆ RepeatRotation()

void InputMgr::RepeatRotation ( int nPad)

Repeat the rotation of a controller once each repeat interval after the initial delay.

Parameters
nPadThe controller.
Ghidra address:
NTSC-U/C: 0x00118848
Ghidra address:
PAL: 0x00119fe0

◆ HandleButton()

bool InputMgr::HandleButton ( JoypadInputMsg * pMsg)

Turn a button of a controller into the input event of its bound action.

A button in demo mode stops the world instead.

Parameters
pMsgThe message of the button.
Returns
False, for every message.
Ghidra address:
NTSC-U/C: 0x001189d8
Ghidra address:
PAL: 0x0011a170

◆ DispatchPriv()

bool InputMgr::DispatchPriv ( Message * pMsg)
overridevirtual

Act on a message sent to the router.

Parameters
pMsgThe message.
Returns
The result of HandleButton() for a controller button, otherwise false.
Ghidra address:
NTSC-U/C: 0x00118d90
Ghidra address:
PAL: 0x0011a528

Implements MsgSink.


The documentation for this class was generated from the following file: