Avoid heap memory allocation and a level of indirection. This allows the compiler to optimize the program even more. No logic has been changed in this patch.
Originally, we store the search results in a CMemory instance which we then assign to the actual function pointer. CMemory is just a pointer class; we can assign the results directly to the actual function pointer. This commit reduces a lot of code verbosity, and also reduced roughly 2KiB worth of static pointers in the resulting executable. This commit also officially deprecates the support for any GameDLL's below S3 (Season 3), since it makes more sense to port the assets from earlier/later games back to the version this SDK supports.
Utilize the new IDetour::DetourSetup() code, IDetour::Attach and IDetour::Detach have been removed in favor of this (significantly reduces chance of user error). Since the template check happens in the idetour header, it is much more aggressive on type mismatches, such as a difference in parameter types, between the function and detour, will now raise a compile time error. As a result, some type mismatches have been fixed in this commit as well.
- Added command line parameter '-modsystem_debug' to allow debugging during init, as we initialize before the first Cbuf_Execute() call (responsible for executing command line post engine init).
- Added warning to 'CLocalize::LoadLocalizationFileLists', when a mod localization file fails to load.
- All mod instances are now added to a single vector, but their 'state' determine whether or not they are enabled. This allows for toggling them on while in-game in the future, without having to rebuild the engine mod list.
- Changed all filesystem calls to use that of the engine instead.
- Changed all container types to valve ones, to maintain compatibility with the filesystem of the engine, and perhaps other things in the future.
- Forced all loads/writes to "PLATFORM" path (this is where the 'mods' folder resides).
- Forced localization files to be only read from the mod instance's directory.
- Allocated each mod instance dynamically, and stored their pointers in the modlist vector to reduce memory overhead during the move operation to modlist, and potential growth of modlist vector (which if required, will reallocate everything, and thus move it all. This especially is expensive with nested vectors (CUtlVector anly supports being nested as a pointer)).
* 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