Commit graph

470 commits

Author SHA1 Message Date
Christoph Oelckers
14101fa447 - health groups and software rendering textures freed of 'level'
Edited cherry-pick of an older commit.
2019-01-29 16:06:17 +01:00
Christoph Oelckers
60873bc5d6 Moved the PointInSector functions into FLevelLocals 2019-01-29 01:30:41 +01:00
Christoph Oelckers
4d98c10ea3 - let the sound code use the current UI level.
This is what should be audible. To prevent other levels from playing sound, all entry points check whether the sound playing entity belongs to the current UI level.
2019-01-27 19:32:38 +01:00
Christoph Oelckers
4f540c1703 - give the sector a level reference. 2019-01-27 17:12:03 +01:00
Christoph Oelckers
f4081c33a6 - give line_t a GetLevel function.
The portal getters need this, even though currently it only gets the global level.
2019-01-25 00:42:55 +01:00
Christoph Oelckers
b445c6fabc - actually use the newly added indices. 2019-01-06 00:46:09 +01:00
Christoph Oelckers
8b18ed4759 - store the index of each map item in the struct itself and return that for the Index function.
If we ever want to refactor the global level data these must not reference the 'level' variable.
The main parts of the map loader cannot use this information, because it can only be created after running the node builder, so it got its own set of index functions instead.
2019-01-06 00:41:46 +01:00
Christoph Oelckers
639fb43682 -reordered sector_t so that the internal declarations are at the top, followed by the member variables and the methods.
Also tried to sort them by renderer use but that turned out to be without any performance effect, even though the struct is a bit better aligned now and several bytes shorter.
2019-01-05 13:27:32 +01:00
Christoph Oelckers
65b01bd16d - fixed incomplete commit.
I have no idea where the rest of this stuff went...
2018-12-30 08:22:34 +01:00
Christoph Oelckers
326e4d8559 - store the master pointer for the subsector lists in sector_t and the seg lists in side_t in FLevelLocals as a TArray instead of relying on the first element's pointer for this.
This simply way bad style.
2018-12-28 14:24:22 +01:00
Christoph Oelckers
2e22c01d45 - moved most content of p_setup.cpp into a MapLoader class. 2018-12-27 12:33:17 +01:00
Kevin Caccamo
e04fc026ff Expand UDMF and ZScript API for side's own additive colors
Add 'useowncoloradd_{top,mid,bottom}' sidedef properties to the UDMF 
spec
Only use side's additive colors if 'useowncoloradd_(top|mid|bottom)' is 
set.
Rename UseOwnColors flag to UseOwnSpecialColors
Add UseOwnAdditiveColor flag to side_t::part
Add EnableAdditiveColor to side_t
Add Side.EnableAdditiveColor to ZScript API
2018-12-26 16:58:27 +01:00
Kevin Caccamo
286886e161 Minor fixes for additive colour ZScript API
Sector.SetAdditiveColor actually called Sector.SetSpecialColor
Add use boolean property, used to determine whether or not to override the sector's additive wall colour with the side's additive colour.
2018-12-26 16:58:27 +01:00
Kevin Caccamo
0773e6a98e Rework implementation as per the new specification
The new specification is more flexible, and allows assigning additive 
colors to individual parts of a sector (walls, sprites, flats) and even 
individual parts of a side (top, middle, bottom)

Add AdditiveColors arrays to sector_t and side_t::part
Initialize AdditiveColors arrays to 0
Export AdditiveColors to ZScript
Save AdditiveColors in saved game files
Use colors from AdditiveColors arrays when setting the additive color 
for the render state
Add code to parse the new UDMF additive color properties
Remove additive color slot from sector color/part enum
Add SetAdditiveColor to sector_t and side_t
Add GetAdditiveColor to side_t
Export new methods and additive color arrays to ZScript
2018-12-26 16:58:27 +01:00
Kevin Caccamo
e5d43a734a Initial work on Doom64-style fade/glow 2018-12-26 16:58:27 +01:00
Christoph Oelckers
494a113920 - more direct native entry points.
- disallow bool as a return value for direct native calls because it only sets the lowest 8 bits of the return register.
- changed return type for several functions from bool to int where the return type was the only thing blocking use as direct native call.
2018-12-05 20:10:44 +01:00
Christoph Oelckers
b26b16e4b7 Merge remote-tracking branch 'remotes/origin/master' into asmjit 2018-11-30 21:29:12 +01:00
Player701
b79e3f8904 - Added a flag to make bouncing objects disappear when hitting sky surfaces 2018-11-30 18:53:57 +01:00
Christoph Oelckers
53d59559cd Added direct native functions to the remaining content of vmthunks.cpp 2018-11-29 17:55:56 +01:00
Christoph Oelckers
62efe11a85 - more direct native functions for sector utilities. 2018-11-29 17:38:58 +01:00
Christoph Oelckers
f43f0b9bd4 - added a few more direct native entry points. 2018-11-29 00:27:09 +01:00
Christoph Oelckers
d3ff657231 - added a direct native function for NextHighestCeilingAt to test multiple return values. 2018-11-28 21:40:56 +01:00
Christoph Oelckers
8e8ee732f4 - another batch of direct native functions. 2018-11-25 14:19:19 +01:00
Christoph Oelckers
6628b34f4a - continued work on adding direct native support. 2018-11-25 13:35:32 +01:00
Christoph Oelckers
dc16c1d44e - moved VM thunks from p_sectors.cpp to a separate file and started adding direct native implementations.
For a few larger functions I took them out of sector_t and made them global functions to avoid creating more unnecessary stubs.
2018-11-25 11:34:50 +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
ZZYZX
d85e5afdfb Destructible geometry - minor fixes and 3D floor support 2018-11-07 00:12:37 +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
49bfdbef9f - create an intermediate structure between sectors and subsectors.
A section is a continuous part of a sector or in some case of several nearby continuous parts. For sectors with far away parts multiple sections will be created, especially when they lie in disjoint parts of the map.
This is mainly supposed to cut down on time for linking dynamic lights. Since they need to traverse subsectors to find all touching sidedefs a more coarse data structure that only contains the info needed for this is more suitable. In particular, this does not contain any intra-sector lines, i.e. those with both sides in the same sector.
2018-11-04 20:10:51 +01:00
ZZYZX
b911bbc424 Single commit - destructible geometry feature 2018-10-31 17:22:09 +01:00
Christoph Oelckers
f7446160bb Merge branch 'master' into renderstate_abstraction 2018-10-29 14:00:43 +01:00
Tommy Nguyen
75bd1b00b4 - use value initialization for secspecial_t 2018-10-23 20:30:27 +02:00
Christoph Oelckers
84a55667d9 - removed more old code from flat renderer.
VBOHeightCheck was from early development when interpolation was not reflected by the vertex buffer.

# Conflicts:
#	src/gl/scene/gl_flats.cpp
2018-10-20 10:39:28 +02:00
Christoph Oelckers
fad406c4c9 - got rid of FNameNoInit and made the default constructor of FName non-initializing.
This setup has been a constant source of problems so now I reviewed all uses of FName to make sure that everything that needs to be initialized is done manually.
This also merges the player_t constructor into the class definition as default values.
2018-08-19 08:19:19 +02:00
Christoph Oelckers
74d8c929cc Give the clipper a reference to the current viewpoint
This is both for efficiency and encapsulation. At last on MSVC in 64 bit, accessing global variables is very inefficient and the clipper was doing it repeatedly in its worker functions.

It is also one less place where the global viewpoint gets checked.
2018-06-19 09:37:49 +02:00
Christoph Oelckers
496e6e2e8f - fixed: The vertex height updater was using the index buffer offsets to access the vertex buffer.
I missed this part when repurposing the vboindex members to store the index buffer offsets.
However, since both indices are needed, they need another set of variables.
2018-05-24 00:01:56 +02:00
Christoph Oelckers
b612e182b4 Merge branch 'indexbuffer'
# Conflicts:
#	src/gl/data/gl_vertexbuffer.h
#	src/gl/scene/gl_flats.cpp
#	src/hwrenderer/data/flatvertices.h
2018-05-22 22:10:21 +02:00
alexey.lysiuk
c6f7d92c76 - added forced automap style to linedef, UDMF only
https://forum.zdoom.org/viewtopic.php?t=59808
2018-05-19 17:09:26 +02:00
Christoph Oelckers
fd3681dae2 - use an indexed vertex buffer to render the flats.
Right now this has no advantage but it allows optimizing the data, e.g. rendering an entire sector in one go instead of per subsector.
2018-05-19 13:33:28 +02:00
Christoph Oelckers
5ec47d8b4f - removed some leftover data in sector_t. 2018-05-19 08:25:26 +02:00
Christoph Oelckers
9bdb0f2e49 - renamed the flag bits for sector_t::MoreFlags, so that they are easier to distinguish from sector_t::Flags.
- 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.
2018-05-01 11:29:29 +02:00
Christoph Oelckers
f49c6cbde2 - use sector_t::GetHeightSec consistently and optimize it.
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.
2018-05-01 09:47:09 +02:00
Christoph Oelckers
7aea010892 - added a sector index to the subsector struct.
This will be used to process dynamic lights for flats in the processing pass, allowing to remove the lights-only pass entirely.
2018-04-30 23:48:16 +02:00
Christoph Oelckers
52c5328412 - made the glow getter functions members of sector_t. 2018-04-02 13:36:28 +02:00
Christoph Oelckers
248a29bf06 - resorted portal render data.
Compiles but does not work...
2018-04-01 22:26:57 +02:00
Christoph Oelckers
65e7b6dfaa - moved the code in gl_data.cpp to better fitting places
* 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
2018-04-01 18:45:27 +02:00
alexey.lysiuk
f629678320 Fixed const correctness for secplane structure
https://forum.zdoom.org/viewtopic.php?t=59151
2018-01-18 15:34:56 +02:00
alexey.lysiuk
a670e79b8a Applied texture offsets and scales on animated doors
https://forum.zdoom.org/viewtopic.php?t=58892
2017-12-29 11:47:30 +02:00
Magnus Norddahl
bf4d7234e1 - Increase MAXWIDTH and MAXHEIGHT defines to support supersampled 5K monitors 2017-07-23 22:04:00 +02:00