Commit graph

15370 commits

Author SHA1 Message Date
Christoph Oelckers
cf4f573a25 - more direct native entry points.
- disallow bool as a return value for direct native calls because it only sets the lowest 8 bits of the return register.
- changed return type for several functions from bool to int where the return type was the only thing blocking use as direct native call.
2019-04-17 17:27:39 +02:00
Christoph Oelckers
082cb5b656 - scriptified P_CheckMeleeRange2. 2019-04-17 16:24:10 +02:00
Christoph Oelckers
c054389345 - fixed: Direct native functions for the JIT compiler may not return bool.
A bool will only set the al register on x64, but the entire eax needs to be set for the JIT code to deal with it.
2019-04-17 16:24:07 +02:00
Christoph Oelckers
15ab1fb09b - deprecated a few functions that depend on AAPTR_* to be useful.
- fixed wrong name for the LineAttack action function.
2019-04-17 16:24:05 +02:00
alexey.lysiuk
3252390642 - fixed linking of optimized targets
CMakeFiles/zdoom.dir/r_utility.cpp.o: In function `R_SetupFrame(FRenderViewpoint&, FViewWindow&, AActor*)':
/home/travis/build/coelckers/gzdoom/src/r_utility.cpp:832: undefined reference to `AActor::GetCameraHeight() const'
CMakeFiles/zdoom.dir/g_shared/a_action.cpp.o: In function `A_Unblock(AActor*, bool)':
/home/travis/build/coelckers/gzdoom/src/g_shared/a_action.cpp:64: undefined reference to `AActor::GetDropItems() const'
2019-04-17 15:11:26 +02:00
Christoph Oelckers
61b91f4897 - fix it 2019-04-17 15:11:24 +02:00
Christoph Oelckers
792aaa5b88 Added direct native entry points to a larger number of functions.
# Conflicts:
#	src/scripting/vmthunks_actors.cpp
2019-04-17 15:11:22 +02:00
alexey.lysiuk
ab111aa034 - fixed linking of optimized POSIX targets
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_Distance2DSquared(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x6ab): undefined reference to `AActor::PosRelative(AActor const*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_Distance3DSquared(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x75f): undefined reference to `AActor::PosRelative(AActor const*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_Vec3To(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x850): undefined reference to `AActor::PosRelative(AActor const*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_Vec2To(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x930): undefined reference to `AActor::PosRelative(AActor const*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_DistanceBySpeed(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0xa00): undefined reference to `AActor::PosRelative(AActor const*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o:vmthunks_actors.cpp:(.text+0xad3): more undefined references to `AActor::PosRelative(AActor const*) const' follow
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_PosRelative(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x1200): undefined reference to `AActor::PosRelative(sector_t*) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_ClearInterpolation(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x127d): undefined reference to `AActor::ClearInterpolation()'
vmthunks_actors.cpp:(.text+0x1298): undefined reference to `AActor::ClearInterpolation()'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_GetBobOffset(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x135a): undefined reference to `AActor::GetBobOffset(double) const'
CMakeFiles/zdoom.dir/scripting/vmthunks_actors.cpp.o: In function `AF_AActor_Distance2D(VMValue*, int, VMReturn*, int)':
vmthunks_actors.cpp:(.text+0x222b): undefined reference to `AActor::PosRelative(AActor const*) const'
2019-04-17 15:11:18 +02:00
Christoph Oelckers
c0c5df0e6e - fixed: ST_FormatMapName did not clear the string it wrote to before appending text. 2019-04-17 15:11:17 +02:00
Christoph Oelckers
22b8bdc02d fixed missing include. 2019-04-17 15:11:15 +02:00
Christoph Oelckers
1fce3298ba - fixed definition of GetUDMFString export. 2019-04-17 15:11:14 +02:00
Christoph Oelckers
77e60865a0 - fixed: SlotPriority must be a float.
It was a fixed before but I missed that when refactoring it into an automatic property.
2019-04-17 15:11:12 +02:00
Rachael Alexanderson
a4e09f1947 - Enforce CheckCheatmode() for cheat-enforced CVARs, allowing them to be changed in normal single player games 2019-04-17 15:11:11 +02:00
drfrag
a235d23c94 - Missing include. 2019-04-17 15:10:11 +02:00
Christoph Oelckers
a5e16e3261 - moved a large part of the VM thunks out of p_mobj.cpp. 2019-04-17 14:55:58 +02:00
Christoph Oelckers
1e4c22f8d4 - more direct native entry points. 2019-04-17 14:55:56 +02:00
Christoph Oelckers
3fb3831843 - fixed: SBar_SetClipRect had a superfluous argument resulting in incorrect behavior 2019-04-17 14:32:19 +02:00
Christoph Oelckers
89e6c400af - missed the header... 2019-04-17 14:32:17 +02:00
Christoph Oelckers
93dedcfd4b - the native APlayerPawn::PlayAttacking2 function is not needed anymore. 2019-04-17 14:32:16 +02:00
Christoph Oelckers
54d1ee2244 - fix bad return type. 2019-04-17 14:32:14 +02:00
Christoph Oelckers
d52889e71e - handle JIT errors in a more user-friendly fashion than aborting.
* use I_Error instead of I_FatalError to abort. I_FatalError is only for things that are not recoverable and should not be handled outside of error cleanup and rethrowing.
* only catch CRecoverableError in JitCompile. Everything else should fall through to the outermost catch block.
* Do not I_FatalError out after handling the exception locally. Just print an error and return null, indicating failure.
2019-04-17 14:32:12 +02:00
Christoph Oelckers
f22aaca74d - scriptified ASpecialSpot.
This only had two simple native methods so the class is not fully scripted.
2019-04-17 14:32:10 +02:00
Christoph Oelckers
92b245d220 - treat REGT_STRING | REGT_ADDROF just like REGT_STRING for direct native functions.
Both pass a reference so there's no need to treat them differently.
2019-04-17 14:32:08 +02:00
Christoph Oelckers
044b635a26 - more direct native function calls. 2019-04-17 14:32:06 +02:00
drfrag
03853930aa - Fixed compilation. 2019-04-17 12:21:08 +02:00
Christoph Oelckers
c87724ef0a Removed all native components from AInventory. 2019-04-16 23:57:22 +02:00
Christoph Oelckers
d40de21bae - scriptified A_SpawnSingleItem, which was the last piece of native code still referencing AInventory 2019-04-16 23:57:19 +02:00
Christoph Oelckers
558c9b48de - scriptified A_SelectWeapon and inlined the last remaining use of APlayerPawn::SelectWeapon. 2019-04-16 23:57:17 +02:00
Christoph Oelckers
d2225040ea - scriptified A_SelectWeapon 2019-04-16 23:57:15 +02:00
Christoph Oelckers
b8e1218645 Removed all remaining references to AInventory
What remains is the class definition and one single reference that will be scriptified.
2019-04-16 23:57:12 +02:00
Christoph Oelckers
b762c0f49c Removed more literal references to AInventory.
# Conflicts:
#	src/hwrenderer/scene/hw_drawinfo.cpp
#	src/v_draw.cpp
2019-04-16 23:57:07 +02:00
Christoph Oelckers
d173ad753f - started removing literal references of AInventory, so far only simple stuff. 2019-04-16 23:57:02 +02:00
drfrag666
ab5e5e0389 - The GetBlend script call is needed in another place as well.
# Conflicts:
#	src/gl/scene/gl_scene.cpp
2019-04-16 22:09:46 +02:00
Christoph Oelckers
e969e8a86b - moved the GetBlend script call to the one single place where it is needed to get rid of one native AInventory method.
# Conflicts:
#	src/g_inventory/a_pickups.cpp
#	src/g_inventory/a_pickups.h
#	src/hwrenderer/scene/hw_drawinfo.cpp
2019-04-16 22:01:08 +02:00
Christoph Oelckers
36af613dfa - The 'A' prefix has no meaning in class names on the script side - even in comments. 2019-04-16 22:01:06 +02:00
Christoph Oelckers
fa2e2e78b4 - removed all direct access to AInventory's members.
We are getting closer to make class Inventory fully scripted.
2019-04-16 22:01:04 +02:00
Magnus Norddahl
c8b5276981 - gcc/clang didn't like having this in a class 2019-04-16 22:01:01 +02:00
Christoph Oelckers
318a9d7893 - fixed max. ammo display on AltHud. 2019-04-16 22:00:59 +02:00
Magnus Norddahl
82a0acbc19 - add bool and unsigned int to the allowed types
- fix one case where floats were used (the JIT always calls with doubles)
2019-04-16 22:00:57 +02:00
Magnus Norddahl
89fd819926 - perform compile time validation of direct native function signatures 2019-04-16 22:00:55 +02:00
Magnus Norddahl
9e432c0c9f - fix VM native calls containing strings and enable them again 2019-04-16 22:00:53 +02:00
Magnus Norddahl
6090e5ec24 - fix compile error 2019-04-16 22:00:50 +02:00
Magnus Norddahl
cd03a487fe - GetInventoryIcon must return an integer for it to work for VM native calls 2019-04-16 22:00:48 +02:00
Christoph Oelckers
a42ece4fb4 - added missing min/max unsigned instructions for the VM. 2019-04-16 22:00:46 +02:00
Rachael Alexanderson
b7d22e2b1e - always apply vid_scalefactor now, even when vid_scalemode is not 0 or 1.
# Conflicts:
#	src/r_videoscale.cpp
2019-04-16 21:57:07 +02:00
Christoph Oelckers
e176410ab6 - fixed crash with weapons which remove themselves from the inventory but continue calling action functions.
This is still an error, so now this throws a meaningful exception.
2019-04-16 21:53:00 +02:00
Christoph Oelckers
d8d52f67b4 - hardened the seg integrity checks against extremely broken mods.
Temple of the Lizardmen 3 has segs lumps in every level that seem to use a different data format and are completely unusable, up to triggering undefined behavior.
2019-04-16 21:52:58 +02:00
Christoph Oelckers
59e0871f00 - fixed: The static variant of PClass::FindFunction may only be used for actual static variables. 2019-04-16 21:52:56 +02:00
Christoph Oelckers
c0686309fc - removed all direct references of AInventory::Owner and AInventory::Amount from the C++ code. 2019-04-16 21:52:53 +02:00
Marisa Kirisame
739999b5ed Fix RemoveInventory not calling DetachFromOwner when an item is the first in the owner's inventory.
Fix CheckAddToSlots not working because it uses GetReplacement incorrectly.
2019-04-16 21:52:50 +02:00