|
resonance 1.0.1
|
Translator from controller readings to the players of one game world. More...
#include <inputmap.h>


Classes | |
| class | Binding |
| One player slot's use of one action. More... | |
Public Types | |
| enum | Action { kActionRotateLeft = 0x726f744c , kActionRotateRight = 0x726f7452 , kActionPlayback = 0x7062636b } |
| Actions other classes enable and disable, as four-character codes. More... | |
Public Member Functions | |
| InputMap (Globals *pGlobals, std::vector< Player * > *pPlayers) | |
| Build the map with no binding and record it in g_pInputMap. | |
| virtual | ~InputMap () |
| Clear g_pInputMap and release every binding. | |
| virtual void | DispatchPriv (Message *pMsg) |
| Pass a RawControllerMsg to OnControllerReading() and ignore every other message. | |
| void | DisableEntries () |
| Clear the enable word of every binding. | |
| void | EnableEntries () |
| Set the enable word of every binding. | |
| void | SetEnabled (int nSlot, int nAction, int nEnabled) |
| Set the enable word of every binding of one slot and one action. | |
| void | AddBinding (int nDevice, int nPort, int nButton, int nSlot, int nAction, int nExtra) |
| Bind one physical control to one slot's action. | |
| void | Rebuild () |
| Rebuild mBindingMap from the controller configuration. | |
| void | StopAllRiffs () |
| Stop the three riffs of every player at the current song position. | |
| Public Member Functions inherited from MsgSource | |
| virtual | ~MsgSource () |
| virtual void | AddSink (MsgSink *pSink) |
| Register a sink, ignoring a sink that is already registered. | |
| virtual void | RemoveSink (MsgSink *pSink) |
| Unregister the first occurrence of a sink. | |
| void | Send (Message *pMsg) const |
| Deliver a message to every registered sink, in registration order. | |
| void | ClearSinks () |
| Unregister every sink. | |
| Public Member Functions inherited from MsgSink | |
| void * | operator new (size_t nSize) |
| Allocate a sink from the tagged heap under the tag "MsgSink". | |
| void | operator delete (void *pBlock) |
| Release a sink to the tagged heap. | |
| virtual | ~MsgSink () |
| virtual void | Dispatch (Message *pMsg) |
| Accept a message. | |
Static Public Member Functions | |
| static InputMap * | shared () |
| Report the map that exists. | |
| static int | MakeKey (int nDevice, int nPort, int nButton) |
| Pack a device, a port, and a button into a key of mBindingMap. | |
Additional Inherited Members | |
| Public Attributes inherited from MsgSource | |
| int | mGraphBuilt |
| A word no member of this class reads. | |
Translator from controller readings to the players of one game world.
It has MsgSource at offset 0 and MsgSink at +0x14. Its two tables are at 0x007cf6c0 and 0x007cf698, the second adjusting this by -20. GrooveWorld creates the one instance with a 0x60-byte allocation and the constructor at 0x00119160. The constructor receives the application and the address of the world's player vector. The instance records itself in g_pInputMap.
Each Binding ties one player slot to one action. mBindingMap keys every physical control, built by MakeKey() from a device, a port, and a button, to the binding it drives. A RawControllerMsg is looked up there and turned into the message its binding's action names. The members are declared in recovered offset order.
| enum InputMap::Action |
Actions other classes enable and disable, as four-character codes.
| Enumerator | |
|---|---|
| kActionRotateLeft | rotL, which sends RotLeftMsg. |
| kActionRotateRight | rotR, which sends RotRightMsg. |
| kActionPlayback | pbck, which sends PlaybackModeMsg. |
Build the map with no binding and record it in g_pInputMap.
| pGlobals | The application globals. |
| pPlayers | The world's player vector. |
|
virtual |
Clear g_pInputMap and release every binding.
|
virtual |
Pass a RawControllerMsg to OnControllerReading() and ignore every other message.
| pMsg | The message. |
Implements MsgSink.
|
static |
Report the map that exists.
|
static |
Pack a device, a port, and a button into a key of mBindingMap.
| nDevice | The device, a four-character code. |
| nPort | The one-based port. |
| nButton | The button. |
| void InputMap::DisableEntries | ( | ) |
Clear the enable word of every binding.
| void InputMap::EnableEntries | ( | ) |
Set the enable word of every binding.
| void InputMap::SetEnabled | ( | int | nSlot, |
| int | nAction, | ||
| int | nEnabled ) |
Set the enable word of every binding of one slot and one action.
The title is inferred.
| nSlot | The player slot. |
| nAction | The action, a four-character code. |
| nEnabled | Non-zero to enable. |
| void InputMap::AddBinding | ( | int | nDevice, |
| int | nPort, | ||
| int | nButton, | ||
| int | nSlot, | ||
| int | nAction, | ||
| int | nExtra ) |
Bind one physical control to one slot's action.
Reuses a binding of the same slot, action, and argument when one exists.
| nDevice | The device, a four-character code. |
| nPort | The one-based port. |
| nButton | The button. |
| nSlot | The player slot. |
| nAction | The action, a four-character code. |
| nExtra | The action's configured argument. |
| void InputMap::Rebuild | ( | ) |
Rebuild mBindingMap from the controller configuration.
Empties the map, then binds every slot of each port's ControllerConfig in GlobalSettings to that port's player slot, with the slot's action code and riff index. It then passes GameOptions::mForceFeedback to the world's ForceFeedbackMgr, when the world has one. GameManagerImpl::OnUnpauseGameSystem() and GrooveWorld call it. The title is inferred.
| void InputMap::StopAllRiffs | ( | ) |
Stop the three riffs of every player at the current song position.
Sends one StopRiffMsg per player and riff, then clears mRiffActive. The title is inferred.