Commit Graph

318 Commits

Author SHA1 Message Date
Christoph Oelckers 259ae41774 - sanitized the 'frozen level' code.
This had two different flags that were checked totally inconsistently, and one was not even saved.
Moved everything into a few subfunctions so that these checks do not have to be scattered all over the code.
2019-01-28 20:15:48 +01:00
Christoph Oelckers 3364988680 - moved the interpolator into FLevelLocals and refactored its use to happen outside the renderers.
There is no need to do this deep inside the renderer where it required code duplication and made it problematic to execute on multiple levels.
This is now being done before and after the top level call into the renderer in d_main.cpp.
This also serializes the interpolator itself to avoid problems with the Serialize functions adding the interpolations into the list which can only work with a single global instance.
2019-01-28 18:26:14 +01:00
Christoph Oelckers 648e472744 - handled approx. half of all cases where the address of level is taken. 2019-01-28 00:55:21 +01:00
Christoph Oelckers 8c542e9be8 - removed level references in the software renderers. 2019-01-27 17:21:36 +01:00
Christoph Oelckers 9f8dd66189 - changed Polyobject thinkers to operate on the actual polyobjects instead of indices
This also changes the action special interface to pass a Level parameter to the separate functions and makes a few other minor adjustments to the polyobject code.
2019-01-24 01:05:07 +01:00
Christoph Oelckers 8da1b5c1b0 - properly handle passing of the light flags.
Since these can be changed on the placed light actor they have to be read from there, so this is now a pointer in FDynamicLight, just like the other properties that can be user-changed.
Also did some cleanup on the interface so that external code doesn't need to dereference the lightflags pointer but can use utility functions for all flags.
2019-01-03 09:24:22 +01:00
Christoph Oelckers d654e02dea - rewrote dynamic lights to not use actors for the internal representation and made DynamicLight a purely scripted class.
This should be less of a drag on the playsim than having each light a separate actor. A quick check with ZDCMP2 showed that the light processing time was reduced to 1/3rd from 0.5 ms to 0.17 ms per tic.
It's also one native actor class less.
2019-01-01 19:35:55 +01:00
Magnus Norddahl 1bb2bb31d4 - fix first softpoly frame being empty 2018-12-25 16:50:11 +01:00
Magnus Norddahl 2cd1734de3 - improve softpoly 3d floor drawing somewhat 2018-12-23 14:59:47 +01:00
Magnus Norddahl 8c52f20373 - fix MemcpyCommand not using the same lines for the threads as softpoly (visible as a race condition when screenblocks didn't start at top of screen) 2018-12-20 04:27:30 +01:00
Magnus Norddahl ebfa61514e - remove InitSoftwareSky 2018-12-19 04:44:25 +01:00
Magnus Norddahl db295fae3a - fix sky drawer issues when not using max screenblocks 2018-12-19 04:27:41 +01:00
Magnus Norddahl c3477e9197 - softpoly decals were upside down 2018-12-17 01:32:46 +01:00
Magnus Norddahl 15d599813b - add support for scaled textures in softpoly 2018-12-16 15:12:45 +01:00
Christoph Oelckers cd25b4be4f - use a TArray to store the particles and remove all 16 bit global variables.
This means one less exit function to deal with - and these days 16 bit variables are a pointless attempt at saving space.
2018-12-15 10:04:49 +01:00
Christoph Oelckers 91a8f5cd04 Merge remote-tracking branch 'remotes/origin/master' into Texture_Cleanup
# Conflicts:
#	src/polyrenderer/poly_renderthread.cpp
#	src/swrenderer/r_renderthread.cpp
2018-12-10 18:47:21 +01:00
Christoph Oelckers 5eab944157 - started separating the texture class from the image format handlers. 2018-12-08 23:28:35 +01:00
Christoph Oelckers 82bd742ea3 - reworked how the software renderer manages its textures.
* it's no longer the main texture objects managing the pixel buffer but FSoftwareTexture.
* create proper spans for true color textures. The paletted spans only match if the image does not have any translucent pixels.
* create proper warp textures instead of working off the paletted variants.

As a side effect, caching of pixel buffers for texture composition is temporarily disabled, as it management of texture redirections. These things will be reimplemented once things progress further. The existing methods here had their share of serious issues that should be fixed.
2018-12-08 12:42:35 +01:00
Christoph Oelckers 92b722e0ee - don't put mutexes into static local variables.
Their initialization semantics are not safe for synchronization objects.
2018-12-08 11:56:31 +01:00
Christoph Oelckers 9409843931 - replaced the last access operator, too
Now everything uses a function.
This really wasn't what operators are supposef to be used for.
2018-12-07 03:01:40 +01:00
Christoph Oelckers 79a0f76801 - replaced TexMan.operator() with two functions.
This was done to make reviewing easier, again because it is virtually impossible to search for the operators in the code.

Going through this revealed quite a few places where texture animations were on but shouldn't and even more places that did not check PASLVERS, although they were preparing some paletted rendering.
2018-12-07 02:53:18 +01:00
Christoph Oelckers 4c67785c40 - moved the span and swtruecolor creation code into FSoftwareTexture. 2018-12-07 00:04:39 +01:00
Christoph Oelckers 32e245f2b9 - moved the software rendering specific parts of the sky setup to r_skyplane.cpp. 2018-12-06 20:52:03 +01:00
Magnus Norddahl e83af15907 - remove some redundant variables 2018-12-06 04:34:19 +01:00
Magnus Norddahl 2aefeb6401 - Use static ifs (C++11 version of them, anyhow) for the triangle draw function 2018-12-06 03:10:14 +01:00
Christoph Oelckers 6eab4a882c - narrowing down the public interface of the texture class
Cannot refactor if the entire class is this wide open to everything.
Not complete yet, doesn't fully compile!
2018-12-06 01:11:04 +01:00
Christoph Oelckers bfcd714186 - started replacing direct references to class AInventory.
The easiest part was the type checks which could be changed to the name variant with a global search and replace.
2018-12-02 21:35:55 +01:00
Christoph Oelckers a0c0e8bdfe Merge remote-tracking branch 'remotes/origin/weapon_scriptification' into asmjit
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2018-11-30 21:28:44 +01:00
Magnus Norddahl 110b982031 - fix compile error on systems with no SSE support 2018-11-29 13:08:46 +01:00
Magnus Norddahl fa185693d2 - _mm_rcp_ps may be faster but its precision is too poor 2018-11-29 00:17:40 +01:00
Magnus Norddahl 4ee7cf2de1 - forgot to set the light level 2018-11-29 00:03:50 +01:00
Magnus Norddahl d62a26a177 - use psprite renderstyle on HUD models 2018-11-29 00:01:16 +01:00
Magnus Norddahl 5e01a874be - merge the span step code used by both the 8 bit and 32 bit drawers 2018-11-26 17:02:01 +01:00
Magnus Norddahl dbb7df998d - step with SSE 2018-11-26 14:32:56 +01:00
Magnus Norddahl 2db433e68f - only do shade clamps if needed 2018-11-26 12:18:07 +01:00
Magnus Norddahl 52b7a77771 - use SSE for the dynlights 2018-11-26 00:49:07 +01:00
Christoph Oelckers 47b1fa774d Merge branch 'asmjit' into weapon_scriptification
# Conflicts:
#	src/gi.cpp
#	wadsrc/static/zscript/base.txt
2018-11-26 00:14:44 +01:00
Magnus Norddahl d30bf44dcc - use SSE for the normal walls 2018-11-25 17:11:05 +01:00
Magnus Norddahl 53175c49a7 - change DrawSpanOpt32 to render a scanline in multiple steps as the speed is about the same and it will make it easier to use SSE for each of the steps 2018-11-25 15:49:15 +01:00
Christoph Oelckers ead28db007 - consolidated the 3 nearly identical code fragments handling the weapon's YAdjust for the different renderers into a utility function in DPSprite. 2018-11-24 22:40:14 +01:00
Magnus Norddahl 3e9f531b5f - add NUMA awareness to drawer threads 2018-11-22 14:48:09 +01:00
Christoph Oelckers f2dcff4386 - more options for Doom 64 style gradients on walls:
* Colors can npw be defined per sidedef, not only per sector.
* Gradients can be selectively disabled or vertically flipped per wall tier.
* Gradients can be clamped to their respective tier, i.e top and bottom of the tier, not the front sector defines where it starts.

The per-wall colors are implemented for hardware and softpoly renderer only, but not for the classic software renderer, because its code is far too scattered to do this efficiently.
2018-11-11 16:04:36 +01:00
Christoph Oelckers ba66c0c889 - changed dynamic light traversal to use sections instead of the subsectors.
This is mostly complete, except for handling intra-section sidedefs.
2018-11-06 00:13:23 +01:00
Christoph Oelckers 9ddca3c3a9 - removed the subsector light lists as a preparation step to move over the light traversal code to use sections instead of subsectors. 2018-11-05 22:35:24 +01:00
Christoph Oelckers f7446160bb Merge branch 'master' into renderstate_abstraction 2018-10-29 14:00:43 +01:00
Christoph Oelckers 9e109995cd - moved model renderer to hwrenderer after removing the remaining traces of OpenGL. 2018-10-28 00:40:41 +02:00
Christoph Oelckers 51acf3053c - fixed model vertex buffer setup.
Setting the buffer and its attribute bindings must be one step, not twp. With Vulkan this is a single API call.
This removes the now obsolete SetVertexBuffer method from the model renderer's interface.
2018-10-27 23:33:22 +02:00
Magnus Norddahl 2404634d5d - fix softpoly bug where sprites and translucent walls in front of models would disappear 2018-10-25 12:40:56 +02:00
Magnus Norddahl 43c30ff485 - fix null pointer crash 2018-10-23 09:17:55 +02:00
Magnus Norddahl 22422635a0 - portal check is overridden by a different inverted check in the software renderer 2018-10-23 09:08:41 +02:00