Commit graph

1387 commits

Author SHA1 Message Date
Christoph Oelckers
ba2defeb14 Merge branch 'master' into newrenderer2 2021-04-05 10:34:34 +02:00
Christoph Oelckers
eb2e77fb75 - Apply fix from EDuke32 commit 7225643e.
Fix undefined behavior/potential OOB access in ST_21_FLOOR_DOOR. g_AnimateGoal does not take a sector number, it takes an animation index, and caps at 1024, not 4096.
2021-04-05 00:14:15 +02:00
Christoph Oelckers
c303884274 - better handling for Duke's scrolling cloudy skies.
* Using the Doom-style dome here because it looks better.
* this necessitated changes to the backend to allow both types of sky domes at the same time
* do not clamp panning fields for cloudy sky with the new renderer because this makes the texture jump.
2021-04-04 20:35:38 +02:00
Christoph Oelckers
ea91b5ba5d - added a map patch for SW:WT's 'skyline' map.
This contains a badly tagged sky sector that makes the new renderer glitch out.
2021-04-04 18:57:03 +02:00
Christoph Oelckers
55ad51ee1f Merge branch 'master' into newrenderer2 2021-04-04 13:23:51 +02:00
Christoph Oelckers
9828cd7129 - this better have a null check... 2021-04-04 13:02:26 +02:00
Christoph Oelckers
6ebbf1288d - Duke/RR: Don't delete master switch sprites.
The sound system may play sounds on them after their deletion - this resulted in undefined behavior. To ensure properly defined behavior the sprite needs to be retained at least as long as the sound controller may still need it - which cannot be reliably determined so it has to be kept around forever. This would be easier if the sound controller code had proper start and stop events instead of inferring what to do from secondary information.
Fixes #288.
2021-04-04 13:01:32 +02:00
Christoph Oelckers
97a0cb2a10 - handle voxel rotation in the backend to enable it for all games.
This was previously only present in the Blood module and missed in Exhumed from upstream so the entire option was rather pointless.
Fixes #290
2021-04-04 10:33:29 +02:00
Christoph Oelckers
a298a3d3df - disabled 'isRunning' in Blood entirely.
After discovering yet another misbehaving place in the game I think it can be safely concluded that this is better left off unconditionally.
The only remaining place where this still gets checked is in nnexts, but I wouldn't expect this to work either.
Fixes #292
2021-04-04 09:35:05 +02:00
Christoph Oelckers
ebac57fb4f - fixed music in Blood's menu
This is only supposed to play for the fade-in of the background but needs to stop when the menu appears.
Fixes #291
2021-04-04 09:25:41 +02:00
Christoph Oelckers
952bccbf5f - added a check for game-side-defined voxels when discarding one-sided wall sprites viewed from the back. 2021-04-03 21:49:28 +02:00
Christoph Oelckers
9c95c902c7 - added a check for game-side-defined voxels when discarding one-sided wall sprites viewed from the back. 2021-04-03 21:40:16 +02:00
Christoph Oelckers
ab36b86a59 - sky tweaking
* Build skies need a different mesh for the dome - the one from GZDoom distorts them too much.
* made adjustment to the positioning math after redoing the mesh
* Exhumed abuses some strange effect of the original sky placement math which means the y-offsetting must be disabled for this game.
* RRRA sky initialization fixed. It must be done after setting up the tiles.
2021-04-03 21:06:02 +02:00
Christoph Oelckers
dc234ea72d - implemented RR's geometry effect.
The grossest of all gross render hack that were ever done with Build...
2021-04-02 22:52:46 +02:00
Mitchell Richters
9c01bde44e - gameinput.cpp: Block player input within sethorizon() and applylook() if target for each has been set by the ticker.
* Stops players having the ability to provide input and fight the system trying to set an input.
2021-04-02 22:47:19 +11:00
Christoph Oelckers
c8a75a8664 - give each DrawInfo its own list of tsprites.
Since these do not fully get processed sequentially the contents need to be preserved until needed.
This required getting rid of the global tsprite array. Polymost still uses a static vatiable, though, but this is only accessed in polymost-exclusive code.
2021-04-02 10:28:40 +02:00
Christoph Oelckers
80e5cd0dc5 - fixed some automap issues:
* Blood's automap was not drawn at all.
* SW's automap always showed all sectors
* SW's player sprite was not rendered.
* Non-automap: Forward gotsector to the game code because there's still a few places in Blood that need it.
2021-04-01 20:47:05 +02:00
Mitchell Richters
88695ef554 Merge branch 'master' into newrenderer2 2021-04-01 16:49:07 +11:00
Mitchell Richters
029f8807df - Make 360. / 2048. a constant expression and replace all uses throughout code. 2021-04-01 10:42:22 +11:00
Mitchell Richters
c630ad9110 Revert "- subjective fix to Duke 3D's RPG harsh recoil."
This reverts commit 839a7bcbe4.

Revert "- Duke: Restore RPG harsh recoil behind a CVAR."

This reverts commit 88a49b0d22.

# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
2021-03-31 20:35:18 +11:00
Mitchell Richters
760c918e75 - Duke: Remove unnecessary int casts from gameexec.cpp.
* Incoming vars are already int and called functions only accept an int so really just no need at all.
2021-03-31 20:07:36 +11:00
Mitchell Richters
16886895b0 - Duke: DoPlayer(): Ensure SB_CENTERVIEW bit is cleared when setting a horiz target from CON.
* Repairs horizon issues raised in https://forum.zdoom.org/viewtopic.php?f=340&p=1185365.
2021-03-31 19:48:38 +11:00
Christoph Oelckers
7bea8ad6ba - fixed texture overlays for SW's sector portals. 2021-03-30 23:27:11 +02:00
Christoph Oelckers
a84060fda7 - SW: mark sector as dirty in wallmove. 2021-03-30 21:51:37 +02:00
Christoph Oelckers
f6984314b7 - SW: let sector objects properly invalidate the sector they are in. 2021-03-30 21:28:27 +02:00
Christoph Oelckers
92bb9c5319 - fixed display of player in mirrors. 2021-03-29 21:48:23 +02:00
Christoph Oelckers
18cf208b7d - fixed SW shadows in new renderer.
shade clamping and full sprite sort was missing,
2021-03-28 22:29:13 +02:00
Christoph Oelckers
e8edb32e0d - fixed camera texture setup.
They still are upside-down but aside from that work as expected.
2021-03-28 19:22:51 +02:00
Christoph Oelckers
81a690970b - SW: hide the player sprite before calling the renderer. 2021-03-28 15:28:08 +02:00
Christoph Oelckers
d3e0a9590c - renderDrawMasks may only be called for Polymost. 2021-03-28 15:14:32 +02:00
Mitchell Richters
6f65eb2270 - Duke: Amend 7e8ef99ec9 to adjust view height where it was originally adjusted.
* Doing this in `renderView()` unconditionally isn't correct as it can lead to a double adjustment if `p->spritebridge == 0 && p->newOwner == nullptr`.
2021-03-28 23:21:07 +11:00
Christoph Oelckers
7e8ef99ec9 - fixed view height in Duke. 2021-03-28 13:38:27 +02:00
Christoph Oelckers
fd0e9824b6 - call the game specific analyzesprites functions. 2021-03-26 15:06:14 +01:00
Christoph Oelckers
be7bca8e9e - expose animatesprite set of functions to new renderer as a callback. 2021-03-26 10:05:01 +01:00
Christoph Oelckers
0b1e81023f - added sprite collection loop to ProcessSector and did a bit of cleanup on the TSprite code. 2021-03-25 23:16:32 +01:00
Christoph Oelckers
f6568fee0c - rewrote SW portal setup to use static data instead of ad-hoc setup.
This was by far the messiest game, there's two reasons for this.
First, the portal links do not need to be in an actual portal sector, so they cannot be used to detect portal sectors.
Second, the game moves portals in place, so all offsets are (0,0,0) so that not even these can be used for detection.

The only working method is the super-complicated original way to look up portals at run time, just being done at map start.
Having static portal links should reduce the render glitches quite significantly because the renderer knows now which sectors belong to a portal and can use this information to ensure proper processing.
2021-03-25 21:21:48 +01:00
Christoph Oelckers
af54cf3a3c - made SW's sector portals operational.
Unlike the other games these are so poorly defined that the engine has to rely on the original fudging to pick the proper portal to link to. As a result they are just as limited as they always were.
In addition all the portal search code had to be reinstated.
2021-03-25 16:45:40 +01:00
Christoph Oelckers
168b0385cf - moved shadeToLight out of build.h. 2021-03-25 09:13:59 +01:00
Mitchell Richters
957f7e9487 - Accept binangle, fixedhoriz and lookangle classes in SetupViewpoint() vs. Q16.16 variables.
* Allows for more precision than Q16.16.
* Used as opportunity for `rollang` to be set using the `asdeg()` method, not `asbuildf()`.
2021-03-25 19:06:01 +11:00
Christoph Oelckers
13bbf0a4f9 - sector portals in RRRA are working. 2021-03-24 23:55:10 +01:00
Christoph Oelckers
dbbdfaa4ba - sector portals in Blood are working. 2021-03-24 23:11:06 +01:00
Christoph Oelckers
b7e8815133 - some further lightening of compat.h. 2021-03-24 21:13:36 +01:00
Christoph Oelckers
d8627a2b3f - removed all remains of projection math weirdness from the automap code in the games plus a bit more cleanup of the engine code. 2021-03-24 20:28:58 +01:00
Christoph Oelckers
09a9e14feb - set up engine portals for SW.
Also moving more code to _polymost.cpp which is only needed for ad-hoc lookup of portals with a client side implementation of a two-layer renderer.
2021-03-21 17:04:06 +01:00
Christoph Oelckers
a36377111c - engine-side portal setup for Blood and RRRA. 2021-03-21 14:48:35 +01:00
Christoph Oelckers
b91441f849 - same render interface rework for Shadow Warrior. 2021-03-21 12:22:50 +01:00
Christoph Oelckers
ecd6e68d69 - made render call adjustments to Exhumed.
This one was easy - no special cases at all. :)
2021-03-21 11:48:18 +01:00
Christoph Oelckers
6f7e7459ea - did some cleanup on Duke's render code to prepare for the new way of handling portals.
Like for Blood, the Polymost-only code has been moved aside.
Closer examination of the preparations the engine is doing for rendering SE40/150-portals shows that all this was merely done to avoid glitches with a two-phase rendering setup - nothing of this will be needed for doing it properly.
They can just be treated as run-of-the-mill stacked sectors. when using hardware rendering capabilities for clipping.
2021-03-21 10:58:11 +01:00
Christoph Oelckers
9f36ef69e6 - fixed variable name clash caused by viewUpdateShake's global variables.
removed the redundant call in the Ticker, because all its results are discarded.
Use arguments instead of global variables to pass data around.
2021-03-21 08:58:38 +01:00
Christoph Oelckers
d42ce0ee7e - WIP 2021-03-20 23:01:16 +01:00