Commit graph

222 commits

Author SHA1 Message Date
Mitchell Richters
a6396cb491 - Centralise input clamping to occur centrally when the engine requests a packet. 2023-12-05 22:39:18 +01:00
Christoph Oelckers
60a36f4902 fix Vectoe3 clamp for real. 2023-12-05 22:39:17 +01:00
Mitchell Richters
e8451d3ddb - Take better advantage of InputPacket::ang's FRotator status.
* Change it to a DRotator as that's what the game is expecting. Too many narrowings against DAngle objects needed.
* Utilise object methods where possible.
* Do all math against the object where possible, not its members.
2023-12-05 22:39:13 +01:00
Mitchell Richters
af8f3139ed - Change InputPacket angles to an FRotator. 2023-12-05 22:39:12 +01:00
Mitchell Richters
3eaf7d2b87 - Make the last commit compile. 2023-12-05 22:39:12 +01:00
Mitchell Richters
e2a949949c - Take better advantage of InputPacket::vel's FVector3 status.
* Change it to a DVector3 as that's what the game is expecting. Too many narrowings against DAngle objects needed.
* Utilise object methods where possible.
* Do all math against the object where possible, not its members.
2023-12-05 22:39:12 +01:00
Mitchell Richters
592d416485 - Change InputPacket velocities to an FVector3. 2023-12-05 22:39:12 +01:00
Mitchell Richters
19c64e55c4 - SW: Consistently apply SOP angle scaling to pitch as well as yaw. 2023-12-05 22:39:11 +01:00
Christoph Oelckers
c02cff1e48 fix saving. 2023-12-05 22:39:07 +01:00
Mitchell Richters
16189ff7f9 - Remove GameInterface::getConsoleActor() in place of direct access. 2023-10-02 18:11:53 +11:00
Mitchell Richters
6de8fc91d6 - Remove GameInterface::reapplyInputBits() and directly perform operation in GameTicker(). 2023-10-02 18:11:51 +11:00
Mitchell Richters
f8ee893529 - Move I_GetEvent() call into GameInput::getInput(). 2023-09-28 22:16:31 +10:00
Mitchell Richters
80da809e0c - Apply cl_noturnscaling CVAR from feaaf2c15a to GameInput::processVehicle(). 2023-09-28 22:16:29 +10:00
Mitchell Richters
e0e459216d - Reduce GameInput::processVehicle() interface by changing three bools to a bitfield. 2023-09-25 19:51:53 +10:00
Mitchell Richters
8d8c30d10e - Reset the crouch toggle only when loading a new game, not every time we clear out the input.
* We need to preserve the crouch toggle when loading saves.
* Deliberately not resetting during level transitions as each level in an episode is interconnecting.
2023-09-24 17:51:22 +10:00
Mitchell Richters
22077c5b50 - Ensure crouch_toggle is cleared when clearing all input. 2023-09-24 15:53:39 +10:00
Mitchell Richters
feaaf2c15a - Allow disabling turn scaling (turbo turn). 2023-09-24 14:15:50 +10:00
Mitchell Richters
29e021b5bf - Move crouch toggling back into the backend so the toggle key can be used as a swim key.
* Reverts 272dfa762d, but is a fresh implementation.
* I doubted anyone was doing this but apparently not.
* Exhumed needed a bit more work as it has very specific underwater checks.
2023-09-24 14:15:49 +10:00
Mitchell Richters
a3aa2e877e - Exhumed: Repair use key clearing issue from ed2c557297.
* It's important that the use button is cleared for Exhumed, just not in the game code like it was previously done.
* Fixes #971.
2023-09-23 09:51:45 +10:00
Mitchell Richters
52ab0fae19 - Duke: Allow reversing while moving forwards to act as the brake.
* Much more intuitive for controllers.
2023-04-25 11:30:48 +10:00
Mitchell Richters
918789705f - Duke: Use the player's angle when adjusting vehicle's HUD rotation. 2023-04-24 22:44:22 +10:00
Mitchell Richters
14629e7b2b - Clamp vehicle input to 1.5x the calculated velocity. 2023-04-24 22:18:40 +10:00
Mitchell Richters
11181f51f8 - Allow roll input through the packet system, giving us 6DOF for VR usage, etc. 2023-04-24 21:31:21 +10:00
Mitchell Richters
a731db95ae - Add initial support for up/down movement within the game, either by key or joystick axis.
* Started with Duke's jetpack, other games to follow for swimming, etc.
2023-04-23 19:53:45 +10:00
Mitchell Richters
e60e767232 - Break down some increasingly long lines in GameInput::processMovement(). 2023-04-23 19:19:26 +10:00
Mitchell Richters
175f858047 - Make scaletozero() static again within gameinput.cpp. 2023-04-23 09:06:31 +10:00
Mitchell Richters
0a90ed4802 - Remove some duplicated lines in PlayerAngles::doViewTilting(). 2023-04-23 08:51:14 +10:00
Mitchell Richters
b179079168 - Move constant from previous commit into the class with the other constants. 2023-04-22 22:45:12 +10:00
Mitchell Richters
df30c01472 - Rework cl_viewtilting 1 to be consistent across games.
* Setup before from when it was Exhumed-only assumed a 30Hz clock. Needed adjusted variables and setup for Shadow Warrior.
2023-04-22 21:40:57 +10:00
Mitchell Richters
6ba227ab8b - Spaces be damned! 2023-04-22 19:50:55 +10:00
Mitchell Richters
71d833f9ea - Make Exhumed's new view tilting features accessible for all games. 2023-04-22 19:34:53 +10:00
Mitchell Richters
bb19997a2c - Apply pitch/yaw input along-side the key inputs.
* Removes a lot of duplicated code.
2023-04-21 21:13:18 +10:00
Mitchell Richters
70dd565c50 - Slightly tune mouse formula in GameInput::processVehicle(). 2023-04-21 21:13:17 +10:00
Mitchell Richters
258ab0db89 - Exhumed: Initial setup of view rolling effects.
* `cl_exviewtilting 1` enables a console-like view rolling upon yaw input.
* `cl_exviewtilting 2` enables a Quake-like view rolling upon strafe input.
2023-04-21 21:13:17 +10:00
Mitchell Richters
2658af9fd0 - Use weapon enums when determining max slot numbers. 2023-04-05 10:22:18 +10:00
Mitchell Richters
0eba341ac1 - Remove GameInput::prepareHidInput() and GameInput::resetHidInput().
* Also reverts 23bff9f701, but changes the loop into a `memset()` call instead.
2023-04-04 20:07:06 +10:00
Mitchell Richters
d454455d22 - Move invertmouse CVARs into common code.
* Removes duplication of CVAR definitions between Raze and GZDoom.
2023-04-04 20:01:21 +10:00
Mitchell Richters
133c8fa80b - Only scale the mouse input in GameInput::processMovement(), where it's needed.
* Also fixes a potential signedness issue for `processVehicle()` if `m_yaw` is negatively set.
2023-04-04 09:53:43 +10:00
Mitchell Richters
a68fcfc71c - Remove GameInterface::getConsoleAngles(), it's not needed anymore. 2023-04-04 07:02:39 +10:00
Mitchell Richters
3ef431a428 - Make scaleAdjust a float since it's what's needed anyway. 2023-04-03 19:38:00 +10:00
Mitchell Richters
69c65dfe7e - Internalise InputPacket used in movement functions. 2023-04-03 19:35:35 +10:00
Mitchell Richters
dbba0abb2e - Move all mouse handling into GameInput class. 2023-04-03 18:47:14 +10:00
Mitchell Richters
8d11fef916 - Initial conversion of game input into class GameInput. 2023-04-03 18:46:36 +10:00
Mitchell Richters
23186cd8bb - Relocate processCrouchToggle(). 2023-04-03 18:38:10 +10:00
Mitchell Richters
31d3349d93 - Rearrange bools in processVehicleInput(). 2023-04-03 18:37:38 +10:00
Mitchell Richters
fb519e9c53 - Move PlayerAngles constants into the class. 2023-04-03 17:07:34 +10:00
Mitchell Richters
272dfa762d - Remove backend crouch toggle solution redeploy with Duke/Exhumed/Blood using new ESyncBit bit.
* I tried to make this work in 2020 but its been nothing but headache. It's something for the game to control via a flag, not the backend to determine.
* For SW, this restores its original implementation.
2023-04-02 18:32:40 +10:00
Mitchell Richters
ea4e850674 - Move remaining mouse CVARs from inputstate.cpp to gameinput.cpp. 2023-04-02 18:32:39 +10:00
Mitchell Richters
10cd63f383 - Use an FVector2 inside HIDInput. 2023-04-02 18:32:39 +10:00
Mitchell Richters
4387294aff - Eliminate the duplicate mouse storage since we have things in the right spot now. 2023-04-02 18:32:39 +10:00