Mitchell Richters
07b1ec518b
- Duke/RR: Consolidate identical vehicle bumping code.
2023-03-20 21:07:52 +11:00
Mitchell Richters
d5bc7718d1
- Duke/RR: Tidy up angle changes/accesses in vehicle ticker code.
...
* Already have an actor pointer on the stack we can use.
* Other tidy-ups.
2023-03-20 21:07:52 +11:00
Mitchell Richters
134b635966
- Duke/RR: Ensure braking sync bit is always cleared in onBoat()
.
2023-03-20 21:07:50 +11:00
Mitchell Richters
c6f6cf5933
- Duke/RR: Fix vehicle controller sign that got lost along the way.
...
* Issue from 9d74a5c60b
.
2023-03-19 22:45:02 +11:00
Mitchell Richters
ebd8ab985e
- Duke/RR: Don't archive off MotoSpeed for reuse at end of vehicle functions.
...
* Kept the workflow identical to the old setup in the other commits, but does not seem necessary and all it does is make the speed one tic behind where it would be otherwise.
2023-03-19 21:58:30 +11:00
Mitchell Richters
ba8f1069ab
- Duke/RR: Fix an issue with reversing.
...
* Got the position of the bools wrong here when removing something unsafe from the input handler.
2023-03-19 21:35:39 +11:00
Mitchell Richters
a9e606ca68
- Duke/RR: Shorten a long ternary.
2023-03-19 21:08:43 +11:00
Mitchell Richters
81650036e6
- Duke/RR: Remove vehForward/Reverse variables from player struct.
...
* Back in 2020, I was trying to tidy stuff up and had no idea about network awareness, etc.
* The original game misused network bits here, however I don't see why the player's angle can't just be tested for signedness. Again, something I didn't see way back when...
2023-03-19 20:55:39 +11:00
Mitchell Richters
37e9cfed45
- Duke/RR: Remove vehBraking variable from player struct.
...
* Back in 2020, I was trying to tidy stuff up and had no idea about network awareness, etc.
* We must continue the misuse of network bits like the original game did to make sure the RRRA vehicles are network aware.
2023-03-19 20:54:43 +11:00
Mitchell Richters
31f8de3854
- Duke/RR: Remove vehTurn variables from player struct.
...
* Back in 2020, I was trying to tidy stuff up and had no idea about network awareness, etc.
* The original game misused network bits here, however I don't see why the player's angle can't just be tested for signedness. Something I didn't see way back when...
2023-03-19 20:54:19 +11:00
Mitchell Richters
76e6efd204
- Duke/RR: Fix oversight in previous commit.
...
* Unknowingly had forced synchronised input on!
2023-03-19 20:09:14 +11:00
Mitchell Richters
d380e73cfd
- Duke: Consolidate boat/moto turn functions into one.
2023-03-19 14:59:35 +11:00
Mitchell Richters
c13c244dca
- Simplify moto velocity sign determination.
2023-03-19 14:35:02 +11:00
Mitchell Richters
9d74a5c60b
- Duke: Consolidate vehicle turning code between boat/moto.
2023-03-19 14:35:00 +11:00
Mitchell Richters
56b95a46f7
- Duke: Consolidate vehicle tilting code between boat/moto.
2023-03-19 13:31:47 +11:00
Mitchell Richters
056330863c
- Duke: Eliminate GetActor()
calls in playerisdead()
.
2023-03-19 09:10:14 +11:00
Mitchell Richters
a7d829d539
- Duke: Change where centering view locks the input.
2023-03-19 09:08:24 +11:00
Mitchell Richters
3ad50d5045
- Duke: Don't reset synchronised input flag if centering view.
...
* The way the playsim works, because the horizon functions come after the yaw ones, yaw was not being applied while pitch was locked.
2023-03-18 22:21:38 +11:00
Mitchell Richters
5b382ac2c6
- Duke: Remove everyothertime
global, we can just use PlayClock
.
2023-03-18 22:21:38 +11:00
Christoph Oelckers
792f977d46
- fixed STAT_ACTORS must handle actors where scale.X is 0 as 'deleted' and destroy them.
2023-03-18 12:08:53 +01:00
Mitchell Richters
1147030bca
- Remove concept of InputOptions
, its messy and unnecessary.
2023-03-18 21:16: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
4355a44721
- Duke: Rework input blocking setup.
...
* Takes the duplicated conditions out of the input handler and makes the ticker responsible by forcing synchronised input.
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
401236980c
- Duke: Tidy up some unnecessarily deep branches in vehicle input code.
2023-03-18 19:19:21 +11:00
Mitchell Richters
51a20211f3
- Duke: Tidy up some repeated bools in vehicle input code.
2023-03-18 19:19:21 +11:00
Mitchell Richters
37dda1aa0e
- Duke: Move input bit pre-processing into hud_input()
.
...
* Really, _really_ need to do something about this `crouch_toggle` malarkey...
2023-03-18 19:19:20 +11:00
Mitchell Richters
5a6495956f
- Duke: Move Quick_Kick
button test into ApplyGlobalInput()
as it doesn't seem to share a bit with any other game anymore.
2023-03-18 19:17:30 +11:00
Mitchell Richters
292030b59e
- Duke: Repair issues with going underwater after taking some stuff out of the global state.
...
* Really, need to do something about this `crouch_toggle` malarkey...
2023-03-18 19:17:28 +11:00
Mitchell Richters
b07732bae4
- Duke: Remove duplicated call to SetupGameButtons()
that's done globally in RunGame()
.
2023-03-18 09:15:17 +11:00
Mitchell Richters
a45890e064
- Move some Duke-specific stuff out of ApplyGlobalInput()
.
2023-03-18 09:15:15 +11:00
Mitchell Richters
eed9716d86
- Move joyaxes[]
array from getHidInput()
directly into ControlInfo
.
2023-03-17 20:58:38 +11:00
Mitchell Richters
fc069feac6
- Negate ControlInfo::dyaw
to match data out of backend.
2023-03-17 20:58:13 +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
1f97e73501
- Rename ControlInfo joystick variables to names matching backend.
2023-03-17 20:16:58 +11:00
Mitchell Richters
686bec5664
- Duke: Make vehicle input functions work on floats and not doubles and FAngles.
...
* It's what's natively needed at the end of the day.
2023-03-17 19:40:46 +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
e6cffbaefb
- Duke: Remove unnecessary playrunning()
test within a loop.
2023-03-17 14:41:17 +11:00
Mitchell Richters
130c5315e9
- Call PlayerAngles::resetCameraAngles()
from within the player loop of each game.
...
* I was only thinking of the console player initially but since each game can draw the view of other players in network games, each game will need to update and reset the camera angles for all players.
2023-03-17 14:40:18 +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
d6b68dec5e
- Duke: Remove player_struct::resurrected
flag I added in 2021 and fix issue properly.
...
* The check for `player_struct::dead_flag` in `FinalizeInput()` was overzealous and is not checked in the original code in this instance.
2023-03-17 12:29:37 +11:00
Mitchell Richters
c4041affb1
- Duke: Reduce boilerplate from previous commit.
2023-03-16 22:24:34 +11:00
Mitchell Richters
9a17d33579
- Duke: Ensure spawned player actor has view height baked in up until the first getzrange()
call.
...
* The original game spawning the player's sprite/actor would set the sprite's pos with the Z matching the player's, which had a height offset already applied.
* This baked in height offset was carried through up until the `SetActor()` call in `processinput()`, where the original game would then strip off `gs.playerheight`.
* This baked in height offset within the actor is critical on the first tic for pre-activated elevators on level spawn to function right, such as E1L2 and E2L3.
* Properly setting the player actor's Z immediately after the initial `getzrange()` call, but before other functions like `movement()`, etc further down in `processinput()` is the best spot.
* Fixes #870 .
2023-03-16 22:15:11 +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
18ef460a99
- Tidy up interface for PlayerAngles::doViewPitch()
since we have internal access to the player's actor.
2023-03-14 21:45:36 +11:00
Christoph Oelckers
6c77d1c39e
- Duke: fixed setup of purely scripted enemies,
...
Some band-aid is still needed for the time being.
2023-02-09 17:34:59 +01:00
Mitchell Richters
991ef5c27f
- Minor input tidy-up.
2023-02-04 17:05:18 +11:00
Christoph Oelckers
4328016963
- move the remaining parts of spawninitdefault to DukeActor::Initialize.
...
This ensures proper execution of all code - spawninitdefault was designed to be the fallback for actors without a special case in spawninit.
2023-01-28 16:33:35 +01:00
Christoph Oelckers
38b278b12d
- fixed enemy setup.
...
All enemies now run a native init function to reduce script-induced problems.
this required adding a NOGRAVITY flag so that the recon can use the same code as well which was the only enemy relying on custom code.
2023-01-28 16:33:15 +01:00
Christoph Oelckers
0db441accb
- scriptified the native parts of the powder keg.
...
This was the last remaining actor with its own native ticking part.
2023-01-28 16:31:46 +01:00
Christoph Oelckers
9f01c87ccb
- scriptified the native part of FireflyFlyingEffect.
2023-01-28 16:31:45 +01:00
Christoph Oelckers
9783b8c402
- scriptified World Tour's flamethrowerflame.
...
The first of 3 mixed native/CON items which are the last things remaining in the main thinker loops.
2023-01-28 16:31:45 +01:00
Christoph Oelckers
81f6899e72
- C++20 constant fixes.
...
Use of enums is deprecated in floating point calculations.
2023-01-21 10:34:44 +01:00
Christoph Oelckers
bb7f00988a
- give Blood's sounds well defined names so they can be defined via SNDINFO.
2023-01-15 16:15:28 +01:00
Christoph Oelckers
841402a776
- allow setting loop points for WAV sounds or other simple formats.
2023-01-15 15:19:21 +01:00
Christoph Oelckers
f1c3a6548f
- use backend pitch features for Duke instead of replicating them on the game side.
2023-01-15 13:18:54 +01:00
Christoph Oelckers
ad0bff921b
- allow setting Duke's relevant sound properties through SNDINFO.
2023-01-15 11:54:24 +01:00
Christoph Oelckers
8001c4041f
- Duke: fixed hitscan vector for pistol's aim check.
2023-01-14 16:48:28 +01:00
Christoph Oelckers
97f14c0e0e
- Duke: fixed projectile offsetting for BOSS2 and BOSS3
2023-01-14 11:53:13 +01:00
Mitchell Richters
62c6131901
- Duke: Make screen backdrop setup the same as the other games.
2023-01-13 11:06:42 +11:00
Mitchell Richters
8ef7e0e4f3
- Duke: Only draw the screen border when the viewport isn't 100%.
2023-01-13 08:56:12 +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
532f994ccb
- RR: stop the bowling pins' tumbling animation when they come to a rest.
...
Fixes an original RR bug.
2023-01-08 18:46:42 +01:00
Christoph Oelckers
ff33dd7188
- Duke: fixed bad surface check.
...
Surfaces are not bit flags, they are values.
2023-01-08 18:32:38 +01:00
Christoph Oelckers
1e3a285534
- Duke: fixed access card activation delay.
2023-01-08 10:34:14 +01:00
Mitchell Richters
9a27cf025f
- Duke: Fix bad setup for stopping Duke's scream when putting the jetpack on.
2023-01-06 22:17:14 +11:00
Mitchell Richters
5e2991acc7
- Duke: Additional fixes for alterang()
.
...
- Initial issue started in 3c1970e9e0
.
- Fix in 4f59e8a3d1
was partial and not enough.
- Ensure delta angle is absolute in if statements as required, but don't use absangle as we need to apply the true delta in the last conditional.
- Fix incorrect random angle addition as compared to older source.
- Fixes #735 .
2023-01-06 21:39:55 +11:00
Mitchell Richters
ba364a1cb6
- Duke: Fix automap sprite angle which was not right with unsynchronised input.
2023-01-05 21:00:31 +11:00
Mitchell Richters
a93342df85
- Duke: Only store one VMValue
member on the stack in CallInitialize()
.
2023-01-05 20:56:04 +11:00
Christoph Oelckers
220c1f0e76
- make sure the RPG's start spund plays.
...
This fix is just a temporary workaround due to the incomplete scriptfication
2023-01-04 20:20:10 +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
f5e9e7d981
- got rid of most remaining references to wallpicnum and overpicnum.
...
What remains now needs changing the variables to texture IDs first.
2022-12-29 14:14:53 +01:00
Christoph Oelckers
90702ae2f5
- consolidated the animwall code by using texture flags.
...
This is way too hacky for generalization. For that newly defined control actors are surely a better option.
2022-12-29 14:14:53 +01:00
Christoph Oelckers
b980789ddf
- skip switch animation checks for custom switch actors.
2022-12-29 14:01:39 +01:00
Christoph Oelckers
95a2b85fae
- migrated the rest of the switch code to use the external data.
2022-12-29 13:35:21 +01:00
Christoph Oelckers
0c0199fbdc
- same procedure for wall switches
2022-12-29 13:33:02 +01:00
Christoph Oelckers
d9122a0482
- split out the sprite switch toggle handler into a common subfunction using the switch definitions.
2022-12-29 13:33:02 +01:00
Christoph Oelckers
4191a9493a
- split RRRA's tag10000specialswitch into a subfunction.
...
Unfortunately I have no idea where this gets used so it's untested for now.
2022-12-29 13:33:02 +01:00
Christoph Oelckers
97a5fc2948
- did a clean reimplementation of resetswitch.
2022-12-29 13:33:02 +01:00
Christoph Oelckers
564e9d2905
- use switch types to cut doen the first switch/case block in checkhitswitch
2022-12-29 13:33:01 +01:00
Christoph Oelckers
808fb3c433
- simplified several switch check blocks using the data from the definition files.
2022-12-29 13:32:30 +01:00
Christoph Oelckers
2386ea9930
- implemented the 3 special switches
...
That's the developer commentary icon in World Tour, the deactivation switch for the chicken processing plant in RR and one shootable alarm bell in RRRA.
2022-12-29 13:32:30 +01:00
Christoph Oelckers
0d9fe83cba
- implemented the switch parser and set up the external definitions.
2022-12-29 13:32:29 +01:00
Mitchell Richters
22f5c69b4c
- Duke: Fix bad checkaccessswitch_*()
calls.
...
* Fixes #815 .
2022-12-29 22:45:36 +11:00
Mitchell Richters
1d69ebe9b0
- Duke: Ensure that the expander hitscans when autoaim is "hitscan only".
...
* Fixes #827 .
2022-12-29 21:17:41 +11:00
Mitchell Richters
adc2396f31
- Duke: Extend fix from previous commit to appropriately resize the VMValue
array also.
2022-12-24 15:41:37 +11:00
CandiceJoy
a943652799
Fixed a Mac debug build crash where CallAnimate attempted to pass one too many parameters to the VM.
2022-12-23 10:38:59 +01:00
Christoph Oelckers
c7e25726c1
- use memset to clear 'gs' in loadconst.
...
MSVC compiled the old assignment to memsetting a local copy and then memcpying it to the destination, but this struct is far too large for that and was causing occasional stack errors when debugging.
2022-12-20 12:44:34 +01:00
Christoph Oelckers
8c41294cb0
- overpicnum lightening.
...
Especially make sure that it is never set to tile 0. There seems to have been some undefined behavior here treating 0 as 'no texture', but doing so inconsistently.
2022-12-18 15:13:22 +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
ffb471666d
- moved the access switch handlers out of checkhitswitch_*.
2022-12-18 15:08:27 +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
e78fd90f67
- adapted sky code for using texture IDs.
2022-12-18 14:42:27 +01:00
Christoph Oelckers
8dfbbc8220
- migrated floorpicnum and ceilingpicnum to FTextures.
...
The sky code still needs some work.
2022-12-18 14:32:52 +01:00
Christoph Oelckers
622710ede4
- migrated all uses of floorpicnum.
...
This necessitated a few more surface type definitions.
2022-12-18 14:02:56 +01:00
Christoph Oelckers
4a306a21dc
- split several texture flags off into a surface type value.
...
Using the same field in the TexExtInfo struct as Blood's surfType.
This frees up a lot of flags for later use.
2022-12-18 13:56:54 +01:00
Christoph Oelckers
1a98f9b478
- Duke: change all checks for mirrors to texture IDs
2022-12-18 13:52:10 +01:00