Commit graph

15026 commits

Author SHA1 Message Date
Christoph Oelckers
00fed23e5f - explicitly declare the constructor and destructor methods of FCheckPosition so that they get a working prototype. 2019-04-16 15:12:33 +02:00
Magnus Norddahl
48d211c79b - add .eh_frame generation code except for building the actual CIE and FDE instructions 2019-04-16 15:12:31 +02:00
Christoph Oelckers
d5f4f93dd2 - allocate storage for all of a function's return values 2019-04-16 14:58:41 +02:00
Christoph Oelckers
179f5720cd - moved the remaining exports from p_sectors.cpp to vmthunks.cpp 2019-04-16 14:58:39 +02:00
Magnus Norddahl
c8c671bbe0 - pass additional return values as the last args to a direct native call 2019-04-16 14:58:37 +02:00
Magnus Norddahl
0f27d0cd66 - use the OP_PARAM and OP_RESULT opcodes to build the function signature 2019-04-16 14:58:35 +02:00
Magnus Norddahl
4e5415d371 - fixed missing setRet call for REGT_POINTER return types 2019-04-16 14:58:34 +02:00
Magnus Norddahl
a557042bcc - fix compile error 2019-04-16 14:58:32 +02:00
Magnus Norddahl
7c75776273 - annotate which function we are calling for better dumpjit info 2019-04-16 14:58:30 +02:00
Magnus Norddahl
ee7d6abdd3 - move the jit runtime to its own file 2019-04-16 14:58:27 +02:00
Christoph Oelckers
f3171c95cc - fixed: Any direct native function may not use struct values as parameters, not even something as simple as an FName. 2019-04-16 14:58:25 +02:00
Christoph Oelckers
c0a26afab9 - free everything. 2019-04-16 14:58:24 +02:00
Christoph Oelckers
7c649a9f0c - delete JIT data when shutting down. 2019-04-16 14:58:21 +02:00
Magnus Norddahl
8fc8dee090 - fix: float constants got their move instructions inserted after the call instruction 2019-04-16 14:58:19 +02:00
Christoph Oelckers
29eee14549 - declare builtins as static. 2019-04-16 14:58:18 +02:00
Christoph Oelckers
3f1c7bdbe8 - added a direct native variant for A_PlaySound because this function is relatively easy to test. 2019-04-16 14:58:15 +02:00
Magnus Norddahl
6289e0ad3d - fix macro expansion error on gcc and clang 2019-04-16 12:41:21 +02:00
Christoph Oelckers
5efa21ad31 - finished adding direct native functions to vmthunks.cpp. 2019-04-16 12:40:48 +02:00
Christoph Oelckers
63575d22c0 - all sector exports done. 2019-04-16 12:40:46 +02:00
Christoph Oelckers
7f4ed65123 - another batch of direct native functions. 2019-04-16 12:40:43 +02:00
Christoph Oelckers
10588add9c - continued work on adding direct native support. 2019-04-16 12:40:40 +02:00
Christoph Oelckers
178c1a41a6 - moved VM thunks from p_sectors.cpp to a separate file and started adding direct native implementations.
For a few larger functions I took them out of sector_t and made them global functions to avoid creating more unnecessary stubs.

# Conflicts:
#	src/p_sectors.cpp
2019-04-16 12:37:04 +02:00
Christoph Oelckers
c01981d08a - define the built-in functions defined in codegen.cpp through the regular interface instead uf just hacking them into the symbol table with incompletely set up data.
- added direct native variants to these builtins and fixed problems with builtin processing.
2019-04-15 22:30:01 +02:00
Christoph Oelckers
20ec6ddce4 - removed AStateProvider from native code.
The only place still referencing it was CallStateChain, so this has been made a static function now instead of a class method.
2019-04-15 22:29:58 +02:00
Christoph Oelckers
376c47bef6 - fixed handling of dummy flags. 2019-04-15 22:29:55 +02:00
Christoph Oelckers
96e9dbd967 - removed all remaining native components of the weapon class. 2019-04-15 22:29:52 +02:00
Christoph Oelckers
d871072f28 - allow defining flags in the script declaration of a class and do that for Weapon. 2019-04-15 22:29:47 +02:00
Christoph Oelckers
309cc57504 - removed all direct access to AWeapon's members to prepare moving this class fully to the script side.
Disregarding UI-side and setup-related calls there's unfortunately still 6 places in the native game code which require direct access.
2019-04-15 22:29:43 +02:00
Christoph Oelckers
ce5792242c - moved the 'Finalize' methods back into a single function in the parser code.
It has been like this initially but was changed when ZDoom gained an overly complicated polymorphic class descriptor object that required a lot of support code. All these complications have long been removed but these methods remained. Since they prevent a class from being moved to the script side entirely they had to be removed.

This was the last major blocker to make Weapon a purely scripted class, the only remaining native method is Serialize which is of no concern for the coming work.
2019-04-15 22:29:39 +02:00
Christoph Oelckers
7caa6a922d - moved MarkPrecacheSounds completely to the script side and added native support to make this a usable feature.
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2019-04-15 22:29:35 +02:00
Christoph Oelckers
ac754b5e96 - some cleanup on the weapon slot interface.
This really shouldn't make any decisions from directly reading weapon class defaults.
2019-04-15 22:29:32 +02:00
Christoph Oelckers
f9dfdace16 - scriptified cht_Takeweaps. 2019-04-15 22:29:30 +02:00
Christoph Oelckers
dadf0394c0 - removed the less-parameters versions of P_SpawnPlayerMissile, because there was only one native call left to them. 2019-04-15 22:29:28 +02:00
Christoph Oelckers
94b0338c31 - scriptified ApplyKickback. 2019-04-15 22:29:26 +02:00
Christoph Oelckers
2145db9fbd - moved the kickback code in P_DamageMobj into a subfunction.
This is a first attempt to reduce the complexity of that 600+ lines monstrosity, and also a good first target for scriptification.
2019-04-15 22:29:24 +02:00
Christoph Oelckers
59bffe2f55 - scriptified A_WeaponReady and its subfunctions. 2019-04-15 22:29:22 +02:00
Christoph Oelckers
951ed466b3 - scriptified P_BobWeapon as a virtual function on PlayerPawn. 2019-04-15 22:29:19 +02:00
Christoph Oelckers
04cd432159 - a little bit of cleanup on some code that repeatedly accessed some fields in AWeapon and produced far too many search results when looking for this. 2019-04-15 22:29:17 +02:00
Christoph Oelckers
0515af2bd3 - removed the bot related properties from AWeapon.
This stuff is now kept locally in the bot code so that it doesn't infest the rest of the engine.
And please don't read the new botsupp.txt file as some new means to configure bots! This was merely done to get this data out of the way.
The bots are still broken beyond repair and virtually unusable, even if proper data is provided for all weapons.
2019-04-15 22:29:15 +02:00
Christoph Oelckers
d31f67cb43 - consolidated the 3 nearly identical code fragments handling the weapon's YAdjust for the different renderers into a utility function in DPSprite.
# Conflicts:
#	src/hwrenderer/scene/hw_weapon.cpp
#	src/polyrenderer/scene/poly_playersprite.cpp
#	src/swrenderer/things/r_playersprite.cpp
2019-04-15 22:07:45 +02:00
Christoph Oelckers
681009e1ea - exported the blood spawning part of P_LineAttack as a virtual ZScript function. 2019-04-15 21:59:08 +02:00
Christoph Oelckers
82ffdd5e6b - moved the weapon selection logic to PlayerPawn as overridable virtual functions. 2019-04-15 21:59:07 +02:00
Christoph Oelckers
af4c37471e - took the weapon selection logic out of the WeaponSlots data and blocked all direct access to the weapon slots internals
This seriously needs to be independent from the data store and better abstracted. More work to come to move this to its proper place.

# Conflicts:
#	src/g_inventory/a_pickups.cpp
2019-04-15 21:59:05 +02:00
Christoph Oelckers
27c67716df - change teleport freeze handling to a player property plus virtual override on PlayerPawn for increased configurability.
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2019-04-15 21:59:03 +02:00
Christoph Oelckers
7c1416cb6f - scriptified BecomeItem and BecomePickup
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2019-04-15 21:59:01 +02:00
Christoph Oelckers
08059f718b - scriptified FilterCoopRespawnInventory. 2019-04-15 21:59:00 +02:00
Christoph Oelckers
1ecada388c - scriptified some simple sound functions. 2019-04-15 21:58:58 +02:00
Christoph Oelckers
d123230fb1 - scriptified APlayerPawn::Die and fixed a few things I encountered while doing it. 2019-04-15 21:58:56 +02:00
Christoph Oelckers
0eec8b293a - scriptified ModifyDropAmount as a virtual function hierarchy for Inventory and children. 2019-04-15 21:58:54 +02:00
Christoph Oelckers
f1c7815b16 - scriptified A_Explode and relatives. 2019-04-15 21:58:52 +02:00