Commit graph

16428 commits

Author SHA1 Message Date
Christoph Oelckers
368c788789 - added a 'check only' option to CreateTexBuffer.
This is meant to calculate the content ID without constructing the texture buffer.
2018-12-12 00:46:58 +01:00
Christoph Oelckers
200188b3a4 - FHardwareTextureContainer.
This is essentially a stripped down version of FHardwareTexture, which can exist on the API independent size, and which stores pointers to hardware textures instead of OpenGL texture handles.
2018-12-12 00:34:37 +01:00
Christoph Oelckers
07f87e2542 - changed CreateTexBuffer to return its info in a structure and not as a naked pointer. 2018-12-11 21:06:34 +01:00
Christoph Oelckers
ab624c8c5a Merge branch 'master' into Texture_Cleanup
# Conflicts:
#	src/textures/hires/hqresize.cpp
2018-12-11 20:27:24 +01:00
Christoph Oelckers
f01d1ec072 - must merge before continuing... 2018-12-11 20:26:33 +01:00
Christoph Oelckers
86d851bc5c - minor cleanup and allow FHardwareTexture to restore the old bindings after creating a texture. 2018-12-11 19:56:23 +01:00
Player701
eb8614fc71 - Force node rebuild for Plutonia 2 MAP25 to fix BSP glitches 2018-12-11 09:15:05 -05:00
alexey.lysiuk
8b46be7686 - print VM stack trace on startup abort exception
https://forum.zdoom.org/viewtopic.php?t=62650
2018-12-11 10:46:56 +02:00
Christoph Oelckers
f6aa16947a - re-added PlayerInfo.BringUpWeapon. 2018-12-11 00:35:53 +01:00
Christoph Oelckers
abd6729d39 - fixed deprecation warnings for member functions not checking the version. 2018-12-11 00:35:22 +01:00
Christoph Oelckers
ad8f484836 - fixed: The JIT compiler crashed on missing ArgFlags.
For ad-hoc Dehacked state functions no ArgFlags are created, in this case they can just be assumed to not be relevant here, because none of these function produces reference arguments.
2018-12-11 00:22:54 +01:00
Christoph Oelckers
5666e4c805 - made camera textures operational again.
Now with proper separation of software rendering logic from the main part of the class.
2018-12-11 00:01:45 +01:00
Rachael Alexanderson
28516c2def - split gl_texture_hqresize into two variables - one for mode, one for multiplier. 2018-12-10 14:25:29 -05: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
drfrag666
cbb5f8a0dc - Fixed: the vid_rendermode CVAR could get wrong values. 2018-12-10 07:08:48 -05:00
alexey.lysiuk
6362415054 - fixed return value of native call to dynamic array's Reserve()
https://forum.zdoom.org/viewtopic.php?t=62841
2018-12-10 11:26:46 +02:00
alexey.lysiuk
8a4b8cc2ca - server CVARs can be changed only by settings controller
Initially, settings controller flag was false by default
It was not touched during construction and destruction of player_t instances though
Now, with all members initialized in class definition, this flag must be saved and restored manually

https://forum.zdoom.org/viewtopic.php?t=62830
2018-12-10 10:36:40 +02:00
Christoph Oelckers
91bb7c0641 Let FSkyboxTexture map to the last defined regular texture of the same name instead of its first face
This is normally a better fallback for the software renderer.
2018-12-10 02:56:49 +01:00
Christoph Oelckers
0d07fb2550 Use FImageTexture for thre null texture
FDummyTexture had a big problem: Whenever it was accessed by accident it crashed the app because it wasn't fully implemented.

What it should do is return empty pixels of the given size, and an unextended FImageTexture is doing just that.
2018-12-10 02:50:22 +01:00
Christoph Oelckers
b32aa60760 Made SWPaletteTexture an ImageSource and let it be managed by the texture manager.
This is a lot easier to manage because the palette is just static data that can easily mimic an image.
2018-12-10 02:43:37 +01:00
Christoph Oelckers
4cd60fbe99 - added caching for true color images as well 2018-12-10 02:35:10 +01:00
Christoph Oelckers
2e7bcf9e41 - implemented a proper texture composition cache.
This will mostly ensure that each patch used for composition is only loaded once and automatically unloaded once no longer needed.
So far only for paletted rendering, but the same logic can be used for true color as well.
2018-12-10 01:17:39 +01:00
Christoph Oelckers
796c0fe931 - fixed precaching to consider animations and switches 2018-12-10 01:13:44 +01:00
Magnus Norddahl
f0ce453d47 - workaround pointer truncation bug in asmjit 2018-12-09 17:36:43 +01:00
Christoph Oelckers
5448874c6e - moved image format detection logic from FTexture to FImageSource. 2018-12-09 17:10:51 +01:00
Christoph Oelckers
34884e2756 - base FFontChar1 and FFontChar2 on FImageSource as well.
Now the only textures not being backed by an image source that are actually getting used during normal rendering are the canvas textures.
2018-12-09 16:00:27 +01:00
Christoph Oelckers
9e25025315 - missed this new file. 2018-12-09 15:41:02 +01:00
Christoph Oelckers
4cedbf6cc2 - split between textures and images is complete now.
* split up FMultiPatchTexture into a builder class and the actual image source.
* since images can now be referenced by multiple textures the old redirection mechanism has been removed. It can be done better and less intrusive now. Simple single patch textures already directly reference the underlying patch image now.
* allocate all image source related data from a memory arena. Since this is all static this makes it a lot easier to free this in bulk.
2018-12-09 15:25:56 +01:00
alexey.lysiuk
40f77e5dac - removed erroneous assertion
https://forum.zdoom.org/viewtopic.php?t=62815
2018-12-09 13:00:36 +02:00
alexey.lysiuk
f6bb33787b - fixed Actor.A_StopSound() native call
Wrong function overload was selected by compiler

https://forum.zdoom.org/viewtopic.php?t=62820
2018-12-09 10:13:43 +02:00
Christoph Oelckers
91f7121452 - made some changes to the FImageSource interface that allows forwarding the bRemap0 flag, but do it so that it doesn't permanently alter how the image looks.
In ZDoom this would affect everything using a patch that got used in a front sky layer, even if the texture was totally unrelated. It is only owed to the low usability of such patches for other purposes that this hasn't caused problems.
2018-12-09 08:15:05 +01:00
Christoph Oelckers
583a740441 - separated the image converters from the texture offsets.
Mostly done, except for FMultiPatchTexture and FFontChar1 + 2.
Note that this commit leaks those image objects!
2018-12-09 07:39:05 +01:00
Magnus Norddahl
670d975a33 - moved argsCache out of JitCompiler::CreateFuncSignature 2018-12-08 23:31:55 +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
e35d88e039 - moved some utility code out of FTexture. 2018-12-08 20:44:28 +01:00
Christoph Oelckers
03626107eb - changed multipatch texture composition to always composite off full source images and not do it recursively.
Previously it tried to copy all patches of composite sub-images directly onto the main image.
This caused massive complications throughout the entire true color texture code and made any attempt of caching the source data for composition next to impossible because the entire composition process operated on the raw data read from the texture and not some cacheable image. While this may cause more pixel data to be processed, this will be easily offset by being able to reuse patches for multiple textures, once a caching system is in place, which even for the IWADs happens quite frequently.

Removing the now unneeded arguments from the implementation also makes things a lot easier to handle.
2018-12-08 17:23:15 +01:00
Christoph Oelckers
1e070d27bd - replaced FTexture::FillBuffer 2018-12-08 14:06:16 +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
Player701
888af3d684 - Added Plutonia 2 MAP10 and MAP11 to the "rebuildnodes" compatibility list. 2018-12-08 12:26:22 +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
e70138a266 - fixed crash with FraggleScript in Nimrod MAP02. 2018-12-07 20:15:02 +01:00
Magnus Norddahl
f17a90ef69 - implement xor swap for vec registers 2018-12-07 19:30:00 +01:00
alexey.lysiuk
0dfb0d8427 - fixed broken Z coordinate in Actor.Vec3Angle() native call 2018-12-07 10:20:18 +02:00
Christoph Oelckers
69cc1f831c Renamed FTexture::GetPixels
This was needed to allow refactoring without letting all the other GetPixels get in the way.
2018-12-07 03:35:10 +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
42b18e6dfb - Disable PALVERS substitution when true color rendering is active. 2018-12-07 02:53:50 +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
3dc9eab743 Renamed the operator() and [] methods in FTextureManager which take a name
The operators cannot be easily searched for so this makes it hard to do any evaluations on the use of this method.
2018-12-07 02:43:27 +01:00
Christoph Oelckers
9fedecbe60 Renamed FTextureManager::GetTexture to GetTextureID
It doesn't return a texture after all and I want to repurpose the name for something else.
2018-12-07 02:31:30 +01:00
Christoph Oelckers
3491182ac3 - fixed compilation 2018-12-07 02:21:39 +01:00