221 Commits

Author SHA1 Message Date
Kawe Mazidjatari
f120354e96 Initial port to CMake
* All libraries have been isolated from each other, and build into separate artifacts.
* Project has been restructured to support isolating libraries.
* CCrashHandler now calls a callback on crash (setup from core/dllmain.cpp, this can be setup in any way for any project. This callback is getting called when the apllication crashes. Useful for flushing buffers before closing handles to logging files for example).
* Tier0 'CoreMsgV' function now calls a callback sink, which could be set by the user (currently setup to the SDK's internal logger in core/dllmain.cpp).

TODO:
* Add a batch file to autogenerate all projects.
* Add support for dedicated server.
* Add support for client dll.

Bugs:
* Game crashes on the title screen after the UI script compiler has finished (root cause unknown).
* Curl error messages are getting logged twice for the dedicated server due to the removal of all "DEDICATED" preprocessor directives to support isolating projects. This has to be fixed properly!
2023-05-10 00:05:38 +02:00
Kawe Mazidjatari
381f09b1d7 CTextLogger: Skip newline characters when advancing cursor
Skip newline characters to avoid having to issue a move left/right command twice before seeing the cursor move.
2023-04-09 23:33:10 +02:00
Kawe Mazidjatari
dbf3b5b91d Improve ImGui logger API
* Better structure packing (reduced padding).
* 'CTextLogger::GetFilter' now returns a reference to 'm_itFilter'.
* Added additional setters and getters.
2023-04-09 22:35:55 +02:00
Kawe Mazidjatari
b0f94fd641 Fix compiler warnings
* Comment unused code.
* Explicitly cast input and results to/from 'toupper'.
2023-04-09 22:24:25 +02:00
Kawe Mazidjatari
a39afd4efe CTextLogger: Manage keyboard and mouse inputs
Manage them under 1 member variable.
2023-04-09 19:53:33 +02:00
Kawe Mazidjatari
d46cc0d6b1 Remove unused member variables 2023-04-09 19:37:00 +02:00
Kawe Mazidjatari
fe2bd4c4d8 Make sure only UTF-8 encoded strings are getting logged
This should fix all bugs and vulnerabilities to the ImGui console. This code has been fuzzed for hours without triggering any exceptions or assertions.
2023-04-09 19:36:30 +02:00
Kawe Mazidjatari
810870b611 Fix buffer overflow in ImGui text logger
Fix a potential buffer overflow that could be triggered by logging invalid characters to the Dear ImGui console. The incrementation of the loop control variable performed by 'UTF8CharLength' was never validated.
2023-04-09 16:15:08 +02:00
Kawe Mazidjatari
d620a7efe8 Fix compiler warnings in cppnet
Constant expressions.
2023-04-03 14:53:17 +02:00
Kawe Mazidjatari
40f065bc1d Fix warnings in cppkore 2023-04-03 14:51:45 +02:00
Kawe Mazidjatari
d8cc85da6b Fix symbol shadowing warnings
'uint' is defined in pseudodefs.h, but also in format.h. The definition in pseudodefs.h shadows the one in format.h. Since the one in format.h is local, it has been renamed to 'uinty' to avoid this behavior.
2023-04-03 01:40:21 +02:00
Kawe Mazidjatari
ae431c6ac2 /W4: Fix unreferenced symbol warnings
Fix verbose unreferenced symbol warnings.
2023-04-02 17:02:04 +02:00
Kawe Mazidjatari
7cc58a642f Rename and mark detour globals as static
Renamed to 'g_DetourVector' and 'g_DetourSet', marked as static.
2023-04-01 13:17:23 +02:00
Kawe Mazidjatari
f9c5986245 Upgrade Dear ImGui to 1.89.4
Upgrade and light restructure of ImGui directory.
2023-03-29 00:19:19 +02:00
Kawe Mazidjatari
387b24875b Downgrade 'libcurl' to 7.54.0
The game uses 7.54.0, downgraded to maintain compatibility if we ever hook curl functions.
2023-03-28 23:14:26 +02:00
Kawe Mazidjatari
654d7a97e7 Remove extraneous trailing semicolon 2023-03-28 21:18:11 +02:00
Kawe Mazidjatari
9dd34ef53a Merge recastnavigation/recastnavigation@8e9c308afd 2023-03-25 17:17:45 +01:00
Kawe Mazidjatari
cea69d3637 Merge recastnavigation/recastnavigation@3c4a34968a 2023-03-25 17:17:12 +01:00
Kawe Mazidjatari
3649f9be5c Remove old comment
This field has been reverse engineered.
2023-03-25 17:14:04 +01:00
Kawe Mazidjatari
3be9f3dd95 Use KeyValues for ImGui panel key binds
Use KeyValues instead of JSON for ImGui panel key binds. The Server Browser 'default' key has been swapped with the 'extended' one: Default = 'VK_F10', Extended = 'VK_HOME'.
2023-03-25 17:13:16 +01:00
Kawe Mazidjatari
193c5bdeba Move sdk specific cfg files to different folder
Move all SDK internal CFG's to 'cfg/system'.
2023-03-24 00:04:45 +01:00
Kawe Mazidjatari
1758abb0aa Fix 'cppkore' close event bug
Fix close callback getting called recursively when application gets closed by user. The initial call originated from 'Form::WmClose', second call from 'Form::CheckCloseDialog'. The original call should set the 'called' flag, but never did.
2023-03-23 23:43:05 +01:00
Kawe Mazidjatari
f66019fbf8 Prune unused features in 'libcppkore' 2023-03-21 00:16:03 +01:00
Kawe Mazidjatari
8d895bab14 Remove extraneous 'template' keyword in Protobuf
Has to be removed, as older (but still capable!) MSVC compilers throw the error 'C2903' (symbol is neither a class template nor a function template). Generated code remained identical after this change.
2023-03-20 13:54:26 +01:00
Kawe Mazidjatari
340c4d3383 Fix compile error in SpdLog
Added check for older compilers to prevent the error 'C2131' (expression did not evaluate to a constant).
2023-03-20 00:28:36 +01:00
Kawe Mazidjatari
dd48093c23 Add experimental switch header
This header allows us to properly switch between experimental/finished STD implementations without having to adjust the source code (required for compiling on older versions of the Visual Studio 2017 compiler).
2023-03-20 00:17:29 +01:00
Kawe Mazidjatari
3e9f405474 Fix MSVC error 'C2280' and 'C2955'
Fix 'attempting to reference a deleted function'.
Fix 'use of class requires a template argument list'.
2023-03-19 17:58:01 +01:00
Kawe Mazidjatari
fd7e981e8c Upgrade SpdLog library to 1.11.0
* Upgrade SpdLog library to 1.11.0.
* Compile SpdLog as static library.
2023-03-18 13:34:43 +01:00
Kawe Mazidjatari
227885a69f Merge recastnavigation/recastnavigation@b51925bb87, recastnavigation/recastnavigation@7501007439 and recastnavigation/recastnavigation@405cc095ab
Everything has been adjusted to maintain compatibility with the game engine.
2023-02-21 18:19:03 +01:00
Kawe Mazidjatari
4e396728c3 Fix typos 2023-02-21 17:56:56 +01:00
Kawe Mazidjatari
c1107fb4ed Fix spelling 2023-02-12 16:27:09 +01:00
Kawe Mazidjatari
55ec60e1ae Upgrade nlohmann json to '3.11.2' 2023-02-07 00:19:56 +01:00
Kawe Mazidjatari
1cf310f1a0 Upgrade Dear ImGui to v1.89.2 2023-01-27 01:48:49 +01:00
Kawe Mazidjatari
e0fa00abf5 Update Microsoft Detours to latest 2023-01-27 00:51:22 +01:00
Kawe Mazidjatari
938df1dd89 Check visible panels in wrapper instead of imgui itself
The SDK's DX interface is much easier to expose to Dear ImGui than game/engine implementations.
2023-01-26 20:00:52 +01:00
Kawe Mazidjatari
b8bbe6e6d0 Add libcurl to project 2023-01-26 13:09:18 +01:00
Kawe Mazidjatari
188cbf8359 Update protobuf to latest
Updated to v21.12.
2023-01-26 03:15:10 +01:00
Kawe Mazidjatari
f47fb63e5f Fix dedicated server compile errors
Huge cleanup for dedicated. All patches in 'opcodes.cpp' are now directly applied to the executable, and kept as reference in the source file. The patch logic is commented. Any other patches for the dedicated server executable should be documented in the patch file found in 'r5dev/resource/patch'.
2023-01-26 02:59:50 +01:00
Kawe Mazidjatari
532ada48e0 Only run duplicate checks in debug
Duplicate checks are only performed in debug builds, if a duplicate is encountered, a bug in code has been found and has to be solved (do not call REGISTER from headers for example).
2023-01-25 19:22:05 +01:00
Kawe Mazidjatari
98331796b2 Fix bug in LZHAM debug log formatting
Should be '%llu' or '%zu' for size types.
2023-01-17 00:42:38 +01:00
Kawe Mazidjatari
ca3e5ac9d1 ImGuiConfig: fix incorrect allocation size causing OOB memory write
Fix was found after the issue in the previous commit was found.
2023-01-15 18:12:39 +01:00
Kawe Mazidjatari
1371bb1f38 Fix typo 2022-12-26 17:01:14 +01:00
Kawe Mazidjatari
55b90781ee Remove experimental CRC implementation in LZHAM
This implementation was done to calculate buffer CRC on the go, as that was what the VPK file system uses for the file crc's. But it later turned out to be unnecessary, and was never reverted.
2022-12-04 01:33:10 +01:00
Kawe Mazidjatari
d20250e436 Heavy output code cleanup
Only add to detour if the VFTable pointer didn't exist yet. Not declaring these in the anonymous namespace significantly reduces code size and unnecessary memory allocations. We might want to consider refactoring this, although it will probably require a big change.
2022-11-27 15:01:55 +01:00
Kawe Mazidjatari
ea18f30eda Fix incorrect rasterization at tile borders (recastnavigation/recastnavigation#476)
Merge recastnavigation/recastnavigation@3901c5854c
2022-11-25 00:05:36 +01:00
Kawe Mazidjatari
8dc12644be Remove unused functions 2022-11-24 11:50:21 +01:00
Kawe Mazidjatari
d3b2893cdc Change ImGui config file path and use engine's FileSystem API
'ImGuiConfig::Load()' was loading from the new path, however 'ImGuiConfig::Save()' was not. Defined path as constant expression to avoid this problem in the future. Also loading the files through the engine's API from now on.
2022-11-24 10:45:42 +01:00
Kawe Mazidjatari
90d87897f8 Improve consistency within the LZHAM library
Make CRC32 consistence with ADLER32
2022-11-17 20:35:43 +01:00
Kawe Mazidjatari
93bca826ef load imgui configs from 'cfg/imgui/*' instead 2022-11-10 15:33:35 +01:00
Kawe Mazidjatari
edd1c62352 Change vperpXZ to vperpXY 2022-10-22 21:59:57 +02:00