whitespace/comment cleanup

This commit is contained in:
AJ Kelly
2011-02-23 13:16:52 -06:00
parent ac745deeb9
commit ef9dd5d271
+17 -20
View File
@@ -262,21 +262,19 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
} }
#endif #endif
// /* TRICKY: Some adapters map the PlayStation digital d-pad to both axes and
// TRICKY: Some adapters map the PlayStation digital d-pad to both axes and * buttons. We want buttons to be used for any mappings where possible
// buttons. We want buttons to be used for any mappings where possible because * because presses of buttons aren't mutually exclusive and presses of axes
// presses of buttons aren't mutually exclusive and presses of axes are (e.g. * are (e.g. can't read presses of both Left and Right simultaneously). So,
// can't read presses of both Left and Right simultaneously). So, when the user * when the user presses a button, we'll wait until the next Update before
// presses a button, we'll wait until the next Update before adding a mapping so * adding a mapping so that we get a chance to see all input events the
// that we get a chance to see all input events the user's press of a panel. * user's press of a panel. Prefer non-axis events over axis events. */
// Prefer non-axis events over axis events.
//
if( !m_WaitingForPress.IsZero() ) if( !m_WaitingForPress.IsZero() )
{ {
if( input.type != IET_FIRST_PRESS ) if( input.type != IET_FIRST_PRESS )
return; return;
/* Don't allow function keys to be mapped. */ // Don't allow function keys to be mapped.
if( input.DeviceI.device == DEVICE_KEYBOARD && (input.DeviceI.button >= KEY_F1 && input.DeviceI.button <= KEY_F12) ) if( input.DeviceI.device == DEVICE_KEYBOARD && (input.DeviceI.button >= KEY_F1 && input.DeviceI.button <= KEY_F12) )
{ {
SCREENMAN->SystemMessage( INVALID_BUTTON ); SCREENMAN->SystemMessage( INVALID_BUTTON );
@@ -303,9 +301,8 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
{ {
switch( button ) switch( button )
{ {
/* We only advertise space as doing this, but most games /* We only advertise space as doing this, but most games use either delete
* use either backspace or delete, and I find them more * or backspace, and I find them more intuitive, so allow them, too. -gm */
* intuitive, so allow them, too. -gm */
/* XXX: For some reason that eludes me, this function gets sent an /* XXX: For some reason that eludes me, this function gets sent an
* KEY_SPACE button press every time the JOY_HAT_UP button is pressed. * KEY_SPACE button press every time the JOY_HAT_UP button is pressed.
@@ -315,7 +312,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
case KEY_DEL: case KEY_DEL:
#ifndef _XBOX #ifndef _XBOX
case KEY_SPACE: case KEY_SPACE:
case KEY_BACK: /* Clear the selected input mapping. */ case KEY_BACK: // Clear the selected input mapping.
#endif #endif
if( m_iCurButton == (int) m_KeysToMap.size() ) if( m_iCurButton == (int) m_KeysToMap.size() )
break; // on exit break; // on exit
@@ -334,7 +331,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
INPUTMAPPER->SaveMappingsToDisk(); INPUTMAPPER->SaveMappingsToDisk();
} }
break; break;
case KEY_LEFT: /* Move the selection left, wrapping up. */ case KEY_LEFT: // Move the selection left, wrapping up.
if( m_iCurButton == (int) m_KeysToMap.size() ) if( m_iCurButton == (int) m_KeysToMap.size() )
break; // on exit break; // on exit
if( m_iCurSlot == 0 && m_iCurController == 0 ) if( m_iCurSlot == 0 && m_iCurController == 0 )
@@ -349,7 +346,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
AfterChangeFocus(); AfterChangeFocus();
m_soundChange.Play(); m_soundChange.Play();
break; break;
case KEY_RIGHT: /* Move the selection right, wrapping down. */ case KEY_RIGHT: // Move the selection right, wrapping down.
if( m_iCurButton == (int) m_KeysToMap.size() ) if( m_iCurButton == (int) m_KeysToMap.size() )
break; // on exit break; // on exit
if( m_iCurSlot == NUM_CHANGABLE_SLOTS-1 && m_iCurController == NUM_GameController-1 ) if( m_iCurSlot == NUM_CHANGABLE_SLOTS-1 && m_iCurController == NUM_GameController-1 )
@@ -364,7 +361,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
AfterChangeFocus(); AfterChangeFocus();
m_soundChange.Play(); m_soundChange.Play();
break; break;
case KEY_UP: /* Move the selection up. */ case KEY_UP: // Move the selection up.
if( m_iCurButton == 0 ) if( m_iCurButton == 0 )
break; // can't go up any more break; // can't go up any more
BeforeChangeFocus(); BeforeChangeFocus();
@@ -372,7 +369,7 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
AfterChangeFocus(); AfterChangeFocus();
m_soundChange.Play(); m_soundChange.Play();
break; break;
case KEY_DOWN: /* Move the selection down. */ case KEY_DOWN: // Move the selection down.
if( m_iCurButton == (int) m_KeysToMap.size() ) if( m_iCurButton == (int) m_KeysToMap.size() )
break; // can't go down any more break; // can't go down any more
BeforeChangeFocus(); BeforeChangeFocus();
@@ -380,11 +377,11 @@ void ScreenMapControllers::Input( const InputEventPlus &input )
AfterChangeFocus(); AfterChangeFocus();
m_soundChange.Play(); m_soundChange.Play();
break; break;
case KEY_ESC: /* Quit the screen. */ case KEY_ESC: // Quit the screen.
SCREENMAN->PlayStartSound(); SCREENMAN->PlayStartSound();
StartTransitioningScreen( SM_GoToNextScreen ); StartTransitioningScreen( SM_GoToNextScreen );
break; break;
case KEY_ENTER: /* Change the selection. */ case KEY_ENTER: // Change the selection.
case KEY_KP_ENTER: case KEY_KP_ENTER:
if( m_iCurButton == (int) m_KeysToMap.size() ) if( m_iCurButton == (int) m_KeysToMap.size() )
{ {