Commit graph

1345 commits

Author SHA1 Message Date
Mitch Richters
bb20827027 - processMovement(): Fix prescaling for Exhumed when using mouse or controller.
* Controller input before was too fast compared to other games, now it's 1:1.
* Mouse input when used without mouse look was too slow, now it's also 1:1 with the other games.
* `hid` in the context of `hidprescale` refers to 'Human Interface Device'.
2021-11-07 18:32:02 +11:00
Mitch Richters
b27f5e3be0 - gameinput.cpp/h: Internalise if statements used before calling PlayerHorizon and PlayerAngle class method scaletozero() into method itself. 2021-11-07 18:25:37 +11:00
Mitch Richters
72531e61db - gameinput.cpp/h: Consolidate all the return to zero code for angles and horizons into class members, using technique from horizoff as basis. 2021-11-07 11:37:12 +11:00
Christoph Oelckers
d20aa47adf - made sector parameter of updatesectorz an int and deprecated the short version. 2021-11-06 19:27:51 +01:00
Christoph Oelckers
83fe41e71e - made updatesector receive a 32 bit int pointer and deprecated the 16 bit variant. 2021-11-06 15:53:16 +01:00
Mitch Richters
a2a75fccc2 - Add support for Duke Nukem's Penthouse Paradise as shipped with the Zoom release of Duke Nukem 3D Atomic. 2021-11-06 23:26:56 +11:00
Mitch Richters
8cf115c444 - searchpaths.cpp: Patch in registry detection for Duke 3D Atomic + Expansions from Zoom on Windows.
* Fixes #567.
2021-11-06 22:59:56 +11:00
Mitch Richters
5050947dca - PlayerAngle::applyinput(): Consolidate some mostly duplicated code into a lambda. 2021-11-06 17:57:00 +11:00
Mitch Richters
1bb0c04e61 Revert "- Blood: Add mechanism to be able to force QAV interpolation based on picnum for testing purposes and not for end-user usage."
This reverts commit 276c000f9f.

* This was added for testing/debugging etc but it really doesn't work unless the QAV is built for it. As such, just get rid of it.
2021-11-06 17:32:55 +11:00
Mitch Richters
ed67d5d395 - PlayerHorizon::applyinput(): Only run through all the horizon to pitch and back code if we have input to process. 2021-11-06 15:34:10 +11:00
Mitch Richters
5f8c8fe0a4 - PlayerHorizon::applyinput(): Consolidate some mostly duplicated code into a lambda. 2021-11-06 15:07:28 +11:00
Mitch Richters
7499c84d0b - Add interpolatedhorizon() inlines to handle interpolating fixedhoriz objects without having to convert old and new values back to Q16.16 first. 2021-11-06 14:07:58 +11:00
Mitch Richters
5ec5321034 - gameinput.h/cpp: Abstract the angle/horizon adjustment math into a few inlines to avoid repetition and having to cast enums as doubles for C++20 compliance. 2021-11-06 14:07:53 +11:00
Mitch Richters
4c02663842 - PlayerAngle::applyinput(): Re-add addition of +/- 1. when returning rotscrnang to 0 lost long, long ago. 2021-11-06 14:07:36 +11:00
Mitch Richters
ab99b6b29d - PlayerHorizon::calcviewpitch(): Make returning horizoff to 0 speed uniform across all games. 2021-11-06 13:31:29 +11:00
Mitch Richters
91f6b2954c - binangle class: Tidy up missed C++20 warning fixed about enum used in floating-point arithmetic. 2021-11-06 10:27:04 +11:00
Mitch Richters
0eb4ff4ad2 - PlayerHorizon::calcviewpitch(): Provide commentary on how numeric literals used in function came to be and place into an enum for clarity. 2021-11-06 10:27:00 +11:00
Mitch Richters
1df2ba80ed - PlayerAngle::applyinput(): Provide commentary on how numeric literals used in rotscrnang/look_ang/spin math came to be and place into an enum for clarity. 2021-11-06 10:26:54 +11:00
Mitch Richters
8e8dfa9f9a - PlayerHorizon::applyinput(): Provide commentary on how numeric literals used in aim/look up/down and return to centre math came to be and place into an enum for clarity. 2021-11-06 09:30:03 +11:00
Mitch Richters
c424f7c8dd - processMovement(). Remove cl_exhumedoldturn CVAR and tidy up numeric literals in use.
* In our older codebase before the input code was refactored, Exhumed's turning was broken and was only applying the base factor of 12, significantly slower than the other games.
* Upon doing some testing in PCExhumed, I noticed their turning was faster as when the counter meets its target, the turn value is shifted left by 2, effectively making it 48: b90417ed8e/source/exhumed/src/player.cpp (L336-L337)
* Removed this CVAR because of this.
* Reworked turning code so that pressing left+right together cancel each other out and that pressing both doesn't call `updateTurnHeldAmt(scaleAdjust)` twice.
* Redid turn averages factoring in Exhumed's speeds, rounded off values and stored in an enum for clarity.
2021-11-06 09:28:47 +11:00
Christoph Oelckers
389f760d45 - address C++20 deprecation warnings with enums in floating point arithmetic. 2021-11-02 23:32:31 +01:00
Christoph Oelckers
86166f5e67 Revert "- xs_Float.h: Make all inlines return an unsigned value, and change previous unsigned inlines to signed."
Revert "- `xs_Float.h`: Add `getint()` getter to `_xs_doubleints` struct."
Revert "- SW: When adjusting horizon in `DoPlayerDeathHoriz()`, just use integer horizon values and not Q16.16."
Revert "- Duke (RR): Clean up some unnecessary `FixedToFloat()` usage with the `fixedhoriz` `asbuildf()` method."
Revert "- `binaryangle.h`: Use `constexpr` on inline functions where it was previously not possible to do so."
Revert "- `m_fixed.h`: Use `constexpr` on inline functions where it was previously not possible to do so."
Revert "- `xs_Float.h`: Convert header to `constexpr`."

This does nor work as it violates the constexpr rules for unions. The code will error out on compilation for accessing an inactive member of a union.
2021-11-01 20:25:38 +01:00
Mitch Richters
f3a2de92a4 - binaryangle.h: Use constexpr on inline functions where it was previously not possible to do so. 2021-11-01 23:37:31 +11:00
Mitch Richters
eb8b075727 - binaryangle.h: Change binangle bitshift operators to operate on signed value to properly handle angles > 1024. 2021-11-01 22:13:39 +11:00
Mitch Richters
0fe5ac6a56 - gameinput.h: Correctly use targetset() in PlayerHorizon and PlayerAngle structs. 2021-10-30 17:30:01 +02:00
Mitch Richters
15c4d38694 - gameinput.h: Add initial structure for PlayerPosition as companion to PlayerAngle and PlayerHorizon structs. 2021-10-30 17:30:01 +02:00
Mitch Richters
7ee4f49649 - gameinput.h: Remove some of the verticality from the PlayerHorizon and PlayerAngle structs. 2021-10-30 17:30:01 +02:00
Christoph Oelckers
6e0fbb2043 - removed templates.h includes. 2021-10-30 10:51:03 +02:00
Mitch Richters
b02a6a3ec9 - Replace MIN() from templates.h with version provided in STL. 2021-10-30 10:36:15 +02:00
Mitch Richters
9894729fc2 - Replace MAX() from templates.h with version provided in STL.
# Conflicts:
#	source/common/textures/hw_ihwtexture.cpp
#	source/common/utility/templates.h
2021-10-30 10:36:02 +02:00
Christoph Oelckers
57b638f26f - use std::clamp instead of our homegrown version. 2021-10-30 10:35:00 +02:00
Mitch Richters
879e2f3ce4 - Build: Promote sintable[] array values to precision Blood uses in prep for replacing Blood's costable[]. 2021-10-30 10:24:15 +02:00
Mitch Richters
3663c4c742 - Split out sine/cosine scaling from bsinf() and bcosf() into its own inline. 2021-10-30 10:24:14 +02:00
Mitch Richters
07fc3b77b1 - Privatise tosigned() method in binangle class. 2021-10-30 10:24:14 +02:00
Christoph Oelckers
f1b40b7878 - bumped savegame version for Exhumed. 2021-10-28 18:59:40 +02:00
Christoph Oelckers
c7d4779b7e - fixed some warnings. 2021-10-26 18:54:43 +02:00
Christoph Oelckers
1214f8ba00 - properly macro-fy parsed strings from Blood's INI. 2021-10-19 21:49:03 +02:00
Christoph Oelckers
d2beee587d - updated version.h. 2021-10-14 22:50:12 +02:00
Christoph Oelckers
562968262c - moved spriteMass into DBloodActor 2021-10-14 19:01:10 +02:00
Christoph Oelckers
62d0d3712e - use a sprite flag to mark mapped sprites.
This avoids another global array which needs to be addressed by sprite index.
2021-10-14 15:09:43 +02:00
Christoph Oelckers
8d9d3d5f8f - disabled palette emulation for the GLES backend.
Right now the shader does not support it and will require significant redesign to work well with the target hardware.
2021-10-13 00:09:18 +02:00
Christoph Oelckers
ff0c4359e0 - deleted unused inlines. 2021-10-11 23:03:11 +02:00
Hugo Locurcio
91ce22931d Add cvars to control automap line alpha and thickness
This can be used to improve automap readability on high-resolution
displays.
2021-10-11 22:30:39 +02:00
Christoph Oelckers
83944a7191 - fixed uninitialized light index variable for floor sprites. 2021-10-11 22:28:26 +02:00
Christoph Oelckers
29769dd673 - fixed engine code warnings pointed out by XCode 13. 2021-10-08 19:06:41 +02:00
Christoph Oelckers
0d4e0d72fb - fixed vertex generation when splitting walls by planes on old hardware. 2021-09-18 13:04:46 +02:00
Christoph Oelckers
e8187b4a99 - fixed bad serializers for vec2_t and vec3_t. 2021-09-12 18:42:58 +02:00
Christoph Oelckers
7f485bfab1 - split off the extended sprite flags into their own word.
Some code overwrites the cstat field entirely (thanks Duke, for being sloppy with this...!)
2021-09-12 18:26:35 +02:00
Christoph Oelckers
99ecfe133d - flag sprites for automapping regardless of the 'automapping' variable's value.
Duke should show its floor sprites, too.
2021-09-12 18:22:38 +02:00
Kevin Caccamo
2297c9351a Attempt to fix music replacement definitions again
Store per-map music replacements in a TMap, and perform the replacements after parsing the MAPINFO
2021-09-12 18:21:42 +02:00