296 Commits

Author SHA1 Message Date
Kawe Mazidjatari
22029abfc2 Fixed compression bug for VPK system
Fixed bug where the compressed buffer size equals the source buffer size getting packed into the VPK chunk. In all occurrences this resulted in corrupted data upon export.

The reason for data being corrupt upon export is because the engine checks the equality of the compressed and decompressed size fields in the directory file, if they are equal, the engine doesn't attempt to decompress the block. So we end up with a still compressed block on the disk (technically not corrupt in the context of the compression lib, but useless as-is on the disk).

If a compressed file doesn't get lower in size we are better out storing it rather than compressing it.

Added a new condition in lzham::lzham_lib_compress_memory which checks source and destination buffer size equality.
2022-06-05 02:24:44 +02:00
Kawe Mazidjatari
e6ef3d71f1 Rename variable 'g_pIConsole' to 'g_pConsole' 2022-05-27 02:46:13 +02:00
Kawe Mazidjatari
58d46c0a8c Rename class 'IBrowser' to 'CBrowser'
Renamed 'g_pIBrowser' to 'g_pBrowser' as well
2022-05-27 02:44:36 +02:00
Kawe Mazidjatari
e1799887d0 Finished GUI SDK Launcher
Implemented logic behind console frontend.
cleaned up sdklauncher.cpp (methods properly split up in class).
2022-05-26 22:04:50 +02:00
Kawe Mazidjatari
4b72afb74f Light refactor for logging
Moved logging functions to dbg.h (tier0) and export them from the dll.
Added additional functions for checking bad pointers (debug only!).
Reduced output code size.
2022-05-25 14:18:29 +02:00
Kawe Mazidjatari
4eaba9f5a2 Gui launcher work
Improved theme
Implemented dedicated server and client logic (gui side only)
2022-05-25 12:07:08 +02:00
Kawe Mazidjatari
dacd307663 See description
* Finished designer code for launcher gui.
* Basic implementation of setting flags for host launch option.
* Check in 'CHostState::LoadConfig' if -launcher is below 1.. if condition is met the cfg's will be executed from 'CHostState::LoadConfig'.
* Added 'StringIsDigit' utility.
2022-05-24 02:23:37 +02:00
Kawe Mazidjatari
4afc4e8d6a Update cppkore theme 2022-05-23 19:12:37 +02:00
Kawe Mazidjatari
b7057a1204 Set correct icon resolution
Small icon handle is no longer equal to large if Icon::ApplicationIcon() is called
2022-05-21 22:41:15 +02:00
Kawe Mazidjatari
04bee896be Fix string/wstring type conflict
cppkore uses string/wstring as StringBase while we use std::string/std::wstring as string/wstring. Changed all types in cppkore to String/WString instead.
2022-05-21 21:51:35 +02:00
Kawe Mazidjatari
f11f3fe95d Add 'cppkore' library to project 2022-05-21 19:58:09 +02:00
Kawe Mazidjatari
637041d5e7 Use 'fs' instead of 'std::filesystem' 2022-05-16 21:54:46 +02:00
Kawe Mazidjatari
81dcfa60a0 Cleanup 2022-05-13 17:51:01 +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
10474d07d7 Update JSON lib to version 3.10.5 2022-05-03 17:28:17 +02:00
Kawe Mazidjatari
84fe122e43 Update ImGui lib
Update to 1.87
2022-04-24 20:52:40 +02:00
Kawe Mazidjatari
a778d910e7 Fix rare crash in naveditor
Running tests in the naveditor without building navigation segfaults the application.

Reduced verbose prints when building navigation.
2022-04-22 02:31:06 +02:00
Kawe Mazidjatari
e1f5e7d46b Un-hardcode all CHostState dependencies
The SDK now works on executables with ASLR enabled.
!TODO: Dedicated.
2022-04-12 02:48:46 +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
aa57170e0d Start of pattern search refactor 2022-04-09 01:14:22 +02:00
Kawe Mazidjatari
b405125357 Fix clang-cl compile
Temporarily commented SDL2 audio as some SSE code doesn't work properly with clang-cl
2022-03-27 22:18:58 +02:00
Kawe Mazidjatari
6f268c0978 Check if ImGui config file exist before attempting to parse it 2022-03-27 12:09:46 +02:00
Kawe Mazidjatari
72ca651003 Cleanup DetourNavMesh.h 2022-03-26 00:44:42 +01:00
Kawe Mazidjatari
9b33e1b94e Fix more debugdraw 2022-03-19 12:56:22 +01:00
Kawe Mazidjatari
35ad8554a5 Somewhat correct working navmesh
The reachability table needs to be figured out still. The issue should be very small, but at the moment I do not have time for it.

The pointer to the table, and table pointers to data is correct, however, not a single poly is ever getting marked as 'reachable' (0xffffffff). This could be either within recast itself (see build_link_table() and set_reachable() functions), or the way the engine parses the data. The function that determines whether poly is reachable is located at '0x140F448E0'
2022-03-18 03:14:07 +01:00
Amos
2fb7aef885 Update Pch.h 2022-03-16 01:35:42 +01:00
Amos
7596f44655 Fix alignment 2022-03-16 01:35:29 +01:00
Amos
243c5e4af7 Fix cylinder debug draw 2022-03-16 01:33:58 +01:00
Amos
7cd73893f4 Build navmesh files to game directory
And additional compiler improvements
2022-03-13 22:20:02 +01:00
Amos
3cf36b5d61 Increase compile performance even more for NavMesh Editor
Cleaned up redundant includes
Reordered required ones
2022-03-13 03:00:07 +01:00
Amos
d71b949468 Add Recast & Detour navmesh editor to SDK 2022-03-13 01:15:52 +01:00
Amos
ee51613492 Add libsdl library to project 2022-03-12 15:38:52 +01:00
Amos
ac94f4fd68 Add Recast & Detour libraries to project
Libraries taken from https://github.com/r-ex/r2recast/tree/apex_legends
2022-03-12 15:11:32 +01:00
Amos
6583e174de Implement custom paks loading per level
Game will check scripts/levels/mapname.json and load all rpaks in the rpak field.
Game now also unloads pak files loaded by the SDK preventing crashes and unnecessary memory usage.

VPK's and STBSP's are planned to be added as well.
2022-03-01 02:39:46 +01:00
Amos
0509fb0358 Cleanup all redundant empty control statements 2022-02-28 01:05:55 +01:00
Amos
f7df14d153 Add protobuf library to project 2022-02-10 00:19:49 +01:00
Amos
a1f96797c0 Console and Browser UX improvements
* Log warnings
* Improve style
* Vector size is now controlled by ConVar instead
* Keep current item in view when console is cleaning up the vector. This doesn't work ideally as its hard to keep track of the current item, and the scroll is a float. In the future it might be better to grab the first vertex of the center line on the console and track that perhaps.
2022-01-22 15:51:09 +01:00
Amos
d4dc9d7c3e Implement new ImGui Input Text flag to move cursor to the end of char buffer 2022-01-17 23:21:19 +01:00
Amos
bdc67e90cb Set default spdlog level to trace 2022-01-14 20:46:30 +01:00
Amos
96ee434d4e Fix missing header errors for SpdLog 2022-01-14 20:46:19 +01:00
Amos
e6254e3a03 Fix issue with ImGui windows where input could loose focus and not work
'ImGui_ImplWin32_WndProcHandler' has to be called at all times from the HwndProc handler as it has to track all events to prevent issues with input.
2022-01-12 13:11:18 +01:00
Amos
c98301d175 Fix LZHAM recompiling pch for each implementation file 2022-01-06 17:30:23 +01:00
Amos
b80be10c4d Compile LZHAM with the solution. Fix missing detours files for sdklauncher 2022-01-06 15:08:39 +01:00
Amos
a0b7bbf366 Compile Microsoft Detours with the solution 2022-01-06 02:22:28 +01:00
IcePixelx
421d5e3c73 Removed obselete funtion from ImGui::Hotkey 2021-12-28 03:07:37 +01:00
Amos
d5b2e58dae Code base refactor + major performance and readability improvement. Read description for details.
* Codebase restructured to SourceSDK codebase style and .cpp/.h assertion paths in the game executable.
* Document most functions with valve style 'Purpose' blocks.
* Rename variables to match the rest of the codebase and Valve's naming convention.
* Dedicated DLL and the SDKLauncher now share the same codebase as the DevSDK.

* Obtain globals or pointers directly instead of waiting for runtime initialized data.
* Dynamically search for all functions and globals (this doesn't count for dedicated yet!).
* Initialize most in-SDK variables.

* Move certain prints and other utilities under ConVars to reduce verbosity and increase performance.
* Print all pattern scan results through a virtual function to make it easier to add and debug new patterns in the future.
* Type global var pointers appropriately if class or type is known and implemented.
* Forward declare 'CClient' class to avoid having 2 'g_pClient' copies.
* Add IDA's pseudo definitions for easier prototyping with decompiled assembly code.

* RPAK decompress Command callback implementation.
* Load decompressed RPaks from 'paks\Win32\' overriding the ones in 'paks\Win64\' (the decompress callback will automatically fix the header and write it to 'paks\Win32\').

* VPK decompress Command callback implementation.
* Move CRC32 ands Adler32 to implementation files.

* Server will print out more details about the connecting client.

* Upgrade ImGui lib to v1.86.
* Don't compile id3dx.h for dedicated.
* Don't compile id3dx.cpp for dedicated
* Implement DevMsg print function allowing to print information to the in-game VGUI/RUI console overlay, ImGui console overlay and the external windows console

* Fixed bug where the Error function would not properly terminate the process when an error is called. This caused access violations for critical/non-recoverable errors.
* Fixed bug where the game would crash if the console or server browser was enabled while the game was still starting up.
* Several bug fixes for the dedicated server (warning: dedicated is still considered work-in-progress!).
2021-12-25 22:36:38 +01:00