1
0
Fork 0
mirror of https://git.rip/DMCA_FUCKER/re3.git synced 2024-11-14 16:29:16 +00:00

Merge branch 'master' into miami

# Conflicts:
#	src/animation/CutsceneMgr.cpp
#	src/audio/AudioLogic.cpp
#	src/audio/soundlist.h
#	src/core/ControllerConfig.cpp
#	src/core/ControllerConfig.h
#	src/core/Streaming.cpp
#	src/peds/PedChat.cpp
#	src/render/Weather.cpp
#	src/rw/TexRead.cpp
#	src/vehicles/Automobile.cpp
#	src/vehicles/Boat.cpp
This commit is contained in:
Sergeanur 2020-08-24 21:59:32 +03:00
commit a3322f17d5
7 changed files with 115 additions and 87 deletions

View file

@ -4,6 +4,16 @@
#include "Pools.h" #include "Pools.h"
#include "DMAudio.h" #include "DMAudio.h"
cAudioScriptObject::cAudioScriptObject()
{
Reset();
};
cAudioScriptObject::~cAudioScriptObject()
{
Reset();
};
void void
cAudioScriptObject::Reset() cAudioScriptObject::Reset()
{ {

View file

@ -7,6 +7,9 @@ public:
CVector Posn; CVector Posn;
int32 AudioEntity; int32 AudioEntity;
cAudioScriptObject();
~cAudioScriptObject();
void Reset(); /// ok void Reset(); /// ok
static void* operator new(size_t); static void* operator new(size_t);

View file

@ -247,7 +247,7 @@ cDMAudio::ReportCrime(eCrimeType crime, const CVector &pos)
int32 int32
cDMAudio::CreateLoopingScriptObject(cAudioScriptObject *scriptObject) cDMAudio::CreateLoopingScriptObject(cAudioScriptObject *scriptObject)
{ {
int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, (CPhysical *)scriptObject); int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, scriptObject);
if ( AEHANDLE_IS_OK(audioEntity) ) if ( AEHANDLE_IS_OK(audioEntity) )
AudioManager.SetEntityStatus(audioEntity, true); AudioManager.SetEntityStatus(audioEntity, true);
@ -264,7 +264,7 @@ cDMAudio::DestroyLoopingScriptObject(int32 audioEntity)
void void
cDMAudio::CreateOneShotScriptObject(cAudioScriptObject *scriptObject) cDMAudio::CreateOneShotScriptObject(cAudioScriptObject *scriptObject)
{ {
int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, (CPhysical *)scriptObject); int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, scriptObject);
if ( AEHANDLE_IS_OK(audioEntity) ) if ( AEHANDLE_IS_OK(audioEntity) )
{ {

View file

@ -215,7 +215,10 @@ void CControllerConfigManager::InitDefaultControlConfiguration()
SetControllerKeyAssociatedWithAction (PED_FIREWEAPON, rsPADINS, KEYBOARD); SetControllerKeyAssociatedWithAction (PED_FIREWEAPON, rsPADINS, KEYBOARD);
SetControllerKeyAssociatedWithAction (PED_FIREWEAPON, rsLCTRL, OPTIONAL_EXTRA); SetControllerKeyAssociatedWithAction (PED_FIREWEAPON, rsLCTRL, OPTIONAL_EXTRA);
#ifdef BIND_VEHICLE_FIREWEAPON
SetControllerKeyAssociatedWithAction (VEHICLE_FIREWEAPON, rsPADINS, KEYBOARD);
SetControllerKeyAssociatedWithAction (VEHICLE_FIREWEAPON, rsLCTRL, OPTIONAL_EXTRA);
#endif
SetControllerKeyAssociatedWithAction (PED_CYCLE_WEAPON_LEFT, rsPADDEL, KEYBOARD); SetControllerKeyAssociatedWithAction (PED_CYCLE_WEAPON_LEFT, rsPADDEL, KEYBOARD);
SetControllerKeyAssociatedWithAction (PED_CYCLE_WEAPON_RIGHT, rsPADENTER, OPTIONAL_EXTRA); // BUG: must be KEYBOARD ? SetControllerKeyAssociatedWithAction (PED_CYCLE_WEAPON_RIGHT, rsPADENTER, OPTIONAL_EXTRA); // BUG: must be KEYBOARD ?
@ -285,6 +288,9 @@ void CControllerConfigManager::InitDefaultControlConfigMouse(CMouseControllerSta
{ {
m_bMouseAssociated = true; m_bMouseAssociated = true;
SetMouseButtonAssociatedWithAction(PED_FIREWEAPON, 1); SetMouseButtonAssociatedWithAction(PED_FIREWEAPON, 1);
#ifdef BIND_VEHICLE_FIREWEAPON
SetMouseButtonAssociatedWithAction(VEHICLE_FIREWEAPON, 1);
#endif
} }
if (availableButtons.RMB) if (availableButtons.RMB)
@ -371,6 +377,9 @@ void CControllerConfigManager::InitDefaultControlConfigJoyPad(uint32 buttons)
SetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_OUT, 3, JOYSTICK); SetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_OUT, 3, JOYSTICK);
case 2: case 2:
SetControllerKeyAssociatedWithAction(PED_FIREWEAPON, 2, JOYSTICK); SetControllerKeyAssociatedWithAction(PED_FIREWEAPON, 2, JOYSTICK);
#ifdef BIND_VEHICLE_FIREWEAPON
SetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, 2, JOYSTICK);
#endif
case 1: case 1:
SetControllerKeyAssociatedWithAction(VEHICLE_ENTER_EXIT, 1, JOYSTICK); SetControllerKeyAssociatedWithAction(VEHICLE_ENTER_EXIT, 1, JOYSTICK);
/*******************************************************************************************/ /*******************************************************************************************/
@ -422,6 +431,9 @@ void CControllerConfigManager::InitDefaultControlConfigJoyPad(uint32 buttons)
SetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_OUT, 2, JOYSTICK); SetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_OUT, 2, JOYSTICK);
case 1: case 1:
SetControllerKeyAssociatedWithAction(PED_FIREWEAPON, 1, JOYSTICK); SetControllerKeyAssociatedWithAction(PED_FIREWEAPON, 1, JOYSTICK);
#ifdef BIND_VEHICLE_FIREWEAPON
SetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, 1, JOYSTICK);
#endif
/*******************************************************************************************/ /*******************************************************************************************/
} }
} }
@ -463,6 +475,9 @@ void CControllerConfigManager::InitialiseControllerActionNameArray()
SETACTIONNAME(SHOW_MOUSE_POINTER_TOGGLE); SETACTIONNAME(SHOW_MOUSE_POINTER_TOGGLE);
SETACTIONNAME(CAMERA_CHANGE_VIEW_ALL_SITUATIONS); SETACTIONNAME(CAMERA_CHANGE_VIEW_ALL_SITUATIONS);
SETACTIONNAME(PED_FIREWEAPON); SETACTIONNAME(PED_FIREWEAPON);
#ifdef BIND_VEHICLE_FIREWEAPON
SETACTIONNAME(VEHICLE_FIREWEAPON);
#endif
SETACTIONNAME(VEHICLE_ENTER_EXIT); SETACTIONNAME(VEHICLE_ENTER_EXIT);
SETACTIONNAME(GO_LEFT); SETACTIONNAME(GO_LEFT);
SETACTIONNAME(GO_RIGHT); SETACTIONNAME(GO_RIGHT);
@ -662,6 +677,10 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown(int32 button,
void CControllerConfigManager::AffectControllerStateOn_ButtonDown_Driving(int32 button, eControllerType type, CControllerState &state) void CControllerConfigManager::AffectControllerStateOn_ButtonDown_Driving(int32 button, eControllerType type, CControllerState &state)
{ {
#ifdef BIND_VEHICLE_FIREWEAPON
if (button == GetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, type))
state.Circle = 255;
#endif
if (button == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKBEHIND, type)) if (button == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKBEHIND, type))
{ {
state.LeftShoulder2 = 255; state.LeftShoulder2 = 255;
@ -813,6 +832,10 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_FirstAndThirdP
{ {
CPad *pad = CPad::GetPad(PAD1); CPad *pad = CPad::GetPad(PAD1);
#ifdef BIND_VEHICLE_FIREWEAPON
if (button == GetControllerKeyAssociatedWithAction(PED_FIREWEAPON, type))
state.Circle = 255;
#endif
if (button == GetControllerKeyAssociatedWithAction(PED_LOCK_TARGET, type)) if (button == GetControllerKeyAssociatedWithAction(PED_LOCK_TARGET, type))
state.RightShoulder1 = 255; state.RightShoulder1 = 255;
@ -894,8 +917,11 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_AllStates(int3
{ {
if (button == GetControllerKeyAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS, type)) if (button == GetControllerKeyAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS, type))
state.Select = 255; state.Select = 255;
#ifndef BIND_VEHICLE_FIREWEAPON
if (button == GetControllerKeyAssociatedWithAction(PED_FIREWEAPON, type)) if (button == GetControllerKeyAssociatedWithAction(PED_FIREWEAPON, type))
state.Circle = 255; state.Circle = 255;
#endif
if (button == GetControllerKeyAssociatedWithAction(GO_LEFT, type)) if (button == GetControllerKeyAssociatedWithAction(GO_LEFT, type))
{ {
@ -1611,28 +1637,25 @@ bool CControllerConfigManager::GetIsMouseButtonUp(RsKeyCodes keycode)
return false; return false;
} }
#define CLEAR_ACTION_IF_NEEDED(action) \
if (key == GetControllerKeyAssociatedWithAction(action, type))\
ClearSettingsAssociatedWithAction(action, type);
void CControllerConfigManager::DeleteMatchingCommonControls(e_ControllerAction action, int32 key, eControllerType type) void CControllerConfigManager::DeleteMatchingCommonControls(e_ControllerAction action, int32 key, eControllerType type)
{ {
if (!GetIsKeyBlank(key, type)) if (!GetIsKeyBlank(key, type))
{ {
if (key == GetControllerKeyAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS,type)) CLEAR_ACTION_IF_NEEDED(CAMERA_CHANGE_VIEW_ALL_SITUATIONS);
ClearSettingsAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS, type); #ifndef BIND_VEHICLE_FIREWEAPON
if (key == GetControllerKeyAssociatedWithAction(PED_FIREWEAPON, type)) CLEAR_ACTION_IF_NEEDED(PED_FIREWEAPON);
ClearSettingsAssociatedWithAction(PED_FIREWEAPON, type); #endif
if (key == GetControllerKeyAssociatedWithAction(GO_LEFT, type)) CLEAR_ACTION_IF_NEEDED(GO_LEFT);
ClearSettingsAssociatedWithAction(GO_LEFT, type); CLEAR_ACTION_IF_NEEDED(GO_RIGHT);
if (key == GetControllerKeyAssociatedWithAction(GO_RIGHT, type)) CLEAR_ACTION_IF_NEEDED(NETWORK_TALK);
ClearSettingsAssociatedWithAction(GO_RIGHT, type); CLEAR_ACTION_IF_NEEDED(SWITCH_DEBUG_CAM_ON);
if (key == GetControllerKeyAssociatedWithAction(NETWORK_TALK, type)) CLEAR_ACTION_IF_NEEDED(TOGGLE_DPAD);
ClearSettingsAssociatedWithAction(NETWORK_TALK, type); CLEAR_ACTION_IF_NEEDED(TAKE_SCREEN_SHOT);
if (key == GetControllerKeyAssociatedWithAction(SWITCH_DEBUG_CAM_ON, type)) CLEAR_ACTION_IF_NEEDED(SHOW_MOUSE_POINTER_TOGGLE);
ClearSettingsAssociatedWithAction(SWITCH_DEBUG_CAM_ON, type);
if (key == GetControllerKeyAssociatedWithAction(TOGGLE_DPAD, type))
ClearSettingsAssociatedWithAction(TOGGLE_DPAD, type);
if (key == GetControllerKeyAssociatedWithAction(TAKE_SCREEN_SHOT, type))
ClearSettingsAssociatedWithAction(TAKE_SCREEN_SHOT, type);
if (key == GetControllerKeyAssociatedWithAction(SHOW_MOUSE_POINTER_TOGGLE, type))
ClearSettingsAssociatedWithAction(SHOW_MOUSE_POINTER_TOGGLE, type);
} }
} }
@ -1640,16 +1663,11 @@ void CControllerConfigManager::DeleteMatching3rdPersonControls(e_ControllerActio
{ {
if (!GetIsKeyBlank(key, type)) if (!GetIsKeyBlank(key, type))
{ {
if (key == GetControllerKeyAssociatedWithAction(PED_LOOKBEHIND, type)) CLEAR_ACTION_IF_NEEDED(PED_LOOKBEHIND);
ClearSettingsAssociatedWithAction(PED_LOOKBEHIND, type); CLEAR_ACTION_IF_NEEDED(PED_CYCLE_WEAPON_LEFT);
if (key == GetControllerKeyAssociatedWithAction(PED_CYCLE_WEAPON_LEFT, type)) CLEAR_ACTION_IF_NEEDED(PED_CYCLE_WEAPON_RIGHT);
ClearSettingsAssociatedWithAction(PED_CYCLE_WEAPON_LEFT, type); CLEAR_ACTION_IF_NEEDED(PED_JUMPING);
if (key == GetControllerKeyAssociatedWithAction(PED_CYCLE_WEAPON_RIGHT, type)) CLEAR_ACTION_IF_NEEDED(PED_SPRINT);
ClearSettingsAssociatedWithAction(PED_CYCLE_WEAPON_RIGHT, type);
if (key == GetControllerKeyAssociatedWithAction(PED_JUMPING, type))
ClearSettingsAssociatedWithAction(PED_JUMPING, type);
if (key == GetControllerKeyAssociatedWithAction(PED_SPRINT, type))
ClearSettingsAssociatedWithAction(PED_SPRINT, type);
if (key == GetControllerKeyAssociatedWithAction(PED_DUCK, type)) if (key == GetControllerKeyAssociatedWithAction(PED_DUCK, type))
ClearSettingsAssociatedWithAction(PED_DUCK, type); ClearSettingsAssociatedWithAction(PED_DUCK, type);
if (key == GetControllerKeyAssociatedWithAction(PED_ANSWER_PHONE, type)) if (key == GetControllerKeyAssociatedWithAction(PED_ANSWER_PHONE, type))
@ -1657,12 +1675,9 @@ void CControllerConfigManager::DeleteMatching3rdPersonControls(e_ControllerActio
if (FrontEndMenuManager.m_ControlMethod == CONTROL_CLASSIC) if (FrontEndMenuManager.m_ControlMethod == CONTROL_CLASSIC)
{ {
if (key == GetControllerKeyAssociatedWithAction(PED_CYCLE_TARGET_LEFT, type)) CLEAR_ACTION_IF_NEEDED(PED_CYCLE_TARGET_LEFT);
ClearSettingsAssociatedWithAction(PED_CYCLE_TARGET_LEFT, type); CLEAR_ACTION_IF_NEEDED(PED_CYCLE_TARGET_RIGHT);
if (key == GetControllerKeyAssociatedWithAction(PED_CYCLE_TARGET_RIGHT, type)) CLEAR_ACTION_IF_NEEDED(PED_CENTER_CAMERA_BEHIND_PLAYER);
ClearSettingsAssociatedWithAction(PED_CYCLE_TARGET_RIGHT, type);
if (key == GetControllerKeyAssociatedWithAction(PED_CENTER_CAMERA_BEHIND_PLAYER, type))
ClearSettingsAssociatedWithAction(PED_CENTER_CAMERA_BEHIND_PLAYER, type);
} }
} }
} }
@ -1671,23 +1686,19 @@ void CControllerConfigManager::DeleteMatching1rst3rdPersonControls(e_ControllerA
{ {
if (!GetIsKeyBlank(key, type)) if (!GetIsKeyBlank(key, type))
{ {
if (key == GetControllerKeyAssociatedWithAction(PED_LOCK_TARGET, type)) #ifdef BIND_VEHICLE_FIREWEAPON
ClearSettingsAssociatedWithAction(PED_LOCK_TARGET, type); CLEAR_ACTION_IF_NEEDED(PED_FIREWEAPON);
if (key == GetControllerKeyAssociatedWithAction(GO_FORWARD, type)) #endif
ClearSettingsAssociatedWithAction(GO_FORWARD, type); CLEAR_ACTION_IF_NEEDED(PED_LOCK_TARGET);
if (key == GetControllerKeyAssociatedWithAction(GO_BACK, type)) CLEAR_ACTION_IF_NEEDED(GO_FORWARD);
ClearSettingsAssociatedWithAction(GO_BACK, type); CLEAR_ACTION_IF_NEEDED(GO_BACK);
if (FrontEndMenuManager.m_ControlMethod == CONTROL_CLASSIC) if (FrontEndMenuManager.m_ControlMethod == CONTROL_CLASSIC)
{ {
if (key == GetControllerKeyAssociatedWithAction(PED_1RST_PERSON_LOOK_LEFT, type)) CLEAR_ACTION_IF_NEEDED(PED_1RST_PERSON_LOOK_LEFT);
ClearSettingsAssociatedWithAction(PED_1RST_PERSON_LOOK_LEFT, type); CLEAR_ACTION_IF_NEEDED(PED_1RST_PERSON_LOOK_RIGHT);
if (key == GetControllerKeyAssociatedWithAction(PED_1RST_PERSON_LOOK_RIGHT, type)) CLEAR_ACTION_IF_NEEDED(PED_1RST_PERSON_LOOK_DOWN);
ClearSettingsAssociatedWithAction(PED_1RST_PERSON_LOOK_RIGHT, type); CLEAR_ACTION_IF_NEEDED(PED_1RST_PERSON_LOOK_UP);
if (key == GetControllerKeyAssociatedWithAction(PED_1RST_PERSON_LOOK_DOWN, type))
ClearSettingsAssociatedWithAction(PED_1RST_PERSON_LOOK_DOWN, type);
if (key == GetControllerKeyAssociatedWithAction(PED_1RST_PERSON_LOOK_UP, type))
ClearSettingsAssociatedWithAction(PED_1RST_PERSON_LOOK_UP, type);
} }
} }
} }
@ -1696,34 +1707,23 @@ void CControllerConfigManager::DeleteMatchingVehicleControls(e_ControllerAction
{ {
if (!GetIsKeyBlank(key, type)) if (!GetIsKeyBlank(key, type))
{ {
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKBEHIND, type)) #ifdef BIND_VEHICLE_FIREWEAPON
ClearSettingsAssociatedWithAction(VEHICLE_LOOKBEHIND, type); CLEAR_ACTION_IF_NEEDED(VEHICLE_FIREWEAPON);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKLEFT, type)) #endif
ClearSettingsAssociatedWithAction(VEHICLE_LOOKLEFT, type); CLEAR_ACTION_IF_NEEDED(VEHICLE_LOOKBEHIND);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKRIGHT, type)) CLEAR_ACTION_IF_NEEDED(VEHICLE_LOOKLEFT);
ClearSettingsAssociatedWithAction(VEHICLE_LOOKRIGHT, type); CLEAR_ACTION_IF_NEEDED(VEHICLE_LOOKRIGHT);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKBEHIND, type)) // note: dublicate CLEAR_ACTION_IF_NEEDED(VEHICLE_LOOKBEHIND); // note: duplicate
ClearSettingsAssociatedWithAction(VEHICLE_LOOKBEHIND, type); CLEAR_ACTION_IF_NEEDED(VEHICLE_HORN);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_HORN, type)) CLEAR_ACTION_IF_NEEDED(VEHICLE_HANDBRAKE);
ClearSettingsAssociatedWithAction(VEHICLE_HORN, type); CLEAR_ACTION_IF_NEEDED(VEHICLE_ACCELERATE);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_HANDBRAKE, type)) CLEAR_ACTION_IF_NEEDED(VEHICLE_BRAKE);
ClearSettingsAssociatedWithAction(VEHICLE_HANDBRAKE, type); CLEAR_ACTION_IF_NEEDED(VEHICLE_CHANGE_RADIO_STATION);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_ACCELERATE, type)) CLEAR_ACTION_IF_NEEDED(TOGGLE_SUBMISSIONS);
ClearSettingsAssociatedWithAction(VEHICLE_ACCELERATE, type); CLEAR_ACTION_IF_NEEDED(VEHICLE_TURRETLEFT);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_BRAKE, type)) CLEAR_ACTION_IF_NEEDED(VEHICLE_TURRETRIGHT);
ClearSettingsAssociatedWithAction(VEHICLE_BRAKE, type); CLEAR_ACTION_IF_NEEDED(VEHICLE_TURRETUP);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_CHANGE_RADIO_STATION, type)) CLEAR_ACTION_IF_NEEDED(VEHICLE_TURRETDOWN);
ClearSettingsAssociatedWithAction(VEHICLE_CHANGE_RADIO_STATION, type);
if (key == GetControllerKeyAssociatedWithAction(TOGGLE_SUBMISSIONS, type))
ClearSettingsAssociatedWithAction(TOGGLE_SUBMISSIONS, type);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_TURRETLEFT, type))
ClearSettingsAssociatedWithAction(VEHICLE_TURRETLEFT, type);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_TURRETRIGHT, type))
ClearSettingsAssociatedWithAction(VEHICLE_TURRETRIGHT, type);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_TURRETUP, type))
ClearSettingsAssociatedWithAction(VEHICLE_TURRETUP, type);
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_TURRETDOWN, type))
ClearSettingsAssociatedWithAction(VEHICLE_TURRETDOWN, type);
} }
} }
@ -1731,8 +1731,7 @@ void CControllerConfigManager::DeleteMatchingVehicle_3rdPersonControls(e_Control
{ {
if (!GetIsKeyBlank(key, type)) if (!GetIsKeyBlank(key, type))
{ {
if (key == GetControllerKeyAssociatedWithAction(VEHICLE_ENTER_EXIT, type)) CLEAR_ACTION_IF_NEEDED(VEHICLE_ENTER_EXIT);
ClearSettingsAssociatedWithAction(VEHICLE_ENTER_EXIT, type);
} }
} }
@ -1740,13 +1739,13 @@ void CControllerConfigManager::DeleteMatching1rstPersonControls(e_ControllerActi
{ {
if (!GetIsKeyBlank(key, type)) if (!GetIsKeyBlank(key, type))
{ {
if (key == GetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_IN, type)) CLEAR_ACTION_IF_NEEDED(PED_SNIPER_ZOOM_IN);
ClearSettingsAssociatedWithAction(PED_SNIPER_ZOOM_IN, type); CLEAR_ACTION_IF_NEEDED(PED_SNIPER_ZOOM_OUT);
if (key == GetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_OUT, type))
ClearSettingsAssociatedWithAction(PED_SNIPER_ZOOM_OUT, type);
} }
} }
#undef CLEAR_ACTION_IF_NEEDED
void CControllerConfigManager::DeleteMatchingActionInitiators(e_ControllerAction action, int32 key, eControllerType type) void CControllerConfigManager::DeleteMatchingActionInitiators(e_ControllerAction action, int32 key, eControllerType type)
{ {
if (!GetIsKeyBlank(key, type)) if (!GetIsKeyBlank(key, type))
@ -1824,7 +1823,9 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio
{ {
switch (action) switch (action)
{ {
#ifndef BIND_VEHICLE_FIREWEAPON
case PED_FIREWEAPON: case PED_FIREWEAPON:
#endif
case GO_LEFT: case GO_LEFT:
case GO_RIGHT: case GO_RIGHT:
case CAMERA_CHANGE_VIEW_ALL_SITUATIONS: case CAMERA_CHANGE_VIEW_ALL_SITUATIONS:
@ -1849,6 +1850,9 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio
return ACTIONTYPE_3RDPERSON; return ACTIONTYPE_3RDPERSON;
break; break;
#ifdef BIND_VEHICLE_FIREWEAPON
case VEHICLE_FIREWEAPON:
#endif
case VEHICLE_LOOKBEHIND: case VEHICLE_LOOKBEHIND:
case VEHICLE_LOOKLEFT: case VEHICLE_LOOKLEFT:
case VEHICLE_LOOKRIGHT: case VEHICLE_LOOKRIGHT:
@ -1869,6 +1873,9 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio
return ACTIONTYPE_VEHICLE_3RDPERSON; return ACTIONTYPE_VEHICLE_3RDPERSON;
break; break;
#ifdef BIND_VEHICLE_FIREWEAPON
case PED_FIREWEAPON:
#endif
case GO_FORWARD: case GO_FORWARD:
case GO_BACK: case GO_BACK:
case PED_1RST_PERSON_LOOK_LEFT: case PED_1RST_PERSON_LOOK_LEFT:

View file

@ -34,6 +34,9 @@ enum e_ControllerAction
PED_LOOKBEHIND, PED_LOOKBEHIND,
PED_DUCK, PED_DUCK,
PED_ANSWER_PHONE, PED_ANSWER_PHONE,
#ifdef BIND_VEHICLE_FIREWEAPON
VEHICLE_FIREWEAPON,
#endif
VEHICLE_ACCELERATE, VEHICLE_ACCELERATE,
VEHICLE_BRAKE, VEHICLE_BRAKE,
VEHICLE_CHANGE_RADIO_STATION, VEHICLE_CHANGE_RADIO_STATION,

View file

@ -1544,7 +1544,11 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8
} else if (column == CONTSETUP_VEHICLE_COLUMN) { } else if (column == CONTSETUP_VEHICLE_COLUMN) {
switch (optionIdx) { switch (optionIdx) {
case 0: case 0:
#ifdef BIND_VEHICLE_FIREWEAPON
controllerAction = VEHICLE_FIREWEAPON;
#else
controllerAction = PED_FIREWEAPON; controllerAction = PED_FIREWEAPON;
#endif
break; break;
case 1: case 1:
case 2: case 2:

View file

@ -253,6 +253,7 @@ enum Config {
#define ALLCARSHELI_CHEAT #define ALLCARSHELI_CHEAT
#define ALT_DODO_CHEAT #define ALT_DODO_CHEAT
#define REGISTER_START_BUTTON #define REGISTER_START_BUTTON
//#define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls
// Hud, frontend and radar // Hud, frontend and radar
#define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better. #define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better.