Commit graph

16215 commits

Author SHA1 Message Date
Christoph Oelckers
1b068a10c6 - fixed last PR.
The result of GetPointer must be null checked as well!
2019-01-07 01:09:57 +01:00
Chronos Ouroboros
3173644ddc Fixed some issues in the ZScript array compilation code. 2019-01-07 01:06:06 +01:00
Cacodemon345
7c573fe05a Move receiver NULL check above the orresult check (#695)
This is to prevent a VM abort from happening here if orresult is false.
2019-01-07 01:04:09 +01:00
Major Cooke
477a7c5aeb Fixed Thing_ProjectileAimed being broken.
- It was calling the fallback aiming in the wrong place when it should have been outside the speed check.
- Credit to _mental_ for the base code, but no gotos involved.
2019-01-07 01:03:08 +01:00
Christoph Oelckers
480dd347c9 - removed level references from p_mobj.cpp.
This time there was one important exported script function: Actor.Spawn.
Since this will require a level pointer in the new scheme of things the old version had to be deprecated, because it is static with no argument that allows retrieving the level. However, since this is probably one of the most widely used functions I added a workaround to let it continue to work if used from inside an actor class, which should constitute >95% of all uses. This required a little bit of hackery in the compiler backend to swap out the function if appropriate.
Aside from that there were 5 places in the internal ZScript that needed handling, which mostly consisted of making a formerly static internal function non-static.
2019-01-07 00:51:18 +01:00
Christoph Oelckers
7d060dc696 - converted a few more in various files. 2019-01-06 22:10:19 +01:00
Christoph Oelckers
6e1b46cda5 - po_man.cpp and p_lnspec.cpp done. 2019-01-06 20:23:03 +01:00
Christoph Oelckers
7f3caaf0ff - portal.cpp is almost free of access to the global level variable. 2019-01-06 17:06:40 +01:00
Christoph Oelckers
9b1870f71f - capitalization of 'level' in all places where no changes will be needed.
Mainly done so that searching for 'level.' returns less noise.
2019-01-06 14:38:51 +01:00
Christoph Oelckers
1aa24eae00 - do not use the global level variable in the status bar.
This now gets passed the level each time it is drawn.
2019-01-06 14:29:31 +01:00
Christoph Oelckers
141a7ff833 - pass level to FSSectorTagIterator as a parameter. 2019-01-06 13:47:24 +01:00
Christoph Oelckers
c7575828ae - check the shader timer only once per frame, not once per draw call. 2019-01-06 13:35:31 +01:00
Christoph Oelckers
b63ddc18b2 - all level references in the hardware renderer have been removed.
The camera to render from will now determine the level being rendered.
2019-01-06 13:17:45 +01:00
Christoph Oelckers
b81297a817 - major cleanup of p_scroll.cpp to eliminate the use of indices to access sidedefs and sectors. 2019-01-06 12:41:02 +01:00
Christoph Oelckers
f93eb1ca7f - removed all level references in p_spec.cpp. 2019-01-06 12:39:52 +01:00
Christoph Oelckers
55339761f6 - fixed serialization of ACS thinker. 2019-01-06 10:25:46 +01:00
Christoph Oelckers
a11eea98b5 - replaced some NULLs with nullptr. 2019-01-06 09:39:35 +01:00
Christoph Oelckers
8ead5a3a6b - pass level num to string locking functions as a parameter. 2019-01-06 09:37:11 +01:00
Christoph Oelckers
cf7ab6d085 - let level stats screen operate only on the data it got provided instead of getting the current level from global variables. 2019-01-06 09:03:58 +01:00
Christoph Oelckers
dca4a42dd6 - changed light mode handling of the hardware renderer so that it only operates on local copies but doesn't alter the level's setting.
There are several places where a temporary change of light mode is needed, all these made this change in the global level struct. Now the change is only local to the active draw info.
2019-01-06 09:00:52 +01:00
Christoph Oelckers
3328821a98 - pass 'level' as a parameter to AABBTree. Also renamed a few things to make the code easier to read. 2019-01-06 08:24:04 +01:00
Chronos Ouroboros
a0ce8f2988 Implemented compound initializers for arrays. 2019-01-06 00:46:56 +01:00
Christoph Oelckers
b445c6fabc - actually use the newly added indices. 2019-01-06 00:46:09 +01:00
Christoph Oelckers
8b18ed4759 - store the index of each map item in the struct itself and return that for the Index function.
If we ever want to refactor the global level data these must not reference the 'level' variable.
The main parts of the map loader cannot use this information, because it can only be created after running the node builder, so it got its own set of index functions instead.
2019-01-06 00:41:46 +01:00
Christoph Oelckers
c05968146e - starting to reduce references to global level variable. 2019-01-05 22:46:45 +01:00
Christoph Oelckers
6f6dc60e2b - moved the global ACS ActiveThinker variable into FLevelLocals. 2019-01-05 21:59:34 +01:00
Christoph Oelckers
b386a09358 - changed AFuncDesc initialization to avoid generating initializer functions.
Visual C++ will never statically initialize a class instance where a member field has a default value set, so the DEFINE_ACTION_FUNCTION variants without a direct native call need to be handled differently. The easiest way to do this is to leave out the nullptr default and omit the value in the initializer list. For trailing fields this will always get them nulled.
2019-01-05 20:48:22 +01:00
Player701
28531c3f8f - Fixed spawn height of projectiles created by SpawnPlayerMissile. 2019-01-05 18:19:51 +01:00
Christoph Oelckers
7b235ea13e - moved the per-level ACS state into FLevelLocals. 2019-01-05 18:19:35 +01:00
Christoph Oelckers
131eef9eb9 - converted the ACS Stringbuilder macros into inline functions. 2019-01-05 16:09:59 +01:00
Christoph Oelckers
c651045ed3 - let RunHealth clamping respect the newly added global properties. 2019-01-05 15:37:14 +01:00
Christoph Oelckers
639fb43682 -reordered sector_t so that the internal declarations are at the top, followed by the member variables and the methods.
Also tried to sort them by renderer use but that turned out to be without any performance effect, even though the struct is a bit better aligned now and several bytes shorter.
2019-01-05 13:27:32 +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
95995e4aa3 - use a local pointer to the current level in FraggleScript parser.
Just to test a few things.
2019-01-05 08:59:45 +01:00
Christoph Oelckers
86551e53df - bumped savegame version because the recent scriptification of APlayerPawn will render all old savegames unusable. 2019-01-05 08:52:21 +01:00
Christoph Oelckers
bfbf7ff9c9 - made forwardmove and sidemove defaults configurable through the gameinfo section. 2019-01-05 08:48:57 +01:00
Christoph Oelckers
d898cadda5 - fixed: Trying to remove the first item in an actor's inventory would lose all owned items. 2019-01-04 18:56:14 +01:00
Christoph Oelckers
b47a3804d2 - fixed delete calls on FDynamicLight.
This isn't allocated from the system heap so it cannot be freed by it.
2019-01-04 16:12:39 +01:00
Christoph Oelckers
980977d444 - fixed: GetSoundClass must be able to handle non-players. 2019-01-04 16:08:45 +01:00
Magnus Norddahl
f10ded756e - split shadowmap AABB tree into two parts. one for static and one for dynamic
- upload only the dynamic AABB subtree using glBufferSubData
- change internal raytracing stack limit from 16 to 32
- update shadowmap AABB tree after R_SetupFrame for proper frame interpolation
2019-01-04 15:51:59 +01:00
Magnus Norddahl
4f4d10ce5f - disable polyobj AABBTree updates 2019-01-04 13:56:36 +01:00
Christoph Oelckers
3b77e2db68 - fixed: The update check for a changed AABBTree was inverted. 2019-01-04 08:46:07 +01:00
Christoph Oelckers
9ba0e7b783 - fixed: The player sound lookup would fail if a sound was only available for the last gender in the list.
This is an ancient bug, but it never registered before - only after making 'other' the default gender for nonsense input it became apparent.
2019-01-04 00:32:47 +01:00
drfrag666
845141d9af - Default gender for sound classes should be male and not other since it could be undefined in SNDINFO. 2019-01-03 18:05:13 -05:00
Christoph Oelckers
f9ff097457 - fixed A_Chase default detection. 2019-01-03 23:43:15 +01:00
Christoph Oelckers
6d87716381 - fixed: G_StartTravel must remove all dynamic lights from the actors it is about to carry over to the next level. 2019-01-03 23:23:08 +01:00
Christoph Oelckers
9521b6cd1f - removed all remaining native parts of APlayerPawn.
Unlike the other classes, the places where variables from this class were accessed were quite scattered so there isn't much scriptified code. Instead, most of these places are now using the script variable access methods.
This was the last remaining subclass of AActor, meaning that class Actor can now be opened for user-side extensions.
2019-01-03 22:05:49 +01:00
Christoph Oelckers
c18e895272 - exported all native components of APlayerPawn.
Only the class definition itself remains and needs to be taken care of.
2019-01-03 18:01:58 +01:00