Commit graph

13754 commits

Author SHA1 Message Date
Mitchell Richters
e34c4353f6 - Exhumed: Properly clamp off pitch in death function. 2023-03-25 17:27:33 +11:00
Mitchell Richters
025f2ec5fb - Exhumed: Do player pitch/yaw before movement code. 2023-03-25 16:58:15 +11:00
Mitchell Richters
79f7ca976b - Exhumed: Refactor the pitch tilting/panning code.
* Made it work on the player's view pitch and not their actual pitch.
* Drastically simplifies implementation and allows its use even with mouse aiming.
2023-03-25 16:52:13 +11:00
Mitchell Richters
7ecf6b26c3 - Exhumed: Might as well split out the death restart as well. 2023-03-25 16:06:19 +11:00
Mitchell Richters
7da9b2c17d - Exhumed: Slightly re-arrange where movement actions are called.
* Removes jank setups like testing whether the player is dead and nulling their input. Now, the movement code just doesn't call if they're dead.
2023-03-25 15:57:23 +11:00
Mitchell Richters
e5e1428062 - Exhumed: Split off runlist signal code from player ticker. 2023-03-25 15:57:22 +11:00
Mitchell Richters
a86751a355 - Exhumed: Move all underwater code into doPlayerBreath().
* Renamed to `doPlayerUnderwater()`.
* Keeps all underwater logic together.
* More importantly, fixes an issue 🙃.
2023-03-25 15:12:13 +11:00
Mitchell Richters
52618ede14 - Exhumed: Amend 187710e9e2. 2023-03-25 15:10:54 +11:00
Mitchell Richters
1ed91ade54 - Exhumed: Fix dopple actor picnum updating. 2023-03-25 14:19:07 +11:00
Mitchell Richters
481c52f175 - Exhumed: Move some player code out of exhumed.cpp and into player.cpp where it should be. 2023-03-25 14:08:02 +11:00
Mitchell Richters
ae361208a0 - Exhumed: Tidy up flags in feebtag(). 2023-03-25 13:18:46 +11:00
Mitchell Richters
66c4a753d9 - Exhumed: Move doPickupHealth() lambda out of doPlayerPickupItems(). 2023-03-25 12:51:18 +11:00
Mitchell Richters
d5a0dd3d80 - Exhumed: Move doPickupWeapon() lambda out of doPlayerPickupItems(). 2023-03-25 12:46:37 +11:00
Mitchell Richters
3854a97913 - Exhumed: Move doProcessPickup() lambda out of doPlayerPickupItems(). 2023-03-25 12:43:06 +11:00
Mitchell Richters
27534c433d - Exhumed: Move lambdas out of doPlayerPickupItems(), starting with doConsoleMessage(). 2023-03-25 12:40:00 +11:00
Mitchell Richters
33cea4a7e1 - Exhumed: Remove offset in doPlayerItemPickups() and just use the statnum. 2023-03-25 12:28:33 +11:00
Mitchell Richters
06e97d26aa - Exhumed: Merge grenade pickup code into generic lambda. 2023-03-25 10:52:40 +11:00
Mitchell Richters
249d6b1b81 - Exhumed: Use an actor pointer on the stack in doPlayerCounters(). 2023-03-25 10:08:55 +11:00
Mitchell Richters
128997c79c - Exhumed: Clean up double getting of player actor in doPlayerBreath(). 2023-03-25 10:06:18 +11:00
Mitchell Richters
47d25932d5 - Exhumed: Move doPlayerMask() into doPlayerCounters(). 2023-03-25 09:42:37 +11:00
Mitchell Richters
1ebc634ac0 - Exhumed: Consolidate two more cases in pickup code. 2023-03-25 08:44:27 +11:00
Mitchell Richters
c0d13f7619 - Exhumed: Use lookup table for health pickups in doPlayerItemPickups(). 2023-03-25 08:43:50 +11:00
Mitchell Richters
e766c29fd5 - Exhumed: Use lookup table for weapon pickups in doPlayerItemPickups(). 2023-03-25 08:41:45 +11:00
Mitchell Richters
be9ece4afc - Exhumed: Use lookup table for some weapon types in doPlayerItemPickups(). 2023-03-25 07:42:20 +11:00
Mitchell Richters
1013d41f89 - Exhumed: Use lookup table for item type in doPlayerItemPickups(). 2023-03-25 07:32:29 +11:00
Mitchell Richters
07dda89cfd - Exhumed: Merge all player counter code into one function.
* Probably a bit too much to break these down as much as I did.
2023-03-25 00:12:52 +11:00
Mitchell Richters
72af290502 - Exhumed: Pass tint values through to lambdas as args as well. 2023-03-25 00:09:17 +11:00
Mitchell Richters
da47369582 - Exhumed: Pass item, amount and sound through to lambdas as args. 2023-03-25 00:09:17 +11:00
Mitchell Richters
84223b6b04 - Exhumed: Remove call to doConsoleMessage() from default lambda so what's going on is clearer. 2023-03-25 00:09:17 +11:00
Mitchell Richters
24b21345b1 - Exhumed: And same for health pickup process. 2023-03-25 00:09:16 +11:00
Mitchell Richters
16c2fa3abe - Exhumed: Same for weapon pickup process. 2023-03-25 00:08:54 +11:00
Mitchell Richters
239ee20a6d - Exhumed: Same for main pickup process. 2023-03-25 00:08:54 +11:00
Mitchell Richters
77e262ce3c - Exhumed: Swap out flag setup in doPlayerItemPickups() for lambdas, starting with console messages. 2023-03-25 00:08:54 +11:00
Mitchell Richters
40033c3a9d - Exhumed: Final switch case statement cleanups in doPlayerItemPickups(). 2023-03-25 00:08:53 +11:00
Mitchell Richters
83c7dfa7c9 - Exhumed: Clean up weapon pickups in doPlayerItemPickups(). 2023-03-24 23:19:57 +11:00
Mitchell Richters
935450251a - Exhumed: Clean up some more switch case statements in doPlayerItemPickups(). 2023-03-24 23:19:14 +11:00
Mitchell Richters
b99e2fa600 - Exhumed: Clean up health pickups in doPlayerItemPickups(). 2023-03-24 23:18:30 +11:00
Mitchell Richters
7f4b9d29b0 - Exhumed: Clean up first few switch case statements in doPlayerItemPickups(). 2023-03-24 23:17:59 +11:00
Mitchell Richters
48803b3631 - Exhumed: Remove gotos in doPlayerItemPickups() and use flag system like PowerslaveGDX. 2023-03-24 23:17:45 +11:00
Mitchell Richters
3f6a0661b6 - Exhumed: Default init nSound to -1 as the code tests > -1 for validity. 2023-03-24 21:42:54 +11:00
Mitchell Richters
a7c311e291 - Exhumed: Tidy up stack variables in doPlayerItemPickups(). 2023-03-24 21:42:40 +11:00
Mitchell Richters
154084322e - Exhumed: Final cleanup of AIPlayer::Tick(). 2023-03-24 21:13:42 +11:00
Mitchell Richters
650aa65533 - Exhumed: Split out player dopple actor update code.
* This cleans most of the player tick code. Now, onto that ghastly pickup code...
2023-03-24 21:13:42 +11:00
Mitchell Richters
0230a51ce2 - Exhumed: Split out player action sequence code. 2023-03-24 21:13:42 +11:00
Mitchell Richters
77fa3f6ea9 - Exhumed: Split out player view sector code. 2023-03-24 21:13:40 +11:00
Mitchell Richters
9c471e0209 - Exhumed: Split out floor damage code. 2023-03-24 20:31:43 +11:00
Mitchell Richters
e1f4b8d8e3 - Exhumed: Split out moving blocks code again. 2023-03-24 20:31:43 +11:00
Mitchell Richters
830c0b72cf - Exhumed: Split out player movement code. 2023-03-24 20:31:43 +11:00
Mitchell Richters
911c5158d2 - Exhumed: Split out player floor actor code. 2023-03-24 20:31:43 +11:00
Mitchell Richters
5fc0b25ad5 - Exhumed: Split out player breath/air/oxygen code. 2023-03-24 20:31:42 +11:00
Mitchell Richters
16561c2a6a - Exhumed: Split out player mask code. 2023-03-24 20:31:08 +11:00
Mitchell Richters
62c045a14f - Exhumed: Clean up some underwater checks. 2023-03-24 20:31:07 +11:00
Mitchell Richters
b160d78701 - Exhumed: Tidy up vect variables on the stack. 2023-03-24 20:26:18 +11:00
Mitchell Richters
4cdced60b1 - Exhumed: Tidy up some pos/sect variables on the stack. 2023-03-24 19:52:38 +11:00
Mitchell Richters
d976a6da01 - Exhumed: Tidy up zVal on player ticker stack. 2023-03-24 19:52:37 +11:00
Mitchell Richters
5463b14b26 - Exhumed: Split out player ramses code. 2023-03-24 19:52:36 +11:00
Mitchell Richters
0271a49030 - Exhumed: Move moving block check code back into player ticker for now.
* Reverts 52b2d1cd7d
* Upon closer inspection, the original code here used `zz` on the player stack, which was re-obtained again using the actor's Z vel, however the actor's Z vel gets modified along the way which could break how this code is meant to work.
* Should be split again but requires holistic thought.
2023-03-24 19:50:27 +11:00
Mitchell Richters
e2d3c4dceb - Exhumed: Get rid of GetAngleToSprite() in favour of backend utility. 2023-03-24 19:50:27 +11:00
Mitchell Richters
eaa58e6687 - Exhumed: Get rid of GetWallNormal() in favour of backend utility. 2023-03-24 19:50:26 +11:00
Mitchell Richters
9906586569 - Make walltype::normalAngle() normalise the returned value. 2023-03-24 19:50:26 +11:00
Mitchell Richters
7fe82690a7 - Exhumed: Fix moving block sound setup to match PowerslaveGDX.
* Setup we had looked wrong by comparison, and it eliminates the last goto in the player tick code!
2023-03-24 19:50:26 +11:00
Mitchell Richters
62de240c27 - Exhumed: Reduce branch depth in CheckMovingBlocks() to make next change more visible. 2023-03-24 19:50:26 +11:00
Mitchell Richters
0e39dbfc95 - Exhumed: Make CheckMovingBlocks() work on player pointer. 2023-03-24 19:50:26 +11:00
Mitchell Richters
e256ac06e9 - Exhumed: Split out player death pitch code. 2023-03-24 19:50:25 +11:00
Mitchell Richters
8812831c73 - Exhumed: Split out player yaw code.
* Consider where this is executed. Should it come after the Ramses check, or be performed along-side player's pitch?
2023-03-24 19:50:25 +11:00
Mitchell Richters
9b3c726458 - Exhumed: Split out player pitch code. 2023-03-24 19:50:25 +11:00
Mitchell Richters
806dca975a - Exhumed: Remove goto out of updatePlayerAction().
* Doesn't really make sense and PowerslaveGDX doesn't do any jumping like this here.
2023-03-24 19:50:25 +11:00
Mitchell Richters
4c8b7e6804 - Exhumed: Initial cleanup of updatePlayerAction(). 2023-03-24 19:50:25 +11:00
Mitchell Richters
791504b5eb - Remove some pointless weapon functions. 2023-03-24 19:38:10 +11:00
Mitchell Richters
7fe6befef8 - Exhumed: Split out player actions code. 2023-03-24 19:36:43 +11:00
Mitchell Richters
a6cec3d4f1 - Exhumed: Just use pPlayer->nAction in player code, don't store on the stack. 2023-03-24 15:14:07 +11:00
Mitchell Richters
0842ea3c14 - Exhumed: Clean out some stale goto calls that were commented out.
* Only two remaining gotos to handle now.
2023-03-24 15:11:32 +11:00
Mitchell Richters
611d7bae98 - Exhumed: Bring player neartag() call to branch where it's needed. 2023-03-24 15:11:32 +11:00
Mitchell Richters
ed2c557297 - Exhumed: Remove ClearSpaceBar() and just directly clear the input bit.
* Also fix issue where `SB_OPEN` bit never seemed to be cleared properly.
* Also just directly test/use the player's input actions to minimise stack variables during this cleanup process.
2023-03-24 15:11:32 +11:00
Mitchell Richters
7293a1f5d1 - Exhumed: Pass player pointer through to updatePlayerTarget(). 2023-03-24 11:59:34 +11:00
Mitchell Richters
cdffb61cc7 - Exhumed: Remove prototype POSIX targets didn't like. 2023-03-23 21:25:49 +11:00
Mitchell Richters
f80b98fe92 - Fix CMakeLists.txt.
* Didn't know these were in there... 🤦‍♂️.
2023-03-23 21:16:04 +11:00
Mitchell Richters
5d6744836f - Exhumed: Have feebtag() return an actor pointer instead. 2023-03-23 21:00:35 +11:00
Mitchell Richters
22e135afeb - Exhumed: Rename pickup actor in pickup code. 2023-03-23 20:52:04 +11:00
Mitchell Richters
757d7b3660 - Exhumed: Split out player pickup code to separate file.
* Want to work on this in isolation.
* Can likely optimise this out to a lookup array of function pointers.
2023-03-23 20:50:08 +11:00
Mitchell Richters
f68c168ae4 - Blood: Delete empty file that got missed. 2023-03-23 20:36:37 +11:00
Mitchell Richters
764ec032c1 - Exhumed: Split out player current item code. 2023-03-23 19:48:27 +11:00
Mitchell Richters
f7433234b2 - Exhumed: Split out player quake code. 2023-03-23 19:48:26 +11:00
Mitchell Richters
04ab6f4640 - Exhumed: Split out player invincibility code. 2023-03-23 19:47:41 +11:00
Mitchell Richters
1a8dcda5b6 - Exhumed: Split out player invisibility code. 2023-03-23 19:47:11 +11:00
Mitchell Richters
374f0bb295 - Exhumed: Split out player double code. 2023-03-23 19:46:45 +11:00
Mitchell Richters
b51623b415 - Exhumed: Split out player torch code. 2023-03-23 19:46:18 +11:00
Mitchell Richters
8f21a89abc - Exhumed: Remove some duplicated code already covered in InitPlayers(). 2023-03-23 19:14:57 +11:00
Mitchell Richters
27144c0bc3 - Exhumed: Store the player's index within the player's struct. 2023-03-23 19:14:26 +11:00
Mitchell Richters
645d75ba0b - Exhumed: Use pointers to access player in AIPlayer::Tick(). 2023-03-23 18:50:30 +11:00
Mitchell Richters
75de294560 - Exhumed: Clean out the rest of input.cpp. 2023-03-23 17:41:01 +11:00
Mitchell Richters
fb9ff7d105 - Exhumed: Increase quake precision in SetQuake(). 2023-03-23 17:38:18 +11:00
Mitchell Richters
bd30e31b8d - Exhumed: Move nQuake[] array into Player struct. 2023-03-23 17:38:18 +11:00
Mitchell Richters
05fd2911a4 - Exhumed: Move dVertPan[] array into Player struct. 2023-03-23 17:38:18 +11:00
Mitchell Richters
095b33fa67 - Exhumed: Clean out the rest of enginesubs.cpp. 2023-03-23 17:38:16 +11:00
Mitchell Richters
e85162df97 - Removed unused lastTic global. 2023-03-23 17:38:01 +11:00
Mitchell Richters
e5f3f5f149 - Make setForcedSyncInput() require a player index.
* This should only ever apply to the console player.
2023-03-23 17:09:02 +11:00
Mitchell Richters
7da3b097fb - Remove the extern status for gamesetinput.
* We don't need to save this variable, we reset it at the start of every tic anyway.
2023-03-23 17:03:43 +11:00
Mitchell Richters
183ad0c61c - Adjust a few setForcedSyncInput() calls. 2023-03-23 16:34:33 +11:00
Mitchell Richters
fa5490b834 - Exhumed: Just move analyzesprites() into gi->processSprites(). 2023-03-23 15:55:00 +11:00