Commit graph

1230 commits

Author SHA1 Message Date
Mitchell Richters
ac35e09d1c - Move each game's stored nPlayer/pnum value to CorePlayer. 2023-10-02 18:44:04 +11: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
02bd017d07 - Directly set CorePlayer::ucmd rather than copying it to a temporary array. 2023-10-02 17:00:50 +11:00
Mitchell Richters
d90aca9640 - Directly store a ticcmd_t object within CorePlayer. 2023-10-02 17:00:50 +11:00
Mitchell Richters
23d4cbc3bd - Remove all game-side PlayerArray[] objects and store within common code. 2023-10-02 15:43:00 +11:00
Mitchell Richters
f9c3a64f35 - Exhumed: Initial setup to convert PlayerArray array to array of ExhumedPlayer pointers. 2023-10-02 15:43:00 +11:00
Mitchell Richters
1604cf009c - Move the actor pointer for each game's player structures into CorePlayer.
* Something strange was going on here with Blood where the static_cast would not work... Moved the player structure into `bloodactor.h` for now to work around it.
2023-10-02 15:42:59 +11:00
Mitchell Richters
6beec5eed2 - Set up initial implementation of CorePlayer struct and make game-side player structs inherit from it. 2023-10-02 15:42:59 +11:00
Mitchell Richters
d107b6a1fa - Exhumed: Rename PlayerList[] array to PlayerArray[] and wrap its access. 2023-10-02 15:42:09 +11:00
Mitchell Richters
5008ac08ac - Exhumed: Rename Player struct to ExhumedPlayer. 2023-10-02 15:41:15 +11:00
Mitchell Richters
61bc8c23cf - Exhumed: Wrap access to player's actor pointer. 2023-10-02 15:30:35 +11:00
Christoph Oelckers
ee07ae35aa retrieve time in fillSummary. 2023-10-01 12:10:56 +02:00
Christoph Oelckers
4dcf0fd3c4 get rid of the GetStats interface function.
Now that all data it retrieves is available in shared code it is no longer needed.
2023-10-01 11:48:32 +02:00
Christoph Oelckers
da3df98484 use global stat manager in Exhumed 2023-10-01 10:17:27 +02:00
Mitchell Richters
dc8be29354 - Exhumed: Use range-based loop in seq_LoadSequences(). 2023-09-28 22:16:31 +10:00
Mitchell Richters
8f9b413d38 - Always clear object in PlayerAngles::initialize() rather than expecting the caller to do it. 2023-09-28 22:16:30 +10:00
Mitchell Richters
7fa5df934b - Make playercmds[] non-global and pass through as pointer. 2023-09-28 22:16:30 +10:00
Mitchell Richters
32480dde16 - Ensure all games preserve SB_CENTERVIEW and SB_CROUCH bits upon loading. 2023-09-24 17:22:38 +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
Christoph Oelckers
d96a928738 - Exhumed: fixed sprite positioning issues
Apparently tile #1 has some significance here.
2023-09-23 10:30:52 +02:00
Christoph Oelckers
d34bad3045 - adapted game side code. 2023-08-19 19:41:40 +02:00
Christoph Oelckers
2095a2120c - consolidated the 4 ReadSound functions. 2023-08-19 18:11:19 +02:00
Christoph Oelckers
3c695a5abd - adapted to backend changes. 2023-08-19 18:08:27 +02:00
Christoph Oelckers
20b96501b6 - moved rnd_plasma into global space again.
C++'s init rules for local static variables are so dumb that this will cause undefined behavior with the RNG management, it's also very inefficient.
2023-08-03 12:55:23 +02:00
Kevin Caccamo
80ac9f6416 Fix a memory write issue with plasma_{A,B,C}
plasma_A[5] = {}; will write the default value for int to the sixth element of plasma_A, causing a global-buffer-overflow.

I assume the intention here was to fill these three arrays with zeroes, which is what I did with the memset calls.
2023-07-12 19:13:05 +10:00
Christoph Oelckers
1b2a249243 - got rid of all tile index constants in Exhumed. 2023-05-21 07:42:26 +02:00
Christoph Oelckers
9bf028b7f0 - eliminated use of one more tile index in Exhumed. 2023-05-20 18:27:12 +02:00
Christoph Oelckers
fd9a9232af - cleanup of Exhumed's 2D code. 2023-05-20 18:08:59 +02:00
Christoph Oelckers
a2b2e2ec87 - got rid of tileHeight and tileWidth. 2023-05-20 18:08:40 +02:00
Christoph Oelckers
11ba136df1 - make autosaving happen immediately for other games than Blood only.
Blood does not like it, but for the others it should be ok.
2023-05-19 22:59:47 +02:00
Christoph Oelckers
6e060c2e83 Revert "- Tidy up autosaving for all the games."
This reverts commit 10445635cf.

Contrary to what the reverted commit states, it is absolutely essential to have this delay. Duke and Blood initialize a lot of things in their first tick that are necessary before the world is stable to save.
2023-05-19 22:53:17 +02:00
Christoph Oelckers
ff24711710 -put the remaining directly accessed textures into the aTexIDs arrays for Blood and Exhumed. 2023-05-19 22:51:32 +02:00
Christoph Oelckers
481f139962 - put texture ID lists into a namespace.
These conflicted with each other.
2023-05-19 22:51:31 +02:00
Christoph Oelckers
9a703639cb - final cleanup of Blood/Exhumed changes. 2023-04-29 11:32:04 +02:00
Christoph Oelckers
01b6d9f27f - eliminated all remaining uses of picnum in Exhumed. 2023-04-29 11:32:03 +02:00
Christoph Oelckers
44e9a66319 - handle 3 more of Exhumed's picnums that were quick to refactor 2023-04-29 11:32:03 +02:00
Christoph Oelckers
0e097903c4 - got rid of a large chunk of picnum accesses in Exhumed. 2023-04-29 11:32:03 +02:00
Christoph Oelckers
44f4104eda - got rid of the last tilenum uses in Duke.
This meant refactoring the crosshair drawer to work on a named texture called "CROSSHAIR" and hard coding the magic numbers for spawndebris.
2023-04-29 09:54:15 +02:00
Mitchell Richters
ef81e713e2 - Exhumed: Clamp off vale in fix from adbd5c3c69.
* Fixes example situations where the player is underwater and smashing against the ceiling, etc.
2023-04-28 19:30:14 +10:00
Mitchell Richters
742d76a4bf - Exhumed: Tidy up some unnecessarily nested if statements in movespritez(). 2023-04-27 22:51:30 +10:00
Mitchell Richters
adbd5c3c69 - Exhumed: Fix velocity loss in movespritez() when warping.
* Old code was adjusting the actor's Z to right off the ceiling with no factoring in of the old interpolation position.
* Due to this, we were hitting the `nCamerapos.Z = min(max(nCamerapos.Z, pSector->ceilingz + 1), pSector->floorz - 1);` bounding in the draw code.
* Since game puts you right at the ceiling, we apply this to the old interpolation position, as well as the current position, however we then add their velocity back onto the current position to make the warp seamless.
2023-04-27 22:51:30 +10:00
Mitchell Richters
78df82e1ed - Exhumed: Clean up loHit global in move.cpp.
* More lazy arg passing via a global...
2023-04-27 22:51:30 +10:00
Mitchell Richters
4c5339274d - Exhumed: Fix bad velocity zeroing from ece41ac84c. 2023-04-27 21:32:36 +10:00
Mitchell Richters
3edc1a5a5a - Exhumed: Make getSequence() return a pointer instead of a reference.
* Gets rid of the awkward `operator[]()` calls.
* Gets rid of `std::ref()` setup in gun.cpp.
* Ensures a copy isn't made if the caller accidentally leaves off an ampersand.
* Allows us to use a consistent getter for native code and VM exports.
2023-04-27 20:16:14 +10:00
Mitchell Richters
ea7fe0e0b4 - Exhumed: Add fixSeqs() and use it to patch OOB issue with skulstrt.seq. 2023-04-26 20:27:28 +10:00
Mitchell Richters
33d4809663 - Exhumed: Ensure sequence data cannot be changed via the getters. 2023-04-26 20:13:26 +10:00
Mitchell Richters
64c47b0385 - Exhumed: Slightly tune damage pushback from previous commit.
* The logic here is that the player's running/double speed velocity is scaled by 0.375 in `updatePlayerVelocity()`, so 0.1875 is half of that scale.
2023-04-25 20:07:10 +10:00
Mitchell Richters
64745dff89 - Exhumed: Allow damage pushback behind CVAR cl_exdamagepush.
* Fixes #907.
* Works in conjunction with ece41ac84c by using the player actor's velocity.
* Original game blanket reset the sprite/actor's vel each tic which cancelled this out.
* Original damage value is far, far too high. Had to scale it back by 1024 units to make it reasonable!
2023-04-25 19:55:05 +10:00
Mitchell Richters
0a6ff79f4f - Exhumed: Give runlist_CheckRadialDamage() a bit of a tidy. 2023-04-25 19:44:25 +10:00