Commit graph

128 commits

Author SHA1 Message Date
Rachael Alexanderson
0f0768652a - force player respawn to call up the player's default class settings before determining where to respawn the player 2020-05-07 04:33:28 -04:00
Christoph Oelckers
5d10d6c448 - directory structure cleanup.
The hwrenderer folder did not contain sufficient files anymore for such extensive subgrouping.
2020-04-29 17:36:58 +02:00
Christoph Oelckers
ba0b42465d - changed shadowmap setup so that the AABB tree is owned and controlled by the map, not the renderer.
Needed to properly separate game logic from backend implementation, the shadowmap had both in the same object thanks to the old setup.
2020-04-26 18:54:43 +02:00
hdr88
554eb1c813 Add current, max and average velocity as stat (#912)
* Add current, max and average velocity as stat
2019-08-28 20:33:07 +02:00
Christoph Oelckers
66db894866 - split off all music code from s_sound.cpp 2019-08-23 17:15:19 +02:00
Christoph Oelckers
3e99216967 - added option to print a map author's name on the summary screen
For now only with font-printed map names. Allowing this with titlepatches will require more work and an option to disable.
2019-08-02 09:11:40 +02:00
Christoph Oelckers
5da2ecda66 - fix the compat_pointonline flag. 2019-03-23 15:28:10 +01:00
Christoph Oelckers
6129f9a9cc - fixed a warning and set NOINITCALL for a few CVARs accessing the current level.
These inits are done at a time when the data isn't even initialized so they will get overwritten anyway.
2019-02-24 10:05:01 +01:00
Christoph Oelckers
ef3e5ef01e - moved a few parts from g_level.cpp to better fitting places. 2019-02-23 15:21:54 +01:00
Christoph Oelckers
af5a2fe522 - removed the ActiveSequences counter.
It was only used to avoid traversing the list if all sequences were paused which is an exceptional situation.
On the other hand, the way it counted was not correct so rather than fixing it it seemed more appropriate to remove it entirely.
2019-02-10 20:30:40 +01:00
Christoph Oelckers
449610496f - fixed: 'level.frozen' still needs to be writable and have an effect. 2019-02-08 20:04:45 +01:00
Christoph Oelckers
9f7fe203fc - had to fix a few things. 2019-02-02 17:29:13 +01:00
Christoph Oelckers
66eb4e5048 - separation of static and map-local event handlers into separate lists.
Having everything lumped together made this a maintenance hassle because it affected how the level has to be stored.
This hasn't been tested yet, so it may not work as intended!
2019-02-02 16:43:11 +01:00
Christoph Oelckers
8d83f03138 - changed the linedef translator into a struct and reorganized its storage to allow having different ones at the same time.
This was the last piece of data that couldn't be distinct for more than one level.
2019-02-02 01:22:12 +01:00
Christoph Oelckers
45dc9a7b47 - renamed the level variables.
currentUILevel is now primaryLevel.
For ZScript, currentVMLevel was added. This is also exported as 'level' and will change as needed.
This also means that no breaking deprecations will be needed in the future, because in order to sandbox a level only 4 variables need to be handled: level, players, playeringame and consoleplayer.
The remaining global variables are not relevant for the level state.

The static 'level' has been mostly removed from the code except some places that still need work.
2019-02-02 00:25:51 +01:00
Christoph Oelckers
6c006a5fbd - added the missing Level parameters to AActor::StaticSpawn and P_ExecuteSpecial.
I think these were the last two still missing it, all remaining uses of the global level variable are in code that doesn't get run through a level tick and are supposed to access the primary level.
2019-02-01 22:02:16 +01:00
Christoph Oelckers
d358e401ee - removed all access to the consoleplayer variable from the play code
There is one exception in ACS for a net arbitrator check.
Aside from this the bot_observer CVAR was also removed. This was never implemented properly and could stomp upon custom player settings.
2019-02-01 17:02:10 +01:00
Christoph Oelckers
64ac6dbc6e - moved thinker storage into FLevelLocals. 2019-01-30 19:09:21 +01:00
Christoph Oelckers
3b4ded5694 - refactored the thinker list.
This was an unorganized set of static members in DThinker but has now been regrouped into something more structured.
2019-01-30 02:15:48 +01:00
Christoph Oelckers
e30f116faf - moved bglobal into FLevelLocals
This is still all static data, only the location has changed, but none of the access.
2019-01-30 01:38:18 +01:00
Christoph Oelckers
8bbdee5c28 - redirect most references to the global players array through FLevelLocals.
The Map loader may not access any global state at all - everything it can touch must be exchangable.
Furthermore, if we want to sandbox each level, there may be no direct access to any kind of global state whatsoever from the play code.
2019-01-30 01:15:32 +01:00
Christoph Oelckers
ebdb2643c4 - moved UDMF custom properties into FLevelLocals. 2019-01-30 00:47:20 +01:00
Christoph Oelckers
78b7b64237 - replaced all TThinkerIterators except one that probably won't be relevant anymore as things progress. 2019-01-30 00:27:05 +01:00
Christoph Oelckers
4ad327d7e0 - moved G_ChangeLevel and other exit functions into FLevelLocals. 2019-01-29 23:45:14 +01:00
Christoph Oelckers
68fe5534a4 - moved the SectorMarker handling into the level itself. 2019-01-29 21:29:44 +01:00
Christoph Oelckers
ea849e5aca - split G_DoLoadLevel into a level specific and a global part. 2019-01-29 21:19:16 +01:00
Christoph Oelckers
1b37d85ac3 - removed a few missed references in FLevelLocals's member functions. 2019-01-29 20:15:06 +01:00
Christoph Oelckers
6451b7d592 - moved the combined compatibility flags into FLevelLocals. 2019-01-29 19:28:22 +01:00
Christoph Oelckers
4cb3ce8196 - StartTravel and EndTravel 2019-01-29 16:11:23 +01:00
Christoph Oelckers
3c565c9e86 - moved the static sky variables into FLevelLocals and removed the redundant ones for the texture ID. 2019-01-29 04:44:44 +01:00
Christoph Oelckers
932bbee928 - fixed some warnings 2019-01-29 02:16:36 +01:00
Christoph Oelckers
1d748b72a8 Split G_DoCompleted into a global part and a level specific part. 2019-01-29 02:39:14 +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
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
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
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
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
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
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