282 Commits

Author SHA1 Message Date
Kawe Mazidjatari
9fd41688e2 Compile full protobuf library
Needed for LiveAPI as reflection/descriptors will be used.
2024-04-05 18:33:10 +02:00
Kawe Mazidjatari
b3a68ed095 Add EABase, EAThread and DirtySDK to R5sdk
DirtySDK (EA's Dirty Sockets library) will be used for the LiveAPI implementation, and depends on: EABase, EAThread.
2024-04-05 18:29:03 +02:00
Kawe Mazidjatari
4d0c5dd3da Protobuf: fix compile error
template Delete<UnknownFieldSet>(); doesn't compile on vs2017 15.6, removed template qualifier.
2024-04-05 18:27:10 +02:00
Kawe Mazidjatari
d11718a956 ImGui: slightly improve cursor scrolling
Add +1 on the right to prevent the cursor from getting under the perimeter, also add note for when feedback loop issue is fixed to accommodate for scrollbar when scrolling.
2024-04-05 18:24:35 +02:00
Kawe Mazidjatari
431621a1cc ImGui: constify local variables 2024-04-05 18:24:35 +02:00
Kawe Mazidjatari
bd797a92db ImGui: fix cursor scrolling bug
* Fix bug where moving cursor all the way to the top + little bit, and then moving below will also scroll the text position below (cursor sticked to top rect).
* Fix bug where cursor skipped a column when moving it past the right perimeter of the console.
2024-04-05 18:24:35 +02:00
Kawe Mazidjatari
3273b7112c ImGui: better name for blinker timer in logger 2024-04-05 18:24:35 +02:00
Kawe Mazidjatari
fda018785e ImGui: upgrade backend to 1.90.4 as well
This wasn't committed, but was supposed to be part of commit 7f6846a3
2024-04-05 18:24:34 +02:00
Kawe Mazidjatari
264c104b09 ImGui: properly implement shift select
The new method wraps around perfectly when the new selection positions overlap each other. This patch also fixes the shift selection drifting when lines are getting deleted.
2024-04-05 18:24:33 +02:00
Kawe Mazidjatari
6f158811e6 ImGui: fix logger not moving end interactive + reduce duplicate code
Only the start interactive was moved if lines were deleted to clamp the vector size. Also fixed the code so the interactives always move if lines get deleted from before their positions, instead of "if" only the mouse is held down.
2024-04-05 18:24:33 +02:00
Kawe Mazidjatari
1f8cd45626 ImGui: make config singleton static
Avoid indirection, also deduplicate common style var assignments.
2024-04-05 18:24:33 +02:00
Kawe Mazidjatari
bddde13b06 ImGui: use Dear ImGui API for the cursor render blinker 2024-04-05 18:19:41 +02:00
Kawe Mazidjatari
405a16d982 ImGui: fix regression in logger after improving cursor selections
If you triple click a line in the logger, the selection mode will be set to SelectionMode::Line, however, when we drag with the mouse, the selection remain on SelectionMode::Line, causing the cursor to be stuck, which breaks the ability to scroll select. Mode must be set to normal during dragging.
2024-04-05 18:19:41 +02:00
Kawe Mazidjatari
71f151397a ImGui: initialize newly added member vars and fix scrolling regression
The types should be floats instead of ints, the compiler actually compiled it as ints after changing to ImCeil. Made vars of correct type and removed extraneous casts.
2024-04-05 18:19:41 +02:00
Kawe Mazidjatari
ef6cd5e444 ImGui: add ability to reset horizontal scroll position
This allows us to reset the horizontal position only when an user submitted a console command in the text box. We don't want to reset the horizontal position if new lines are added since user could still be reading text that is otherwise clipped away.
2024-04-05 18:19:40 +02:00
Kawe Mazidjatari
c80d6eb0d2 ImGui: fix bug in CTextEditor::IsHandleMouseInputsEnabled
Returned the incorrect value, should've returned m_bHandleMouseInputs.
2024-04-05 18:19:40 +02:00
Kawe Mazidjatari
56b73af57d ImGui: add multiple fixes and improvements
Add some selection improvements from maintained version at https://github.com/santaclose/ImGuiColorTextEdit.

patch contains:
* advance cursor to end of selection
* add shift + mouse select
2024-04-05 18:19:40 +02:00
Kawe Mazidjatari
dac0ab4d99 ImGui: fix right move
Ctrl + arrow should move to word end, not next word. This also fixes a bug where it would index into into the second character when the line end gets reached.
2024-04-05 18:19:40 +02:00
Kawe Mazidjatari
197772e5f7 ImGui: fix logger not showing horizontal scrollbar when text clips 2024-04-05 18:19:40 +02:00
Kawe Mazidjatari
db2b42cb03 ImGui: heavy optimizations to text logger (WIP)
This code originated from an imgui code editor, where it would make sense to have per-character colors. But for the console, we only ever do 1 color per line. Just store the string and one color instance, this also allows us to just take the string instead of manually reconstructing it which is very slow. The code now also only stores 32bits for color (per line) instead of 128 bits (ImVec4) as we only ever need to convert it once.

As a result, a bunch of rendering code could be dropped, and the pass filter is now also very fast as we don't need to reconstruct the string to check for the filter, we just pass a char* in which doesn't cost any perf.
2024-04-05 18:19:40 +02:00
Kawe Mazidjatari
85c7db410d ImguiSystem: properly implement ImGui and fix several bugs
Moved implementation to dedicated class 'CImguiSystem' with the following changes:

* Added mutex for ImGui_ImplWin32_WndProcHandler(), the window proc is ran from a different thread than CImguiSystem::SampleFrame() is being called from. Needs a mutex as both functions interact with the input queue list.

* Added init stages for debugging and preventing the system from running certain parts of the code if a certain stage hasn't been reached yet.

* NULL out ImGuiContext::ConfigNavWindowingKeyNext , we don't need any nav window shortcuts as users don't need then in-game, and it also interferes with certain key binds some users have.

* CImguiSystem::SampleFrame() (previously ImguiSystem_SampleFrame()), is now being called from CMaterialSystem::SwapBuffers(), as that function is called from the main thread while also getting updated during level loads/etc, so instead of switching between 2 static buffers for as long as the levels are being loaded, we imgui updates properly too and directly swap afterwards.

* Removed hack in CGame::WindowProc() where we would only run windowproc if we aren't shutting the game down. This was needed as there was a chance of a crash at some rare cases, but this was simply due to a missing mutex which has been addressed and fixed as of this commit.

* Lock mutex during init and shutdown.
2024-04-05 18:19:39 +02:00
Kawe Mazidjatari
9e6559a244 ImGui: set X scroll in console window as well
Previously only the Y would reset, making you not see the end if you were scrolled too far in the X.
2024-04-05 18:19:39 +02:00
Kawe Mazidjatari
6cf88dc16c Engine: render ImGui in main thread and fix many threading bugs
ImGui drawing code now takes place in the main thread, a snapshot of the render data is created in CMaterialSystem::SwapBuffers(), and is being rendered in the render thread right before SpinPresent().

The reason why this was necessary, is because ConVar::GetString() isn't thread safe if its not marked FCVAR_MATERIAL_SYSTEM_THREAD or FCVAR_ACCESSIBLE_FROM_THREADS, and we used it for the console suggestions window, which iterates over every ConVar, accessible from threads or not.
2024-04-05 18:17:12 +02:00
Kawe Mazidjatari
1ac38516d8 Upgrade Dear ImGui to 1.90.4 2024-04-05 18:13:33 +02:00
Kawe Mazidjatari
04613822ae Thirdparty: add LZ4 to project
Will be used for data block sender/receiver rebuild
2024-04-05 17:58:51 +02:00
Kawe Mazidjatari
ff9aa78d0d Thirdparty: upgrade SpdLog to 1.13.0 2024-04-05 17:56:52 +02:00
Kawe Mazidjatari
c8e5d263bd Thirdparty: upgrade to latest RapidJSON 2024-04-05 17:56:51 +02:00
Kawe Mazidjatari
29c7cc9e58 ZStd: explicitly set debug level
Explicitly set to 0 for release
2024-04-05 17:56:50 +02:00
Kawe Mazidjatari
cbae59a158 ZStd: fix typo in CMakeLists
Incorrect filter name
2024-04-05 17:56:47 +02:00
Kawe Mazidjatari
a9ed0762e1 ZStd: suppress thirdparty code warnings 2024-04-05 17:56:47 +02:00
Kawe Mazidjatari
2b06bc8abb Add ZSTD to SDK 2024-04-05 17:53:22 +02:00
Kawe Mazidjatari
ee82d5d8e0 Tier1: move KeyValues class to Tier1
The KeyValues class belongs here. Also reimplemented most loading methods for KeyValues, and adjusted the VPK building code to account for it. Pointers to the engine's implementation of KeyValues have been moved to a separate header ('keyvalues_iface.h'), as this allows external tools code to utilize the standalone KeyValues class implementation. Playlist utilities are completely separated from the KeyValues header; these have nothing to do with KeyValues other than manipulating a global KeyValues object for the playlists, and thus have been named as such and moved to rtech/playlists.
2024-04-05 17:42:05 +02:00
Kawe Mazidjatari
1f7bbe5b92 Recast: make detail mesh edge detection more robust
Merge recastnavitagion/recastnavitagion@c393777d26
Instead of using a distance check which can fail at large magnitudes due
to low precision we can check whether the edges are actually on the
hull.
2024-04-05 17:19:29 +02:00
Kawe Mazidjatari
e3bf2036b3 Recast: fix:rcBuildLayerRegions missing areaType
Merge recastnavitagion/recastnavitagion@ddaa361b08
2024-04-05 17:19:28 +02:00
Kawe Mazidjatari
144d5f62e1 IDetour: code refactor
Utilize the new IDetour::DetourSetup() code, IDetour::Attach and IDetour::Detach have been removed in favor of this (significantly reduces chance of user error). Since the template check happens in the idetour header, it is much more aggressive on type mismatches, such as a difference in parameter types, between the function and detour, will now raise a compile time error. As a result, some type mismatches have been fixed in this commit as well.
2024-04-05 16:41:09 +02:00
Kawe Mazidjatari
3831058f81 New method for IDetour
This will deprecate IDetour::Attach and IDetour::Detatch. This should reduce the chances of potential errors caused by using the wrong function in the wrong method (e.g. using DetourAttach in IDetour::Detatch).
2024-04-05 16:41:09 +02:00
Kawe Mazidjatari
8c22d9ed80 Fix compiler warnings on Visual Studio 2017
Should not be a constexpr, this caused cryptic errors in template code when compiling the code with older compilers.
2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
e2b231f4e0 Fix declaration/implementation mismatch 2024-04-05 16:34:29 +02:00
Kawe Mazidjatari
5d9b9ec9d5 Fix CVE-2023-38546
Merge: curl/curl@61275672b4
2024-04-05 16:21:45 +02:00
Kawe Mazidjatari
8bd1fa4c6e Fix JWT compile errors and warnings 2024-04-05 16:21:44 +02:00
Kawe Mazidjatari
dc011e5d99 Add MbedTLS library to SDK
Will be used for the JWS library, should eventually be replaced with SChannel.
2024-04-05 16:21:44 +02:00
Kawe Mazidjatari
cc3b91a3b6 WIP: add JWT library
Currently does not compile, pending integration into SDK.
2024-04-05 16:05:56 +02:00
Kawe Mazidjatari
156e31404e Light protobuf cmakelist cleanup
Add missing files and remove unused version file (version file was also incorrect, it mentions version 3.19 but we have 3.21.12).
2023-09-17 22:06:15 +02:00
Kawe Mazidjatari
7b5f40fb9d Upgrade spdlog library to 1.12.0 2023-09-17 20:37:44 +02:00
Kawe Mazidjatari
00aee57e7c Add NVIDIA SDK 2023-09-09 14:50:11 +02:00
Kawe Mazidjatari
b85003a9ac Replace JSON library with RapidJSON
Less copies and overall CPU time parsing/constructing JSON's as we are mostly still using string pointers rather than STL string container.
2023-09-07 11:17:05 +02:00
Kawe Mazidjatari
abaab38d9d Rename dtOffMeshConnection field
CAI_Navigator::m_traverseRefYaw gets set to this field.
2023-08-29 00:33:48 +02:00
Kawe Mazidjatari
9049e61d34 Move pointers to 'dtQueryData' struct
In the engine, m_query gets memset to size '0x58', and it passes this field as reference to other functions which then access the 3 pointers. Moving the 3 pointers there made the struct size 0x58, and showed a much better disassembly. Moved these type here to reflect the changes made in the engine.
2023-08-27 23:56:11 +02:00
Kawe Mazidjatari
71b0781715 Utilize 'DevMsg()' for uncertain builds only
Only uncertain builds will contain DevMsg()/DevWarning() prints. For retail, Msg() and Warning() should be used instead.
2023-08-21 19:12:29 +02:00
Kawe Mazidjatari
5c05f91891 Custom class name for SDK Launcher
Something that could be searched up without clashes and pulled up front.
2023-07-31 23:26:34 +02:00