32 Commits

Author SHA1 Message Date
Kawe Mazidjatari
8d6358512b Debug overlay cleanup 2023-01-24 18:43:00 +01:00
Kawe Mazidjatari
502a1d2324 Switch box overlay transform type to 'matrix3x4_t'
Actual type turned out to be 'matrix3x4_t' after further reverse engineering.
2023-01-23 02:20:21 +01:00
Kawe Mazidjatari
2501c37044 Globally convert all byte patterns to strings
These get reconverted to masked byte patterns at runtime. With the signature map cache system, this will only happen when building the cache.
2022-12-01 22:44:55 +01:00
Amos
70ad249762 Initialize OverlayBase_t::m_nFlags 2022-11-02 14:30:04 +01:00
Kawe Mazidjatari
2a86970f12 Fix Smart Pistol's trajectory trace (laser line)
The smart pistol's laser line overlay did not draw after the debug overlay rebuild. After some small debugging, I found out that there was a function that creates the curved trace, and creates an overlay with index 4 (originally swept_box), however, the structure is different to that of swept_box. This is laser_line. Implemented logic for drawing out laser line, which essentially just calls DrawLine (as is the case in the engine).
2022-10-30 23:38:19 +01:00
Kawe Mazidjatari
5548a74d59 Major cleanup (see description)
* Fix all compiler error for GameSDK on S0 and S1.
* Remove some unused patterns and globals (launch performance gains of 100ms).
* Remove most duplicate patterns.
* Relocate globals from engine to a more appropriate location.
* Renamed some unknown vars to a more appropriate name (most of these where obtained a while back, but as we reversed more parts of the engine, some of these vars become known).
* Renamed some vars to fit the naming convention used in the SDK.
* Fixed pattern debug logging using the wrong pointer, thus displaying the wrong address.
2022-08-18 02:15:23 +02:00
Kawe Mazidjatari
8c6ee8a834 Remove 'm' prefix from dll globals
Large commit.
2022-08-09 03:02:00 +02:00
Kawe Mazidjatari
7de9dfd2d9 Add missing field to OverlayBox_t 2022-07-12 15:38:51 +02:00
Kawe Mazidjatari
521cbad760 Proper SSE structure for OverlayBox_t::Transforms 2022-07-12 12:28:23 +02:00
Kawe Mazidjatari
e8a0c5e752 Add cvar for debug overlay z-buffer.
Only OverlayLine_t has a field to determine whether or not to ignore the z-buffer.
Added ConVar 'r_debug_overlay_zbuffer' to allow setting z-buffer for all overlays.
2022-07-11 21:23:26 +02:00
Kawe Mazidjatari
96abdf619c Rebuild 'ai_script_nodes_draw'
Originally stripped from retail.
2022-07-11 12:00:08 +02:00
Kawe Mazidjatari
39094ab11b Change v_RenderBox prototype to take const reference on transforms. 2022-07-10 14:39:03 +02:00
Kawe Mazidjatari
856b386945 Debug overlay improvements and new render utilities.
Fixed internal RenderBox transforms (origin and angles are packed in xmm registers).
Added new render utilities in the SDK similar to the script ones.
2022-07-10 14:30:28 +02:00
Kawe Mazidjatari
d8a45ae563 Overlay improvements
* Move render utils to dedicated file.
* Implement more render/mesh utils.
* Added structure for OverlayTriangle_t, OverlaySweptBox_t and OverlayCapsule_t.
OverlayCapsule_t has been modified to accommodate the size in r5 (2 new vectors).
2022-07-07 21:31:00 +02:00
Kawe Mazidjatari
7d89a42b56 Mathlib implementation
SourceSDK mathlib port with light modifications.
Renamed Vector to Vector3D (to avoid confusion with std::vector (declared as vector) and Vector2D/Vector4D).
2022-07-06 21:11:32 +02:00
Kawe Mazidjatari
e45cba48be Box overlay progress 2022-07-06 11:22:37 +02:00
Kawe Mazidjatari
f98a575dfa Fix S1 compiler errors 2022-06-18 21:24:02 +02:00
Kawe Mazidjatari
e711c54bf9 DebugOverlay improvements
Use rebuild 'DestroyOverlay()'
Use 'size_t' type for MemAlloc_Internal alloc size.
2022-06-15 01:35:48 +02:00
Kawe Mazidjatari
e70e4d1a8c Add DebugOverlay implementation 2022-06-15 01:24:29 +02:00
Kawe Mazidjatari
3144227ec8 Update GetAdr implementations to feature spdlog
Fixed all alignments and reduced code verbosity
2022-05-13 14:53:25 +02:00
Kawe Mazidjatari
e32cc6ae6a Code overhaul
Moved every pattern to IDetour interface. This allows for debugging patterns scans more easily, and create threads during pattern searching (Operation is now fired in APIENTRY).

Also cleaned up some unused code/extraneous comments.
Slightly increased performance by purging duplicate patterns.
Made variable search less dependent from other results (except if pattern-to-scan results is within the same header)
2022-04-18 03:35:08 +02:00
Kawe Mazidjatari
092b7e9d43 Start of migration to IDetour interface
Migrating to this to initialize all patterns and prototypes in Systems_Init() instead.
This should make debugging missing/not found patterns easier and allow for opting out variable/constant search (some of these require other patterns to be found, thus resulting in seg faults..).

Also added check to detect if user has a eligible CPU to run this SDK.
The game requires SSE and SSE2 instruction sets. Our SDK requires this too due to the use of SSE intrinsics, so we cannot let the game handle this. We have to check it ourselves.
2022-04-11 01:44:30 +02:00
Kawe Mazidjatari
8c1dfb50f4 Address class cleanup/improvements
* Move most definitions to implementation file to avoid recompiling whole program for small changes
* Pass strings by reference for where possible.
* Split Module class to dedicated file.
* Add const qualifiers to all eligible methods for address/module class
* Some renaming
2022-04-10 19:59:34 +02:00
Kawe Mazidjatari
b3631facbe Update all function casts 2022-04-09 06:05:47 +02:00
Kawe Mazidjatari
e2f06a8a68 Massive performance improvements
Inline every signature defined in the SDK (previously each translation unit had its own copy of the signature and function prototype). DLL init is near instant now (85% speed improvements).
2022-04-09 02:18:57 +02:00
Kawe Mazidjatari
aa57170e0d Start of pattern search refactor 2022-04-09 01:14:22 +02:00
Amos
16f2bbc45c Adapt even more to new log system 2022-03-07 11:32:12 +01:00
Amos
98a428ace9 Fix S2 crash when launching a different version 2022-01-07 01:03:41 +01:00
Amos
c486c2d593 Portability to S2 completed
CServer functions are evolving quite heavily over these seasons, so these need a bit of work
2022-01-05 02:11:21 +01:00
Amos
fbcea85631 Fix compiler error caused by merging commits from different branches 2022-01-04 12:11:59 +01:00
Amos
22c0b5c867 Dedicated server improvements 2021-12-30 17:20:47 +01:00
Amos
39a8a8fd30 Implement patch to enable 'DrawAllOverlays()'. 2021-12-30 02:36:43 +01:00