Commit graph

1391 commits

Author SHA1 Message Date
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
Christoph Oelckers
94b2b0af31 - widen sector index in engineLoadBoard to 32 bit 2021-11-09 00:07:00 +01:00
Christoph Oelckers
a5f51cfd88 - SW: migrate everything to the main clipmove function 2021-11-08 23:11:30 +01:00
Christoph Oelckers
5ba005276f Revert "- redid the 'inside' function."
This reverts commit c034c2a299.

While the function works, it is subtly different for points exactly on a line - enough to cause problems with Shadow Warrior's waypoint implementation.
2021-11-08 23:11:20 +01:00
Christoph Oelckers
c034c2a299 - redid the 'inside' function.
This is based on external information and does not use any of the original Build code.
Despite being a lot clearer than Build's bit masking voodoo and using 64 bit math to avoid overflows it is roughly 10% faster. :)

Code was moved to gamefuncs.cpp because this no longer falls under the Build license.
2021-11-08 21:29:21 +01:00
Christoph Oelckers
eeaa7f98f0 - inlines for validating sector and wall indices. 2021-11-08 18:56:10 +01:00
Christoph Oelckers
5d0c9a9fc8 - flush the network timer righr after loading and before starting a level.
Without this the entire load time may get registered as skipped frames-
2021-11-07 22:51:02 +01:00
Christoph Oelckers
60faceaf59 - Exhumed: fixed serialization.
The exhumedActors array was not written out, resulting in all kinds of strange effects.
2021-11-07 21:45:51 +01:00
Christoph Oelckers
6b6c3f26a5 - use wallsofsector in a few more places. 2021-11-07 18:08:22 +01:00
Christoph Oelckers
59df3b0e19 - added a little utility that allows iterating over the walls of a sector with C++ for's. 2021-11-07 17:27:05 +01:00
Christoph Oelckers
ae08ae1d8d - some leftover shorts plus utilities that ended up unused but may be useful later. 2021-11-07 16:46:23 +01:00
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