Commit graph

248 commits

Author SHA1 Message Date
Christoph Oelckers
0b36beb10d serialize the remap data of custom translations defined at run time. 2023-11-19 12:44:22 +01:00
Christoph Oelckers
bdee1f3d34 added per-sector sky UDMF properties.
(Hardware rendering only, the SW renderer is not in a state where this is easily done.)
2023-10-29 17:49:59 +01:00
Christoph Oelckers
12bc9db609 hooked up the per-level colormaps with the hardware renderer. 2023-10-29 08:13:01 +01:00
Professor Hastig
f92f6b8de4 added wall texture skewing.
This uses the same UDMF properties as Eternity recently introduced for the same feature.
2023-10-20 08:23:56 +02:00
Christoph Oelckers
7a5a2858a2 yet even more GetChars calls added. 2023-10-07 23:29:24 +02:00
nashmuhandes
be2616ca97 Fix missing serialization of LevelLocals' flags3 2023-07-15 20:05:39 +02:00
Shiny Metagross
6d00e4a3f3 Finished serializing
- Implemented an FString TArray which goes into save files that saves a model file and path, and when the game is loaded, spits back out the model to be Loaded when loading a save file
2022-07-22 17:11:59 +02:00
Christoph Oelckers
a25ba16755 - don't move bad polyobjects in the savegame loader. 2022-04-15 22:41:55 +02:00
Christoph Oelckers
c4ed0cefde - MBF21: implemented new line flags.
While 'block players' was just a simple remap, 'block land monsters' required quite a bit of work...
This also fixes the bug that BLOCK_FLOATERS was never checked for sliding against a wall.
2021-06-28 20:17:08 +02:00
nashmuhandes
16b0dd2fe8 Fix random crash when travelling between hub maps in multiplayer. 2021-03-05 10:56:51 +01:00
Christoph Oelckers
668ebd9be1 - immediately abort loading a savegame if object deserialization fails.
If the loader is allowed to go on, these objects will be linked into game structures and may do unpredictable things before the loader has a chance to abort at the end.
2020-09-26 20:36:10 +02:00
Christoph Oelckers
7b292cca57 - split the serializer in two to keep the Doom specific parts out of the main file. 2020-04-11 20:20:53 +02:00
Christoph Oelckers
f74efcf721 - split the TObjPtr serializers into a separate file to avoid polluting everything that needs to use the serializer.
To use these it is necessary to include dobject.h and all its dependencies, so this should not be done unless necessary.
2020-04-11 20:20:53 +02:00
Christoph Oelckers
cf757ba834 - made the translation container a class.
This also splits off some Doom-specific implementation details into higher level headers.
2020-04-11 14:00:11 +02:00
Christoph Oelckers
d00ad60437 - fixed a few issues pointed out by the assert in the TArray [] operator. 2020-04-11 14:00:10 +02:00
Christoph Oelckers
5865c4dcca - use FString to manage strings in bot code. 2020-04-11 14:00:07 +02:00
Christoph Oelckers
9b9fd35107 - hooked up the colorization feature.
It can now be used from UDMF and ZScript.
To avoid clutter it doesn't allow setting the values individually but requires definition of a data record in TEXTURES.

colorization
{
    DesaturationFactor <float>
    Invert
    AddColor <color>
    ModulateColor <color>
    BlendColor <color>, <mode> [, <alpha>]
}

Mode for BlendColor can be Alpha (normal translucent blending), as well as 3 special values taken from Build engine games: Screen, Overlay and HardLight.
2019-12-29 11:30:37 +01:00
Christoph Oelckers
bb8db9422f - scaled down the texture colorization feature for easier usability.
It makes little sense exposing every minute detail of this through UDMF.
Setting it up that way is far too complicated. Using virtual textures that map to a real texture plus a colorization record should be far easier to use by mappers.
This also doesn't piggyback on the Doom64 color feature anymore and is completely separate, despite some redundancies.
This is still missing the texture definition part, though.
2019-12-20 22:25:10 +01:00
Christoph Oelckers
3a249cb06f - added high level interface to the new properties, i.e. UDMF and ZScript. 2019-12-20 18:02:42 +01:00
Christoph Oelckers
66db894866 - split off all music code from s_sound.cpp 2019-08-23 17:15:19 +02:00
Christoph Oelckers
7346288bf5 - moved some more files. 2019-07-14 21:09:49 +02:00
Christoph Oelckers
0b09c2b20a - do not call OnRegister when saving a game. 2019-04-06 09:29:49 +02:00
Christoph Oelckers
8a243cf084 - fixed: Sound sequences must be serialized after the sounds.
Otherwise their data gets reset by the sound initialization.
2019-03-30 18:41:38 +01:00
Christoph Oelckers
0422f40d80 - restored calling OnRegister for event handlers after loading a savegame
It should be said in no uncertain terms that OnRegister operates on an uninitialized level so it should only be used for setting up the registering process of the event handler itself and nothing else - not even the event handler's data!!!
2019-03-26 17:02:40 +01:00
Christoph Oelckers
3698a5edc1 - replaced the assignment operator in player_t with a named function.
This didn't behave like an assignment operator so it shouldn't be one, especially since the two places where it got called need different functionality.
2019-03-03 12:12:17 +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
97e3e858a1 - re-count impact decals each time a savegame is loaded.
This counter is not always reliable, especially when running for longer periods, so putting it in a savegame is not a good idea.
2019-02-07 09:39:36 +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
484485f3cf - made the event manager an object so it can be instantiated multiple times. 2019-02-02 10:46:34 +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
202f3d7d80 - changed most places where a player index is calculated by subtracting the player array's base access. 2019-02-01 17:31:11 +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
f6a91e1722 - moved the I_Error prototypes to doomerrors.h to avoid having to include the low level system header for this. 2019-01-31 19:38:04 +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
f410762695 - missed two lines. 2019-01-30 00:29:42 +01:00
Christoph Oelckers
6451b7d592 - moved the combined compatibility flags into FLevelLocals. 2019-01-29 19:28:22 +01:00
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
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
50d59e99cb - moved sound sequence head of list into FLevelLocals. 2019-01-28 23:53:40 +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
41e576bbb5 - removed the intermediate P_SpawnPlayer inline 2019-01-28 03:02:25 +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
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
9b1b6db85d - added a pseudo-serializer for FLevelLocals pointers.
This doesn't really write out any info for the pointer, if the level does not match it just errors out.
This is both for quick detection of badly used level data and for automatic restoring of the pointer from the serializer's working level.

This also removed the temporary workarounds in DAutomap and DLevelScript to restore these pointers when a savegame is loaded.
2019-01-26 21:23:19 +01:00
Christoph Oelckers
e5139cc325 - moved all EV_Light* functions and G_SerializeLevel into FLevelLocals 2019-01-26 17:55:15 +01:00