Commit graph

16356 commits

Author SHA1 Message Date
Christoph Oelckers
87859b2950 - add Level parameter to G_LeavingHub 2019-01-29 02:08:53 +01:00
Christoph Oelckers
f9239f6e0f - added a compiler-side workaround for the formerly static methods of FLevelLocals.
LevelLocals on the left side of.a function call will now always be remapped to 'Level', which will either remap to the same-named instance variable or the global deprecated one.

In a few degenerate cases where there is a conflicting local variable named 'level' it may error out but that is unavoidable here but this is very unlikely.
2019-01-29 02:04:31 +01:00
Christoph Oelckers
60873bc5d6 Moved the PointInSector functions into FLevelLocals 2019-01-29 01:30:41 +01:00
Christoph Oelckers
68667e5eaa - moved particle storage into FLevelLocals.
- moved parts of the render setup out of the separate render functions.

Things like particle and polyobject linking were duplicated several times for rendering different things in different renderers.
These things only need to be set up once before the renderer is started so it makes a lot more sense to consolidate them into one place outside the actual rendering code.
2019-01-29 01:09:02 +01:00
Christoph Oelckers
50d59e99cb - moved sound sequence head of list into FLevelLocals. 2019-01-28 23:53:40 +01:00
Christoph Oelckers
623330f938 - initial adjustments for P_Ticker. 2019-01-28 22:33:50 +01:00
Christoph Oelckers
befacddab4 - removed level references in p_trace.cpp. Also added a null check to the sector pointer of the LineTracer Trace function because a null pointer here would crash. 2019-01-28 22:19:09 +01:00
Christoph Oelckers
6312c44234 - removed the remaining level references from p_acs.cpp. 2019-01-28 22:04:33 +01:00
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
3721771934 - forgot to save this. 2019-01-28 18:44:42 +01:00
Christoph Oelckers
3c14a7db76 - use map time, not hub time for map actions. 2019-01-28 18:42:56 +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
6a43d6c7ff Merge remote-tracking branch 'origin/master' into new_level_refactor 2019-01-28 15:50:42 +01:00
Christoph Oelckers
44f622c644 - more XCode warnings fixed. 2019-01-28 15:41:52 +01:00
Christoph Oelckers
d1ca3ef994 - added braces as per XCode's suggestion. 2019-01-28 15:20:02 +01:00
Christoph Oelckers
1dc11c5032 - changed infighting check so that the static skill checker does not access the level
Instead the level needs to be queried now.
2019-01-28 14:31:23 +01:00
Christoph Oelckers
d0942bcb97 - moved FirstThinker function to FLevelLocals
Currently it is meaningless but that's where it should be later.
2019-01-28 14:06:19 +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
0ef0698d24 - use the proper level for setting up a hardware rendered scene.
The shader timer may be taken from the primary level for the entire scene, because it will always be the same for all levels in a set.
The camera textures need to be prepared for all levels.
2019-01-28 02:43:39 +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
64e9f7e43b - changemap must use the current UI level if the user wants to go to "*". 2019-01-28 02:08:49 +01:00
Christoph Oelckers
aee8851643 - fixed all the missed level references in the decal thinkers. 2019-01-28 02:07:46 +01:00
Christoph Oelckers
472a1118dd - had to move the tag manager. This somehow got skipped by the last commit. 2019-01-28 01:37:21 +01:00
Christoph Oelckers
7211c1db0f - give the tag manager a reference to the level.
This is needed for the compatibility search of the sector tag iterator which linearly searches the sector array.
2019-01-28 01:33:52 +01:00
Christoph Oelckers
a7746278a8 - a few remaining simple ones
This also removes a few pointless comments that popped up and consolidates setting a level's music into a subfuntion.
2019-01-28 01:25:52 +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
b4acb857ad - the final batch of easy level replacements.
What's left will require a bit more work...
2019-01-27 21:59:19 +01:00
Christoph Oelckers
11c453a71f - fix handling of the global script in FraggleScript.
Depending on serialization order is not a good idea here, so now it's no longer stored as a parent in the main level script but explicitly checked for when looking for a variable.
2019-01-27 21:03:25 +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
b4a95ccaa9 - roughly 50 more, mostly search and replace. 2019-01-27 19:16:14 +01:00
Christoph Oelckers
06ba8c4c00 - 50 more simple replacements of 'level' 2019-01-27 17:35:50 +01:00
Christoph Oelckers
8c542e9be8 - removed level references in the software renderers. 2019-01-27 17:21:36 +01:00
Christoph Oelckers
4f540c1703 - give the sector a level reference. 2019-01-27 17:12:03 +01:00
Christoph Oelckers
522cc855ad - a few more. 2019-01-27 16:59:50 +01:00
alexey.lysiuk
95679c36b2 - added virtual destructor to FDelayedCommand
src/c_dispatch.cpp:143:5: warning: delete called on 'FDelayedCommand' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
src/tarray.h:582:5: warning: delete called on 'FDelayedCommand' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
src/tarray.h:574:5: warning: delete called on 'FDelayedCommand' that is abstract but has non-virtual destructor [-Wdelete-non-virtual-dtor]
2019-01-27 17:38:10 +02:00
Christoph Oelckers
ae544fa21f - removed a few direct uses of TThinkerIterator. 2019-01-27 16:15:32 +01:00
Christoph Oelckers
c8cd11422a - translate UMAPINFO specials at execution time, not load time.
At load time the context for translation does not exist.
2019-01-27 16:09:05 +01:00
Christoph Oelckers
73696e2781 - handled most level references in actorinlines.h and p_mobj.cpp. 2019-01-27 16:08:22 +01:00
Christoph Oelckers
c94f0f47a2 - removed all remaining references to level and TThinkerIterator from p_floor.cpp, p_lights.cpp, p_pusher.cpp and p_scroll.cpp. 2019-01-27 15:02:37 +01:00
Christoph Oelckers
5aa379e50e - removed all remaining references to level and TThinkerIterator from p_enemy.cpp. 2019-01-27 14:53:08 +01:00
Christoph Oelckers
2ed2202caa - removed all remaining references to level and TThinkerIterator from p_enemy.cpp. 2019-01-27 14:49:51 +01:00
Christoph Oelckers
73ea59179c - fixed some deprecation warnings about 'level'. 2019-01-27 14:48:35 +01:00
Christoph Oelckers
84baa5bb4d - deprecated the global 'level' variable.
This will currently output 9 warnings for the UDMF property getters. To silence these a bit more work is needed.
2019-01-27 14:33:02 +01:00
Christoph Oelckers
e9954ee018 Merge branch 'master' into new_level_refactor 2019-01-27 14:08:23 +01:00
Christoph Oelckers
9bb4ea34e7 - fixed: When A_SpawnProjectile got fixed, this fix broke the old A_CustomMissile function because the added workaround was overlooked.
This now separates the code more clearly into the twp paths to make the differences easier to see and compare.
2019-01-27 14:00:23 +01:00
Christoph Oelckers
e7aa10b5c8 - changed thinker initialization to occur in a Construct function instead of the constructor itself.
This was done to ensure that this code only runs when the thinker itself is fully set up.
With a constructor there is no control about such things, if some common initialization needs to be done it has to be in the base constructor, but that makes the entire approach chosen here to ensure proper linking into the thinker chains impossible.
ZDoom originally did it that way, which resulted in a very inflexible system and required some awful hacks to let the serializer work with it - the corresponding bSerialOverride flag is now gone.

The only thinker class still having a constructor is DFraggleThinker, because it contains non-serializable data that needs to be initialized in a piece of code that always runs, regardless of whether the object is created explicitly or from a savegame.
2019-01-27 13:08:54 +01:00
Christoph Oelckers
22939aade7 Merge branch 'master' into new_level_refactor
# Conflicts:
#	src/c_dispatch.cpp
2019-01-27 10:26:23 +01:00
Christoph Oelckers
39f53a4de0 - took the delayed console command execution out of the thinker management.
Doing this intermingled with the thinkers is highly unsafe because there are absolutely no guarantees about order of execution.
Effectively it ran these commands right in the middle of the playsim which could cause all sorts of synchronization issues, because CCMDs are part of the UI, not the playsim.

- pass a const string to AddCommandString.

This function manipulated the input buffer, leading to all sorts of code contortions to make sure that the passed parameter is clean for that.
This function will now create a copy of the passed parameter which it can manipulate without complicating its calling code.

# Conflicts:
#	src/c_dispatch.cpp
2019-01-27 10:24:49 +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