26 Commits

Author SHA1 Message Date
Kawe Mazidjatari
3f8baf6f68 Allow setting compile options for specific targets
Previously, it was all controlled from the global init (applied to all projects), but some projects need different options. With these changes, you can disable the common options applied in the 'add_module' macro, and set your own if desired.
2023-06-17 00:45:27 +02:00
Kawe Mazidjatari
96ab1f1af0 Use explicit cast for CUtlBuffer ctor 2023-06-13 17:09:07 +02:00
Kawe Mazidjatari
975c40876a CModule and CMemory class improvements
This commit significantly reduces output code size, and a noticeable increase in performance. Changes are:
- Removed all extraneous std::string and std::vector copy constructions; use raw pointers instead to boost performance.
- Marked simple getters in CModule inline.
- Marked several functions in CModule const.
- Slightly reordered CModule class.
- 'CMemory::CheckOpCodes' and 'CMemory::Patch' now take a const reference.
2023-06-12 18:40:16 +02:00
Kawe Mazidjatari
9f44bcc818 Treat compiler warnings as errors
Treat them as errors globally. Most of the time a warning is a bug, or problem in code that could be solved in a different (better) manner. Thirdparty code have this disabled. The warnings as errors option can be globally disabled through the CMake GUI, but this is not recommended.
2023-05-15 09:44:26 +02:00
Kawe Mazidjatari
6a86ae2606 Cleanup CMakeLists files
Light cleanup in CMakeLists files. Split protocols and improve filter names.
2023-05-14 17:36:08 +02:00
Kawe Mazidjatari
8dbc2024c6 CMake code improvements
Use the 'add_module' macro to add modules without creating duplicate code. This macro also takes a reuse PCH as parameter, so modules that need a precompiled header, could reuse those from different targets that compile them. This commit also restructures the group order of the generated solution files for easier code navigation.
2023-05-13 00:14:53 +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
rexx
f310497464 fetch correct sdk module from pluginsdk 2023-05-08 19:28:16 +01:00
rexx
c29324b5dc rewrite PluginSystem_Init to use source filesystem 2023-05-08 19:12:52 +01:00
Kawe Mazidjatari
bc0904b148 Fix compiler error for Visual Studio 2017
Function 'is_directory' is only static in the Visual Studio 2017 headers.
2023-05-03 23:59:11 +02:00
rexx
bcc51460bc
new new modsystem pr (#96)
* modsystem v2 initial commit

* call CModSystem::Init

* clean up custom cvar value handling

* add mod script compiling support

* add error check to script rson loading

yes this error is a duplicate but this one exits the game

* fix typo

* fix compile error
2023-05-02 19:26:49 +01:00
Kawe Mazidjatari
0f660aee8b Construct 'fs::path' only once 2023-04-30 12:13:20 +02:00
O-Robotic
a54e1df06a Fix plugin directory creation 2023-04-27 20:34:05 +01:00
rexx
3eb660c9f7 enable pluginsystem 2023-04-23 22:28:16 +01:00
Kawe Mazidjatari
cdb03a5d97 Use standalone filesystem functions instead
The member variants do not exist in experimental filesystem implementations.
2023-03-20 00:19:17 +01:00
Marvin D
61383efb50 Comment to plugin system for a bug that needs fixing. 2022-12-25 14:49:24 +01:00
Marvin D
2f4d61ab55 ePluginCallback should be enum class 2022-12-12 17:26:35 +01:00
Marvin D
b13c542ed1 CPluginCallbackList impl
* CPluginSystem allows for function callbacks now.
2022-12-12 17:16:39 +01:00
Kawe Mazidjatari
85d0d5fa9a Load plugins from 'bin/x64_retail/plugins' 2022-11-08 21:17:40 +01:00
Kawe Mazidjatari
34a06147d7 Fix spelling errors
Overall spelling improvements and cleanup..
2022-09-09 19:47:31 +02:00
Marvin D
10b87b3bbc PluginSDK init and PluginSystem improvements
* Plugins can be loaded now (commented)
2022-08-21 00:59:55 +02:00
Marvin D
c37d7a6b0c remove versioning, will be handled by factory. 2022-08-20 12:45:14 +02:00
Marvin D
60b2db9eaa create abstract class for PluginSystem, refactor Factory System 2022-08-20 12:42:19 +02:00
Marvin D
cebc6a13b6 Merge PluginSystem_Reload and PluginSystem_Init together 2022-08-20 11:42:22 +02:00
Marvin D
0a8a463245 PluginSystem_Reload logic 2022-08-20 11:28:28 +02:00
Marvin D
55a620aa4d CPluginSystem init, for native mods.
* Not finished yet.
* Need to make a proper ModuleManager
* Handle PluginSystem_Reload()
2022-08-20 01:59:36 +02:00