Commit graph

918 commits

Author SHA1 Message Date
Mitchell Richters
77265b3138 - SW: Fix regression from 1900cf1fcc where the conversion from GetDeltaAngle() to getincangle() got muddled up. 2020-09-22 20:02:58 +10:00
Mitchell Richters
d40a2d3e95 Merge branch 'back_to_basics2' into Blood_InputReworking
# Conflicts:
#	source/blood/src/hudsprites.cpp
#	source/exhumed/src/status.cpp
#	source/games/duke/src/game_misc.cpp
#	source/sw/src/draw.cpp
2020-09-22 07:34:39 +10:00
Mitchell Richters
9859571ded - DrawCrosshair(): Factor in Blood's adjustable horizon which defaults to 90.
* Fixes https://forum.zdoom.org/viewtopic.php?f=340&t=69920.
2020-09-22 07:29:52 +10:00
Mitchell Richters
59e4fae064 - Game input: Fix miscellaneous issues.
* Duke/RR: Fix `SB_CENTERVIEW` not clearing while `cl_syncinput 1`.
* Duke/RR: Remove superfluous call to `apply_seasick()`.
* RR: Change two calls from `playerSetAngle()` to `playerAddAngle()` Updated version of `playerSetAngle()` doesn't stop setting angle until target is reached, a bit too strict for this and compromised vehicle turning.
* `applylook()`: Remove dead flag. Was only used with Duke, no other game called the function when dead anyway. Since the input helpers are processed outside of `applylook()` now this is not needed.
* `applylook()`: Extend function with a bit of commentary.
2020-09-21 17:12:53 +10:00
Mitchell Richters
f806cdcec6 - Blood/Duke/RR/SW: Unify the player's angle/horizon helper functions. 2020-09-21 17:12:51 +10:00
Mitchell Richters
7bf1cacc7f - Blood/Duke/RR/SW: Unify the player's angle function.
* For Blood/SW, exposes `SB_LOOK_LEFT`/`SB_LOOK_RIGHT` to games, hooking up `q16look_ang` and `q16rotscrnang` within.
* For SW, use Duke & Blood's return to center function and remove `PF_TURN_180` bit.
* For RR, replace a few misused bits with some bools inside of `player_struct`.
* Since bulk of functionality is sourced from Duke (30Hz), apply proper scaling so SW speed matches (40Hz).
2020-09-21 17:12:26 +10:00
Mitchell Richters
0ab3b33a6c - Blood/Duke/RR/SW: Unify the player's horizon function.
* For Duke/SW, we continually apply `SB_CENTERVIEW` only if it was previously a toggled action, similar to Blood.
* For SW, we remove two SW-specific bits (`PF_LOCK_HORIZ` and `PF_LOOKING`) that are no longer needed.
* For Duke, we remove `return_to_center` and just use the `SB_CENTERVIEW` action bit as required.
* For `sethorizon()`, feature set and adjustment speeds are an averaged out accumulation across Duke/SW:
** GameTicRate is factored in for adjustment decisions to provide consistency for SW being the faster game.
** Adjustment amounts are half way between Duke/SW.
2020-09-20 20:01:36 +10:00
Mitchell Richters
f0b32b6078 - SW: Implement cl_viewbob. 2020-09-20 18:25:16 +10:00
Mitchell Richters
f2b48fe79c - SW: Uplift DoPlayerHorizon() with changes to serve as basis for standardised backend player horizon function.
* Pre-requisite to make it possible to stop using Q16.16 for horizon input.
* Perform look up/down and aim up/down using true pitch without the need for a helper.
* Adapt SW's return to center function to work based on true pitch (Duke's is a bit too fast for my liking).
* Duke's aim up/down and look up/down is 6 & 12 respectively, SW's is 8 & 16 respectively. Let's go half-way at 7 & 14.
2020-09-20 16:21:35 +10:00
Mitchell Richters
1900cf1fcc - Move Duke's getincangle() function to the backend, create Q16.16 variant (getincangleq16()) and replace Shadow Warrior's discrete implementations shared versions.
* Need SW's input helpers available for Blood but therefore also need an angle delta function that does not seem to exist in Blood.
* Realise that gamecontrol.h/cpp might not be the most appropriate place, but it's a shared location and these will go into binaryangle.h when its utilisation can be more realised.
* Because SW's logic was reversed, in that param #1 was the new angle and param #2 was the current, all calls have been reversed.
* By happenstance, also fixes an issue with multiple 180° turns in quick succession.
2020-09-20 16:21:13 +10:00
Christoph Oelckers
bac357a6be - disable the weapon in SW's savepics.
The way the weapon drawer is implemented does not work well with save pictures.
2020-09-19 21:31:35 +02:00
Christoph Oelckers
005f8feceb - properly use the correct delay for an ANM's final frame. 2020-09-18 22:49:51 +02:00
Christoph Oelckers
7b879f6fe7 - removed now unused SavegameLoaded variable. 2020-09-18 01:11:38 +02:00
Christoph Oelckers
77a2bcb958 - SW: make ambients start properly.
This fell victim to some fudging code that was needed to avoid crashes with the original game loop.
All that fudging could easily be removed now because nothing of it is needed anymore.
2020-09-18 00:33:18 +02:00
Mitchell Richters
71a06b7cdd - SW: Fix quake intensity. 2020-09-17 09:01:19 +10:00
Christoph Oelckers
4dc7f8b142 - undid some formatting screwups from the merge. 2020-09-16 19:28:51 +02:00
Christoph Oelckers
942beea1ff Merge branch 'back_to_basics2' 2020-09-16 19:26:23 +02:00
Mitchell Richters
4370686c81 - SW: Allow disabling melee weapon blurring. 2020-09-16 19:18:08 +02:00
Christoph Oelckers
6776508239 - widescreen asset setup and consolidation of .def file loading. 2020-09-16 19:13:06 +02:00
Christoph Oelckers
867b8f006f Reverted key input changes from yesterday.
At least the SW version did not work right so let's take no chances here.
2020-09-15 21:54:10 +02:00
Christoph Oelckers
e7ddc4178a - fixed bad Printf formatting directives in swcustom parser. 2020-09-15 21:45:05 +02:00
Christoph Oelckers
eb4e0b1b83 - restrict keyboard input to the actual tic in SW as well.
Also fixed the blocking of the strafe key with sector objects - this must have gotten lost somewhere.
2020-09-14 21:25:53 +02:00
Mitchell Richters
c5648be2bd - SW: Properly scale controller input. 2020-09-14 19:29:12 +10:00
Mitchell Richters
3fc96e8840 - SW: Stop keyboard fvel/svel from allowing loc.fvel/loc.svel like Duke.
* Stops overshooting keymove when playing with `cl_syncinput 0`.
* Keymove is never as high as MAXFVEL/MAXSVEL, which is used as a thrash point for controller input.
* Fixes #390.
2020-09-14 18:54:03 +10:00
Christoph Oelckers
57a9419f8e - use FString for returning strings from the script parser.
This is mainly a preparation for merging the parser into sc_man, because sc_man does not keep token texts in a static variable.
This commit also fixes a handful of places that were flagged by the stricter conversion rules of FString.
2020-09-13 10:29:57 +02:00
Christoph Oelckers
89316aea33 - demoted the SWCustom parser to the primitive Hexen interface after finding out that this is all the Build parser can do.
This also meant I had to add symbol support to the old style number parsers.
2020-09-12 10:23:47 +02:00
Christoph Oelckers
af7ad28ad6 - fixed some warnings that came back through the backdoor. 2020-09-10 23:28:50 +02:00
Christoph Oelckers
d5b9a9ee43 Merge remote-tracking branch 'remotes/Github_private/InputStuffs' into back_to_basics2 2020-09-10 23:25:43 +02:00
Christoph Oelckers
ef5ac2319e - migrated SW's info script parser to sc_man. 2020-09-10 17:46:54 +02:00
Mitchell Richters
baeea5bf3c - SW: Fix angle speed while walking on sector objects like the bus in Seppuku Station.
* `playerSetAngle()` is too rigid since it continually sets angle until target reached, causing sluggish input. We only need to add a delta here.
2020-09-10 23:12:51 +10:00
Mitchell Richters
19fd0331d4 - SW: Interpolate vehicle sector objects for now, until something better can be determined. 2020-09-10 20:47:41 +10:00
Mitchell Richters
3df0d40312 - SW: Fix stupid issue with playerSetAngle() and tweak how angTarget/horizTarget is determined to have been met. 2020-09-10 20:26:19 +10:00
Mitchell Richters
be6e0d87d7 Revert "- SW: Attempt at making vehicle movement work nicely while uninterpolated."
This reverts commit 28a3ef131f.

I mostly added this to visualise an attempt at how I've attempted to make the vehicles work with unsynchronised input. I don't wish for this to be committed to the main branch as it's a net negative.
2020-09-10 19:56:13 +10:00
Christoph Oelckers
0c55c61b17 - SW load screen setup. 2020-09-09 23:10:18 +02:00
Christoph Oelckers
2ffb6a3580 - finally got rid of SWBOOL. 2020-09-09 20:32:24 +02:00
Christoph Oelckers
e044582aef - fixed all issues with SWBOOL as pointed out by a type-safe wrapper class. 2020-09-09 20:28:05 +02:00
Christoph Oelckers
1a647e8104 - globally search and replaced TRUE and FALSE in SW.
There were a handful of warnings afterward which were also addressed.
The SWBOOL type has not been handled yet.
2020-09-09 19:52:52 +02:00
Mitchell Richters
b2272bd377 SW: Partially revert 73d0772e87 and do in a way that's more fidele to the original workflow. 2020-09-09 23:01:37 +10:00
Mitchell Richters
28a3ef131f - SW: Attempt at making vehicle movement work nicely while uninterpolated. 2020-09-09 22:45:21 +10:00
Mitchell Richters
e24521b189 - SW: Uplift playerSetHoriz() similar to uplift to playerSetAngle() in b832442e31. 2020-09-09 22:04:59 +10:00
Mitchell Richters
b832442e31 - SW: New implementation of playerSetAngle() that works better for intended purpose. This corrects the issues with angle not being quite right when getting onto a ladder. 2020-09-09 21:29:03 +10:00
Mitchell Richters
b72a3326d0 Merge branch 'back_to_basics2' into InputStuffs
# Conflicts:
#	source/core/d_net.cpp
2020-09-09 06:56:27 +10:00
Christoph Oelckers
298949ceb8 - more compat.h cleanup
Its elimination is getting closer. :)
2020-09-08 18:48:18 +02:00
Christoph Oelckers
ec1c42b04a - got rid of common.h
All still relevant content was moved to places closer to its use.
2020-09-08 18:39:47 +02:00
Christoph Oelckers
8d2d36457f - consolidated the map name display on startup
Fixes #275
2020-09-08 18:28:41 +02:00
Mitchell Richters
48630914b1 - SW: Remove boat code from new input code for cleanliness. 2020-09-09 00:34:51 +10:00
Mitchell Richters
1e3199413c - SW: Rename all Tank-related function code to Vehicle. 2020-09-08 21:54:48 +10:00
Mitchell Richters
8625ac573d - SW: Comment out all boat code, it's actually not used within the game at all and was very confusing... 2020-09-08 21:40:20 +10:00
Mitchell Richters
cb7e797842 - SW: Partially revert changes from df0331a4c3. 2020-09-08 20:48:01 +10:00
Mitchell Richters
73d0772e87 - SW: Call DoPlayerMoveTurret() in processMovement() in lieu of DoPlayerTurnTurret() and don't interpolate sector object's sprite while !cl_syncinput.
* Makes operating the tank silky smooth while unsynchronised.
2020-09-08 19:42:22 +10:00