aboutsummaryrefslogtreecommitdiff
path: root/src/hud.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove years from copyright headersGravatar Michael Smith 2025-04-071-2/+2
| | | | | | | | They're legally unnecessary as far as I know, and kind of annoying to maintain on a long-term basis. This was done with the consent of all 3 other contributors, in case anyone was wondering.
* Pass screen width and height into HudPaint eventsGravatar Michael Smith 2025-04-061-5/+4
| | | | | This makes it unnecessary to call hud_screensize in basically every handler.
* Use C23 void-argument-free prototypesGravatar Michael Smith 2025-04-061-1/+1
| | | | | | | In the future we can also consider moving to {} instead of {0} for initialisers, but my old Clang (16) doesn't support this, so it might be wise to wait longer on that one so people don't need too bleeding-edge of a compiler just to build this thing.
* Rewrite and redesign codegen and feature systemGravatar Michael Smith 2025-04-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Also switch to somewhat proper C23 flags while we're at it. This is a huge change. It took me forever, in between being really busy. Sorry about that. But the good news is I'm now free to start integrating the various patches that have accumulated since last release. Well, at least in between still being really busy. Gotta manage expectations. The main benefit of introducing GAMESPECIFIC() is that features that don't apply to a particular game no longer show up *at all*, and less time is wasted on init. It also enables a cool optimisation wherein unnecessary REQUIRE_GAMEDATA() checks can elided at compile time whenever the gamedata is known up-front to always exist in supported games. The DEF_FEAT_CVAR macro family meanwhile makes it easier to manage the lifecycle of cvars/ccmds, with less manual registering, unhiding and such. Originally I was going to try and just hack these features into the existing codegen abomination, but it just got too terrible. This rewrite should make it easier to continue tweaking codegen behaviour in future. It also has slightly better error messages.
* Improve the HUD API slightlyGravatar Michael Smith 2024-09-081-3/+9
| | | | | | | - Add text size measurement (for centring etc.). - Add a wchar_t equivalent since ushort would be wrong on Linux. Avoid actually using wchar.h because it's a big bloaty header, particularly on Windows.
* Revise syntax macros and add a ton of branch hintsGravatar Michael Smith 2024-08-231-7/+12
| | | | | | | | | My new programming style is branch hints. All non-confusing branches must be hinted when I can be bothered. It's faster, sometimes, maybe. Also, start trying to use more signed sizes in at least some of the places where it makes sense. Unsigned sizes are surprisingly error-prone!
* Rethink mem_loadoffset, and consequently, kill itGravatar Michael Smith 2024-01-211-1/+1
| | | | | | | | | Suggested by bill. Having something semantically pointer-sized that's only ever used for stuff that's always 32-bit doesn't really make sense. Note that I intentionally did not add a copyright line for myself in hud.c because, I mean, come on. I'll just say I waive any claim to that tiny trivial change.
* Add VGUI HUD overlay drawing featureGravatar Matthew Wozniak 2023-12-191-0/+194
Currently only supports Orange Box and Left 4 Dead branches. There's quite a large amount of gamedata involved in making this work, and figuring it out for the likes of Portal 2 doesn't seem like a major priority at the moment.