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.
Changed all loggers to use the internal 'CoreMsg/CoreMsgV' functions. Significantly reduced duplicate code and CPU time. Code is also much more robust.
* Code now only acquires mutex lock when the actual logging part takes place.
* Code now only checks and strip ANSI rows if its enabled to begin with.
* Code now supports setting log levels, which ultimately could be tweaked with a cvar.
* Changed logger and file names to be more readable.
TODO:
* The RCON protocol has to be modified to accommodate these changes.
* Warning now only logs if error level < 5.
* Warning buffer size has been increased to '10000' (internal buffer size).
* Error is now hooked as well.
* Error buffer size has been increased to '4096' (internal buffer size).
* Con_NPrintf has been refactored; 'cl_showhoststats' has been removed.
* Con_NPrintf buffer size has been increased to '4096' (MAXPRINTMSG).
* CTextOverlay::Con_NPrintf now checks the first byte in the character buffer before rendering anything, and sets the first byte to a terminating null character after rendering. This fixes the bug causing the host_speeds overlay to be still drawn while the cvar 'host_speeds' was disabled.
This change was planned for a long time. This moves all REGISTER calls to a single translation unit, this is required as we currently added a very dirty workaround for not registering duplicates by checking if VFTable pointer was already present in the vector... Registering from single translation unit prevents duplicate instances that gets created if header is included by more cpp files.
Reworking this reduced 100kb+ of compiled code. This commit also reworked the way functions/variables/constant gets logged with their addresses; the new code formats them on the fly, and allows for resize at any time. Formatting is no longer required by programmer.
TODO: currently there are some compile errors for dedicated and client dll's. These will be resolved very soon as they need to be properly worked out still (server & client only stuff needs to be properly split). Use the 'main' (stable) branch for the time being if you need to compile these dll's.
* Change qualifiers for some types (make const, static const, etc..).
* Renamed 'CNotifyText' to 'CTextNotify'.
* Renamed 's_LogMutex' to 'g_LogMutex' (mutex was not static).
* Use single static buffer instead of each overlay having its own (its only used in the material system thread).
* Improved readability by using ternary operators and c++ style casts.
* Fade notify text by a fixed amount regardless of the frame times.
* Implement Valve's 'lerping' animation for text when entries fade away and expire.
* Don't run/push/remove anything if 'con_drawnotify' is disabled.
Renamed to EGlobalContext_t and used globally for all context types combined into one (required for rcon messages for example, as we do native and script messages, while also retaining colors).
* Use responceid from server to determine in which context to log.
* Moved all script loggers from combined enums to minus instead (SERVER = -3, CLIENT = -2, UI = -1 SERVER_CODE = 0, etc), this makes it much easier to align stuff in combined systems such as the RUI logger or NetMsg().
* Color log networked RCON messages properly on the client.
* Added dedicated logger for all received RCON messages (net_console.log).
* Log commands submitted through in-game console (allows for easier debugging when going through log files).
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)
Inline every signature defined in the SDK (previously each translation unit had its own copy of the signature and function prototype). DLL init is near instant now (85% speed improvements).
* Added ability to invert rect to calculate offsets from bottom/right as well so debug text doesn't get out of view, or obstruct view when window is resized.
* Added Con_NPrintf() hook which shows detailed systems running times and VGUI panel debug information.
* Add Cbuf_AddText and Cbuf_Execute signatures.
* Remove additional VGui stuff from dedicated statemachine.
* Move signatures to their respective headers.
* De-inline 'CHostState::FrameUpdate()'
* Ported al new patters to GAMEDLL_S1, CEngine still recreation needs extra work