aboutsummaryrefslogtreecommitdiff
path: root/src/engineapi.h
Commit message (Collapse)AuthorAgeFilesLines
* Get it sort-of-mostly working in "Old Engine" HL2HEADmasterGravatar Michael Smith 14 days1-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While we're at it, come up with a way for certain gamedata matches to be Windows-only. Somewhat reduces ifdef usage, although does not entirely remove it of course. Tested in HL2 2707. Haven't tested other HL2 builds, or Episode 1. Doesn't seem to work in DMoMM yet either; not sure why. A big list of stuff still to fix follows. Hidden cvars are currently an issue. We still need to figure out what to do with the flag bits because FCVAR_HIDDEN just doesn't exist in OE and there's some other flag with the same value instead. We also need to do something about the flag setting in fixes.c since HIDDEN is again not a thing, and also DEVONLY is not a thing either. When the plugin is autoloaded, all the initial log text gets eaten, because there's some stupid crap we have to do to trick the engine into displaying coloured text otherwise it just won't. Not even stuff from Warning(). Very stupid, but Hayden already figured out a solution, so that'll be done in another upcoming commit. Apparently raw mouse input breaks the menu. We might need to bump up the priority on making that hook only be active when there's no UI open - something I wanted to do anyway due to the demo drive issues. Big thanks to Hayden for doing a lot of the initial groundwork on this, particularly the cvar registration stuff. He gets a copyright notice in con_.c even though I ended up doing a lot of stuff differently because quite a bit of his work is still in there. Don't blame him for the self-modifying code though, that was my crazy idea. Sorry, but, in my defence... Well, it works.
* Improve the plugin_load/plugin_unload hooksGravatar Michael Smith 2025-06-071-4/+3
| | | | | | | | | | | Most notably, don't just silently return when no parameter is provided; allow the default handler to print the usual error message. Also, don't raise the PluginLoaded/PluginUnloaded events when nothing has actually happened. And rearrange the v1/v2 union so we don't need to spell out `v2.common`. Error message issue pointed out by Evan Lin - thanks!
* Add type-safety to virtual calls and accessorsGravatar Michael Smith 2025-04-171-12/+12
| | | | | | | | | | | | This probably should have been the design from the start. It's still possible to use void pointers, and this is done in a couple of places for simplicity, but wherever possible, we have actual structs for things now. Additionally, in places where vtables are fiddled with, e.g. vtable hooks, we have actual struct definitions with vtable pointers so there's need for pointer-casting horror.
* Remove years from copyright headersGravatar Michael Smith 2025-04-071-1/+1
| | | | | | | | 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.
* Use C23 void-argument-free prototypesGravatar Michael Smith 2025-04-061-2/+2
| | | | | | | 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.
* Add basic button input HUDGravatar Matthew Wozniak 2024-09-141-0/+27
| | | | | | | | | | | | Committer's note: this is heavily modified from the original code contributed by woz (and somewhat improved by bill and aciidz). Copyright notices reflect joint authorship accordingly. woz still gets commit authorship though because it feels wrong to yoink that from someone. :^) And yes, the original code was written in 2022. Time flies. A lot of the code is still kind of hacky and ugly and I'd like to improve it later but there's other things to do so that can wait.
* Rewrite the gamedata and entprops systems entirelyGravatar Michael Smith 2024-08-231-10/+1
| | | | | | | | | | | | This removes the horrible janky old KeyValues parser and replaces it with a couple of trivial ad-hoc text parsers. In doing so, make the format of the actual gamedata files more human-friendly too. We also gain support for nested SendTables in mkentprops, which are required to get at various things like player velocity. And, the actual string matching is made more efficient (or, at least, more scalable) by way of a cool radix tree thing which generates a bunch of switch cases on distinct characters.
* Add cutscene skipping to L4D quick resetGravatar Michael Smith 2023-12-041-0/+1
| | | | Also done with quite a lot of RE help from bill - thanks again!
* Fix CPlugin ABI on newer L4D2 versionsGravatar Michael Smith 2023-11-261-2/+11
| | | | | Thanks bill for spotting this issue. It was causing crashes on unload, which is obviously no good.
* Perform very minor load/unload optimisationsGravatar Michael Smith 2023-08-301-0/+6
| | | | Because why not.
* Make various preparations for upcoming featuresGravatar Michael Smith 2023-08-021-0/+17
| | | | | | | | | | | | | | | | | | | | | | A lot of this is random WIP from a while back, at least a month ago, and is being committed now to get it out of the way so that other patches can be brought in and integrated against it without causing headaches. Also rolled into this commit is a way to distinguish plugin_unload from exiting the game. This is required for another soon-to-be-integrated feature to avoid crashing on exit, and could in theory also be used to speed up unloading on exit in future. While we're at it, this also avoids the need to linearly scan through the plugin list to do the old branch unloading fix, because we can. Rough summary of the other smaller stuff I can remember doing: - Rework bitbuf a bit - Add some cryptographic nonsense in ac.c (not final at all) - Introduce the first couple of "chunklets" libraries as a sort-of subproject of this one - Tidy up random small bits and bobs - Add source for a small keypair generation tool - Rework democustom to be very marginally more useful
* Refactor the RGBA colour struct into engineapi.hGravatar Michael Smith 2023-05-041-1/+11
| | | | | | In both the engine and SST it's used in more places than just console printing, so it makes more sense to give it a more appropriate nanme and location.
* Fix deferred init for Portal 2 compatibilityGravatar Michael Smith 2023-01-151-1/+1
| | | | Thanks Bill for figuring out what the problem was.
* Add basic mouse input scalingGravatar Michael Smith 2022-12-251-0/+1
|
* Remove some dodgy whitespaceGravatar Michael Smith 2022-05-261-1/+1
|
* Further clean up engine API initialisationGravatar Michael Smith 2022-05-121-5/+6
|
* Add entity property finding and L4D warp testingGravatar Michael Smith 2022-05-031-4/+43
| | | | | | | | This was a lot more code than expected, but it might be finally close to time to release the next beta... We'll see if any more rabbit holes present themselves to jump into, though.
* Centralise engine access, add Portal FOV changerGravatar Michael Smith 2022-04-301-0/+101
- A bunch of stuff is now defined in one header, engineapi.h - engineapi.c is responsible for setting up any interfaces/stuff that's used in more than one place - mkgamedata is pretty much rewritten and now supports nested conditionals - gamedata variables no longer have the gamedata_ prefix because it was just annoyingly long all the time - vcall macros are somewhat revamped and support dynamic (gamedata) indices - Portal 1 FOV can be set anywhere from 75-120 using fov_desired - tested in both the main versions currently used by runners - A few typos were also fixed ("intput," "writeable," "indexes")