Commit graph

438 commits

Author SHA1 Message Date
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
41e576bbb5 - removed the intermediate P_SpawnPlayer inline 2019-01-28 03:02:25 +01:00
Christoph Oelckers
66695ac6a0 - made most of the player spawn spot handliing functions members of FLevelLocals. 2019-01-28 02:44:05 +01:00
Christoph Oelckers
d941dea005 - added a level iterator for operations that need to make changes to all open levels.
Since currently there is only one level, this will obvciously only run once on that level for the time being.

This is mainly used for CCMDs and CVARs which either print some diagnostics or change some user-settable configuration.
2019-01-28 02:41:29 +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
b4a95ccaa9 - roughly 50 more, mostly search and replace. 2019-01-27 19:16:14 +01:00
Christoph Oelckers
8323524014 - give thinkers a 'level' member and change linking to the chain to happen outside the constructor. 2019-01-27 01:49:20 +01:00
Christoph Oelckers
05830455e7 - made the automap an object.
This simplifies handling a lot because it allows to make the level the owner of its map.
2019-01-26 15:21:20 +01:00
Christoph Oelckers
ba114f6f23 - give the hardware renderer's drawinfo its own level pointer 2019-01-25 01:26:16 +01:00
Christoph Oelckers
0a6b6173de - Moved Strife conversation data into FLevelLocals. 2019-01-24 19:53:11 +01:00
Christoph Oelckers
0e5986769e - moved the tid hash into FLevelLocals and adjusted the interface to the iterators. 2019-01-24 19:28:40 +01:00
Christoph Oelckers
1f2162fea8 - moved the scripted creation functions for tag iterators to LevelLocals
The old static methods are now deprecated, this was done to clarify the relationships at play here.
2019-01-24 02:17:10 +01:00
Christoph Oelckers
7e9340f3b7 - removed most global references to the tag manager by routing most access to FLevelocals. 2019-01-24 01:40:09 +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
55339761f6 - fixed serialization of ACS thinker. 2019-01-06 10:25:46 +01:00
Christoph Oelckers
7b235ea13e - moved the per-level ACS state into FLevelLocals. 2019-01-05 18:19:35 +01:00
Christoph Oelckers
a0ad4ea193 - made the corpse queue a simple array in FLevelLocals.
I have to wonder why it had to use such a complicated implementation that provided no advantages whatsoever.
The new code is just 1/5th of the old one's size and much closer to Hexen's original implementation which also was a simple array but with no means to resize the queue.
2019-01-05 10:53:06 +01:00
Christoph Oelckers
dab68184f5 - moved the global spot state into FLevelLocals.
This way it doesn't even have to be a thinker.
2019-01-05 10:04:27 +01:00
Christoph Oelckers
7b16433e97 - changed FraggleScript setup so that the MapLoader does not use the global level variable anymore.
This involves passing the level explicitly to many functions. What was done here may seem a bit excessive but at least it covers everything.
Most importantly, the global ActiveThinker pointer has been moved into FLevelLocals and is now getting tracked properly by the level without using dangerous assumptions about how the game organizes its data.
2019-01-05 09:40:03 +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
Christoph Oelckers
3f8d565dbb - split up P_FreeLevelData, so that everything that clears out fields in FLevelLocals is now in a member function of that class. 2018-12-31 12:42:03 +01:00
Christoph Oelckers
f35ac75ca2 - fixed precaching of switches.
The backwards animation accessed the wrong array which in case of sequences with different length could crash
2018-12-29 14:01:07 +01:00
Christoph Oelckers
17e053499e - reworked the lock code to remove the 255 locks limit and to allow it to automatically deinitialize. 2018-12-29 10:19:31 +01:00
Christoph Oelckers
f31b1b92c9 - eliminated the two global FraggleScript variables by moving them into DFraggleThinker. 2018-12-29 01:18:21 +01:00
Christoph Oelckers
5f303859e9 - made some changes to how the compatibility code works to allow removing the last remaining global variables of the map loading code.
Everything temporary is now part of the MapLoader class.
2018-12-28 23:14:11 +01:00
Christoph Oelckers
0e904286e8 - moved renderinfo.cpp entriely into the map loader. 2018-12-28 15:51:32 +01:00
Christoph Oelckers
11e9cdae33 - split polyobject init into its own file and cleaned things up a bit. 2018-12-28 15:05:05 +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
64595abe60 - moved main polyobject array into FLevelLocals and simplified the setup process to not depend on P_SpawnMapThing.
Since the SpawnedThings array is still available when polyobjects are spawned it makes no sense to create an expensive linked list in P_SpawnMapThing.
This can be done far better by scanning through the array again and collect all matching items in a second array.
2018-12-28 10:08:39 +01:00
Christoph Oelckers
84a28454dc - split maploader.cpp so that the parts that are not setting up the actual map data go back to p_setup.cpp. 2018-12-28 09:17:10 +01:00
Christoph Oelckers
2edf02d731 - moved map loader files to a subdirectory. 2018-12-27 17:11:10 +01:00
Christoph Oelckers
f351df5c22 - moved Extradata parser into MapLoader class. 2018-12-27 12:33:18 +01:00
Christoph Oelckers
733cd5260a - moved slope creation functions and most initialize-time variables into MapLoader class. 2018-12-27 12:33:18 +01:00
Christoph Oelckers
89ba723609 - moved the content from p_glnodes into the MapLoader class. 2018-12-27 12:33:17 +01:00
Christoph Oelckers
2e22c01d45 - moved most content of p_setup.cpp into a MapLoader class. 2018-12-27 12:33:17 +01:00
Christoph Oelckers
b31f284e28 - fixed 3D floor initialization for actor spawning.
Since actors are being spawned before the renderer gets set up this needs to fully initialize the list before spawning the actors, then take it down again for creating the vertex buffer and then recreate it.
2018-12-27 08:28:09 +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
80bcac48ef Forcibly assign 0 to the additive special color 2018-12-26 16:58:27 +01:00
Christoph Oelckers
e279214f5b - removed the hasglnodes variables.
Since the software renderer also requires GL nodes now this was always true.
2018-12-20 18:40:19 +01:00
Christoph Oelckers
0faa9111b9 - moved P_OpenMapData and related content out of p_setup.cpp. 2018-12-19 18:41:53 +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
Christoph Oelckers
796c0fe931 - fixed precaching to consider animations and switches 2018-12-10 01:13:44 +01:00
Christoph Oelckers
6faeadaceb - hardened the seg integrity checks against extremely broken mods.
Temple of the Lizardmen 3 has segs lumps in every level that seem to use a different data format and are completely unusable, up to triggering undefined behavior.
2018-12-03 18:10:36 +01:00
Christoph Oelckers
a5a9ab07af Merge branch 'master' into asmjit 2018-11-28 18:44:42 +01:00
Christoph Oelckers
9c398cd343 - fixed: P_Recalculate3DFloors may not be called before the vertex buffer has been set up.
Since this function creates dynamic copies for 3D floors that need to be split it requires the vertex buffer index to be set up.
In older versions this did not produce errors because there was a fallback render path that was less efficient.
Now with that fallback removed this resulted in temporary 3D floors being created without valid vertex data.
2018-11-28 18:42:37 +01:00
Christoph Oelckers
ad04001135 - fixed some issues with the bodyque and moved this variable into FLevelLocals
* it was never saved in savegames, leaving the state of dead bodies undefined
* it shouldn't be subjected to pointer substitution because all it contains is old dead bodies, not live ones.
2018-11-19 18:13:23 +01:00
Christoph Oelckers
a0a2230b92 - removed test code that was accidentally left in. 2018-11-11 21:50:33 +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
3448749de6 - replaced a few temporary allocations with TArray and added a few convenience loader functions for this.
Amazingly with today's optimizers this creates code which is just as good as doing it all manually with the added benefit of being safer.
2018-11-10 11:56:18 +01:00
Christoph Oelckers
625eb1e76a - FVertexBuilder's output looks correct now. 2018-11-05 21:11:54 +01:00