From b956be0f44930fe1d764c07e680f7cee47c1587a Mon Sep 17 00:00:00 2001 From: Roman Masanin <36927roma@gmail.com> Date: Sun, 27 Sep 2020 04:22:59 +0300 Subject: another clamp --- src/core/common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/core') diff --git a/src/core/common.h b/src/core/common.h index ba1d24ef..0a2a236e 100644 --- a/src/core/common.h +++ b/src/core/common.h @@ -219,6 +219,8 @@ extern int strncasecmp(const char *str1, const char *str2, size_t len); #define clamp(v, low, high) ((v)<(low) ? (low) : (v)>(high) ? (high) : (v)) +#define clamp2(v, center, radius) ((v) < (center) ? Max(v, center - radius) : Min(v, center + radius)) + inline float sq(float x) { return x*x; } #define SQR(x) ((x) * (x)) -- cgit v1.2.3 From a0588ef8b1e54765c042dd5cdeb9b4b31cad578f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?eray=20or=C3=A7unus?= Date: Tue, 29 Sep 2020 02:29:10 +0300 Subject: Restore All Cars are Heli cheat --- src/core/ControllerConfig.cpp | 3 --- src/core/Pad.cpp | 4 ++-- src/core/Pad.h | 8 +++----- src/core/config.h | 5 ++--- 4 files changed, 7 insertions(+), 13 deletions(-) (limited to 'src/core') diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp index b0e04e2b..e7982221 100644 --- a/src/core/ControllerConfig.cpp +++ b/src/core/ControllerConfig.cpp @@ -733,9 +733,6 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown_Driving(int32 FindPlayerVehicle()->GetModelIndex() == MI_DODO #ifdef FIX_BUGS || CVehicle::bAllDodosCheat -#ifdef ALLCARSHELI_CHEAT - || bAllCarCheat -#endif #endif ))) { diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp index a8ccbc36..36e14e55 100644 --- a/src/core/Pad.cpp +++ b/src/core/Pad.cpp @@ -526,7 +526,7 @@ void KangarooCheat() } #endif -#ifdef ALLCARSHELI_CHEAT +#ifdef RESTORE_ALLCARSHELI_CHEAT void AllCarsHeliCheat(void) { wchar* string; @@ -1438,7 +1438,7 @@ void CPad::AddToPCCheatString(char c) CPed::SwitchDebugDisplay(); #endif -#ifdef ALLCARSHELI_CHEAT +#ifdef RESTORE_ALLCARSHELI_CHEAT // "CARSAREHELI" if (!_CHEATCMP("ILEHERASRAC")) AllCarsHeliCheat(); diff --git a/src/core/Pad.h b/src/core/Pad.h index 72851317..cde2d3c5 100644 --- a/src/core/Pad.h +++ b/src/core/Pad.h @@ -286,6 +286,8 @@ public: bool GetMiddleMouseJustUp() { return !!(!NewMouseControllerState.MMB && OldMouseControllerState.MMB); } bool GetMouseWheelUpJustUp() { return !!(!NewMouseControllerState.WHEELUP && OldMouseControllerState.WHEELUP); } bool GetMouseWheelDownJustUp() { return !!(!NewMouseControllerState.WHEELDN && OldMouseControllerState.WHEELDN); } + bool GetMouseX1JustUp() { return !!(!NewMouseControllerState.MXB1 && OldMouseControllerState.MXB1); } + bool GetMouseX2JustUp() { return !!(!NewMouseControllerState.MXB2 && OldMouseControllerState.MXB2); } bool GetLeftMouse() { return NewMouseControllerState.LMB; } bool GetRightMouse() { return NewMouseControllerState.RMB; } @@ -469,8 +471,4 @@ public: }; VALIDATE_SIZE(CPad, 0xFC); -extern CPad Pads[MAX_PADS]; - -#ifdef ALLCARSHELI_CHEAT -extern bool bAllCarCheat; -#endif +extern CPad Pads[MAX_PADS]; \ No newline at end of file diff --git a/src/core/config.h b/src/core/config.h index 82044f75..327230d0 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -250,7 +250,7 @@ enum Config { #endif #define DETECT_PAD_INPUT_SWITCH // Adds automatic switch of pad related stuff between controller and kb/m #define KANGAROO_CHEAT -#define ALLCARSHELI_CHEAT +#define RESTORE_ALLCARSHELI_CHEAT #define ALT_DODO_CHEAT #define WALLCLIMB_CHEAT #define REGISTER_START_BUTTON @@ -258,14 +258,13 @@ enum Config { // Hud, frontend and radar #define HUD_ENHANCEMENTS // Adjusts some aspects to make the HUD look/behave a little bit better. -#define BETA_SLIDING_TEXT +//#define BETA_SLIDING_TEXT #define TRIANGULAR_BLIPS // height indicating triangular radar blips, as in VC #define PC_MENU #ifndef PC_MENU # define PS2_MENU //# define PS2_MENU_USEALLPAGEICONS -//# define PS2_LIKE_MENU // An effort to recreate PS2 menu, cycling through tabs, different bg etc. #else # define MAP_ENHANCEMENTS // Adding waypoint etc. # define TRIANGLE_BACK_BUTTON -- cgit v1.2.3 From 35d7591defb352c2af49af0d6e0d3340e7b59672 Mon Sep 17 00:00:00 2001 From: shfil Date: Sat, 26 Sep 2020 20:11:25 +0200 Subject: some SilentPatch fixes # Conflicts: # src/core/Camera.cpp # src/weapons/Weapon.cpp --- src/core/CdStream.cpp | 4 +++- src/core/Radar.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'src/core') diff --git a/src/core/CdStream.cpp b/src/core/CdStream.cpp index d9978040..c11fb72a 100644 --- a/src/core/CdStream.cpp +++ b/src/core/CdStream.cpp @@ -106,12 +106,14 @@ CdStreamInit(int32 numChannels) GetDiskFreeSpace(nil, &SectorsPerCluster, &BytesPerSector, &NumberOfFreeClusters, &TotalNumberOfClusters); _gdwCdStreamFlags = 0; - + +#ifndef FIX_BUGS // this just slows down streaming if ( BytesPerSector <= CDSTREAM_SECTOR_SIZE ) { _gdwCdStreamFlags |= FILE_FLAG_NO_BUFFERING; debug("Using no buffered loading for streaming\n"); } +#endif _gbCdStreamOverlapped = TRUE; diff --git a/src/core/Radar.cpp b/src/core/Radar.cpp index 559a8cd6..b9fc369d 100644 --- a/src/core/Radar.cpp +++ b/src/core/Radar.cpp @@ -1151,6 +1151,10 @@ int CRadar::SetCoordBlip(eBlipType type, CVector pos, int32 color, eBlipDisplay if (!ms_RadarTrace[nextBlip].m_bInUse) break; } +#ifdef FIX_BUGS + if (nextBlip == NUMRADARBLIPS) + return -1; +#endif ms_RadarTrace[nextBlip].m_eBlipType = type; ms_RadarTrace[nextBlip].m_nColor = color; ms_RadarTrace[nextBlip].m_bDim = true; @@ -1182,6 +1186,10 @@ int CRadar::SetEntityBlip(eBlipType type, int32 handle, int32 color, eBlipDispla if (!ms_RadarTrace[nextBlip].m_bInUse) break; } +#ifdef FIX_BUGS + if (nextBlip == NUMRADARBLIPS) + return -1; +#endif ms_RadarTrace[nextBlip].m_eBlipType = type; ms_RadarTrace[nextBlip].m_nColor = color; ms_RadarTrace[nextBlip].m_bDim = true; @@ -1526,6 +1534,10 @@ CRadar::ToggleTargetMarker(float x, float y) if (!ms_RadarTrace[nextBlip].m_bInUse) break; } +#ifdef FIX_BUGS + if (nextBlip == NUMRADARBLIPS) + return; +#endif ms_RadarTrace[nextBlip].m_eBlipType = BLIP_COORD; ms_RadarTrace[nextBlip].m_nColor = 0x333333FF; ms_RadarTrace[nextBlip].m_bDim = 1; -- cgit v1.2.3 From 6c59d97520c309a5fff6ed6da4499518281817ba Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Tue, 29 Sep 2020 17:16:02 +0200 Subject: Fix warning ISO C++11 does not allow conversion from string literal to 'char * --- src/core/timebars.cpp | 4 ++-- src/core/timebars.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/timebars.cpp b/src/core/timebars.cpp index 884feffd..f7dedf0c 100644 --- a/src/core/timebars.cpp +++ b/src/core/timebars.cpp @@ -50,7 +50,7 @@ void tbInit() #endif } -void tbStartTimer(int32 unk, char *name) +void tbStartTimer(int32 unk, const char *name) { strcpy(TimerBar.Timers[TimerBar.count].name, name); TimerBar.Timers[TimerBar.count].unk = unk; @@ -58,7 +58,7 @@ void tbStartTimer(int32 unk, char *name) TimerBar.count++; } -void tbEndTimer(char* name) +void tbEndTimer(const char* name) { uint32 n = 1500; for (uint32 i = 0; i < TimerBar.count; i++) { diff --git a/src/core/timebars.h b/src/core/timebars.h index 6d3b853e..1a5a0573 100644 --- a/src/core/timebars.h +++ b/src/core/timebars.h @@ -1,6 +1,6 @@ #pragma once void tbInit(); -void tbStartTimer(int32, char*); -void tbEndTimer(char*); +void tbStartTimer(int32, const char*); +void tbEndTimer(const char*); void tbDisplay(); \ No newline at end of file -- cgit v1.2.3 From 73e4350320a11b0f3ca7530cedc9364363c2ce03 Mon Sep 17 00:00:00 2001 From: Filip Gawin Date: Tue, 29 Sep 2020 17:27:36 +0200 Subject: Use Const instead of const (last commit) --- src/core/timebars.cpp | 4 ++-- src/core/timebars.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/core') diff --git a/src/core/timebars.cpp b/src/core/timebars.cpp index f7dedf0c..31949009 100644 --- a/src/core/timebars.cpp +++ b/src/core/timebars.cpp @@ -50,7 +50,7 @@ void tbInit() #endif } -void tbStartTimer(int32 unk, const char *name) +void tbStartTimer(int32 unk, Const char *name) { strcpy(TimerBar.Timers[TimerBar.count].name, name); TimerBar.Timers[TimerBar.count].unk = unk; @@ -58,7 +58,7 @@ void tbStartTimer(int32 unk, const char *name) TimerBar.count++; } -void tbEndTimer(const char* name) +void tbEndTimer(Const char* name) { uint32 n = 1500; for (uint32 i = 0; i < TimerBar.count; i++) { diff --git a/src/core/timebars.h b/src/core/timebars.h index 1a5a0573..3871b61c 100644 --- a/src/core/timebars.h +++ b/src/core/timebars.h @@ -1,6 +1,6 @@ #pragma once void tbInit(); -void tbStartTimer(int32, const char*); -void tbEndTimer(const char*); +void tbStartTimer(int32, Const char*); +void tbEndTimer(Const char*); void tbDisplay(); \ No newline at end of file -- cgit v1.2.3