141 Commits

Author SHA1 Message Date
Kawe Mazidjatari
47beb282f2 RTech cleanup and improvements
* Combined members of TextureHeader_t and RTechTextureInfo_t.
* Renamed 's_pRTechBytesPerPixel' to 's_pBytesPerPixel' and declared const.
* Renamed 'dxgiToRPakFormat' to 's_DxgiToTxtrTable' and declared const.
* Renamed 'rpakToDxgiFormat' to 's_TxtrToDxgiTable' and declared const.
* Moved 'g_DxgiToTxtrTable' and 'g_TxtrToDxgiTable' to 'texture.g.h'.
* Moved 's_pBytesPerPixel' to 'texture.g.h'.
* Fixed defect where we used the [] operator on a std::map that should be const (s_TxtrToDxgiTable), replaced with the const version of std::map::at.
2022-10-13 21:59:06 +02:00
Marvin D
514a407e4c RPakHeader_t/RPakLoadedInfo_t additions 2022-09-18 13:55:44 +02:00
Kawe Mazidjatari
729475c74c Light cleanup
Use NO_ERROR instead of NULL for error code parameter passed to Error(..).
2022-09-14 01:14:51 +02:00
Kawe Mazidjatari
3d6d6644bd Logging bug fix and error handling improvements
* Replaced the boolean 'fatal' parameter with a error code parameter, anything non-null will prompt a message (fatal) and terminate the process with given error code.
* Fixed bug where the global ostreamsink for spdlog did NOT get cleared in 'SQVM_PrintFunc' when cvar 'sq_showvmoutput' was < 3. Moved to global scope.
* Added error message for when detouring the process has failed, with the error code.
* Only call 'Plat_GetProcessUpTime()' once per log, (improves performance and fixes bug where the error message box would show a different time stamp than what is logged into the console or file).
* All TIER0 loggers only log to notify and console when the SDK engine has fully initialized and detoured all functions.
2022-09-14 00:39:38 +02:00
Kawe Mazidjatari
34a06147d7 Fix spelling errors
Overall spelling improvements and cleanup..
2022-09-09 19:47:31 +02:00
Kawe Mazidjatari
23e85cae37 Use type alias for all pak handle variables
* Use type alias 'RPakHandle_t'.
* Improved debug/exception messages.
2022-08-29 17:00:50 +02:00
Kawe Mazidjatari
ca0172ed1f Add cvar for RTech debugging and removed dev flag from 'launchplaylist' 2022-08-22 21:15:46 +02:00
Marvin D
5f73413286 different print for OpenFile 2022-08-22 19:03:33 +02:00
Marvin D
3a8647b6f4 Load .starpak from /Win32/ support
* S3< not tested.
2022-08-22 14:43:06 +02:00
Kawe Mazidjatari
2010e11310 Add 'fatal' functionality to Error()
When fatal is set, the function will show a error dialogue, which will halt the process and close when the message is dismissed. Else we will end up in a crash.
2022-08-22 12:42:41 +02:00
Kawe Mazidjatari
5bc798fe97 Merge 'Sys_LoadAssetHelper' with 'RTech::OpenFile' and rehook.
Removed clashing hook and merged logic into RTech::OpenFile, and re-enabled hook.
2022-08-18 12:34:33 +02: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
8bf6dac3d8 Code improvements
* Use GetVirtualMethodTable for VFTable pointers.
* Pack CClientState to 4 bytes (this aligns it properly in memory).
* Use CClientState members directly for setting m_bRestrictServerCommands/m_bRestrictClientCommands.
2022-08-15 22:29:16 +02:00
Kawe Mazidjatari
88b3336758 Many small code improvements and optimizations
* Use c++ methods as much as possible.
* Use enum types for accessing NavMesh objects from array.
* Use size_t for for loops when testing against size types.
* Don't compute strlen twice of more on the same string.
* Don't use unnecessary c string casts if there is a method with a std::string overload.
* Don't create string objects from string pointers if we could use them directly.
* Don't initialize RCON password twice on each change, and don't set if the new password equals the old.
2022-08-11 11:07:45 +02:00
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