77 Commits

Author SHA1 Message Date
Kawe Mazidjatari
8c6ee8a834 Remove 'm' prefix from dll globals
Large commit.
2022-08-09 03:02:00 +02:00
Kawe Mazidjatari
9d06a02614 General cleanup
* Use Cbuf functions for executing commands in ImGui panels.
* Use const qualifiers for all vftable indexes.
2022-08-09 02:35:00 +02:00
Kawe Mazidjatari
0c583d7522 Temporary fix for rpaks not loading from override dir 2022-08-06 22:17:47 +02:00
Marvin D
587b92659e dedicated compile fix for RTech changes. 2022-08-06 00:34:26 +02:00
PixieCore
946da4b2cc Fix variable names in RTech::OpenFile 2022-08-06 00:20:49 +02:00
PixieCore
1cd0ae5c87 General code cleanup, Rebuild and hooked RTech::OpenFile
* RTech std namespace removal
* RTech::OpenFile Rebuild.
* FileHandleTracker_t fully reversed, grabbing m_FileHandles from memory now.
* RTech::FindFreeSlotInFiles needs more research.
*
2022-08-06 00:16:11 +02:00
rexx
2e3b4205c0 remove streamoverlay hook 2022-07-21 17:05:19 +01:00
rexx
cb4e422724 reimplement stream overlay drawing 2022-07-20 22:50:55 +01:00
PixieCore
8aa71d6676 RTech::CreateDXTexture cleanup. 2022-07-20 14:54:59 +02:00
PixieCore
f57da25341 RTech changes.
* Added RPakAssetBinding_t.
* Added RPakUnknownStruct_t
* PatternScan the global RPakUnknownStruct_t.
* Renamed Members of CMaterialGlue
* RTechTextureInfo_t now has another unknown member named.
2022-07-20 11:27:42 +02:00
PixieCore
2be140f09d Update rtech_utils.cpp 2022-07-10 13:24:48 +02:00
PixieCore
afc312d86d Removed s_pBitsPerPixelWord and implemented it properly. 2022-07-10 13:11:48 +02:00
PixieCore
0eec5c6361 Updated RTech.
* Further cleanup of RTech::CreateDXTexture.
* New field in RTechTextureInfo_t which counts the total streamed mips.
* Added a few comments.
2022-07-09 10:41:02 +02:00
Kawe Mazidjatari
59eeec656a Guard RTech::CreateDXTexture out for S0/S1 2022-07-08 23:50:38 +02:00
PixieCore
c4977a39aa Add field to RTechTextureInfo_t. 2022-07-08 23:38:33 +02:00
rexx
d64079fd6b enable CreateDXTexture hook 2022-07-08 22:33:43 +01:00
PixieCore
931670e0ac Moved dxgiFormat further down. 2022-07-08 23:19:53 +02:00
PixieCore
d51ceddf38 RTech::CreateDXTexture cleanup.
* Separated RPakTextureHeader_t and made an RTech version.
* Fixed up RTechTextureInfo_t struct.
* Still needs testing with 4K textures.
2022-07-08 23:18:15 +02:00
PixieCore
ff7ae51718 RTech::CreateDXTexture works now.
* Will clean up the function next.
2022-07-08 20:31:27 +02:00
PixieCore
1b2c0cecd0 CShaderGlue changes and RTech implementation.
* Added RTech::LoadShaderSet for the asset load routine
* Grabbing CShaderGlue::SetupShader and CShaderGlue::m_pVTable dynamically now
* Everything verified for every season, cross-compatible!
2022-07-04 22:52:10 +02:00
Kawe Mazidjatari
4323f0273d Dynamically get Rui debug font face
No longer hardcoded to ArameMono (default cfg's are set to ArameMono still).
2022-07-03 11:33:42 +02:00
IcePixelx
f1395c0bad
Little cleanup, branch to test changes when at home. (#69)
* Little cleanup, branch to test changes when at home.

* Remove non-used variables
2022-06-23 18:03:53 +02:00
PixieCore
0e4c126823 Revert NULL passing into second arg (was for testing) 2022-06-22 14:06:53 +02:00
PixieCore
62ac2c03ff RTech::CreateDXTexture fix for CreateShaderResourceView 2022-06-22 14:03:41 +02:00
PixieCore
8bf08af7b9 Start of RTech::CreateDXTexture rebuild.
* Currently crashes due to stack corruption.
2022-06-19 18:07:43 +02:00
Kawe Mazidjatari
e110aa5832 RTech decompress cleanup
Cast to proper types
2022-06-17 18:42:13 +02:00
Kawe Mazidjatari
6451aaba2b Fix dedicated server compiler error 2022-06-12 13:34:07 +02:00
Kawe Mazidjatari
7c0c541405 FileExist cleanup
Use fs::path constructor for all strings.
Renamed CPakFile::AsyncLoad to CPakFile::LoadAsync.
Renamed CPakFile::Load to CPakFile::LoadPak.
2022-06-12 12:40:26 +02:00
Kawe Mazidjatari
fc74a692fa Prefix global vectors with 'g_v' 2022-05-27 02:21:54 +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
f14b3e5dfa Confirmed working on <S3 2022-05-19 21:29:40 +02:00
PixieCore
67201edc82 fix comments on RTech::GetPakLoadedInfo. 2022-05-19 00:53:58 +02:00
PixieCore
5655b8c759 Implementation for rpak swap. Read description.
* RTech::GetPakLoadedInfo returns a reference now instead of a copy. Make sure to check the pointer is valid from now on if dealing with the returned pak entry.
* RTech::GetPakLoadedInfo now has a overloaded function that takes string as argument for searching an pak entry.
* new ConCommand pak_swap which has Pak_Swap_f as callback.
* Pak_Swap_f performs pak unload and then load again.
* pak_requestunload can now be used with pak name
2022-05-19 00:47:16 +02:00
Kawe Mazidjatari
2ef4f087c5 RPakLoadedInfo_t backwards compatibility
Padded struct with 48 bytes (extra FF padding in memory) to match the size with earlier builds (<S3)
2022-05-17 01:33:45 +02:00
Kawe Mazidjatari
e4c26736e5 Use DevMsg instead of Warning 2022-05-16 21:40:52 +02:00
Kawe Mazidjatari
d1402a7465 General cleanup and improvements
Hook CPakFile::Unload() and track when mp_lobby is unloaded.
Removed duplicate pointers for MOD_ProcessPakQueue().
Use DWORD for thread id comparison in MOD_ProcessPakQueue().
Use RPakHandle_t for all RPak handles.
2022-05-16 20:44:19 +02:00
Kawe Mazidjatari
596682c483 More robust RPak loading/unloading system
This is currently the most robust way to perform this.
However it might fail still as the locks don't seem valid for the second loads (we currently load more paks from the same queue..).

We need to push the strings to the queue list and let the engine load these too so a new lock is acquired for that job.
2022-05-15 12:20:21 +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
215f205508 Improve CMDLCache::GetMaterialTable()
This should also be backwards compatible now
2022-05-06 02:32:25 +02:00
Kawe Mazidjatari
c3f31d694a Improved mod RPak loading between changelevel
Note: this does not work reliably still.

The only way we could make this work 100% reliable would be to fully rebuild '0x140341D40' in the SDK and load our pak files among with the pre-existing g_pakLoadApi->AsyncLoad() call in this function, as this will ensure everything will be ran synchronously.

The current approach by taking some JT fifolock wrapper will only work reliably between one level change, unsure why the second and up fail.
2022-05-04 02:25:27 +02:00
Kawe Mazidjatari
713bafc416 See description
Fixed 'MOD_PreloadPak()' being called recursively.
Fixed wrong datatype for pak handle.
Use new and better method of parsing JSON files.
Don't unload pak files if user issued 'ChangeLevel' to the same level.

NOTE: This is still not complete and currently under development.
2022-05-03 17:36:42 +02:00
Kawe Mazidjatari
34502e5147 Make loading required paks per level more reliable
Also seems to work good on the dedicated server
2022-04-25 04:05:42 +02:00
Kawe Mazidjatari
b421a17d2b Dedicated server optimizations
Removed all ui.rpak/ui.dll assets loading on the dedicated server.
Moved AsyncLoad to CPakFile class.
Moved g_pMallocPool to tslist.h.
2022-04-19 03:55:20 +02:00
Kawe Mazidjatari
3d32346b39 Fix patterns for S1 and removed redundant code 2022-04-19 00:00:45 +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
7ba4f4021b Remove last hardcoded addresses for GameSDK 2022-04-13 01:25:33 +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
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
2dcbf59041 Move ConVar/ConCommand stuff to tier1 instead and cleanup KeyValues/KeyValuesSystem 2022-04-09 16:16:40 +02:00