Commit graph

13787 commits

Author SHA1 Message Date
Christoph Oelckers
a9ad3a1e52 - fixed two broken ScriptUtil calls in FraggleScript. 2019-04-18 13:14:51 +02:00
Christoph Oelckers
e87d04d843 - added a 'forceworldpanning' map flag.
Since unfortunately this cannot be set as a general default, let's at least make it as easy as possible to disable that panning+scaling madness without having to edit the texture data.

# Conflicts:
#	src/swrenderer/textures/r_swtexture.h
#	src/textures/texture.cpp

# Conflicts:
#	src/textures/texture.cpp
2019-04-18 13:14:32 +02:00
Christoph Oelckers
c0e9530fd0 - fixed: The light defaults were not fully deleted on an engine restart. 2019-04-18 13:12:55 +02:00
Christoph Oelckers
7e2540732d - store UnchangedSpriteNames in Dehacked in a less hacky manner. 2019-04-18 13:12:53 +02:00
Christoph Oelckers
71e77defa3 - use a TArray to store the particles and remove all 16 bit global variables.
This means one less exit function to deal with - and these days 16 bit variables are a pointless attempt at saving space.
2019-04-18 13:12:51 +02:00
Christoph Oelckers
cee9f52f2f - improved error reporting for badly defined translations.
This needs to be handled by the caller for all use cases because the translation parser lacks the context to do a proper error report.

# Conflicts:
#	src/textures/multipatchtexture.cpp
2019-04-18 13:07:39 +02:00
Christoph Oelckers
ce6b24308e - fixed: sidedef-less GLWalls may not apply per-sidedef render properties.
These always come from open-sector render hacks where the renderer tries to fill in some gaps

# Conflicts:
#	src/hwrenderer/scene/hw_walls.cpp

# Conflicts:
#	src/gl/scene/gl_walls_draw.cpp
2019-04-18 13:05:44 +02:00
Christoph Oelckers
988e8042bb - two more places where explicit allocations could be replaced. 2019-04-18 13:02:23 +02:00
Christoph Oelckers
d4611683a6 - let FxNop have a value type, even if it's just TypeError. 2019-04-18 13:02:21 +02:00
Magnus Norddahl
bafc5e6a3c - add vanilla lightmode that behaves exactly as Doom's original light did
# Conflicts:
#	src/hwrenderer/scene/hw_drawinfo.cpp
#	src/hwrenderer/scene/hw_renderstate.cpp
#	src/hwrenderer/scene/hw_renderstate.h
#	src/hwrenderer/scene/hw_skyportal.cpp
#	src/hwrenderer/scene/hw_weapon.cpp

# Conflicts:
#	src/g_level.cpp
#	src/gl/compatibility/gl_20.cpp
#	src/gl/renderer/gl_lightdata.cpp
#	src/gl/renderer/gl_renderstate.h
#	src/gl/scene/gl_skydome.cpp
#	src/gl/scene/gl_weapon.cpp
#	src/hwrenderer/scene/hw_weapon.cpp
#	src/hwrenderer/utility/hw_lighting.cpp
2019-04-18 12:50:03 +02:00
Rachael Alexanderson
f442d4bd54 - split gl_texture_hqresize into two variables - one for mode, one for multiplier.
# Conflicts:
#	src/textures/hires/hqresize.cpp

# Conflicts:
#	src/gl/textures/gl_hqresize.cpp
#	src/r_videoscale.cpp
2019-04-17 21:04:41 +02:00
Rachael Alexanderson
301246236c - added normal5x and normal6x 2019-04-17 20:59:20 +02:00
drfrag
96f996d8aa Revert "Revert "- update xBRZ upscaler to version 1.6""
This reverts commit 285791622d.

# Conflicts:
#	src/gl/textures/gl_hqresize.cpp
#	wadsrc/static/menudef.txt

Goodbye to TDM-GCC.
2019-04-17 20:33:41 +02:00
Christoph Oelckers
c47549c009 - code simplification. 2019-04-17 20:00:29 +02:00
Christoph Oelckers
4cdfd7ff33 - fixed incorrect alignment of scaled world panned textures combined with per-sidedef scaling in the hardware renderer
This particular case incorrectly factored in the sidedef's scaling factor for how to calculate the offset.
Fortunately this is a very rare case - a quick check yielded no maps depending on it.
Should any map surface that depends on this bug a compatibility option may be needed but it doesn't seem likely that this may be the case.
2019-04-17 20:00:28 +02:00
alexey.lysiuk
a93807833a - disable music playback if WinMM stream cannot be opened
https://forum.zdoom.org/viewtopic.php?t=62888
2019-04-17 19:59:16 +02:00
alexey.lysiuk
ec432beea0 - print VM stack trace on startup abort exception
https://forum.zdoom.org/viewtopic.php?t=62650
2019-04-17 19:57:22 +02:00
Christoph Oelckers
3a3ae0bcd5 - fixed deprecation warnings for member functions not checking the version. 2019-04-17 19:44:10 +02:00
Christoph Oelckers
8ad73d32b8 - fixed: The JIT compiler crashed on missing ArgFlags.
For ad-hoc Dehacked state functions no ArgFlags are created, in this case they can just be assumed to not be relevant here, because none of these function produces reference arguments.
2019-04-17 19:44:07 +02:00
alexey.lysiuk
e6590f6ad9 - fixed return value of native call to dynamic array's Reserve()
https://forum.zdoom.org/viewtopic.php?t=62841
2019-04-17 19:44:05 +02:00
alexey.lysiuk
c4aa2c5e46 - server CVARs can be changed only by settings controller
Initially, settings controller flag was false by default
It was not touched during construction and destruction of player_t instances though
Now, with all members initialized in class definition, this flag must be saved and restored manually

https://forum.zdoom.org/viewtopic.php?t=62830
2019-04-17 19:44:04 +02:00
Magnus Norddahl
e4502de60b - workaround pointer truncation bug in asmjit 2019-04-17 19:44:02 +02:00
alexey.lysiuk
651dce449a - removed erroneous assertion
https://forum.zdoom.org/viewtopic.php?t=62815
2019-04-17 19:44:00 +02:00
alexey.lysiuk
9b49c6777d - fixed Actor.A_StopSound() native call
Wrong function overload was selected by compiler

https://forum.zdoom.org/viewtopic.php?t=62820
2019-04-17 18:44:14 +02:00
Magnus Norddahl
60a35e0bb3 - moved argsCache out of JitCompiler::CreateFuncSignature 2019-04-17 18:44:12 +02:00
Christoph Oelckers
10aea91745 - don't put mutexes into static local variables.
Their initialization semantics are not safe for synchronization objects.
2019-04-17 18:44:08 +02:00
Christoph Oelckers
da8686813d - fixed crash with FraggleScript in Nimrod MAP02. 2019-04-17 18:40:00 +02:00
alexey.lysiuk
84c7a810b1 - fixed broken Z coordinate in Actor.Vec3Angle() native call 2019-04-17 18:39:56 +02:00
alexey.lysiuk
7ba1e5945f - fixed native calls to LevelLocals.GetUDMF*() functions
https://forum.zdoom.org/viewtopic.php?t=62774
2019-04-17 18:39:53 +02:00
Christoph Oelckers
c90e4b773a - this "genuine hack" was totally redundant... 2019-04-17 17:44:07 +02:00
Christoph Oelckers
a6ff1637df - more direct native stuff, this is a week old but was almost forgotten.
# Conflicts:
#	src/hwrenderer/postprocessing/hw_postprocessshader.cpp
2019-04-17 17:42:24 +02:00
Christoph Oelckers
013040eacd - missed one definition for adding a direct native call. 2019-04-17 17:27:42 +02:00
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
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
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
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
Christoph Oelckers
fc341c901f - fixed issues with Dehacked's ad-hoc script code generation
* The functions had no prototype and caused crashes.
* even after creating a prototype it didn't work because CreateAnonymousFunction was set up incorrectly for the case where a known return type was given.
2019-04-16 21:52:47 +02:00
drfrag
48c2f6451e - disable alpha test on models if the renderstyle isn't STYLE_Normal
- compare against the thing renderstyle since the local copy has been modified
(patches by dpJudas)
2019-04-16 21:51:19 +02:00
Christoph Oelckers
ba0e19f2a2 - made the BUddha checks readable again. 2019-04-16 21:34:55 +02:00
Christoph Oelckers
dc29eee077 - fixed compile warning 2019-04-16 21:34:53 +02:00
Christoph Oelckers
0a36ad0182 - removed assert that got triggered in an edge case that must pass here. 2019-04-16 21:34:51 +02:00
Christoph Oelckers
1bfa1fd5a6 - implemented missing 'exact' parameter for ThinkerIterator.Next. 2019-04-16 21:34:49 +02:00
Christoph Oelckers
5043106e97 - started replacing direct references to class AInventory.
The easiest part was the type checks which could be changed to the name variant with a global search and replace.

# Conflicts:
#	src/hwrenderer/scene/hw_sprites.cpp

# Conflicts:
#	src/hwrenderer/scene/hw_sprites.cpp
2019-04-16 21:34:23 +02:00
Major Cooke
4e8d88f7df - fixed: P_PoisonPlayer and P_PoisonDamage did not check for NODAMAGE.
- fixed: P_PoisonDamage's check for Buddha2 and the Buddha powerup were inverted.
- fixed: P_PoisonDamage checked the modified damage instead of the raw, allowing amplifiers to boost the damage beyond telefrag and circumventing regular buddha.
2019-04-16 21:28:39 +02:00
Christoph Oelckers
9f2b62c99c - scriptified AInventory::Tick.
This was the last bit of code standing in the way of making AInventory a fully scripted class.
All that's left to sort out is some variable accesses - the vast majority of them in SBARINFO.
2019-04-16 21:28:37 +02:00
Magnus Norddahl
abc4406d18 - ptest is a SSE 4.1 instruction 2019-04-16 21:28:35 +02:00
Christoph Oelckers
bdd6d31a63 - scriptified the AutoUseHealth feature.
This again is a piece of code that reads and even writes to inventory items' properties, so better have it on the script side.
2019-04-16 21:28:34 +02:00
Christoph Oelckers
80e3ce735b - scriptified the decision making of the invuseall CCMD.
Custom items had no way to adjust to this - and it also was the last native access to ItemFlags.
2019-04-16 21:28:32 +02:00
Christoph Oelckers
9ff5257ce9 - scriptified P_DropItem. 2019-04-16 21:28:30 +02:00
Christoph Oelckers
17862639a1 - scriptified the no-spawn flag check for armor and health items. 2019-04-16 21:28:29 +02:00
Christoph Oelckers
e9dd8f3e4f - consolidated the check for "is actor an owned inventory item" into a subfunction.
This check occured 9 times in the source, better have it only once.
2019-04-16 21:28:26 +02:00
Christoph Oelckers
e8a6f82682 - scriptified G_PlayerFinishLevel.
Outside of SBARINFO this was the biggest remaining piece of code that referenced AInventory internals.
2019-04-16 21:28:24 +02:00
Christoph Oelckers
9315a217b3 - scriptified AActor::ClearInventory 2019-04-16 21:28:21 +02:00
Christoph Oelckers
a2ffe6327b - took the last methods aside from Tick and Serialize out of AInventory.
# Conflicts:
#	src/g_inventory/a_pickups.cpp
#	src/g_inventory/a_pickups.h
2019-04-16 21:28:19 +02:00
drfrag
8ef732704c - Missing include. 2019-04-16 19:55:28 +02:00
Christoph Oelckers
a1615457ac - properly hook up the alt HUD with the status bar.
# Conflicts:
#	src/d_main.cpp
2019-04-16 19:09:14 +02:00
Christoph Oelckers
0d8975ed31 - scriptified the last components of the alternative HUD.
- moved the ALTHUDCF parser PClass::StaticInit, so that it gets done right after creating the actor definitions.

All left to do is not to reallocate the AltHud object for each frame but store it in a better suited place.

# Conflicts:
#	src/d_main.cpp

# Conflicts:
#	src/info.cpp
2019-04-16 19:03:43 +02:00
Christoph Oelckers
376266b6a0 - scriptified the main drawer for the in-game HUD and removed all intermediate VM calls from the native source. 2019-04-16 19:02:01 +02:00
Christoph Oelckers
9d8dd5c529 - scriptified the AltHUD'S powerup drawer. 2019-04-16 19:01:55 +02:00
Christoph Oelckers
f509fdfdaa - scriptified and cleaned up the AltHUD's DrawCoordinates, DrawTime and DrawLatency functions.
Some backing functionality was moved elsewhere because scripting should not have access to low level system information.
2019-04-16 19:01:53 +02:00
Christoph Oelckers
eb07b8e543 - scriptified the AltHUD's inventory drawer and fixed the InvPrev CCMD. 2019-04-16 19:01:51 +02:00
Christoph Oelckers
e0915877b4 - scriptified the AltHUD's weapon drawer. 2019-04-16 19:01:50 +02:00
Christoph Oelckers
045d6d4355 - added the missing TNT1A0 check for icon-less keys.
Since it tries to get the icon from the spawn state it also has to check if that actually has a valid sprite.
2019-04-16 19:01:48 +02:00
Christoph Oelckers
437c72a089 - AltHUD ammo drawer scriptified. 2019-04-16 19:01:46 +02:00
Christoph Oelckers
cbb92af1db - allow %*d etc. format specifiers in ZScript, but only for numeric types. 2019-04-16 19:01:45 +02:00
Christoph Oelckers
1033dc3b10 - Alt HUD scriptification, part 1. 2019-04-16 19:01:43 +02:00
Magnus Norddahl
08f415bad9 - don't use SSE for integer min/max 2019-04-16 18:46:09 +02:00
Magnus Norddahl
1e533d726c - Use SSE2 for min/max instead 2019-04-16 18:46:07 +02:00
Christoph Oelckers
ca67327d1c - this was wrong... 2019-04-16 18:46:01 +02:00
Christoph Oelckers
ff9eaed1ba - fixed script call in PickNewWeapon. 2019-04-16 18:45:58 +02:00
Christoph Oelckers
53c1614a51 - fixed: P_Massacre without a class restriction no longer worked. 2019-04-16 18:45:56 +02:00
Christoph Oelckers
d18ed18d2e - scriptified invnext and invprev CCMDs. 2019-04-16 18:45:54 +02:00
Christoph Oelckers
081d0bbcca - moved ValidateInvFirst to the script side because this was one of the major functions that directly reference AInventory. 2019-04-16 18:45:52 +02:00
Christoph Oelckers
d021d63d33 - moved AInventory::DoRespawn fully to the script side. 2019-04-16 18:45:49 +02:00
Christoph Oelckers
a7909c16e5 - made CallTryPickup a global function.
This one still gets called in too many places but stands in the way of moving Inventory fully to the script side.
2019-04-16 18:45:47 +02:00
Christoph Oelckers
9981674a27 - re-fixed the massacre fix for Dehacked-modified inventory items.
Instead of overriding the Massacre method it is preferable to clear the flags causing the bad behavior, most notably ISMONSTER.

# Conflicts:
#	src/g_inventory/a_pickups.cpp
#	src/g_inventory/a_pickups.h
2019-04-16 18:45:43 +02:00
Christoph Oelckers
be8d1c950d - scriptified GiveAmmo and the one remaining piece of native code still using it. 2019-04-16 18:45:41 +02:00
Christoph Oelckers
f1bf1cc44e - scriptified DropInventory. 2019-04-16 18:45:38 +02:00
Christoph Oelckers
a614f2a81e - scriptified UseInventory and several functions using the already scriptified ones,
# Conflicts:
#	src/g_statusbar/sbar.h
2019-04-16 18:45:36 +02:00
Christoph Oelckers
e7c798f58f - scriptified TakeInventory, including the ACS/FS interfaces. 2019-04-16 18:45:03 +02:00
Christoph Oelckers
390f8ef209 - code consolidation in invnext and invprev. 2019-04-16 18:45:01 +02:00
Christoph Oelckers
d2741813ab - scriptified RemoveInventory and Inventory.OnDestroy. 2019-04-16 18:44:59 +02:00
Christoph Oelckers
8609e2ba68 - scriptified GiveInventory and made the interface a bit more configurable by mods.
Now a child type can decide for itself how to treat 'amount'.
The scripting interfaces to this function in ACS and FraggleScript have been consolidated and also scriptified.
2019-04-16 18:44:56 +02:00
Christoph Oelckers
2a192cde92 - scriptified AddInventory. 2019-04-16 18:44:53 +02:00
Christoph Oelckers
de6916756b - disabled direct native functions for now until the problems with string arguments are fixed. 2019-04-16 18:44:50 +02:00
Christoph Oelckers
057604a7b1 - added direct native variants to nearly all status bar function.
I skipped ValidateInvFirst because that one will have to be scriptified soon.
2019-04-16 18:44:49 +02:00
Magnus Norddahl
b6737c0cd3 - minor code cleanup now that it is working 2019-04-16 18:18:30 +02:00
Christoph Oelckers
712b85fc61 - removed the no longer needed exception prevention hack.
# Conflicts:
#	src/scripting/vm/vmframe.cpp

# Conflicts:
#	src/scripting/vm/vmframe.cpp
2019-04-16 18:18:16 +02:00
Christoph Oelckers
fc4b757b17 - fixed: V_FindFontColor is not suitable for direct calls from JIT code, thanks to its FName parameter. 2019-04-16 18:17:32 +02:00
Christoph Oelckers
4049b56d50 - a bit of code reordering for adding direct native entry points.
- offloaded key list generation for alternative HUD to non-UI parts.

This change also revealed a problem with handling empty sprites in the key list so this got fixed, too.

# Conflicts:
#	src/g_shared/shared_hud.cpp
2019-04-16 18:17:05 +02:00
Magnus Norddahl
c84f13829f - fix augmentation length bug 2019-04-16 18:14:40 +02:00
Magnus Norddahl
4393684831 - unwind data is now working on macOS 2019-04-16 18:14:39 +02:00
Christoph Oelckers
56228a853b - moved all exports from class Font to vmthunks.cpp and gave them direct native entrypoints.
- changed PARAM_STRING to use the passed string by reference instead of by value. The 3 instances where passing by value was needed now use PARAM_STRING_VAL.

# Conflicts:
#	src/v_video.h
2019-04-16 18:14:09 +02:00
Christoph Oelckers
798cebf891 - fixed character to int conversion for UTF8-characters. 2019-04-16 17:43:33 +02:00
alexey.lysiuk
e9daf31b23 - previous fix attempts done right
# Conflicts:
#	src/m_cheat.cpp
2019-04-16 17:43:23 +02:00
SanyaWaffles
a00a567532 Attempts to fix errors introduced by merging of asmjit branch and wea… (#649)
* Attempts to fix errors introduced by merging of asmjit branch and weapons scripting branch

* This didn't work. The others should work though.

* fix scriptutil.cpp:(.text+0x18d): undefined reference to `PClass::FindActor(FName)'

* Attempt to fix compilation on macOS

# Conflicts:
#	src/m_cheat.cpp
2019-04-16 17:42:13 +02:00
Magnus Norddahl
0746784965 - implemented unwind data on Unix - does it work? no idea, there's no easy way to tell when the debugger doesn't support the interface.. 2019-04-16 17:40:48 +02:00
Christoph Oelckers
f2ac0f4c53 - removed the longjmp based exception catch/rethrow mechanism and instead force-terminate in case a user exception is thrown while the VM is executing JITed code on a non-Windows system
On Windows none of this is needed, because we can generate a proper unwind frame for the JITed functions, but even on Linux, it would require manual additions to each single piece of native code that ever gets called from inside a JIT compiled function.
This is an utterly prohibitive proposition because it makes direct native calls a virtual impossibility
So, in order to get the thrown error properly presented both I_Error and ThrowAbortException will now forward to I_FatalError if it is called from inside a JIT context.

# Conflicts:
#	src/scripting/vm/vmframe.cpp
2019-04-16 17:32:32 +02:00
Christoph Oelckers
bd4e41d6cb -add a dummy definition for vm_jit in 32 bit. 2019-04-16 17:28:36 +02:00
Christoph Oelckers
a7913e9ba9 - fixed: the direct native GetTextureSize used the wrong calling convention. 2019-04-16 17:28:35 +02:00
Player701
e5fa48ae79 - Added a flag to make bouncing objects disappear when hitting sky surfaces 2019-04-16 17:28:33 +02:00
Christoph Oelckers
5c91df5c73 - let FOBJModel::ParseVector actually use its templated size parameter
In this setup the array can be statically updated because the size is always constant per instantiation
2019-04-16 17:28:31 +02:00
Christoph Oelckers
94424aeed8 - Changed a few allocations into usin TArrays
S_SoundCurve in particular looked like a candidate for leaking memory.
2019-04-16 17:28:30 +02:00
drfrag
999f6f6920 - Fixed warning. 2019-04-16 17:25:08 +02:00
Magnus Norddahl
7c1730f221 - fix native call crash and assertion error 2019-04-16 17:14:31 +02:00
Magnus Norddahl
f65b7fb1be - hook up unix unwind info (still not working) 2019-04-16 17:14:30 +02:00
Magnus Norddahl
d65298e929 - fix WriteSLEB128 2019-04-16 17:14:28 +02:00
Magnus Norddahl
14bb291901 - fix compile errors 2019-04-16 17:14:26 +02:00
Magnus Norddahl
fd0104bc71 - implemented unwind info for Linux and macOS - now to fix the bugs that cannot be fixed when the documentation is as useless as it is for those platforms.. 2019-04-16 17:14:25 +02:00
Christoph Oelckers
2f68a0681d - fixed code generation for dummy results. 2019-04-16 17:10:39 +02:00
Christoph Oelckers
ebf368ffc6 - fixed compilation warnings. 2019-04-16 17:10:35 +02:00
Christoph Oelckers
4bffe69912 - direct native methods for dynamic arrays. 2019-04-16 17:10:33 +02:00
Christoph Oelckers
3758e3e1fa Add direct native calls to TexMan's native methods.
# Conflicts:
#	src/textures/texturemanager.cpp
2019-04-16 16:37:37 +02:00
Christoph Oelckers
09f4c7e4a9 Made all virtual base functions for the event handler scripted
This was by far the largest block of native virtuals, and they were only native to be able to allow checking if the event was implemented for the current handler. This can easily be done by looking at the byte code, just like VMCall also does but in turn it removes more than half of the existing native virtuals from the interface.
2019-04-16 15:26:14 +02:00
Christoph Oelckers
76ac8bf27c Direct native functions for SBarInfo
Mostly pointless because they all get used only once and aren't even virtual overrides, but I only realized this after everything was complete…
2019-04-16 15:26:13 +02:00
Christoph Oelckers
b033fd3d52 Added direct native functions to the remaining content of vmthunks.cpp 2019-04-16 15:12:47 +02:00
Christoph Oelckers
3c11090d09 - more direct native functions for sector utilities. 2019-04-16 15:12:45 +02:00
Magnus Norddahl
e4ce93382b - Emit DW_CFA_advance_loc and DW_CFA_def_cfa_offset codes 2019-04-16 15:12:43 +02:00
Christoph Oelckers
4ac866aedc - added a few more direct native entry points. 2019-04-16 15:12:41 +02:00
Christoph Oelckers
03b7d84058 - added a direct native function for NextHighestCeilingAt to test multiple return values. 2019-04-16 15:12:37 +02:00
Magnus Norddahl
29e051a36a - fix typo in macro 2019-04-16 15:12:34 +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