aboutsummaryrefslogtreecommitdiff
path: root/src/rinput.c
Commit message (Collapse)AuthorAgeFilesLines
* 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.
* Rewrite and redesign codegen and feature systemGravatar Michael Smith 2025-04-061-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix crash on exit when our raw input is usedGravatar Michael Smith 2024-09-281-2/+3
| | | | | | | | | | | | Turns out window messages still get generated after the plugin is unloaded, causing now-unloaded SST code to get called. In some edge cases some Windows appCompat logic will also then start suppressing FreeLibrary calls for that game, which breaks plugin hot reloading. Very dumb and very confusing. I didn't notice the crashing before due to lack of minidumps from the relevant games, so thanks aciidz for pointing this issue out.
* Increase mouse factor limit to 100Gravatar Michael Smith 2024-09-151-1/+1
| | | | | | Requested repeatedly by Portal people, and I don't see why not. We were conservative at first but I've yet to come up with a real reason why slowing mouse input further would be a problem.
* Revise syntax macros and add a ton of branch hintsGravatar Michael Smith 2024-08-231-15/+16
| | | | | | | | | 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!
* Perform very minor load/unload optimisationsGravatar Michael Smith 2023-08-301-0/+2
| | | | Because why not.
* Make various preparations for upcoming featuresGravatar Michael Smith 2023-08-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* Adapt vote reset code into fast campaign resettingGravatar Michael Smith 2023-06-031-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is kind of a breaking change but the other code was obviously never released or relied on by anyone - it will be pushed at the same time as this in fact. It still seems worth having the original committed separately to show the progression of development of the feature, however. Technically the standalone vote cooldown resetting could also be added back if ever desired however there doesn't seem to be that much of a use case for that at the moment. This feature ought to be a lot more convenient now as it allows for resetting back to a set starting point no matter where the player is in a run. It isn't universally useful as All Campaigns Legacy solo runs require switching to a different type of server and Main Campaigns co-op runs require restarting the game after Swamp Fever to work around the god mode bug, however it is still useful in a good few situations. Unfortunately this turned out to be pretty complex to implement, first requiring a bunch of interop with valve's rather wacky KeyValues stuff, and then requiring a bunch of especially difficult reverse engineering of L4D1 v1.0.0.5 because it doesn't use said KeyValues stuff and does something else completely different instead. A side effect of all this work is that the nag removal hack is now part of the KeyValues stuff in kvsys.c, which is kind of a comfier place for it than just kind of dumped in the middle of sst.c.
* Refactor the RGBA colour struct into engineapi.hGravatar Michael Smith 2023-05-041-6/+6
| | | | | | 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.
* Add basic mouse input scalingGravatar Michael Smith 2022-12-251-29/+106
|
* Add magical feature codegen system, at long lastGravatar Michael Smith 2022-08-101-3/+8
|
* Solve the error logging situationGravatar Michael Smith 2022-06-021-6/+5
|
* Fix GetCursorPos hook return valueGravatar Michael Smith 2022-04-261-1/+1
| | | | | | I'd noticed this at some point but it didn't seem to matter, and now all of sudden it does matter because magic. The hook just stopped working suddenly.
* Add engine_no_focus_sleep backport, fix codegenGravatar Michael Smith 2022-04-251-1/+1
| | | | Default gamedata values actually work the way they're supposed to now.
* Move WIN32_LEAN_AND_MEAN and NOMINMAX into flagsGravatar Michael Smith 2022-04-241-2/+0
| | | | | | | | They're literally always defined thusfar, and it's always possible to include specific headers for other stuff. So, rather than litter the source with defines (which might not even work in the likes of os.h if some other system header already decided to define/include stuff), let's just define it at the build script level.
* Remove useless raw input multithreadingGravatar Michael Smith 2022-03-211-24/+3
| | | | | | | Turns out creating the input window on the main thread means it actually gets events from the game's event loop on the main thread which means we don't have to do our own event loop at all and in fact doing so is kind of broken and causes thread lockups and leaks and other such nonsense.
* Add m_rawinput reimplementation to replace RInputGravatar Michael Smith 2022-03-211-0/+181
It's archive so you can set m_rawinput 1, load SST via VDF and then never think about it again.