Commit graph

1110 commits

Author SHA1 Message Date
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
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
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
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
fa5490b834 - Exhumed: Just move analyzesprites() into gi->processSprites(). 2023-03-23 15:55:00 +11:00
Mitchell Richters
0ac7af6cd7 - Exhumed: Avoid unnecessarily iterating through tsprites twice. 2023-03-23 15:54:59 +11:00
Mitchell Richters
10ebc00853 - Exhumed: Attempt to make player pTarget updating MP friendly.
* This probably works better than using the temporary view pos vector of the console player, anyway.
* Might assist with #626 as well.
2023-03-23 15:54:59 +11:00
Mitchell Richters
3b889d5c36 - Exhumed: Make main loop player index aware. 2023-03-23 15:54:59 +11:00
Mitchell Richters
c486940b2c - Exhumed: Ensure playsim runs with PlayClock at 0 for first tic. 2023-03-23 15:54:59 +11:00
Mitchell Richters
eed1d14b9d - Exhumed: Split out velocity updating to static function. 2023-03-23 15:54:59 +11:00
Mitchell Richters
187710e9e2 - Exhumed: Set nFreeze input locking in right spot. 2023-03-23 15:54:58 +11:00
Mitchell Richters
895304ccee - Exhumed: Split out weapon updating to static function. 2023-03-23 15:54:58 +11:00
Mitchell Richters
e9e36fedb2 - Exhumed: Split out inventory updating to static function. 2023-03-23 15:54:58 +11:00
Mitchell Richters
88e6a6e894 - Rework ff652f454c slightly to accept an InputPacket pointer. 2023-03-22 20:08:53 +11:00
Mitchell Richters
ff652f454c - Tidy up how games reapply needed bits at start of tic. 2023-03-22 18:17:50 +11:00
Mitchell Richters
b3c27a177e - Consolidate each game's gi-GetInput() into a unified function.
* Eliminates a lot of boilerplate.
* Consolidation of input accumulation buffers discretely used in each game.
* Allows privatisation of `PlayerAngles::CameraAngles`.
2023-03-18 19:49:25 +11:00
Mitchell Richters
65ee4b14d6 - Move gi->getConsoleActor() directly into the header. 2023-03-18 19:29:29 +11:00
Mitchell Richters
bd3e9b305e - Adjust signatures of input functions slightly for consistency. 2023-03-18 19:29:29 +11:00
Mitchell Richters
b8ba78cf89 - Exhumed: Use array pointers in GameInterface::Ticker() for one's sanity. 2023-03-18 19:29:28 +11:00
Mitchell Richters
42a895d666 - Exhumed: Move dead checks out of the input handler and into the ticker. 2023-03-18 19:29:15 +11:00
Mitchell Richters
1af60fb02b - Exhumed: Clear local input accumulation buffer after copying a packet, just like the other games. 2023-03-18 19:19:22 +11:00
Mitchell Richters
0cf44e42fc - Exhumed: Eliminate initsectp global. 2023-03-18 19:19:22 +11:00
Mitchell Richters
d30ce9691a - Exhumed: Eliminate initpos global. 2023-03-18 19:19:22 +11:00
Mitchell Richters
5fe4b0fdb1 - Exhumed: Eliminate inita global. 2023-03-18 19:19:21 +11:00
Mitchell Richters
446218dd7b - Get mouse/controller input by pointed variable and not copy on return. 2023-03-17 20:58:11 +11:00
Mitchell Richters
7f79ee9801 - Exhumed: Repair missing negation affecting death sequence.
* Pitch negation strike's back!
2023-03-17 19:17:18 +11:00
Mitchell Richters
81caf74721 - Tidy up coord stat to use gi->getConsoleActor() and also print pitch. 2023-03-17 17:28:26 +11:00
Mitchell Richters
3c4b4e4483 - Tidy up warptocoords CCMD since everything is in an actor now.
* Now accepts floating point inputs.
* Restores lost pitch capability.
2023-03-17 17:28:04 +11:00
Mitchell Richters
d329328191 - Rename PlayerAngles::RenderAngles to CameraAngles.
* Better conveys what it is and separates it from the already established `getRender*()` methods around the place.
* Sorry Simon!
2023-03-17 14:20:36 +11:00
Mitchell Richters
742a2e5c9a - Exhumed: Ensure automap uses untouched interpolated actor position.
* Using chase cam while the automap was on was drawing the player sprite incorrectly.
2023-03-17 14:11:27 +11:00
Mitchell Richters
cb1e4e7a34 - Exhumed: Ensure Player::items[] is signed.
* Change originates from b71c725e3e.
* Matches PCExhumed and GDX.
* Logic in game requires this variable to be signed.
* Fixes #415.
* Fixes #888.
2023-03-16 13:05:22 +11:00
Mitchell Richters
3d6f1e1a04 - Exhumed: Store dedicated player velocity in Player struct.
* Changes implementation in 67c7dd65f9.
* Cannot rely on the actor's velocity alone as parts of the game modify this, such as getting hit by lava dudes, but game nullifies this at the start of the player's tic.
2023-03-16 12:17:42 +11:00
Mitchell Richters
0d62e6befe - Exhumed: Optimise UnlinkIgnitedAnim() from fb97e3c6ca a bit.
* Bad cherry pick caused a stat iteration over the wrong stat number.
* Cleaned up commentary to reflect that we have actors and not so much sprites or an anim array anymore.
2023-03-15 22:52:14 +11:00
sirlemonhead
fb97e3c6ca PCExhumed: Fixed Ignited sprite anim issue that could cause invalid array access.
* Fixes #638.
2023-03-15 17:20:29 +11:00
Mitchell Richters
a90665732c - Clean up other PlayerAngles interfaces for consistency. 2023-03-14 21:45:38 +11:00
Mitchell Richters
62561d863e - Tidy up PlayerAngles::doPitchKeys() interface by passing the whole sync packet through. 2023-03-14 21:45:37 +11:00
Mitchell Richters
9ffc65fa48 - Exhumed: Eliminate PlayerInput struct in favour of InputPacket object PlayerList::input. 2023-03-14 21:45:37 +11:00
Mitchell Richters
67c7dd65f9 - Exhumed: Remove PlayerInput::vel in favour of just using actor's velocity. 2023-03-14 21:45:37 +11:00
Mitchell Richters
73acffac2c - Exhumed: Move PlayerInput::nItem to Player struct as Player::nCurrentItem. 2023-03-14 21:45:37 +11:00
Mitchell Richters
f77b1007be - Exhumed: Remove unused PlayerInput::buttons 2023-03-14 21:45:37 +11:00
Mitchell Richters
c73ee5f848 - Exhumed: Move PlayerInput::pTarget to Player struct. 2023-03-14 21:45:37 +11:00
Mitchell Richters
991ef5c27f - Minor input tidy-up. 2023-02-04 17:05:18 +11:00
Christoph Oelckers
432021b8e7 - Exhumed: avoid shade hacks with palette emulation on.
This code only makes sense with true color rendering.
2023-01-28 11:44:05 +01:00
Christoph Oelckers
33f0d229fa - Exhumed: fixed bad return values for two HUD functions. 2023-01-21 14:37:57 +01:00
Mitchell Richters
7f1add4786 - Exhumed: Remove unused local variable left over from 087aa7b2ee. 2023-01-13 10:34:31 +11:00
Mitchell Richters
087aa7b2ee - Exhumed: Tidy up DrawMap() entrypoint. 2023-01-12 18:59:32 +11:00
Mitchell Richters
c606fc11da - Add call to resetForcedSyncInput() for all games.
* Blood was missing it.
* If it's pre-added to all games, it never needs thinking about.
2023-01-12 18:59:32 +11:00
Christoph Oelckers
2e35d6a6a8 - Exhumed: account for rounding errors in MoveSectorSprites
The formula here left no margin for error and minor rounding errors are inevitable with this code.
2023-01-07 10:45:15 +01:00
Christoph Oelckers
d064706f93 - got rid of wallpicnum and overpicnum.
All map geometry npw uses texture IDs and no longer depends on Build's tile system.
(What's missing is a new map format, though, but this was a necessary prerequisite to make that worthwile...)
2022-12-29 14:14:53 +01:00
Christoph Oelckers
b1e2b2addf - backend cleanup from GZDoom. 2022-12-18 16:31:50 +01:00
Christoph Oelckers
837e4d1438 - eliminated many uses of wallpicnum.
The ones left require a bit more work on the data first.
2022-12-18 15:11:08 +01:00
Christoph Oelckers
a9ea2cd5c0 - moved GetReservedScreenSpace function into the scripted status bar where it belongs.
Since this is supposed to return the height of the status bar, keeping it native is a bit pointless as it cannot be modified that way.
2022-12-18 14:47:38 +01:00
Christoph Oelckers
c41dc29885 - eliminated half of the remaining tileWidth and tileHeight calls. 2022-12-18 14:45:09 +01:00
Christoph Oelckers
e78fd90f67 - adapted sky code for using texture IDs. 2022-12-18 14:42:27 +01:00
Christoph Oelckers
5147826eeb - consolidated precaching code and rewrote the core to work on texture IDs. 2022-12-18 13:37:54 +01:00
Christoph Oelckers
20edd800f9 - big texture system refactor.
Finally that quickly slapped together BuildTiles class is gone and replaced with something that better integrates with the underlying texture manager
2022-12-18 13:05:58 +01:00
Christoph Oelckers
ff09257d47 - Exhumed: allow Anubis to get out of the walking state if he loses his target.
This happened on occasion on the first map
2022-12-14 10:25:01 +01:00
Kevin Caccamo
4cdb0c3c55 Attempt to fix #787 2022-12-13 14:08:02 +01:00
Christoph Oelckers
9c1fc93e1c - Exhumed: The ObjectList was not properly garbage collected. 2022-12-13 08:49:56 +01:00
Mitchell Richters
c3f276a08a - Tidy up remaining Build angle constants in gamefuncs.h. 2022-12-11 19:46:27 +01:00
Mitchell Richters
de8353f085 - Eliminate BAngToDegree constant. 2022-12-11 19:46:26 +01:00
Mitchell Richters
67b40ee1d5 - Convert angle in hud_drawsprite() to work on true degrees, and in the right direction. 2022-12-11 19:46:26 +01:00
Christoph Oelckers
e26d9106aa - handle all occurences of tileWidth and tileHeight using spritetypebase::picnum. 2022-12-11 19:44:01 +01:00
Christoph Oelckers
f479f995a1 - transitioned all tileLeftOffset and tileTopOffset calls to use the texture manager. 2022-12-11 19:44:01 +01:00
Christoph Oelckers
0869497ecb - rewrote the tile pixel cache to work on texture IDs instead of tile IDs.
This allows using the related checking features with other textures as well.
2022-12-11 19:44:00 +01:00
Christoph Oelckers
8b0e86e88b - wrap a few more accesses to picnum variables 2022-12-11 19:44:00 +01:00
Christoph Oelckers
ede5b017ab - renamed walltype::picnum to wallpicnum for easier searching. 2022-12-11 19:43:58 +01:00
Christoph Oelckers
51ad64f71e - initialize all special tiles to their intended type before starting the game.
This ensures that we have an immutable mapping of tile number to texture ID now.
2022-12-11 19:43:58 +01:00
Christoph Oelckers
a63ee8079a - implemented customizable breakable walls and ported all hard coded variants to use this. 2022-12-11 19:43:57 +01:00
Mitchell Richters
2c592405fa - Separate pitch/yaw key input into separate functions and apply from the ticker. 2022-12-11 19:43:56 +01:00
Mitchell Richters
f58e3c58aa - Remove PlayerAngles::setPitch() method usage. 2022-12-11 19:43:56 +01:00
Mitchell Richters
7a7758efaa - Remove PlayerAngles::addPitch() method usage. 2022-12-11 19:43:56 +01:00
Mitchell Richters
968d0ae0d2 - Implement new scaled angle change setup and remove enforcement of synchronised input. 2022-12-11 19:43:55 +01:00
Mitchell Richters
15b101870d - Completely remove current scaled angle change setup.
* During this transition, temporarily enforce synchronised input at all times.
2022-12-11 19:43:55 +01:00
Christoph Oelckers
67e807de26 - exported the tile flag setters to .def. 2022-12-11 18:42:01 +01:00
Mitchell Richters
6c0493868e - Implement new method for applying scaled angle changes.
* This method works more accurately to how an angle change would occur under interpolated circumstances.
2022-12-11 18:42:01 +01:00
Mitchell Richters
5a8612110d - Process scaled angle adjustments in each game's render function, not from the input function.
* Previous config had the potential to call `I_GetInputFrac()` nearly twice in a row, which would have resulted in some hitching.
* Calling from each game's render function avoids the above and means we can start applying scaled angle changes one frame faster.
2022-12-11 18:42:01 +01:00
Mitchell Richters
58c1efb8de - Exhumed: Remove all remaining angle wrapper usage. 2022-12-11 18:42:00 +01:00
Mitchell Richters
1aad5eacfa - Remove all remaining legacy wrappers. 2022-12-11 18:42:00 +01:00
Mitchell Richters
cca36b8061 - Make legacy weapon drawers in PlayerAngles local to Redneck code, they will eventually go. 2022-12-11 18:42:00 +01:00
Mitchell Richters
e972818db5 - Tidy up modern crosshair/weapon offset drawers. 2022-12-11 18:41:59 +01:00
Mitchell Richters
25de63ffb5 - Cleanup of render draw code to use new angle getter. 2022-12-11 18:41:59 +01:00
Mitchell Richters
599a375d67 - Rename DCoreActor::interpolatedangle() to DCoreActor::interpolatedyaw() 2022-12-11 18:41:59 +01:00
Mitchell Richters
abdeeac205 - Rework PlayerAngles::doViewPitch() to apply at ticrate like PlayerAngles::doViewYaw(). 2022-12-11 18:41:59 +01:00
Mitchell Richters
f9aeee5b4a - Split out view angle stuff out of PlayerAngles::applyYaw() into PlayerAngles::doViewYaw().
* Do all the view angle stuff as interpolated changes in the playsim as well, there's no need for these to be done at ticrate.
2022-12-11 18:41:59 +01:00
Mitchell Richters
d7d76d5fc4 - Move all PlayerAngles view angle properties into new DRotator objects. 2022-12-11 18:41:58 +01:00
Mitchell Richters
175b182805 - Invert rotscrnang so it rolls forward, consistent with all other angles. 2022-12-11 18:41:58 +01:00
Mitchell Richters
bef4536c1f - Remove old PlayerAngles backup/restore methods. 2022-12-11 18:41:58 +01:00
Mitchell Richters
630c10856e - Re-write PlayerAngles scaled adjustment methods. 2022-12-11 18:41:58 +01:00
Mitchell Richters
aa868232c8 - Clean up all previously annotated angle/yaw checks. 2022-12-11 18:41:58 +01:00
Mitchell Richters
a84e09048e - Change wrapper internals for current yaw to the actor's sprite DRotator and make sure all the games load a level. 2022-12-11 18:41:57 +01:00
Mitchell Richters
7f5b97a0b7 - Change wrapper internals for current pitch to the actor's sprite DRotator and make sure all the games load a level. 2022-12-11 18:41:57 +01:00