summaryrefslogtreecommitdiffstats
path: root/src/core/ControllerConfig.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ControllerConfig.cpp')
-rw-r--r--src/core/ControllerConfig.cpp45
1 files changed, 30 insertions, 15 deletions
diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index cba8186f..6a5080e5 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -4,7 +4,8 @@
#endif
#include "common.h"
-#include "crossplatform.h"
+#include "platform.h"
+#include "crossplatform.h" // for Windows version
#include "ControllerConfig.h"
#include "Pad.h"
#include "FileMgr.h"
@@ -163,14 +164,14 @@ void CControllerConfigManager::InitDefaultControlConfiguration()
SetControllerKeyAssociatedWithAction (VEHICLE_LOOKRIGHT, rsPADDOWN, KEYBOARD);
SetControllerKeyAssociatedWithAction (VEHICLE_LOOKRIGHT, 'E', OPTIONAL_EXTRA);
-
- if ( _dwOperatingSystemVersion != OS_WIN98 )
- {
+
+ if ( _dwOperatingSystemVersion == OS_WIN98 )
+ SetControllerKeyAssociatedWithAction(VEHICLE_HORN, rsSHIFT, OPTIONAL_EXTRA); // BUG: must be KEYBOARD ?
+ else
+ {
SetControllerKeyAssociatedWithAction(VEHICLE_HORN, rsLSHIFT, OPTIONAL_EXTRA);
SetControllerKeyAssociatedWithAction(VEHICLE_HORN, rsRSHIFT, KEYBOARD);
- }
- else
- SetControllerKeyAssociatedWithAction(VEHICLE_HORN, rsSHIFT, OPTIONAL_EXTRA); // BUG: must be KEYBOARD ?
+ }
SetControllerKeyAssociatedWithAction (VEHICLE_HANDBRAKE, rsRCTRL, KEYBOARD);
SetControllerKeyAssociatedWithAction (VEHICLE_HANDBRAKE, ' ', OPTIONAL_EXTRA);
@@ -216,19 +217,19 @@ void CControllerConfigManager::InitDefaultControlConfiguration()
SetControllerKeyAssociatedWithAction (PED_JUMPING, rsRCTRL, KEYBOARD);
SetControllerKeyAssociatedWithAction (PED_JUMPING, ' ', OPTIONAL_EXTRA);
-
- if ( _dwOperatingSystemVersion != OS_WIN98 )
- {
+
+ if ( _dwOperatingSystemVersion == OS_WIN98 )
+ SetControllerKeyAssociatedWithAction(PED_SPRINT, rsSHIFT, OPTIONAL_EXTRA); // BUG: must be KEYBOARD ?
+ else
+ {
SetControllerKeyAssociatedWithAction(PED_SPRINT, rsLSHIFT, OPTIONAL_EXTRA);
#ifndef FIX_BUGS
SetControllerKeyAssociatedWithAction(PED_SPRINT, rsRSHIFT, OPTIONAL_EXTRA); // BUG: must be KEYBOARD
#else
SetControllerKeyAssociatedWithAction(PED_SPRINT, rsRSHIFT, KEYBOARD);
#endif
- }
- else
- SetControllerKeyAssociatedWithAction(PED_SPRINT, rsSHIFT, OPTIONAL_EXTRA); // BUG: must be KEYBOARD ?
-
+ }
+
SetControllerKeyAssociatedWithAction (PED_CYCLE_TARGET_LEFT, '[', KEYBOARD);
SetControllerKeyAssociatedWithAction (PED_CYCLE_TARGET_RIGHT, ']', OPTIONAL_EXTRA); // BUG: must be KEYBOARD ?
@@ -609,6 +610,7 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown(int32 button,
case MOUSE:
state = &CPad::GetPad(PAD1)->PCTempMouseState;
break;
+ default: break;
}
if (pad != NULL)
@@ -1023,7 +1025,7 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonUp(int32 button, eC
case JOYSTICK:
state = &CPad::GetPad(PAD1)->PCTempJoyState;
break;
-
+ default: break;
}
if (process)
@@ -1292,6 +1294,7 @@ bool CControllerConfigManager::GetIsKeyboardKeyDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetApps())
return true;
break;
+ default: break;
}
return false;
@@ -1492,6 +1495,7 @@ bool CControllerConfigManager::GetIsKeyboardKeyJustDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetAppsJustDown())
return true;
break;
+ default: break;
}
return false;
@@ -1529,6 +1533,7 @@ bool CControllerConfigManager::GetIsMouseButtonDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetMouseX2())
return true;
break;
+ default: break;
}
return false;
@@ -1566,6 +1571,7 @@ bool CControllerConfigManager::GetIsMouseButtonUp(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetMouseX2Up())
return true;
break;
+ default: break;
}
return false;
@@ -1746,6 +1752,7 @@ void CControllerConfigManager::DeleteMatchingActionInitiators(e_ControllerAction
DeleteMatchingCommonControls (action, key, type);
DeleteMatching1rst3rdPersonControls (action, key, type);
break;
+ default: break;
}
}
}
@@ -1769,6 +1776,7 @@ bool CControllerConfigManager::GetIsKeyBlank(int32 key, eControllerType type)
if (key != 0)
return false;
break;
+ default: break;
}
return true;
@@ -1835,6 +1843,7 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio
case PED_SNIPER_ZOOM_OUT:
return ACTIONTYPE_1RSTPERSON;
break;
+ default: break;
}
return ACTIONTYPE_NONE;
@@ -1860,6 +1869,7 @@ void CControllerConfigManager::ClearSettingsAssociatedWithAction(e_ControllerAct
m_aSettings[action][type].m_Key = 0;
m_aSettings[action][type].m_ContSetOrder = SETORDER_NONE;
break;
+ default: break;
}
ResetSettingOrder(action);
@@ -1880,6 +1890,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
return GetControllerSettingTextMouse (action);
case JOYSTICK:
return GetControllerSettingTextJoystick(action);
+ default: break;
}
}
}
@@ -2223,6 +2234,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextKeyBoard(e_ControllerAc
return TheText.Get("FEC_SFT"); // "SHIFT"
break;
}
+ default: break;
}
}
}
@@ -2255,6 +2267,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextMouse(e_ControllerActio
case 7:
return TheText.Get("FEC_MXT"); // MXB2
break;
+ default: break;
}
return NULL;
@@ -2374,6 +2387,7 @@ bool CControllerConfigManager::GetIsActionAButtonCombo(e_ControllerAction action
case PED_CYCLE_TARGET_RIGHT:
return true;
break;
+ default: break;
}
return false;
@@ -2394,6 +2408,7 @@ wchar *CControllerConfigManager::GetButtonComboText(e_ControllerAction action)
case VEHICLE_LOOKBEHIND:
return TheText.Get("FEC_LBC"); // Use Look Left With Look Right.
break;
+ default: break;
}
return NULL;