Commit graph

301 commits

Author SHA1 Message Date
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
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
ddab2c3e78 - removed the playernum parameter from CheckLocalView
This was always used with 'consoleplayer' which really is the only thing making sense here. But this is a part of the global state which should be avoided in play code.

In particular, this makes no real sense in case of secondary maps where it should always return false.
2019-01-31 03:29:25 +01:00
Christoph Oelckers
aa340145ac - moved the remaining thinker code to g_shared 2019-01-31 02:51:07 +01:00
Christoph Oelckers
4ad327d7e0 - moved G_ChangeLevel and other exit functions into FLevelLocals. 2019-01-29 23:45:14 +01:00
Christoph Oelckers
de1b89707d Handle level in block iterators.
The scripted interface isn't done yet.
2019-01-29 03:26:22 +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
06ba8c4c00 - 50 more simple replacements of 'level' 2019-01-27 17:35:50 +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
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
ba114f6f23 - give the hardware renderer's drawinfo its own level pointer 2019-01-25 01:26:16 +01:00
Christoph Oelckers
4d55c28b60 - moved a large batch of code from p_spec.cpp and a few other files into the maploader folder. 2019-01-24 20:27:34 +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
65750bd7bf Wrap all iterator calls in the map loader into FLevelLocals methods.
This should later be done for everything else as well, but the map loader should really be free of global dependencies ASAP.

Also replace TThinkerIterator<AActor> with FThinkerIterator globally because this only adds pointless type checks - with all actor subclasses being scripted this class has become redundant.
2019-01-24 00:43:43 +01:00
Christoph Oelckers
85b5f8d0a0 - moved several setup methods into the map loader
Code hasn't been moved yet, this only changes the declarations.
2019-01-24 00:22:18 +01:00
Christoph Oelckers
ac7a9183aa - re-applied the changes for p_spec.cpp
This is mostly map loader code which really should not operate on the global level.
2019-01-24 00:02:51 +01:00
alexey.lysiuk
11958b713e - fixed many compilation errors with GCC and Clang 2019-01-23 20:45:01 +01:00
Christoph Oelckers
4de649d4d1 - major cleanup of p_scroll.cpp to eliminate the use of indices to access sidedefs and sectors. 2019-01-23 20:39:38 +01:00
Christoph Oelckers
7b235ea13e - moved the per-level ACS state into FLevelLocals. 2019-01-05 18:19:35 +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
6c9d0b166a Added direct native entry points to a larger number of functions. 2018-12-05 17:34:11 +01:00
Christoph Oelckers
9348baeeb1 Removed all remaining references to AInventory
What remains is the class definition and one single reference that will be scriptified.
2018-12-04 17:11:36 +01:00
Christoph Oelckers
94ed30e782 - removed the default parameter handling from all native script functions because it is no longer needed. 2018-11-17 10:03:40 +01:00
Marisa Kirisame
477cf23fd2 Adds "OnGiveSecret" virtual function on Actor for customizing behavior of secret finding. 2018-06-05 10:06:53 -04: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
3c49804c6c - some Transfer_Heights related optimizations.
* only call hw_CheckViewArea if the result is not known yet.
* check the map up front if it even contains heightsecs. This allows to shortcut the above check entirely for maps without sector transfers and will allow further optimizations.
2018-05-01 09:02:24 +02:00
alexey.lysiuk
2ae8d39441 Removed all superfluous #include's
Automatically optimized by CLion IDE with manual corrections
2018-04-24 14:30:35 +03:00
alexey.lysiuk
ba4cc1a6ca Added activation type to WorldLine(Pre)Activated events
https://forum.zdoom.org/viewtopic.php?t=60232
2018-04-14 11:52:09 +03:00
Marisa Kirisame
8ff81c93e8 Fix building on GCC7. 2018-04-08 21:53:20 +02:00
Marisa Kirisame
08f3afab0b Separated P_ActivateLine ZScript export into two functions, one with and one without a vector parameter. 2018-04-08 21:53:20 +02:00
Marisa Kirisame
5d0ff4c8ba Exports P_ActivateLine to ZScript (along with constants for activation type) 2018-04-08 21:53:20 +02:00
Marisa Kirisame
0656916bf2 Add WorldLinePreActivated to override line activation, as a counterpart to WorldLineActivated. 2018-03-24 16:30:49 +01:00
Marisa Kirisame
69c6e95b08 Add worldlineactivated event, triggered after successful line activation. 2018-03-24 10:23:31 +01:00
alexey.lysiuk
69e7bb57d4 Fixed VM abort with null activator for SecretTrigger object
https://forum.zdoom.org/viewtopic.php?t=57612
2017-08-19 11:19:29 +03:00
alexey.lysiuk
54abe5f5d4 Fixed handling of default arguments in Actor.GiveSecret() 2017-08-18 11:22:18 +03:00
Christoph Oelckers
96d328de9b - removed all Doom Source license and all default Raven copyright headers and replaced them with GPLv3. Also fixed the license in a few other files.
For some files that had the Doom Source license attached but saw heavy external contributions over the years I added a special note to license all original ZDoom code under BSD.
2017-04-17 13:33:19 +02:00
Christoph Oelckers
33ee761b37 - fixed: The timing of Heretic's lava damage was not correct. 2017-04-17 10:10:09 +02:00
Christoph Oelckers
cd180d29c7 - block direct use of 'new' for DObjects.
This is to ensure that the Class pointer can be set right on creation. ZDoom had always depended on handling this lazily which poses some problems for the VM.
So now there is a variadic Create<classtype> function taking care of that, but to ensure that it gets used, direct access to the new operator has been blocked.

This also neccessitated making DArgs a regular object because they get created before the type system is up. Since the few uses of DArgs are easily controllable this wasn't a big issue.

- did a bit of optimization on the bots' decision making whether to pick up a health item or not.
2017-04-14 13:31:58 +02:00
Christoph Oelckers
6599e2c425 - moved the VM types into their own file and only include it where really needed. 2017-04-13 01:12:04 +02:00
Christoph Oelckers
4ed5b91b0f - added a few missing includes which were not triggered as error in a debug build. 2017-03-10 09:57:10 +01:00
Christoph Oelckers
ad41b23506 - replaced the homegrown integer types in all p* sources and headers. 2017-03-08 18:55:52 +01:00
Christoph Oelckers
8dac678200 - added DAMAGE_NO_ARMOR flag for ACS's SectorDamage function. 2017-02-25 19:10:49 +01:00
ZZYZX
09ca1f610d Removed World*Unsafe handlers (merged with WorldLoaded/WorldUnloading); Removed the concept of 'map-local static' handlers, static handlers are now only those that run globally. 2017-01-30 07:50:09 +02:00
ZZYZX
3e093a20ff First take at serialization 2017-01-24 00:17:12 +02:00
ZZYZX
efb1e5d33a Implemented global EventHandlers in MAPINFO 2017-01-23 20:48:57 +02:00
ZZYZX
35ec14f465 Made the EventHandler class tree a bit more branchy. Now disallowing creation of Static* via EventHandler.Create. 2017-01-23 20:48:57 +02:00
Christoph Oelckers
616f954153 - scriptified PowerIronFeet and PowerMask. 2017-01-16 19:04:03 +01:00