Commit graph

15031 commits

Author SHA1 Message Date
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
Christoph Oelckers
e234d450aa - scriptified GetDefaultInventory. 2019-04-15 21:58:50 +02:00
Christoph Oelckers
864796a6a2 - removed MeleeWeapon flag from the tomed PhoenixRod and the fighterhammer.
In both cases, having this flag on will render the monster-backing-off-check for melee attacks ineffective because it would misinterpret these weapons as close range only - which they aren't. Even for the PhoenixRod the range is longer than what gets checked here.
As a consequence, the bot's check for missile shooting melee weapons has also become pointless because no such weapon is defined anymore.
2019-04-15 21:58:48 +02:00
Christoph Oelckers
beae232f83 - exported one FraggleScript function for testing. 2019-04-15 21:58:46 +02:00
Christoph Oelckers
c326c4c521 - exported a few more weapon handling functions so that the native GetDownState stub could be removed. 2019-04-15 21:58:45 +02:00
Christoph Oelckers
53b41cf32f - let player_t::Resurrect use P_BringUpWeapon to raise the weapon again instead of doing it directly.
This seems a bit safer.
2019-04-15 21:58:43 +02:00
Christoph Oelckers
c1442fae0d - scriptified P_BringUpWeapon because this was the only native function still referencing AWeapon::GetReadyState. 2019-04-15 21:58:41 +02:00
Christoph Oelckers
8c2c888d82 - scriptified A_SpawnItem(Ex) and A_ThrowGrenade.
These were the last native functions referencing AWeapon::DepleteAmmo, so that function is now exclusively on the scripting side.
2019-04-15 21:58:39 +02:00
Christoph Oelckers
1b225588d1 - scriptified 3 more functions in stateprovider. 2019-04-15 21:58:37 +02:00
Christoph Oelckers
05e8a6c62d - scriptified A_RailAttack. 2019-04-15 21:58:35 +02:00
Christoph Oelckers
394d8e414f - scriptified A_CustomPunch 2019-04-15 21:58:33 +02:00
Christoph Oelckers
54ba5b4829 - scriptified A_FireProjectile 2019-04-15 21:58:31 +02:00
Christoph Oelckers
d99b46c861 - scriptified A_FireBullets and A_CustomBulletAttack. 2019-04-15 21:58:30 +02:00
Christoph Oelckers
f794cab92f - deleted redundant native ActivateMorphWeapon method. 2019-04-15 21:58:28 +02:00
Christoph Oelckers
4c7096ffac - started with a ScriptUtil class which will allow moving function implementations for ACS and FraggleScript to zscript.txt
So far 3 functions for testing implemented.

# Conflicts:
#	src/p_acs.cpp
2019-04-15 21:58:26 +02:00
Christoph Oelckers
1b6af10f38 - scriptified Weapon.CheckAmmo and Weapon.DepleteAmmo 2019-04-15 21:56:30 +02:00
Christoph Oelckers
9e6279ed5b - scriptified the rest of the morph code. 2019-04-15 21:56:28 +02:00
Christoph Oelckers
5f5410e35f - fixed: Since out types cannot be marked as such in a function prototype (as it'd cause parameter mismatches in the resolving pass) it is necessary to check the argflags as well when determining the register type. 2019-04-15 21:56:26 +02:00
Christoph Oelckers
b886219f53 - scriptified P_MorphMonster. 2019-04-15 21:56:23 +02:00
Christoph Oelckers
d4ff49e110 - fixed message output. 2019-04-15 21:56:22 +02:00
Christoph Oelckers
02f785f794 - testing and cleanup of scripted morph code. 2019-04-15 21:56:20 +02:00
Christoph Oelckers
9b1e96262c - P_UndoPlayerMorph scriptified.
Not tested yet and still missing a new native interface.
2019-04-15 21:56:18 +02:00
Christoph Oelckers
395413fc9a - scriptified P_MorphPlayer and dependencies.
It still needs its counterpart scriptified as well before it can work.

# Conflicts:
#	src/gi.cpp
#	wadsrc/static/zscript/base.txt
2019-04-15 21:56:16 +02:00
Christoph Oelckers
8669dbdcfe - removed test and debug code.
# Conflicts:
#	src/gl/scene/gl_scenedrawer.h
2019-04-15 21:50:57 +02:00
drfrag
60e667f732 - Fixed compilation. 2019-04-15 21:48:55 +02:00
Magnus Norddahl
5f7aeb3186 - fix missing include statement 2019-04-15 16:09:14 +02:00
Christoph Oelckers
1fd23f5228 - fixed initialization of default parameters in dynamically created function calls like in the MENUDEF parser 2019-04-15 16:09:13 +02:00
Magnus Norddahl
31f524fd6b - inline VBTL opcode
- remove old META and CLSS implementations
2019-04-15 16:09:11 +02:00
Magnus Norddahl
d4e3bee7c6 - add return type to CreateFuncSignature 2019-04-15 16:09:10 +02:00
Magnus Norddahl
1aebbfb3b5 - fix typo 2019-04-15 16:09:08 +02:00
Magnus Norddahl
815b7d8b7e - add support in the jit compiler to do direct native calls using the x64 calling convention 2019-04-15 16:09:07 +02:00
Christoph Oelckers
f00892e06d - exported ADecal to ZScript as a non-native class.
Its one function is still native but this was by far the easiest of the remaining actor classes to export.
2019-04-15 16:09:05 +02:00
Christoph Oelckers
cc8e390dce removed the quite redundant GetStateForButtonName function
Since it forwards directly to FindState and has no script bindings there is no need to keep it, it'd only complicate the full scriptification of the weapon class if it stuck around.
2019-04-15 16:09:04 +02:00
Christoph Oelckers
95767fb63a - fixed some issues with the bodyque and moved this variable into FLevelLocals
* it was never saved in savegames, leaving the state of dead bodies undefined
* it shouldn't be subjected to pointer substitution because all it contains is old dead bodies, not live ones.

# Conflicts:
#	src/r_data/r_translate.cpp
2019-04-15 16:08:18 +02:00
Christoph Oelckers
edfe8b36c6 - cleaned up the PointerSubstitution code
Since the only thing it gets used for is swapping out PlayerPawns it can safely skip all global variables that never point to a live player, which allowed to remove quite a bit of code here that stood in the way of scriptifying more content
2019-04-15 16:06:22 +02:00
Christoph Oelckers
f2fe079ddb - fixed the reginfo checks for the Draw... functions.
They need to be offset by the same amount as the arguments so that the values are properly matched.

# Conflicts:
#	src/v_draw.cpp
2019-04-15 16:03:51 +02:00
Christoph Oelckers
5e63252fdc - moved the type infomation entirely out of VMValue.
For the varargs functions that used the Type field to validate their parameters, now a hidden additional argument is passed which contains a byte array with the type info for the current call's arguments. Since this is static per call location it can be better prepared once when the code is being compiled instead of being put in a runtime created array for each invocation. Everything else uses the per-function instance of the same data.

The only thing that still needed the type field with a VMValue is the defaults array, so this uses a different struct type now to store its data.

# Conflicts:
#	src/v_draw.cpp
2019-04-15 16:02:17 +02:00
Christoph Oelckers
cb9c1f021c - generate register type info for the parameter lists of all functions.
Currently used for loading parameters into registers.
For checking parameters of native functions some more work is needed to get the info to the function. Currently it doesn't receive the function descriptor.
2019-04-15 15:52:22 +02:00
Magnus Norddahl
a277137d85 - add missing CheckVMFrame call 2019-04-15 15:52:21 +02:00
Magnus Norddahl
0fe213765b - only allocate stack space for vmframe and call returns when we need them 2019-04-15 15:52:20 +02:00
Magnus Norddahl
03258d1334 - improve dumpjit output slightly 2019-04-15 15:52:19 +02:00
Magnus Norddahl
ec3b491f19 - don't emit VMValue.Type information when we know the receiver isn't going to read it anyway 2019-04-15 15:52:18 +02:00
Magnus Norddahl
fe64de28d4 - delay emitting PARAM and VTBL instructions until CALL/CALL_K 2019-04-15 15:52:16 +02:00
alexey.lysiuk
5d0bf48e22 - use custom offsetof() macro
src/scripting/vm/jit_call.cpp:164:38: warning: offset of on non-standard-layout type 'VMScriptFunction' [-Winvalid-offsetof]
src/scripting/vm/jit_load.cpp:87:50: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof]
src/scripting/vm/jit_load.cpp:96:50: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof]
src/scripting/vm/jit_load.cpp:257:53: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof]
2019-04-15 15:52:15 +02:00
alexey.lysiuk
4edcb06a9d - fixed compilation of POSIX targets
src/scripting/backend/vmbuilder.h:169:19: error: no member named 'function' in namespace 'std'
2019-04-15 15:52:14 +02:00
Christoph Oelckers
b33fd19fa2 - missed one OP_RESULT. 2019-04-15 15:52:13 +02:00