17 Commits

Author SHA1 Message Date
Kawe Mazidjatari
7f15b94cd9 String tools improvements
* Add 'V_IsValidPath'.
* Add optional parameter to 'V_StripLastDir', in which the new length of the string gets written into.
2023-05-29 21:37:15 +02:00
Kawe Mazidjatari
d809a9f633 Use PCH generated from VPC globally
This reduced output code size with 40KiB, improved compile times and appeared to improve runtime performance as well.
2023-05-14 02:10:17 +02:00
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
fe0cce731b Explicitly disable certain warnings in code
This code is good as-is, they cannot be adjusted to suppress the warnings while still guaranteeing its functionality.
2023-04-03 14:55:16 +02:00
Kawe Mazidjatari
a1f7cc9a0d Make code compatible with older C++ versions
Made compatible with earlier C++ versions without having verbose compiler warnings.
2023-04-03 01:41:46 +02:00
Kawe Mazidjatari
a71839f13a /W4: Fix potentially non zero-terminated string
The prior call to 'strcpy' might not zero-terminated string, explicitly perform this operation to prevent this bug.
2023-04-02 16:56:54 +02:00
Kawe Mazidjatari
a4a2f34c10 /W4: Fix signed/unsigned mismatch
This commit fixes warnings and bugs caused by signed/unsigned mismatch.
2023-04-02 12:09:43 +02:00
Kawe Mazidjatari
7de717d47c /W4: Use 'constexpr' to evaluate branch at compile time
Fixes many compiler warnings.
2023-04-02 11:19:23 +02:00
Kawe Mazidjatari
c2094a68de Add and implement file path normalization logic
Implementation taken from game executable.
2023-04-02 02:00:47 +02:00
Kawe Mazidjatari
4357c9dbf3 Fix many compiler warnings
Fix many compiler warnings indicating potentially unwanted implicit conversions/truncations.
2023-04-02 00:59:24 +02:00
Kawe Mazidjatari
a0527721b6 Add new strtools
New strtools from Source SDK (will be used in the future).
2023-03-17 00:00:09 +01:00
Kawe Mazidjatari
b050616c35 Fix compiler warning for tier1
should be a 64bit type as input is 64bit, too.
2023-02-26 19:38:01 +01:00
Kawe Mazidjatari
837f53ccb7 Promote CUtlBuffer size types to 64bits
In the engine, all these seem to be 64bits as well as the members are 64bits.
2023-02-12 17:54:15 +01:00
Kawe Mazidjatari
843cc6f4ca A more complete implementation of the CUtlBuffer class
Added the implementation file and changed more methods to be 64 bit.
2022-11-22 08:57:33 +01:00
Kawe Mazidjatari
6266549cd7 CEngineAPI::SetStartupInfo rebuild
Full rebuild of assembled function "CEngineAPI::SetStartupInfo". The assembly seems to match original function after rebuild. Does NOT support S1 yet, because TRACEINIT is inline in S1.
2022-11-07 22:25:20 +01:00
Kawe Mazidjatari
4551f6d494 Implement convar_list and convar_differences
Also added more CCvarUtilities methods which are yet to be implemented.
2022-08-13 12:39:57 +02:00
Kawe Mazidjatari
059a394523 Add commonmacros.h and strtools.h/.cpp from SourceSDK
strtools has been redacted to just what we need
2022-05-28 16:12:37 +02:00