Commit Graph

13504 Commits

Author SHA1 Message Date
Christoph Oelckers d0f38d7362 - wall sprite WIP. 2021-03-27 13:22:34 +01:00
Christoph Oelckers 1dfb2672a8 - flat sprite rendering! 2021-03-26 20:28:44 +01:00
Christoph Oelckers fd0e9824b6 - call the game specific analyzesprites functions. 2021-03-26 15:06:14 +01:00
Christoph Oelckers 098db655ab - did some fudging on the scene viewport until thinks looked right again.
I have no idea, though, why it has to be this particular formula, though. It doesn't seem to make any sense.
2021-03-26 01:55:24 +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 463dbc4c4f - fixed issue with empty voxel slots. 2021-03-25 08:37:44 +01: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 368b2319f2 - replaced 'static FORCE_INLINE' globally with 'inline'.
I have no idea what kind of compiler needs such a construct, it's totally not how C++ should be written.
2021-03-24 21:43:36 +01:00
Christoph Oelckers b7e8815133 - some further lightening of compat.h. 2021-03-24 21:13:36 +01:00
Christoph Oelckers 8993095bc0 - got rid of pow2char 2021-03-24 20:37:20 +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 022edd2dc2 - cleaned engine.cpp off all code exclusive to the Polymost renderer. 2021-03-24 19:45:42 +01:00
Christoph Oelckers e47b4507e4 - serialize the sector portal offset table.
Due to where this happens, the init code for these portals cannot be run when loading a savegame so it has to be saved.
2021-03-24 18:42:00 +01:00
Christoph Oelckers 1297e4ed02 - SW's line to sprite portals are working now.
Also fixed a clipper issue with Blood's line to line portals.
2021-03-24 10:33:50 +01:00
Christoph Oelckers 9903b39cf5 - make Blood's line to line portal operational.
Note that these portals cannot be rotated, so to preserve bad setups this limitation needs to be replicated.
If we want proper line to line portals for all games they need to be made a different portal type.
2021-03-24 09:04:48 +01:00
Christoph Oelckers 829be9b56b - use value parameters for arguments in binaryangle.h. 2021-03-24 09:02:07 +01:00
Christoph Oelckers 087da46522 - finally got mirrors working. 2021-03-23 21:23:49 +01:00
Christoph Oelckers c681fa6699 - use Build math for mirror transitions. 2021-03-23 20:30:19 +01:00
Christoph Oelckers 46e0b16370 - fixed ordering issues in drawer
* do not check the clipper in the collection pass to reduce number of bunches. Clipping here brings no performance gain.
* fixed the loop reset in FindClosestBunch to actually process the array's first element.
2021-03-23 19:20:06 +01:00
Christoph Oelckers 0c7f05a416 - let the clipper work exclusively on Build coordinates. 2021-03-22 23:40:25 +01:00
Christoph Oelckers 096ce5e025 - initial sky fixes. 2021-03-22 16:02:52 +01:00
Christoph Oelckers e884a418f8 - portal WIP 2021-03-22 12:07:29 +01:00
Christoph Oelckers cecfbb76e8 - fixed uninitialized clear color variable. 2021-03-22 12:07:15 +01:00
Christoph Oelckers 63f057d93f - portal and sky WIP. 2021-03-21 22:48:01 +01:00
Christoph Oelckers 75159e06c0 - uncommented the portal code in hw_walls.cpp. 2021-03-21 19:36:55 +01:00
Christoph Oelckers 9fe462d358 - adapted GZDoom's portal framework.
Not tested yet and somewhat stripped down, as the portals this needs to support are a lot less complex - plus some of the issues in Doom do not apply here.
2021-03-21 18:41:23 +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 757d7be18b - updated the earcut.hpp triangulator.
The old one wasn't triangulating the bathroom sector in DUKEDC2 properly, the bug got fixed upstream in the mean time.
2021-03-21 11:54:39 +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
Christoph Oelckers 4109a256ac - Blood: cleanup of render code.
Renaming of disassembly variables and moving of disabled Crystal Ball renderer to a separate function.
2021-03-20 19:20:42 +01:00
Christoph Oelckers f30a568858 - moved wallfront function into polymost.cpp.
This was one of the few functions left in engine.cpp that accesses the global scene state.
2021-03-20 19:10:46 +01:00
Christoph Oelckers 91957e40f1 - moved some original Raze code out if the Build folder. 2021-03-20 17:08:55 +01:00
Christoph Oelckers fedfc2cfa4 - removed global variables that were only being used by the automap drawer plus a few other obsolete things. 2021-03-20 16:46:06 +01:00
Christoph Oelckers 30f4e2b29d - replaced the engine automap drawer with one leveraging the newly added sector geometry data.
This eliminates a lot of code depending on Build's projection math.
2021-03-20 16:20:48 +01:00
Christoph Oelckers 88706e8e13 - added a cache for the sector geometry.
Now it only needs recreation if the sector changes.
2021-03-19 23:18:09 +01:00
Christoph Oelckers 5a0c8da6bf - Duke: fixed some incorrect assignments in CON parser 2021-03-19 23:18:09 +01:00
Christoph Oelckers 3df5c440f9 - added some helpers to make it easier to determine if a sector's geometry has been altered.
Walls had no sector reference so this was added for marking the sector as altered when a vertex gets dragged around.
2021-03-19 23:18:09 +01:00
Mitchell Richters 895b875453 - Invert `rollang` in hw_entrypoint.cpp:SetupView(). 2021-03-20 08:35:17 +11:00
Christoph Oelckers 93bb774573 - flat alignment.
This still gets redone each frame for each sector and needs to be buffered
2021-03-19 19:53:55 +01:00