These files are not part of the actual renderer but part of the system code.
This means, for separated modern and legacy GL renderers, there still will only be one set of this, unlike everything else.
(concatenated "UMSH" signature + datafile + anivfile)
This is pretty much 100% functional by now.
Hasn't been tested on platforms other than Linux yet, though.
Code definitely deserves some cleaning.
At least one version of Windows SDK (10.0.17134.0) has broken _pgmptr/_get_pgmptr()
It points to an empty string for multi-byte character set applications
GetModuleFileName() is now used instead regardless of compiler/toolchain
Added extra guard against unexpected program paths to avoid crashes
https://forum.zdoom.org/viewtopic.php?t=60598
The case with forward declared class used as a parent must be handled explicitly
actor MyWeapon : Weapon { Weapon.AmmoType "MyBaseAmmo" }
actor MyAmmo : MyBaseAmmo { }
actor MyBaseAmmo : Ammo { }
This is better be made part of the 2D interface.
That would have been done long ago if it hadn't been for the totally incompatible way this was handled by the purely paletted software renderer.
Now with that out of the way there is no point keeping this code this deeply embedded in the renderer.
Although this is currently safe there is no guarantee that future refactorings will keep the current draw lists, so it's better if GLDecal used its own copy of the data.
- precalculate if a sector's floor and ceiling plane overlap. This avoids rechecking this for each single call of hw_FakeFlat.
- vertices must be marked dirty every time they change after map setup. That means that ChangePlaneTexZ must do this as well, because it cannot rely on interpolation taking care of it.
- Having a 'dirty' argument for SetPlaneTexZ's ZScript version makes no sense. If the value changes from the script side the vertices must always be marked to be recalculated.
This was all over the place, with half of it using the function and half doing incomplete checks on the underlying variables.
Also did some optimization on the IGNOREHEIGHTSEC flag: Putting it on the destination sector instead of the model sector makes the check even simpler and allows to precalculate the effect of 3D floors on the heightsec, which previously had to be run on every call and made the function too complex for inlining.
* only call hw_CheckViewArea if the result is not known yet.
* check the map up front if it even contains heightsecs. This allows to shortcut the above check entirely for maps without sector transfers and will allow further optimizations.
This should fix bug reported in https://forum.zdoom.org/viewtopic.php?
f=104&t=56682.
There were two problems:
1. Algorithm to select a free voice was not appropriate. Changed to a
simple "least-recently-freed voice" algorithm.
2. Sustained voices were treated as used voices and never got replaced.
Now sustained voices are preferentially replaced when there are no free
voices.
Lots of this was still laid out for DirectDraw. This removes most of Begin2D so that it can be done more cleanlz.
Note that this commit renders weapon sprites and screen blends incorrectly. Those will be fixed in an upcoming commit.
Since they mess around with the texture coordinates, these need to be backed up and restored afterward.
There was also an issue with the ValidNormal check that was suffering from imprecisions that cause walls to be skipped, so the check was removed because it was mostly pointless.
src/hwrenderer/dynlights/hw_aabbtree.h:45:2: error: no template named 'TArray'
src/hwrenderer/dynlights/hw_aabbtree.h:48:2: error: no template named 'TArray'
* split gl_shadowmap.cpp into a GL dependent and an API independent part.
* gl_drawinfo must be kept around for the HUD sprite because it connects the renderer with the hardware indpendent part of the engine.
- added thread_local to some static arrays being used for setting up dynamic lights.
Right now it's of little consequence but these will have to be maintained per thread if the render data setup is done by worker tasks.
It was impossible to complete Sin City 2 The Satan Complex without cheating since ZDoom 2.6.0
Change in applying of DeHackEd patches from 77a4b9a29b broke triggering of important linedef that pushes friendly marine to exit switch
https://www.doomworld.com/idgames/levels/doom2/Ports/s-u/satanx
Decals will now be processed into a list in the processing pass, allowing to use the vertex buffer even on GL3 hardware and to offload this part of the work to a multithreaded worker task.
* to do this efficiently the amount of required vertices needs to be calculated up-front
* always create the vertices in the data generation pass, not the render pass.
* added synchronisation code to the vertex buffer allocator.
Without multithreading this causes a slight slowdown, due to added processing cost. (Frozen Time bridge scene drops from 47 fps to 44 fps on my test machine.
- eliminated hqresize.cpp's dependency on GL headers.
- cleaned up the logic for CreateTexBuffer so that hqresize.cpp does not need to check for software warped textures anymore.
Actors get initialized from their defaults so anything done in the constructor or some explicit member initialization will be overwritten.
They must use their properties for setting up configurable fields and do the rest in BeginPlay.
This replaces the old redirection hackery that had to work differently for the legacy render path.
Overriding CopyTrueColorTranslated is far more robust and ensures that no edge cases can reach the GetPixels function, which wasn't the case before.
src\sound\adlmidi\adlmidi_private.hpp(457): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) (compiling source file src\sound\adlmidi\adlmidi.cpp)
src\sound\opnmidi\opnmidi_private.hpp(404): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) (compiling source file src\sound\opnmidi\opnmidi.cpp)
src\sound\adlmidi\adlmidi_private.hpp(457): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) (compiling source file src\sound\adlmidi\adlmidi_midiplay.cpp)
src\sound\adlmidi\adlmidi_private.hpp(457): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) (compiling source file src\sound\adlmidi\adlmidi_load.cpp)
src\sound\adlmidi\adlmidi_private.hpp(457): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) (compiling source file src\sound\adlmidi\adlmidi_private.cpp)
src\sound\adlmidi\adlmidi_private.hpp(457): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) (compiling source file src\sound\adlmidi\adlmidi_opl3.cpp)
src\sound\opnmidi\opnmidi.cpp(132): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\opnmidi\opnmidi.cpp(147): warning C4800: 'unsigned int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\adlmidi\adlmidi.cpp(168): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\adlmidi\adlmidi.cpp(177): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\adlmidi\adlmidi.cpp(186): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\adlmidi\adlmidi.cpp(195): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\adlmidi\adlmidi.cpp(209): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\adlmidi\adlmidi_midiplay.cpp(740): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\adlmidi\adlmidi_midiplay.cpp(741): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\adlmidi\adlmidi_midiplay.cpp(742): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\adlmidi\adlmidi_midiplay.cpp(743): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\opnmidi\opnmidi_private.hpp(404): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) (compiling source file src\sound\opnmidi\opnmidi_midiplay.cpp)
src\sound\opnmidi\opnmidi_private.hpp(404): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) (compiling source file src\sound\opnmidi\opnmidi_load.cpp)
src\sound\opnmidi\opnmidi_midiplay.cpp(697): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\opnmidi\opnmidi_midiplay.cpp(698): warning C4800: 'unsigned int': forcing value to bool 'true' or 'false' (performance warning)
src\sound\opnmidi\opnmidi_private.hpp(404): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) (compiling source file src\sound\opnmidi\opnmidi_opn2.cpp)
src\sound\opnmidi\opnmidi_private.hpp(404): warning C4800: 'int': forcing value to bool 'true' or 'false' (performance warning) (compiling source file src\sound\opnmidi\opnmidi_private.cpp)
This is for mitigating the recently discovered problem with attenuated lights getting reduced in size, even on OpenGL 3+. The intent of the shrinking was to account for higher brightness of non-attenuated lights on OpenGL 2 and was never meant to be active on more modern versions.
The factor will apply to any attenuated light defined after it and will be inherited by included sub-lumps, but it will only last for the lunp it is set in.
If you have a definition for the broken behavior, AddLightAssociation
'lightsizefactor 0.667' at the top of your GLDEFS.
- added copy constructors and assignement operators to GLFlat and GLWall so that they can use memcpy instead of field-by-field copy. This actually increases performance slightly.
This is mainly for future-proofing because storing these as objects in an array not only has a negative impact when using multithreading due to longer blocking time for the threads but also makes it hard to cache this data for reuse.
This data is game critical and may only be altered by code that knows what is allowed and what not. It must never be altered by any user code ever.
However, since the SkyViewpoint actors need to set up some relations between themselves and the default sky portals the previously purely internal 'internal' flag has been exported as a new keyword.
The most frequent call using this is the regular texture creation function where this results in a pointless allocation and destruction of a temporary string which is easily avoided.
* use names, not strings, to allow use of switch/case.
* avoid creating the checksum a second time per level.
* do an early-out check for maps that do not have scripted compatibility.
They were already deactivated because with 5 render modes present this was destructive, having only 2 options available.
Since the render mode can now be changed on the fly this isn't as critical anymore as it once was.
With the software renderer not being used for 2D anymore it would be quite annoying if every texture class had to implement these.
If done properly, the SW renderer should actually be forced to dynamic_cast any texture to a FWorldTexture before using this stuff, but that'd be some pointless overhead better saved.
src/gl/renderer/gl_renderer.cpp:775:39: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare]
src/gl/renderer/gl_renderer.cpp:776:39: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare]
src/gl/renderer/gl_renderer.cpp:777:39: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare]
src/gl/renderer/gl_renderer.cpp:778:45: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare]
src/gl/renderer/gl_renderer.cpp:779:40: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare]
src/gl/renderer/gl_renderer.cpp:780:45: warning: comparison of two values with different enumeration types ('F2DDrawer::ETextureDrawMode' and 'TexMode') [-Wenum-compare]
src/v_draw.cpp:1144:51: warning: '&' within '|' [-Wbitwise-op-parentheses]
src/textures/texture.cpp:1050:20: warning: comparison of integers of different signs: 'int' and 'unsigned long' [-Wsign-compare]
src\intermission\intermission.cpp(80): warning C4101: 'lumpnum': unreferenced local variable
GCC 7:
src/gl/renderer/gl_renderer.cpp:702:2: error: non-constant condition for static assertion
src/gl/renderer/gl_renderer.cpp:702:2: error: value ‘12’ of type ‘float*’ is not a constant expression
src/gl/renderer/gl_renderer.cpp:703:2: error: non-constant condition for static assertion
src/gl/renderer/gl_renderer.cpp:703:2: error: value ‘20’ of type ‘PalEntry*’ is not a constant expression
Clang:
src/gl/renderer/gl_renderer.cpp:701:16: error: static_assert expression is not an integral constant expression
src/gl/renderer/gl_renderer.cpp:701:23: note: cannot access field of null pointer
This removes the entire palette switch and all the special checks to ensure that no menu can be drawn over this image.
Instead it gives this texture its special palette in the texture manager so that the proper image is created right away.
I decided against exposing this as an editing feature because it is far too specific to this particular image and the raw page format it uses.
A quick check of /idgames shows no project ever replacing it - especially no ZDoom-based project - so no extended handling is needed to make this work with other texture formats.
- with renderers freely switchable, some shortcuts in the 3D floor code had to be removed, because now the hardware renderer can get FF_THISINSIDE-flagged 3D floors.
- changed handling of attenuated lights in the legacy renderer to be adjusted when being rendered instead of when being spawned. For the software renderer the light needs to retain its original values.
- Slightly improve how softpoly processes portals
- Pass the vertex transform matrix via a command rather than being part of the drawer args
- Improve zbuffer drawers in the software renderer
- Misc model rendering fixes
It may use the same calculations as the hardware renderer but must use the 2D drawer for display.
It should be investigated if the hardware renderer can do this as well.
This does not work with a setup where the same backend is driving both renderers.
Most of this is now routed through 'screen', and the decision between renderers has to be made inside the actual render functions.
The software renderer is still driven by a thin opaque interface to keep it mostly an isolated module.
This will cause incorrectly generated textures and the reason for this no longer exists because CreateTexBuffer is doing this as a postprocessing step now.
* the MAPINFO options now get handled in g_mapinfo.cpp and g_level.cpp, just like the rest of them as members of level_info_t and FLevelLocals.
* RecalcVertexHeights has been made a member of vertex_t and been moved to p_sectors.cpp.
* the dumpgeometry CCMD has been moved to p_setup.cpp
This fixes usage of uninitialized variable in ACSStringPool::PoolEntry objects
The initial version (before 66d15dc) increased pool size by one entry and assign all its members right after that
The improved version reserved MIN_GC_SIZE entries but didn't initialize anything except the first one
ACSStringPool::FindFirstFreeEntry() cannot find the proper entry as it uses PoolEntry::Next member for list traversal
It's enough to initialize Next member with FREE_ENTRY value because other fields will be assigned anyway inside ACSStringPool::InsertString()
https://forum.zdoom.org/viewtopic.php?t=60049
This theoretically means that the software renderer could access this data as well - if it just had been written with a more flexible texture interface.
However, as things stand, this may require quite a bit of work to achieve.
The old organization made sense when ZDoom still was a thing but now it'd be better if all pure data with no dependence on renderer implementation details was moved out.
A separation between GL2 and GL3+4 renderers looks to be inevitable and the more data is out of the renderer when that happens, the better.
Previously, only .wad files can specified without file extension for -iwad command line option
For example, -iwad square1 will load square1.pk3 as IWAD
This was originally invented to fix the sprite offsets for the hardware renderer.
Changed it so that it doesn't override the original offsets but acts as a second set.
A new CVAR has been added to allow controlling the behavior per renderer.
This also replaces DTA_ColormapStyle with proper implementations of its components. As implemented it was a very awkward mixture of various effects that already existed in a separate form. As a result of its implementation it required additional but completely redundant shader support which could be removed now. As a side effect of this change a new DTA_Desaturate option was added.
No more locking insanity! :)
There are no locking counters or other saveguards here that would complicate the implementation because there's precisely two places where this buffer must be locked - the RenderView functions of the regular and poly SW renderer which cannot be called recursively.
In its current form this is quite useless. What's really needed is to require a lock on the RenderBuffer for the 3D scene, but since this is not needed for the 2D stuff anymore it can be done far simpler.
This was a bad idea from the start and really only made sense with DirectDraw.
These days a FrameBuffer represents an abstract hardware canvas that shares nothing with a software canvas so having these classes linked together makes things needlessly complicated.
The software render buffer is now a canvas object owned by the FrameBuffer.
Note that this commit deactivates a few things in the software renderer, but from the looks of it none of those will be needed anymore if we set OpenGL 2 as minimum target.
This is a necessary first step for simplifying the texture handling in order to refactor it.
# Conflicts:
# src/gl/system/gl_swframebuffer.cpp
# src/textures/textures.h
# src/win32/fb_d3d9.cpp
This was done mainly to reduce the amount of occurences of the word FTexture but it immediately helped detect two small and mostly harmless bugs that were found due to the stricter type checks.
This merely addresses the crashing issue, it does nothing about the faulty initialization logic here that causes the chorus not to get initialized properly if reverb is active.
The issue needs more in-detail investigation but for now this has to suffice.
Notes:
* ADL: The DMX volume model was set as default to unify volumes on all bank. Otherwise, if you will use 'Generic' or 'Win9x', the sound will became too loud than wanted. Each bank has own default volume model which is used when 'Auto' is set.
* ADL: 6 chips is optimal to work with default banks
* OPN: 8 chips are set to provide 48 polyphony channels. (each OPN2 chip has 6 channels only)
* Text files: junk spaces from end of lines are was auto-removed.