From 517e2ee9a5fa6f9100378cdcb24a3acd68c01f89 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 20 Aug 2020 12:55:41 +0200 Subject: small fixes --- src/core/main.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/core') diff --git a/src/core/main.h b/src/core/main.h index 9ad4ed1c..96fbef05 100644 --- a/src/core/main.h +++ b/src/core/main.h @@ -20,6 +20,9 @@ extern bool gbShowTimebars; class CSprite2d; +bool DoRWStuffStartOfFrame(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha); +bool DoRWStuffStartOfFrame_Horizon(int16 TopRed, int16 TopGreen, int16 TopBlue, int16 BottomRed, int16 BottomGreen, int16 BottomBlue, int16 Alpha); +void DoRWStuffEndOfFrame(void); void InitialiseGame(void); void LoadingScreen(const char *str1, const char *str2, const char *splashscreen); void LoadingIslandScreen(const char *levelName); -- cgit v1.2.3 From b5ccc721ae73d9cf62480ae5f20c3439a9572fb5 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 20 Aug 2020 19:40:35 +0300 Subject: Add VEHICLE_FIREWEAPON (disabled by default) --- src/core/ControllerConfig.cpp | 48 +++++++++++++++++++++++++++++++++++++++++-- src/core/ControllerConfig.h | 3 +++ src/core/Frontend.cpp | 6 +++++- src/core/config.h | 1 + 4 files changed, 55 insertions(+), 3 deletions(-) (limited to 'src/core') diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp index fe1821c2..4a901d17 100644 --- a/src/core/ControllerConfig.cpp +++ b/src/core/ControllerConfig.cpp @@ -208,7 +208,10 @@ void CControllerConfigManager::InitDefaultControlConfiguration() SetControllerKeyAssociatedWithAction (PED_FIREWEAPON, rsPADINS, KEYBOARD); 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_RIGHT, rsPADENTER, OPTIONAL_EXTRA); // BUG: must be KEYBOARD ? @@ -276,6 +279,9 @@ void CControllerConfigManager::InitDefaultControlConfigMouse(CMouseControllerSta { m_bMouseAssociated = true; SetMouseButtonAssociatedWithAction(PED_FIREWEAPON, 1); +#ifdef BIND_VEHICLE_FIREWEAPON + SetMouseButtonAssociatedWithAction(VEHICLE_FIREWEAPON, 1); +#endif } if (availableButtons.RMB) @@ -361,6 +367,9 @@ void CControllerConfigManager::InitDefaultControlConfigJoyPad(uint32 buttons) SetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_OUT, 3, JOYSTICK); case 2: SetControllerKeyAssociatedWithAction(PED_FIREWEAPON, 2, JOYSTICK); +#ifdef BIND_VEHICLE_FIREWEAPON + SetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, 2, JOYSTICK); +#endif case 1: SetControllerKeyAssociatedWithAction(VEHICLE_ENTER_EXIT, 1, JOYSTICK); /*******************************************************************************************/ @@ -411,6 +420,9 @@ void CControllerConfigManager::InitDefaultControlConfigJoyPad(uint32 buttons) SetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_OUT, 2, JOYSTICK); case 1: SetControllerKeyAssociatedWithAction(PED_FIREWEAPON, 1, JOYSTICK); +#ifdef BIND_VEHICLE_FIREWEAPON + SetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, 1, JOYSTICK); +#endif /*******************************************************************************************/ } } @@ -449,6 +461,9 @@ void CControllerConfigManager::InitialiseControllerActionNameArray() SETACTIONNAME(SHOW_MOUSE_POINTER_TOGGLE); SETACTIONNAME(CAMERA_CHANGE_VIEW_ALL_SITUATIONS); SETACTIONNAME(PED_FIREWEAPON); +#ifdef BIND_VEHICLE_FIREWEAPON + SETACTIONNAME(VEHICLE_FIREWEAPON); +#endif SETACTIONNAME(VEHICLE_ENTER_EXIT); SETACTIONNAME(GO_LEFT); SETACTIONNAME(GO_RIGHT); @@ -644,6 +659,10 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown(int32 button, 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)) { state.LeftShoulder2 = 255; @@ -788,7 +807,11 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_ThirdPersonOnl void CControllerConfigManager::AffectControllerStateOn_ButtonDown_FirstAndThirdPersonOnly(int32 button, eControllerType type, CControllerState &state) { 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)) state.RightShoulder1 = 255; @@ -870,8 +893,11 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_AllStates(int3 { if (button == GetControllerKeyAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS, type)) state.Select = 255; + +#ifndef BIND_VEHICLE_FIREWEAPON if (button == GetControllerKeyAssociatedWithAction(PED_FIREWEAPON, type)) state.Circle = 255; +#endif if (button == GetControllerKeyAssociatedWithAction(GO_LEFT, type)) { @@ -1593,8 +1619,10 @@ void CControllerConfigManager::DeleteMatchingCommonControls(e_ControllerAction a { if (key == GetControllerKeyAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS,type)) ClearSettingsAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS, type); +#ifndef BIND_VEHICLE_FIREWEAPON if (key == GetControllerKeyAssociatedWithAction(PED_FIREWEAPON, type)) ClearSettingsAssociatedWithAction(PED_FIREWEAPON, type); +#endif if (key == GetControllerKeyAssociatedWithAction(GO_LEFT, type)) ClearSettingsAssociatedWithAction(GO_LEFT, type); if (key == GetControllerKeyAssociatedWithAction(GO_RIGHT, type)) @@ -1643,6 +1671,10 @@ void CControllerConfigManager::DeleteMatching1rst3rdPersonControls(e_ControllerA { if (!GetIsKeyBlank(key, type)) { +#ifdef BIND_VEHICLE_FIREWEAPON + if (key == GetControllerKeyAssociatedWithAction(PED_FIREWEAPON, type)) + ClearSettingsAssociatedWithAction(PED_FIREWEAPON, type); +#endif if (key == GetControllerKeyAssociatedWithAction(PED_LOCK_TARGET, type)) ClearSettingsAssociatedWithAction(PED_LOCK_TARGET, type); if (key == GetControllerKeyAssociatedWithAction(GO_FORWARD, type)) @@ -1668,6 +1700,10 @@ void CControllerConfigManager::DeleteMatchingVehicleControls(e_ControllerAction { if (!GetIsKeyBlank(key, type)) { +#ifdef BIND_VEHICLE_FIREWEAPON + if (key == GetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, type)) + ClearSettingsAssociatedWithAction(VEHICLE_FIREWEAPON, type); +#endif if (key == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKBEHIND, type)) ClearSettingsAssociatedWithAction(VEHICLE_LOOKBEHIND, type); if (key == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKLEFT, type)) @@ -1797,7 +1833,9 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio switch (action) { case CAMERA_CHANGE_VIEW_ALL_SITUATIONS: +#ifndef BIND_VEHICLE_FIREWEAPON case PED_FIREWEAPON: +#endif case GO_LEFT: case GO_RIGHT: case NETWORK_TALK: @@ -1819,6 +1857,9 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio return ACTIONTYPE_3RDPERSON; break; +#ifdef BIND_VEHICLE_FIREWEAPON + case VEHICLE_FIREWEAPON: +#endif case VEHICLE_LOOKBEHIND: case VEHICLE_LOOKLEFT: case VEHICLE_LOOKRIGHT: @@ -1839,6 +1880,9 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio return ACTIONTYPE_VEHICLE_3RDPERSON; break; +#ifdef BIND_VEHICLE_FIREWEAPON + case PED_FIREWEAPON: +#endif case PED_LOCK_TARGET: case GO_FORWARD: case GO_BACK: diff --git a/src/core/ControllerConfig.h b/src/core/ControllerConfig.h index 7d0e1073..92017a93 100644 --- a/src/core/ControllerConfig.h +++ b/src/core/ControllerConfig.h @@ -32,6 +32,9 @@ enum e_ControllerAction PED_JUMPING, PED_SPRINT, PED_LOOKBEHIND, +#ifdef BIND_VEHICLE_FIREWEAPON + VEHICLE_FIREWEAPON, +#endif VEHICLE_ACCELERATE, VEHICLE_BRAKE, VEHICLE_CHANGE_RADIO_STATION, diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index d82c5df4..788c1760 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -1634,7 +1634,11 @@ CMenuManager::DrawControllerBound(int32 yStart, int32 xStart, int32 unused, int8 } else if (column == CONTSETUP_VEHICLE_COLUMN) { switch (optionIdx) { case 0: - controllerAction = PED_FIREWEAPON; +#ifdef BIND_VEHICLE_FIREWEAPON + controllerAction = VEHICLE_FIREWEAPON; +#else + controllerAction = PED_FIREWEAPON; +#endif break; case 1: case 2: diff --git a/src/core/config.h b/src/core/config.h index 8e91853d..c4b4fc77 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -231,6 +231,7 @@ enum Config { #define ALLCARSHELI_CHEAT #define ALT_DODO_CHEAT #define REGISTER_START_BUTTON +//#define BIND_VEHICLE_FIREWEAPON // Adds ability to rebind fire key for 'in vehicle' controls // Hud, frontend and radar #define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better. -- cgit v1.2.3 From 73dd29ea3a532eeb49f92c429fd7d12144d8ce62 Mon Sep 17 00:00:00 2001 From: Sergeanur Date: Thu, 20 Aug 2020 19:56:02 +0300 Subject: Cleanup CControllerConfigManager deletion a bit --- src/core/ControllerConfig.cpp | 135 +++++++++++++++--------------------------- 1 file changed, 49 insertions(+), 86 deletions(-) (limited to 'src/core') diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp index 4a901d17..576a58b1 100644 --- a/src/core/ControllerConfig.cpp +++ b/src/core/ControllerConfig.cpp @@ -1613,30 +1613,25 @@ bool CControllerConfigManager::GetIsMouseButtonUp(RsKeyCodes keycode) 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) { if (!GetIsKeyBlank(key, type)) { - if (key == GetControllerKeyAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS,type)) - ClearSettingsAssociatedWithAction(CAMERA_CHANGE_VIEW_ALL_SITUATIONS, type); + CLEAR_ACTION_IF_NEEDED(CAMERA_CHANGE_VIEW_ALL_SITUATIONS); #ifndef BIND_VEHICLE_FIREWEAPON - if (key == GetControllerKeyAssociatedWithAction(PED_FIREWEAPON, type)) - ClearSettingsAssociatedWithAction(PED_FIREWEAPON, type); + CLEAR_ACTION_IF_NEEDED(PED_FIREWEAPON); #endif - if (key == GetControllerKeyAssociatedWithAction(GO_LEFT, type)) - ClearSettingsAssociatedWithAction(GO_LEFT, type); - if (key == GetControllerKeyAssociatedWithAction(GO_RIGHT, type)) - ClearSettingsAssociatedWithAction(GO_RIGHT, type); - if (key == GetControllerKeyAssociatedWithAction(NETWORK_TALK, type)) - ClearSettingsAssociatedWithAction(NETWORK_TALK, type); - if (key == GetControllerKeyAssociatedWithAction(SWITCH_DEBUG_CAM_ON, type)) - 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); + CLEAR_ACTION_IF_NEEDED(GO_LEFT); + CLEAR_ACTION_IF_NEEDED(GO_RIGHT); + CLEAR_ACTION_IF_NEEDED(NETWORK_TALK); + CLEAR_ACTION_IF_NEEDED(SWITCH_DEBUG_CAM_ON); + CLEAR_ACTION_IF_NEEDED(TOGGLE_DPAD); + CLEAR_ACTION_IF_NEEDED(TAKE_SCREEN_SHOT); + CLEAR_ACTION_IF_NEEDED(SHOW_MOUSE_POINTER_TOGGLE); } } @@ -1644,25 +1639,17 @@ void CControllerConfigManager::DeleteMatching3rdPersonControls(e_ControllerActio { if (!GetIsKeyBlank(key, type)) { - if (key == GetControllerKeyAssociatedWithAction(PED_LOOKBEHIND, type)) - ClearSettingsAssociatedWithAction(PED_LOOKBEHIND, type); - if (key == GetControllerKeyAssociatedWithAction(PED_CYCLE_WEAPON_LEFT, type)) - ClearSettingsAssociatedWithAction(PED_CYCLE_WEAPON_LEFT, type); - if (key == GetControllerKeyAssociatedWithAction(PED_CYCLE_WEAPON_RIGHT, type)) - 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); + CLEAR_ACTION_IF_NEEDED(PED_LOOKBEHIND); + CLEAR_ACTION_IF_NEEDED(PED_CYCLE_WEAPON_LEFT); + CLEAR_ACTION_IF_NEEDED(PED_CYCLE_WEAPON_RIGHT); + CLEAR_ACTION_IF_NEEDED(PED_JUMPING); + CLEAR_ACTION_IF_NEEDED(PED_SPRINT); if (CMenuManager::m_ControlMethod == CONTROL_CLASSIC) { - if (key == GetControllerKeyAssociatedWithAction(PED_CYCLE_TARGET_LEFT, type)) - ClearSettingsAssociatedWithAction(PED_CYCLE_TARGET_LEFT, type); - if (key == GetControllerKeyAssociatedWithAction(PED_CYCLE_TARGET_RIGHT, type)) - ClearSettingsAssociatedWithAction(PED_CYCLE_TARGET_RIGHT, type); - if (key == GetControllerKeyAssociatedWithAction(PED_CENTER_CAMERA_BEHIND_PLAYER, type)) - ClearSettingsAssociatedWithAction(PED_CENTER_CAMERA_BEHIND_PLAYER, type); + CLEAR_ACTION_IF_NEEDED(PED_CYCLE_TARGET_LEFT); + CLEAR_ACTION_IF_NEEDED(PED_CYCLE_TARGET_RIGHT); + CLEAR_ACTION_IF_NEEDED(PED_CENTER_CAMERA_BEHIND_PLAYER); } } } @@ -1672,26 +1659,18 @@ void CControllerConfigManager::DeleteMatching1rst3rdPersonControls(e_ControllerA if (!GetIsKeyBlank(key, type)) { #ifdef BIND_VEHICLE_FIREWEAPON - if (key == GetControllerKeyAssociatedWithAction(PED_FIREWEAPON, type)) - ClearSettingsAssociatedWithAction(PED_FIREWEAPON, type); + CLEAR_ACTION_IF_NEEDED(PED_FIREWEAPON); #endif - if (key == GetControllerKeyAssociatedWithAction(PED_LOCK_TARGET, type)) - ClearSettingsAssociatedWithAction(PED_LOCK_TARGET, type); - if (key == GetControllerKeyAssociatedWithAction(GO_FORWARD, type)) - ClearSettingsAssociatedWithAction(GO_FORWARD, type); - if (key == GetControllerKeyAssociatedWithAction(GO_BACK, type)) - ClearSettingsAssociatedWithAction(GO_BACK, type); + CLEAR_ACTION_IF_NEEDED(PED_LOCK_TARGET); + CLEAR_ACTION_IF_NEEDED(GO_FORWARD); + CLEAR_ACTION_IF_NEEDED(GO_BACK); if (CMenuManager::m_ControlMethod == CONTROL_CLASSIC) { - if (key == GetControllerKeyAssociatedWithAction(PED_1RST_PERSON_LOOK_LEFT, type)) - ClearSettingsAssociatedWithAction(PED_1RST_PERSON_LOOK_LEFT, type); - if (key == GetControllerKeyAssociatedWithAction(PED_1RST_PERSON_LOOK_RIGHT, type)) - ClearSettingsAssociatedWithAction(PED_1RST_PERSON_LOOK_RIGHT, type); - 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); + CLEAR_ACTION_IF_NEEDED(PED_1RST_PERSON_LOOK_LEFT); + CLEAR_ACTION_IF_NEEDED(PED_1RST_PERSON_LOOK_RIGHT); + CLEAR_ACTION_IF_NEEDED(PED_1RST_PERSON_LOOK_DOWN); + CLEAR_ACTION_IF_NEEDED(PED_1RST_PERSON_LOOK_UP); } } } @@ -1701,37 +1680,22 @@ void CControllerConfigManager::DeleteMatchingVehicleControls(e_ControllerAction if (!GetIsKeyBlank(key, type)) { #ifdef BIND_VEHICLE_FIREWEAPON - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_FIREWEAPON, type)) - ClearSettingsAssociatedWithAction(VEHICLE_FIREWEAPON, type); + CLEAR_ACTION_IF_NEEDED(VEHICLE_FIREWEAPON); #endif - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKBEHIND, type)) - ClearSettingsAssociatedWithAction(VEHICLE_LOOKBEHIND, type); - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKLEFT, type)) - ClearSettingsAssociatedWithAction(VEHICLE_LOOKLEFT, type); - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKRIGHT, type)) - ClearSettingsAssociatedWithAction(VEHICLE_LOOKRIGHT, type); - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_LOOKBEHIND, type)) // note: dublicate - ClearSettingsAssociatedWithAction(VEHICLE_LOOKBEHIND, type); - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_HORN, type)) - ClearSettingsAssociatedWithAction(VEHICLE_HORN, type); - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_HANDBRAKE, type)) - ClearSettingsAssociatedWithAction(VEHICLE_HANDBRAKE, type); - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_ACCELERATE, type)) - ClearSettingsAssociatedWithAction(VEHICLE_ACCELERATE, type); - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_BRAKE, type)) - ClearSettingsAssociatedWithAction(VEHICLE_BRAKE, type); - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_CHANGE_RADIO_STATION, type)) - 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); + CLEAR_ACTION_IF_NEEDED(VEHICLE_LOOKBEHIND); + CLEAR_ACTION_IF_NEEDED(VEHICLE_LOOKLEFT); + CLEAR_ACTION_IF_NEEDED(VEHICLE_LOOKRIGHT); + CLEAR_ACTION_IF_NEEDED(VEHICLE_LOOKBEHIND); // note: duplicate + CLEAR_ACTION_IF_NEEDED(VEHICLE_HORN); + CLEAR_ACTION_IF_NEEDED(VEHICLE_HANDBRAKE); + CLEAR_ACTION_IF_NEEDED(VEHICLE_ACCELERATE); + CLEAR_ACTION_IF_NEEDED(VEHICLE_BRAKE); + CLEAR_ACTION_IF_NEEDED(VEHICLE_CHANGE_RADIO_STATION); + CLEAR_ACTION_IF_NEEDED(TOGGLE_SUBMISSIONS); + CLEAR_ACTION_IF_NEEDED(VEHICLE_TURRETLEFT); + CLEAR_ACTION_IF_NEEDED(VEHICLE_TURRETRIGHT); + CLEAR_ACTION_IF_NEEDED(VEHICLE_TURRETUP); + CLEAR_ACTION_IF_NEEDED(VEHICLE_TURRETDOWN); } } @@ -1739,8 +1703,7 @@ void CControllerConfigManager::DeleteMatchingVehicle_3rdPersonControls(e_Control { if (!GetIsKeyBlank(key, type)) { - if (key == GetControllerKeyAssociatedWithAction(VEHICLE_ENTER_EXIT, type)) - ClearSettingsAssociatedWithAction(VEHICLE_ENTER_EXIT, type); + CLEAR_ACTION_IF_NEEDED(VEHICLE_ENTER_EXIT); } } @@ -1748,13 +1711,13 @@ void CControllerConfigManager::DeleteMatching1rstPersonControls(e_ControllerActi { if (!GetIsKeyBlank(key, type)) { - if (key == GetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_IN, type)) - ClearSettingsAssociatedWithAction(PED_SNIPER_ZOOM_IN, type); - if (key == GetControllerKeyAssociatedWithAction(PED_SNIPER_ZOOM_OUT, type)) - ClearSettingsAssociatedWithAction(PED_SNIPER_ZOOM_OUT, type); + CLEAR_ACTION_IF_NEEDED(PED_SNIPER_ZOOM_IN); + CLEAR_ACTION_IF_NEEDED(PED_SNIPER_ZOOM_OUT); } } +#undef CLEAR_ACTION_IF_NEEDED + void CControllerConfigManager::DeleteMatchingActionInitiators(e_ControllerAction action, int32 key, eControllerType type) { if (!GetIsKeyBlank(key, type)) -- cgit v1.2.3 From dace79c7c351d77e83afa3f77a9c34763f9292f1 Mon Sep 17 00:00:00 2001 From: aap Date: Thu, 20 Aug 2020 23:45:05 +0200 Subject: small streaming fixes --- src/core/Streaming.cpp | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'src/core') diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp index 1892bf57..507815fa 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -273,8 +273,12 @@ CStreaming::Shutdown(void) { RwFreeAlign(ms_pStreamingBuffer[0]); ms_streamingBufferSize = 0; - if(ms_pExtraObjectsDir) + if(ms_pExtraObjectsDir){ delete ms_pExtraObjectsDir; +#ifdef FIX_BUGS + ms_pExtraObjectsDir = nil; +#endif + } } void @@ -1191,7 +1195,7 @@ found: if(id == -1) return false; // still no luck ms_lastVehicleDeleted = id; - // this is more that we wanted actually + // this is more than we wanted actually ms_numVehiclesLoaded++; }else RemoveModel(id); @@ -1384,18 +1388,17 @@ CStreaming::StreamZoneModels(const CVector &pos) // unload pevious group if(ms_currentPedGrp != -1) for(i = 0; i < NUMMODELSPERPEDGROUP; i++){ - if(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] == -1) - break; - SetModelIsDeletable(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i]); - SetModelTxdIsDeletable(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i]); + if(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] != -1){ + SetModelIsDeletable(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i]); + SetModelTxdIsDeletable(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i]); + } } ms_currentPedGrp = info.pedGroup; for(i = 0; i < NUMMODELSPERPEDGROUP; i++){ - if(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] == -1) - break; - RequestModel(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i], STREAMFLAGS_DONT_REMOVE); + if(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i] != -1) + RequestModel(CPopulation::ms_pPedGroups[ms_currentPedGrp].models[i], STREAMFLAGS_DONT_REMOVE); } } RequestModel(MI_MALE01, STREAMFLAGS_DONT_REMOVE); @@ -1593,8 +1596,6 @@ CStreaming::GetNextFileOnCd(int32 lastPosn, bool priority) * Files larger than the buffer size can only be loaded by channel 0, * which then uses both buffers, while channel 1 is idle. * ms_bLoadingBigModel is set to true to indicate this state. - * - * TODO: two-part files */ // Make channel read from disc @@ -1935,7 +1936,7 @@ CStreaming::UpdateMemoryUsed(void) // empty } -#define STREAM_DIST (2*SECTOR_SIZE_X) +#define STREAM_DIST 80.0f void CStreaming::AddModelsToRequestList(const CVector &pos) @@ -2232,7 +2233,7 @@ CStreaming::DeleteRwObjectsBehindCamera(size_t mem) assert(ymin <= ymax); // Delete a block of sectors that we know is behind the camera - if(TheCamera.GetForward().x > 0){ + if(TheCamera.GetForward().x > 0.0f){ // looking east xmax = Max(ix - 2, 0); xmin = Max(ix - 10, 0); @@ -2254,7 +2255,7 @@ CStreaming::DeleteRwObjectsBehindCamera(size_t mem) } // Now a block that intersects with the camera's frustum - if(TheCamera.GetForward().x > 0){ + if(TheCamera.GetForward().x > 0.0f){ // looking east xmax = Max(ix + 10, 0); xmin = Max(ix - 2, 0); @@ -2296,7 +2297,7 @@ CStreaming::DeleteRwObjectsBehindCamera(size_t mem) assert(xmin <= xmax); // Delete a block of sectors that we know is behind the camera - if(TheCamera.GetForward().y > 0){ + if(TheCamera.GetForward().y > 0.0f){ // looking north ymax = Max(iy - 2, 0); ymin = Max(iy - 10, 0); @@ -2318,7 +2319,7 @@ CStreaming::DeleteRwObjectsBehindCamera(size_t mem) } // Now a block that intersects with the camera's frustum - if(TheCamera.GetForward().y > 0){ + if(TheCamera.GetForward().y > 0.0f){ // looking north ymax = Max(iy + 10, 0); ymin = Max(iy - 2, 0); -- cgit v1.2.3 From 771235d21367bcc293749082aed2086f2a7a5939 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 23 Aug 2020 13:30:21 +0200 Subject: weather fixes --- src/core/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/config.h b/src/core/config.h index c4b4fc77..2c4e26e5 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -209,8 +209,8 @@ enum Config { #define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU //#define USE_TEXTURE_POOL #define CUTSCENE_BORDERS_SWITCH -//#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur) -//#define EXTENDED_PIPELINES // custom render pipelines (includes Neo) +#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur) +#define EXTENDED_PIPELINES // custom render pipelines (includes Neo) #define MULTISAMPLING // adds MSAA option #ifdef LIBRW -- cgit v1.2.3 From 6c63dfd86dc3cd5816dc308d9338906364a81664 Mon Sep 17 00:00:00 2001 From: aap Date: Sun, 23 Aug 2020 13:30:42 +0200 Subject: accidentally enabled extended stuff.... --- src/core/config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/config.h b/src/core/config.h index 2c4e26e5..c4b4fc77 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -209,8 +209,8 @@ enum Config { #define NO_ISLAND_LOADING // disable loadscreen between islands via loading all island data at once, consumes more memory and CPU //#define USE_TEXTURE_POOL #define CUTSCENE_BORDERS_SWITCH -#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur) -#define EXTENDED_PIPELINES // custom render pipelines (includes Neo) +//#define EXTENDED_COLOURFILTER // more options for colour filter (replaces mblur) +//#define EXTENDED_PIPELINES // custom render pipelines (includes Neo) #define MULTISAMPLING // adds MSAA option #ifdef LIBRW -- cgit v1.2.3