Commit graph

3128 commits

Author SHA1 Message Date
Christoph Oelckers
3b59afae31 - some progress. 2019-01-10 21:02:20 +01:00
Christoph Oelckers
f25397b391 - started building the framework to replace the global level variable
A few of the old level members will also be moved to the new class, now that workaround getters can be implemented.
These currently spit out some deprecation warnings which will be addressed next.
2019-01-10 19:46:51 +01:00
Marrub
5dbd81ea7f Make LevelLocals::ExecuteSpecial return int 2019-01-10 17:28:19 +01:00
Christoph Oelckers
ad17bce1f0 - use map time, not hub time for map actions. 2019-01-10 03:42:54 +01:00
Christoph Oelckers
72d09c0338 - the next batch of 'level' removals.
Untested, may not work!
2019-01-10 02:30:38 +01:00
Christoph Oelckers
80427b72e9 - made OP_NEW a builtin function instead of an opcode.
The code was present 3 times due to the JIt, and this is not something that benefits from being a real opcode, even in the interpreted case.
2019-01-10 02:12:43 +01:00
Christoph Oelckers
2aa9c065ac - added Level parameter to R/P_PointInSector(Sub)Sector. 2019-01-10 00:30:04 +01:00
Christoph Oelckers
0b2daaf20f - fixed bad variable name. 2019-01-09 20:48:16 +01:00
Christoph Oelckers
4227b9020c - moved bglobal.freeze to FLevelLocals, because this flag has nothing specific to do with bots as it freezes the entire level. 2019-01-09 18:59:41 +01:00
Christoph Oelckers
0ed856fbd4 - moved the TIDHash array to FLevelLocals and adjusted the actor iterator code. 2019-01-09 01:42:25 +01:00
Christoph Oelckers
6b9641d673 - moved the tag manager into FLevelLocals.
This also involves deprecating the old creation functions because they do not have a proper level context.
2019-01-08 23:39:48 +01:00
Christoph Oelckers
e91971964f - another large batch of level references removed. 2019-01-08 20:40:43 +01:00
Christoph Oelckers
48fa938b10 - Gave DThinker a Level field and replaced all uses of the placeholer __GetLevel function.
Thinkers are always part of a level if they are linked and active, so this reference needs to be kept so that a thinker can unlink itself on destruction.
2019-01-08 01:57:26 +01:00
Christoph Oelckers
8dabd2961d Merge branch 'master' of https://github.com/coelckers/gzdoom 2019-01-08 01:19:26 +01:00
Christoph Oelckers
f251e341a8 - continued with the 'level' eradication. 2019-01-07 20:50:34 +01:00
Christoph Oelckers
aac7657fb1 - P_Ticker handled
It may be a bit tricky to separate per-session and per-level actions here - for now only the sound resuming has been moved because that cannot be done per level.
2019-01-07 17:33:17 +01:00
Christoph Oelckers
1b068a10c6 - fixed last PR.
The result of GetPointer must be null checked as well!
2019-01-07 01:09:57 +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
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
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
f93eb1ca7f - removed all level references in p_spec.cpp. 2019-01-06 12:39:52 +01:00
Christoph Oelckers
c651045ed3 - let RunHealth clamping respect the newly added global properties. 2019-01-05 15:37:14 +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
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
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
Christoph Oelckers
f9ff097457 - fixed A_Chase default detection. 2019-01-03 23:43:15 +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
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
c753d59a72 - scriptified A_SkullPop and ObtainInventory.
These were the last relevant items to access PlayerPawn.InvFirst.
2019-01-03 00:35:56 +01:00
Christoph Oelckers
6eb8ded471 - made ColorRangeStart and ColorRangeEnd meta properties of APlayerPawn.
These are only used during initialization and they should have been readonly from the start.
2019-01-02 22:13:57 +01:00
Christoph Oelckers
bc47fdfa78 - scriptified useflechette CCMD's item finding code. 2019-01-02 11:58:26 +01:00
Marrub
3e3d21cd35 Fix A_CustomBulletAttack's spawnofs_xy parameter
The current behaviour offsets to the front of the actor rather than the side, due to an oversight in the code, which oddly is not present in the A_FireBullets equivalent.
2019-01-02 08:13:53 +01:00
Christoph Oelckers
dc612703d5 - scriptified the declaration of AmbientSound
Most of the code is still native, but this means that PlayerPawn is the last remaining child of AActor.
2019-01-02 01:05:20 +01:00
Player701
68091db598 - Since GetParentAmmo is now virtual, BackpackItem and the "give ammo" cheat should call GetParentAmmo to determine base ammo classes. 2019-01-01 22:00:35 +01:00
Christoph Oelckers
d654e02dea - rewrote dynamic lights to not use actors for the internal representation and made DynamicLight a purely scripted class.
This should be less of a drag on the playsim than having each light a separate actor. A quick check with ZDCMP2 showed that the light processing time was reduced to 1/3rd from 0.5 ms to 0.17 ms per tic.
It's also one native actor class less.
2019-01-01 19:35:55 +01:00
alexey.lysiuk
99479d84b1 - fixed everlasting fast projectile after hitting ceiling
Without the test for ceiling hit fast projectile could enter its Death state every tick infinitely

https://forum.zdoom.org/viewtopic.php?t=63023
2019-01-01 08:14:28 +01:00
Christoph Oelckers
0b2a919bbe - fixed crash in AutoUseStrifeHealth
The loop never checked if the item was still valid and would continue to try to use it, even after it was removed from the inventory and destroyed.
As native code this just failed silently, but with the VM it needs to be explicitly checked.
2018-12-31 19:03:02 +01:00
Major Cooke
8d9d71f55f - Fixed: SXF_CLEARCALLERSPECIAL cleared the spawned actor's special instead of the caller. 2018-12-30 19:01:31 +01:00
alexey.lysiuk
36896a1224 - fixed ammo check for weapon with 'uses both' flags
https://forum.zdoom.org/viewtopic.php?t=63047
2018-12-29 13:36:10 +02:00
alexey.lysiuk
8e684f9687 - fixed missing attack sound in A_CustomPunch
See 7bb3855439/src/p_actionfunctions.cpp (L1729)

https://forum.zdoom.org/viewtopic.php?t=63049
2018-12-29 12:34:38 +02:00