Commit graph

1405 commits

Author SHA1 Message Date
Mitch Richters
cb91e23c75 - Clamp the return value in PitchToHoriz() between the range of an INT32 value, and fix some math in the PitchToBAM() and BAMToPitch() inlines. 2021-12-07 19:59:30 +11:00
Mitch Richters
acf38f7a21 - Make a number of CVARs in gamecvars.cpp saved as part of the global config.
Full list:
* `cl_weaponsway`
* `cl_viewbob`
* `cl_interpolate`
* `cl_slopetilting`
* `cl_showweapon`
* `cl_syncinput`
* `cl_hudinterpolation`
* `cl_loadingscreens`
2021-12-07 19:59:26 +11:00
Christoph Oelckers
c2baa68160 - fixed camera textures breaking in SW when restarting a level.
This was caused by attempting to delete the camera textures when cleaning up the mirror array.
The Build tile manager was not prepared for such a use case and left a broken texture behind.

To allow this to function it now resets the texture replacement type when deleting a tile and to avoid creating new camera textures these will now be stored in a cache and recycled later.
2021-12-02 21:40:43 +01:00
Christoph Oelckers
f765783437 - various small bits of cleanup. 2021-11-29 00:57:11 +01:00
Christoph Oelckers
e59d976691 - added .ssi to the list of known extensions for container files. 2021-11-29 00:57:11 +01:00
Christoph Oelckers
1de9c63d45 - fixed center aligned rendering of 2D content.
This calculates the centered pivot point in integer texel coordinate space so for odd numbers it must round down instead of using a fractional position.
2021-11-29 00:57:10 +01:00
Christoph Oelckers
6cec61683d - fixed incorrectly placed tileUpdatePicnum call in new renderer for sprites.
This was only in the regular sprite call and did not affect models or voxels.
2021-11-29 00:57:10 +01:00
Christoph Oelckers
18d1084f7c - fixed assignment of map hacks with multiple maps assigned.
The parser only ever added the last MD4 but not the others.
2021-11-29 00:57:10 +01:00
Christoph Oelckers
35c2d6d14e - fixed translucent voxel rendering. 2021-11-29 00:57:10 +01:00
Christoph Oelckers
793aaf242c - make upscaling of sky textures depend on the single tile size, not the entire composite texture. 2021-11-29 00:57:10 +01:00
Christoph Oelckers
2d806d415a - clear interpolations when starting a new map. 2021-11-29 00:57:09 +01:00
Mitch Richters
ca0464c139 - Change out of box default of cl_runmode to 0, which allows the bound run key to act like an autorun negator.
* Requested in https://forum.zdoom.org/viewtopic.php?f=342&t=73031.
2021-11-29 00:56:32 +01:00
Mitch Richters
8fefead4e5 - Remove cancellation of quick turn if mouse/keyboard/controller angle input is detected that was introduced in 2129d3b4e7.
* Requested in https://forum.zdoom.org/viewtopic.php?f=342&t=73231
* Neither EDuke32 nor GZDoom do this, so the rationale is we shouldn't either.
2021-11-29 00:56:32 +01:00
Christoph Oelckers
cd3288860a - fixed automap player drawing for follpw mode off in all games. 2021-11-29 00:56:32 +01:00
Christoph Oelckers
fcbb7320a8 - Duke/RR: added all checks needed for not letting Duke crash with noclip when not accepting -1 as a valid sector pointer.
All places that were causing a crash are now guared by calling 'insector()'.
2021-11-29 00:56:31 +01:00
Christoph Oelckers
baf36a321b - inside, haskey and removed unused processmove functions. 2021-11-29 00:56:30 +01:00
Christoph Oelckers
9b6d6eb7f9 - sector[] in render interface 2021-11-29 00:56:30 +01:00
Christoph Oelckers
a7634c4cad - Duke: use pointers in interpolation interface. 2021-11-29 00:56:27 +01:00
Christoph Oelckers
adf3133fdc - use sectnum and wallnum to get an index from pointers instead of subtracting the array base. 2021-11-29 00:56:26 +01:00
Christoph Oelckers
4e31360fe4 - cleaned up dragpoint
This still contained some code for EDuke32's TROR and used a shared static global array.
It now uses the BFSSearch class to manage its bit array to unlimit the size of its working set and to avoid reallocation.
2021-11-29 00:56:25 +01:00
Christoph Oelckers
7126aa22f4 - preparations in the map loader for dynamically sized data storage.
This also consolidates these parts for Blood with the other games.
2021-11-29 00:56:25 +01:00
Christoph Oelckers
c410b1be45 - glass stuff 2021-11-29 00:56:21 +01:00
Christoph Oelckers
7111b2470c - SW: use BFSSearch in TraverseBreakableWalls 2021-11-29 00:55:45 +01:00
Christoph Oelckers
2a51e5eca3 - fixed: BFSSearch did not mark its start sector as added.
As a result it could be added twice.
2021-11-29 00:55:44 +01:00
Christoph Oelckers
6fc43287b3 - redid Exhumed's BelowNear function.
Use BFSSearch, only run one iteration of the search and only run the search if the result is actually used.
2021-11-29 00:55:44 +01:00
Christoph Oelckers
12c26976f0 - GetClosestSpriteSectors: replace distance calculation with proper math.
No need to sample multiple points along the wall if we can just properly calculate the actual distance. :)
2021-11-29 00:55:44 +01:00
Christoph Oelckers
d2f0934726 - Blood: cleaned up GetClosestSpriteSectors
using BFSSearch now and avoiding pointless loop to avoid setting the checked bit.
The entire outcome was just as if the bit was never checked inside the loop, so do just that when not running in compatibility mode.
This simplifies the remaining code quite a lot because it now just needs to run over all walls with no special case considered.
2021-11-29 00:55:44 +01:00
Christoph Oelckers
b685163ab1 - Blood: extend all 16 bit fields holding sector or wall indices to 32 bit. 2021-11-29 00:55:41 +01:00
Christoph Oelckers
5bb805663e - Duke/RR: cleaned up the rest of hitradius* as well
Using wallsofsector iterator plus defining local variables more locally.
2021-11-29 00:55:40 +01:00
Mitch Richters
da7de8f1d8 - Harden the skill CCMD to test for valid skill range for loaded game, not the maximum size of the gSkillNames[] array which may not be completely filled. Also print valid skill names in addition to numbers to help the user. 2021-11-29 00:55:40 +01:00
Christoph Oelckers
821f341e03 - use BFSSearch in hitradius_d 2021-11-29 00:55:39 +01:00
Christoph Oelckers
a29e6c084a - BFSSearch class added
This was prompted by a bug that was recently introduced in one of the ad-hoc implementations of such a search.

Let’s better use a helper class to deal with the problems and help unify memory usage.
2021-11-29 00:55:39 +01:00
Christoph Oelckers
ad030d7e23 - Duke: SE20 + SE128 are wall-free
Also use symbolic constantfor SE_128 to make it easier to find.
2021-11-29 00:55:39 +01:00
Christoph Oelckers
58a091067f - use provided sector/wall iterators in cacheit functions 2021-11-29 00:55:39 +01:00
Mitch Richters
2a7d0e6fe3 - gi->AddExcludedEpisode(): Pass FString variable through as reference instead of by value. 2021-11-29 00:55:31 +01:00
Mitch Richters
974ca7bd1d - Remove a lot of reference values on primitive data types from Blood's QAV interpolation system. Also use move assignments on the ignoredata TMap when we're adding it to the game-side after processing it. 2021-11-29 00:55:31 +01:00
Christoph Oelckers
01abe7b2ac - addressed most unused/uninitialized variable warnings from MSVC. 2021-11-29 00:55:30 +01:00
Christoph Oelckers
f7fdc5af41 - address several warnings reported by GCC 11. 2021-11-29 00:55:29 +01:00
Mitch Richters
1906de5d0c - Adjust PlayerHorizon and PlayerAngle struct member scaletozero() to consistently return to zero at the same speed for synchronised and unsynchronised input at any framerate from 60 fps to at least 1000 fps. 2021-11-29 00:55:15 +01:00
Mitch Richters
e491d15ff9 - Move InputScale() out of inputstate.cpp and into i_time.cpp as I_GetInputFrac() to make it available to GZDoom for potential future requirements.
* As part of this, feed the output of `I_GetInputFrac()` to `gi->GetInput()` instead of having each game's virtual override calling it locally.
2021-11-29 00:55:01 +01:00
Christoph Oelckers
b7465ab67b - spriteGetSlope/spriteSetSlope take spritetype pointer arguments. 2021-11-29 00:53:41 +01:00
Mitch Richters
1228cb6044 - InputState::AddEvent(): Partially revert changes performed in 4d629e7de8 that were believed not necessary. This functionality is still needed in some of Exhumed's cutscenes that are performed in-engine and not as a screenjob. 2021-11-19 08:11:32 +11:00
Mitch Richters
4d629e7de8 - Make screenjob valid keys for skipping ignore the Alt key as its used for modifiers, and special keys like the screenshot bind.
* Partially revert 8bb13bc4c2 as its changes are no longer needed.
* Partially revert 9e40e49c2c as its changes are no longer needed.
* Fixes #577.
2021-11-18 20:59:07 +11:00
Mitch Richters
719724da53 - Ensure g_nextskill is re-initialised everytime a save is loaded.
* Fixes #582.
2021-11-18 20:06:33 +11:00
Christoph Oelckers
8f19dc12d8 - SW: code/data pointer saving cleanup.
* a large number of code pointer records were removed because none of these functions ever gets assigned to a pointer
* instead of looking up entries by index, do it by name. This is far less fragile and will survive deeper refactoring. The old storage by table index will break as soon as a single entry gets removed.

Since the old savegames got broken due to this problem recently it was a good time to change the setup.
2021-11-11 23:28:28 +01:00
Christoph Oelckers
a79f7a3784 - SW: use a dynamic array to track already visited sectors in TraverseBreakableWalls. 2021-11-11 21:57:55 +01:00
Christoph Oelckers
642088ed80 - let ValidateSprite print better messages when developer mode is set to warning and also call it for Blood. 2021-11-11 21:28:53 +01:00
Mitch Richters
6581d9d709 - InputScale(): Tidy up some math I just put in.
* Time for bed... *yarns*.
2021-11-10 22:23:59 +11:00
Mitch Richters
3c4afaa6ee - InputScale(): Add enabled-by-default scaler to returned value from function to correct drift that occurs as the frame-rate increases, taking into account different scaling ratios needed for differing ticrates. 2021-11-10 20:27:19 +11:00
Mitch Richters
5a33caa635 - InputScale(): Add enabled-by-default scaler to returned value from function to correct drift that occurs as the frame-rate increases, taking into account different scaling ratios needed for differing ticrates. 2021-11-10 20:13:06 +11:00