Commit graph

16307 commits

Author SHA1 Message Date
Chronos Ouroboros
4fdcc47edc Added support for implicitly-sized initialized arrays.
Also fixed dynamic arrays not being cleared before initializing.
2019-01-23 20:43:46 +01:00
Christoph Oelckers
a1ae01e392 - fixed last PR.
The result of GetPointer must be null checked as well!
2019-01-23 20:43:23 +01:00
Chronos Ouroboros
7c91b27463 Fixed some issues in the ZScript array compilation code. 2019-01-23 20:43:06 +01:00
Cacodemon345
70a07e154c 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-23 20:42:41 +01:00
Major Cooke
7666997580 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-23 20:42:17 +01:00
Christoph Oelckers
83ce72db48 - check the shader timer only once per frame, not once per draw call. 2019-01-23 20:40:17 +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
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
Christoph Oelckers
3314a1efe5 - scriptified the remaining PlayerPawn methods. 2019-01-03 14:35:17 +01:00
Christoph Oelckers
2258a71c36 - took several methods out of the native PlayerPawn implementation, either by scriptification or moving them to other places. 2019-01-03 13:59:46 +01:00
alexey.lysiuk
4cc78c3273 - fixed compilation warning with GCC and Clang
src/hwrenderer/dynlights/hw_aabbtree.cpp:143:24: warning: comparison of integers of different signs: 'const int' and 'unsigned int' [-Wsign-compare]
2019-01-03 14:24:09 +02:00
Christoph Oelckers
23146f1af2 - scriptified PlayerPawn.ResetAirSupply. 2019-01-03 13:04:48 +01:00
Christoph Oelckers
badacbb968 - scriptified APlayerPawn's DamageFade handling. 2019-01-03 12:47:34 +01:00
Christoph Oelckers
2bd72478ee - scriptified P_CalcHeight.
This was the only code using the ViewBob member variable.
This also moves the range check for this variable to its application, because a badly behaved mod can just as easily change it at run time instead of just setting an absurdly large value in the class definition.
2019-01-03 11:57:20 +01:00
Christoph Oelckers
9e5c5b68c5 - did some more lightening on the PlayerPawn class. 4 more properties and one native member function have been handled. 2019-01-03 10:06:45 +01:00
Christoph Oelckers
8da1b5c1b0 - properly handle passing of the light flags.
Since these can be changed on the placed light actor they have to be read from there, so this is now a pointer in FDynamicLight, just like the other properties that can be user-changed.
Also did some cleanup on the interface so that external code doesn't need to dereference the lightflags pointer but can use utility functions for all flags.
2019-01-03 09:24:22 +01:00