Commit graph

14612 commits

Author SHA1 Message Date
Mitchell Richters
6a06df0e45 - Duke: Change a few triple negations from the wrapper removal process. 2023-12-05 22:39:24 +01:00
Mitchell Richters
0f1f3d804f - Use DCorePlayer::GetActor() inside of CCMD(warptocoords). 2023-12-05 22:39:23 +01:00
Mitchell Richters
0c13d4fe3a - Fix most GCC warnings in the backend/common code code.
* Most of them were just signedness issues. Hopefully I got everything right here.
* 3rd party stuff deliberately not touched.
2023-12-05 22:39:23 +01:00
Mitchell Richters
526db7f8b0 - Fix all GCC warnings in the game-side code.
* Most of these were due to mixed spaces/tabs playing nastiness with non-braced if/else statements.
2023-12-05 22:39:23 +01:00
Mitchell Richters
084be1a45c - Store scaleAdjust directly inside the GameInput object. 2023-12-05 22:39:23 +01:00
Mitchell Richters
bdf566b348 - Remove GameInput friendships inside PlayerAngles in lieu of a local inline function. 2023-12-05 22:39:23 +01:00
Mitchell Richters
23dd0bab87 - Exhumed: Manual sweep for last replacements of player index for pointer. 2023-12-05 22:39:23 +01:00
Mitchell Richters
9871bb4a73 - Exhumed: Clean up player accesses in player.cpp. 2023-12-05 22:39:22 +01:00
Mitchell Richters
33296e61fb - Exhumed: Clean up player accesses in map.cpp and move.cpp. 2023-12-05 22:39:22 +01:00
Mitchell Richters
51b5393a23 - Exhumed: Clean up player accesses in items.cpp and associated utilities. 2023-12-05 22:39:22 +01:00
Mitchell Richters
692d995257 - Exhumed: Clean up player accesses in gun.cpp and associated utilities. 2023-12-05 22:39:22 +01:00
Mitchell Richters
a9ca3d7375 - Exhumed: Clean up player accesses in grenade code. 2023-12-05 22:39:22 +01:00
Mitchell Richters
856b6630f1 - Exhumed: Clean up player accesses in cheats.cpp. 2023-12-05 22:39:22 +01:00
Mitchell Richters
ad5f1d9f7d - Exhumed: Clean up player accesses in AddAmmo(). 2023-12-05 22:39:22 +01:00
Mitchell Richters
d4b0cb14b4 - Exhumed: Convert most of Ra to pointers. 2023-12-05 22:39:22 +01:00
Mitchell Richters
02f8ac3bb3 - Duke: Clean up player accesses in weapons code. 2023-12-05 22:39:21 +01:00
Mitchell Richters
2d6930fddc - SW: Clean up player accesses in DoGet(). 2023-12-05 22:39:21 +01:00
Mitchell Richters
63605f034d - Duke: Manual sweep for last replacements of GetActor() calls for stack pointer. 2023-12-05 22:39:21 +01:00
Mitchell Richters
66a77ea860 - Duke: Manual sweep for last replacements of player index for pointer. 2023-12-05 22:39:21 +01:00
Mitchell Richters
0615eba516 - Duke: Clean up player/actor accesses in checksectors_*(). 2023-12-05 22:39:21 +01:00
Mitchell Richters
48f1be7e0c - Duke: Clean up player/actor accesses in checkhitswitch() and associated utilities. 2023-12-05 22:39:21 +01:00
Mitchell Richters
b5f2357949 - Duke: Clean up player/actor accesses in moveclouds(). 2023-12-05 22:39:21 +01:00
Mitchell Richters
2de143214b - Duke: Clean up player/actor accesses in checkhitdefault(). 2023-12-05 22:39:20 +01:00
Mitchell Richters
4b410d48ba - Duke: Clean up player/actor accesses in doanimations(). 2023-12-05 22:39:20 +01:00
Mitchell Richters
5f132f5cda - Duke: Clean up player/actor accesses in findplayer utilities. 2023-12-05 22:39:20 +01:00
Mitchell Richters
60228e10c6 - Duke: Clean up actor accesses in premap.cpp. 2023-12-05 22:39:20 +01:00
Mitchell Richters
7401bf4c6f - Duke: Clean up actor accesses in player_d.cpp. 2023-12-05 22:39:20 +01:00
Mitchell Richters
4464497c28 - Duke: Clean up player/actor accesses in processinput_*(). 2023-12-05 22:39:20 +01:00
Mitchell Richters
32d294fed0 - Duke: Clean up player/actor accesses in processweapon(). 2023-12-05 22:39:20 +01:00
Mitchell Richters
0c7450bdb7 - Duke: Clean up player/actor accesses in player_w.cpp. 2023-12-05 22:39:19 +01:00
Mitchell Richters
3cefaf9030 - Duke: Clean up player/actor accesses in operateweapon(). 2023-12-05 22:39:19 +01:00
Mitchell Richters
9836925258 - Duke: Clean up player/actor accesses in fireweapon(). 2023-12-05 22:39:19 +01:00
Mitchell Richters
caa7d50505 - Duke: Clean up player/actor accesses in operateTripbomb(). 2023-12-05 22:39:19 +01:00
Mitchell Richters
58a87b658c - Duke: Clean up player/actor accesses in movement(). 2023-12-05 22:39:19 +01:00
Mitchell Richters
7dc0bde2be - Duke: Clean up player/actor accesses in operateJetpack(). 2023-12-05 22:39:19 +01:00
Mitchell Richters
18f362d68e - Add player's view angles to stat coord. 2023-12-05 22:39:19 +01:00
Mitchell Richters
561d756baa - Duke: Repair SB_CENTERVIEW not re-applying on the first tic. 2023-12-05 22:39:18 +01:00
Mitchell Richters
a6396cb491 - Centralise input clamping to occur centrally when the engine requests a packet. 2023-12-05 22:39:18 +01:00
Mitchell Richters
d2af13b924 - Make some utilities in vectors.h available as constexpr. 2023-12-05 22:39:18 +01:00
Mitchell Richters
a64de707e0 - Make TRotator<T> available as constexpr. 2023-12-05 22:39:18 +01:00
Mitchell Richters
4ff3351dd1 - Make TMatrix3x3<T> available as constexpr. 2023-12-05 22:39:18 +01:00
Mitchell Richters
eae8ebec31 - Make TVector4<T> available as constexpr. 2023-12-05 22:39:18 +01:00
Mitchell Richters
6b9ec49038 - Make TVector3<T> available as constexpr. 2023-12-05 22:39:18 +01:00
Mitchell Richters
ad694b7a8c - Make TVector2<T> available as constexpr. 2023-12-05 22:39:17 +01:00
Christoph Oelckers
60a36f4902 fix Vectoe3 clamp for real. 2023-12-05 22:39:17 +01:00
Mitchell Richters
d32961ca01 - Duke: Clean up actor accesses in player.cpp. 2023-12-05 22:39:17 +01:00
Mitchell Richters
3293d2337b - Duke: Clean up player/actor accesses in underwater(). 2023-12-05 22:39:17 +01:00
Mitchell Richters
6bb5958a93 - Duke: Clean up player/actor accesses in checkp(). 2023-12-05 22:39:17 +01:00
Mitchell Richters
be417e324b - Duke: Clean up player/actor accesses in haslock(). 2023-12-05 22:39:17 +01:00
Mitchell Richters
175b856406 - Duke: Clean up player/actor accesses in shoot(). 2023-12-05 22:39:17 +01:00
Mitchell Richters
0e1520ab1f - Duke: Clean up player/actor accesses in all input look functions. 2023-12-05 22:39:16 +01:00
Mitchell Richters
8e2d4a3f52 - Duke: Clean up player/actor accesses in playerJump(). 2023-12-05 22:39:16 +01:00
Mitchell Richters
443b66ea9d - Duke: Clean up player/actor accesses in playerCrouch(). 2023-12-05 22:39:16 +01:00
Mitchell Richters
2197128dc4 - Duke: Clean up player/actor accesses in timedexit(). 2023-12-05 22:39:16 +01:00
Mitchell Richters
c7c63413ce - Duke: Clean up player/actor accesses in endoflevel(). 2023-12-05 22:39:16 +01:00
Mitchell Richters
55c150845c - Duke: Clean up player/actor accesses in playerisdead(). 2023-12-05 22:39:16 +01:00
Mitchell Richters
4865fc7d8e - Duke: Clean up player/actor accesses in footprints(). 2023-12-05 22:39:16 +01:00
Mitchell Richters
d44d14a770 - Duke: Clean up player/actor accesses in makepainsounds(). 2023-12-05 22:39:15 +01:00
Mitchell Richters
6c067d4c38 - Duke: Clean up player/actor accesses in dokneeattack(). 2023-12-05 22:39:15 +01:00
Mitchell Richters
387ed6ceac - Duke: Clean up player/actor accesses in PlayerColorChanged(). 2023-12-05 22:39:15 +01:00
Mitchell Richters
0425cc82fa - Duke: Clean up player/actor accesses in noise.cpp. 2023-12-05 22:39:15 +01:00
Mitchell Richters
dbf7872243 - Duke: Clean up player/actor accesses in hudweapon_*(). 2023-12-05 22:39:15 +01:00
Mitchell Richters
74a5a7584e - Duke: Clean up player/actor accesses in checkcursectnums(). 2023-12-05 22:39:15 +01:00
Mitchell Richters
9e56237f99 - Duke: Clean up player/actor accesses in selectweapon_*(). 2023-12-05 22:39:15 +01:00
Mitchell Richters
287df1c18a - Duke: Clean up player/actor accesses in hud_input(). 2023-12-05 22:39:14 +01:00
Mitchell Richters
823e032c9a - Duke: Clean up player/actor accesses in displayweapon_*(). 2023-12-05 22:39:14 +01:00
Mitchell Richters
8f64af1f04 - Duke: Clean up player/actor accesses in displaymasks_*(). 2023-12-05 22:39:14 +01:00
Mitchell Richters
1e55b12e61 - Duke: Convert all the aplWeapon* crap to work on player pointers. 2023-12-05 22:39:14 +01:00
Mitchell Richters
b8ffcf3799 - Duke: Pass player pointer through to alterang(). 2023-12-05 22:39:14 +01:00
Mitchell Richters
2720c6f8c6 - Duke: Move PlayerUseItem() wrapper into DDukePlayer. 2023-12-05 22:39:14 +01:00
Mitchell Richters
4aeb19df84 - Duke: Move PlayerUseItem() wrapper into DDukePlayer.
* Regex used: `PlayerUseItem\(\w+\,\s?(\w+)\)` -> `p->itemUsed($1)`.
2023-12-05 22:39:14 +01:00
Mitchell Richters
487459afd7 - Duke: Remove PlayerInput() wrapper.
* Regex used: `PlayerInput\(\w+\,\s?(SB_\w+)\)` -> `!!(p->cmd.ucmd.actions & $1)`.
2023-12-05 22:39:13 +01:00
Mitchell Richters
14cf143739 - Duke: Remove PlayerInputBits() wrapper. 2023-12-05 22:39:13 +01:00
Mitchell Richters
97504df124 - Duke: Remove PlayerSetInput() wrapper. 2023-12-05 22:39:13 +01:00
Mitchell Richters
d7fbd8b348 - Duke: Remove PlayerNewWeapon() wrapper. 2023-12-05 22:39:13 +01:00
Mitchell Richters
beb083e471 - Duke: Got rid of two more InputPacket wrappers. 2023-12-05 22:39:13 +01:00
Mitchell Richters
2b0b98a49c - SW: Shorten the setup in DoPlayerVehicleInputScaling(). 2023-12-05 22:39:13 +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
8c1e392afc - Remove the TVector2 (const TVector3<vec_t> &other) constructor.
* This narrowing constructor was causing a problem with a `clamp()` overload in the next commit.
* Believe this is a product of a by-gone time before we had the `XY()` method on `TVector3<T>` objects.
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
4e9f2ef3f7 - Duke: Get rid of two InputPacket wrappers. 2023-12-05 22:39:11 +01:00
Mitchell Richters
0087f8e092 - Duke: Restore underwater input scaling to unsynchronised input which was lost back in March (b3c27a177e4787bf9341973039e73c1403e1b230). 2023-12-05 22:39:11 +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
Mitchell Richters
d683a6900a - SW: Remove DSWPlayer::drive_avel, we can just use DCoreActor::lastcmd for this. 2023-12-05 22:39:11 +01:00
Mitchell Richters
54d307a7e6 - Move doslopetilting() into DDukePlayer. 2023-12-05 22:39:11 +01:00
Mitchell Richters
c029273e19 - Duke: Clean up player/actor accesses in ParseState::parse(). 2023-12-05 22:39:11 +01:00
Mitchell Richters
cec1893852 - Duke: Clean up player/actor accesses in game_misc.cpp. 2023-12-05 22:39:10 +01:00
Mitchell Richters
9529e8fa67 - Duke: Clean up player/actor accesses in game.cpp. 2023-12-05 22:39:10 +01:00
Mitchell Richters
5d67edf6db - Duke: Clean up player/actor accesses in cheats.cpp. 2023-12-05 22:39:10 +01:00
Mitchell Richters
cbe977bfec - Duke: Remove unused angle rotation from ccmds(). 2023-12-05 22:39:10 +01:00
Mitchell Richters
f93dcf253f - Duke: Remove unused angle rotation from animatesprites_r(). 2023-12-05 22:39:10 +01:00
Mitchell Richters
f570167f48 - Duke: Clean up player/actor accesses in animatesprites_r.cpp. 2023-12-05 22:39:10 +01:00
Mitchell Richters
b1391cb482 - Duke: Clean up player/actor accesses in animatesprites_d.cpp. 2023-12-05 22:39:10 +01:00
Mitchell Richters
f8d403739a - Duke: Clean up player/actor accesses in actors_lava.cpp. 2023-12-05 22:39:10 +01:00
Mitchell Richters
cfc24a3697 - Duke: Tidy up resetplayerstats() to avoid looping through the players three times. 2023-12-05 22:39:09 +01:00
Mitchell Richters
4e1148e1ff - Duke: Fix resetplayerstats() setup. 2023-12-05 22:39:09 +01:00
Mitchell Richters
ae0de2d6aa - Clean up serialisers in savegamehelp.cpp. 2023-12-05 22:39:09 +01:00
Christoph Oelckers
a6467d2c9a use a TArray for the screenshot buffer. 2023-12-05 22:39:09 +01:00
Christoph Oelckers
3e47edb677 Revert "fixed CollisionData export."
This reverts commit fe02190604.
2023-12-05 22:39:09 +01:00
Christoph Oelckers
2096b74421 Duke: fixed bad loop index in gamevar init code. 2023-12-05 22:39:09 +01:00
Christoph Oelckers
330e2af217 made SW's panel sprites into actual DObjects
so that they can a) cleanly be exposed to scripting later and b) serialized for savegames without using gross hacks.
2023-12-05 22:39:09 +01:00
Christoph Oelckers
88d5d15094 fixed bad assumption about object destruction state in garbage collector.
The assumption was made that every object in the ToDestroy list wasn't destroyed yet.
This assumption is wrong in case one object destroys an owned one on its own destruction.
Instead this case must be properly dealt with and duplicate destruction be avoided.

This happened with the panel sprite sentinel in SW's player object.
2023-12-05 22:39:08 +01:00
Christoph Oelckers
0463623daf SW: fix serialization of panel sprites 2023-12-05 22:39:08 +01:00
Christoph Oelckers
3a37bda806 do not copy players, it is not allowed for polymorphic classes. 2023-12-05 22:39:08 +01:00
Mitchell Richters
8d205bc896 - Clean up a bunch of serialisers that were saving vector members, and not the whole vector. 2023-12-05 22:39:08 +01:00
Mitchell Richters
8bed6c9241 - Centralise the saving of player actions within DCorePlayer's serialiser. 2023-12-05 22:39:08 +01:00
Mitchell Richters
7a408582bc - Blood: Fix missing call to Super while saving. 2023-12-05 22:39:08 +01:00
Mitchell Richters
60c69f3344 - Duke: Remove some duplicated save variables. 2023-12-05 22:39:08 +01:00
Mitchell Richters
8281e5b324 - Exhumed: Remove some duplicated save variables. 2023-12-05 22:39:07 +01:00
Mitchell Richters
9df739186c - SW: Remove some duplicated save variables. 2023-12-05 22:39:07 +01:00
Mitchell Richters
176d027a3f - Duke: Clean up player/actor accesses in resetpspritevars(). 2023-12-05 22:39:07 +01:00
Mitchell Richters
9325759a48 - Duke: Ensure player's pnum is updated during premap. 2023-12-05 22:39:07 +01:00
Christoph Oelckers
c02cff1e48 fix saving. 2023-12-05 22:39:07 +01:00
Christoph Oelckers
5448f6ec2c turn players into DObjects and fix several bugs with bad memory access.
* DObjects may not be memset to 0.
* There was still code trying to retrieve the player index with pointer artithmetic. With an array of pointers this does not work.
2023-12-05 22:38:34 +01:00
Christoph Oelckers
1ce8ceac5d fixed GC handling of players.
These were missing null checks, the player pointers also weren't nulled after deleting the objects.
2023-12-05 22:03:57 +01:00
Christoph Oelckers
049bd41efe fixed warning 2023-12-05 22:03:57 +01:00
Christoph Oelckers
6dd27f2262 directory structure cleanup 2023-12-05 21:58:36 +01:00
Christoph Oelckers
5f8cd74ba5 added missing license to Duke's vmexports.cpp 2023-12-05 21:57:15 +01:00
Mitchell Richters
bdd02953c3 - Duke: Clean up player/actor accesses in rrra_specialstats(). 2023-10-02 21:24:26 +11:00
Mitchell Richters
ca4f00b6b3 - Duke: Clean up player/actor accesses in movetransports_r(). 2023-10-02 21:24:25 +11:00
Mitchell Richters
6c72a2a1fa - Duke: Clean up player/actor accesses in ifhitbyweapon_r(). 2023-10-02 21:24:05 +11:00
Mitchell Richters
8584745ce4 - Duke: Clean up player/actor accesses in addweapon_r.cpp. 2023-10-02 21:23:42 +11:00
Mitchell Richters
9a301d6e06 - Duke: Fix incorrect distance value in handle_se28(). 2023-10-02 21:23:42 +11:00
Mitchell Richters
2d7ab0f581 - Duke: Clean up player/actor accesses in handle_se28(). 2023-10-02 21:23:42 +11:00
Mitchell Richters
9fb63af7b6 - Duke: Clean up player/actor accesses in movetransports_d(). 2023-10-02 21:23:41 +11:00
Mitchell Richters
3274450fe6 - Duke: Clean up player/actor accesses in ifhitbyweapon_d(). 2023-10-02 21:23:05 +11:00
Mitchell Richters
fe5581f3cf - Duke: Clean up player/actor accesses in addweapon_d.cpp. 2023-10-02 21:14:55 +11:00
Mitchell Richters
95d5e1f57d - Duke: Clean up player/actor accesses in gameexec.cpp. 2023-10-02 21:14:32 +11:00
Mitchell Richters
d4999619dc - Duke: Clean up player/actor accesses in movefta(). 2023-10-02 20:45:33 +11:00
Mitchell Richters
6f248ff34c - Duke: Clean up player/actor accesses in alterang(). 2023-10-02 20:45:06 +11:00
Mitchell Richters
5e82e5ab94 - Duke: Clean up player/actor accesses in handle_se31(). 2023-10-02 20:44:40 +11:00
Mitchell Richters
36fd510f2c - Duke: Clean up player/actor accesses in handle_se24(). 2023-10-02 20:44:21 +11:00
Mitchell Richters
6754dd03f1 - Duke: Clean up player/actor accesses in handle_se27(). 2023-10-02 20:43:01 +11:00
Mitchell Richters
c98083bf75 - Duke: Clean up player/actor accesses in handle_se26(). 2023-10-02 20:42:42 +11:00
Mitchell Richters
6764acccb0 - Duke: Clean up player/actor accesses in handle_se20(). 2023-10-02 20:42:20 +11:00
Mitchell Richters
da75e29d5c - Duke: Clean up player/actor accesses in handle_se18(). 2023-10-02 20:42:00 +11:00
Mitchell Richters
c948b4a526 - Duke: Clean up player/actor accesses in handle_se17(). 2023-10-02 20:41:43 +11:00
Mitchell Richters
98eacf83b9 - Duke: Clean up player/actor accesses in handle_se13(). 2023-10-02 20:41:24 +11:00
Mitchell Richters
0c8539b0dd - Duke: Clean up player/actor accesses in handle_se05(). 2023-10-02 20:41:07 +11:00
Mitchell Richters
10ede7ce16 - Duke: Clean up player/actor accesses in handle_se02(). 2023-10-02 20:41:06 +11:00
Mitchell Richters
3aea097f87 - Duke: Clean up player/actor accesses in handle_se30(). 2023-10-02 20:41:05 +11:00
Mitchell Richters
c19ac0a916 - Duke: Clean up player/actor accesses in handle_se14(). 2023-10-02 20:39:26 +11:00
Mitchell Richters
f992ec9221 - Duke: Clean up player/actor accesses in handle_se00(). 2023-10-02 20:39:03 +11:00
Mitchell Richters
eb8a359c77 - Duke: Clean up player/actor accesses in move(). 2023-10-02 20:38:48 +11:00
Mitchell Richters
091c6cb9dd - Duke: Clean up player/actor accesses in hitradius(). 2023-10-02 20:38:22 +11:00
Mitchell Richters
76f47a61bb - Duke: Clean up player/actor accesses in moveplayers(). 2023-10-02 20:38:06 +11:00
Mitchell Richters
7a6e036849 - Duke: Clean up player/actor accesses in movedummyplayers(). 2023-10-02 20:37:40 +11:00