Commit graph

14399 commits

Author SHA1 Message Date
Christoph Oelckers
91f7121452 - made some changes to the FImageSource interface that allows forwarding the bRemap0 flag, but do it so that it doesn't permanently alter how the image looks.
In ZDoom this would affect everything using a patch that got used in a front sky layer, even if the texture was totally unrelated. It is only owed to the low usability of such patches for other purposes that this hasn't caused problems.
2018-12-09 08:15:05 +01:00
Christoph Oelckers
583a740441 - separated the image converters from the texture offsets.
Mostly done, except for FMultiPatchTexture and FFontChar1 + 2.
Note that this commit leaks those image objects!
2018-12-09 07:39:05 +01:00
Magnus Norddahl
670d975a33 - moved argsCache out of JitCompiler::CreateFuncSignature 2018-12-08 23:31:55 +01:00
Christoph Oelckers
5eab944157 - started separating the texture class from the image format handlers. 2018-12-08 23:28:35 +01:00
Christoph Oelckers
e35d88e039 - moved some utility code out of FTexture. 2018-12-08 20:44:28 +01:00
Christoph Oelckers
03626107eb - changed multipatch texture composition to always composite off full source images and not do it recursively.
Previously it tried to copy all patches of composite sub-images directly onto the main image.
This caused massive complications throughout the entire true color texture code and made any attempt of caching the source data for composition next to impossible because the entire composition process operated on the raw data read from the texture and not some cacheable image. While this may cause more pixel data to be processed, this will be easily offset by being able to reuse patches for multiple textures, once a caching system is in place, which even for the IWADs happens quite frequently.

Removing the now unneeded arguments from the implementation also makes things a lot easier to handle.
2018-12-08 17:23:15 +01:00
Christoph Oelckers
1e070d27bd - replaced FTexture::FillBuffer 2018-12-08 14:06:16 +01:00
Christoph Oelckers
82bd742ea3 - reworked how the software renderer manages its textures.
* it's no longer the main texture objects managing the pixel buffer but FSoftwareTexture.
* create proper spans for true color textures. The paletted spans only match if the image does not have any translucent pixels.
* create proper warp textures instead of working off the paletted variants.

As a side effect, caching of pixel buffers for texture composition is temporarily disabled, as it management of texture redirections. These things will be reimplemented once things progress further. The existing methods here had their share of serious issues that should be fixed.
2018-12-08 12:42:35 +01:00
Christoph Oelckers
92b722e0ee - don't put mutexes into static local variables.
Their initialization semantics are not safe for synchronization objects.
2018-12-08 11:56:31 +01:00
Christoph Oelckers
e70138a266 - fixed crash with FraggleScript in Nimrod MAP02. 2018-12-07 20:15:02 +01:00
alexey.lysiuk
0dfb0d8427 - fixed broken Z coordinate in Actor.Vec3Angle() native call 2018-12-07 10:20:18 +02:00
Christoph Oelckers
69cc1f831c Renamed FTexture::GetPixels
This was needed to allow refactoring without letting all the other GetPixels get in the way.
2018-12-07 03:35:10 +01:00
Christoph Oelckers
9409843931 - replaced the last access operator, too
Now everything uses a function.
This really wasn't what operators are supposef to be used for.
2018-12-07 03:01:40 +01:00
Christoph Oelckers
42b18e6dfb - Disable PALVERS substitution when true color rendering is active. 2018-12-07 02:53:50 +01:00
Christoph Oelckers
79a0f76801 - replaced TexMan.operator() with two functions.
This was done to make reviewing easier, again because it is virtually impossible to search for the operators in the code.

Going through this revealed quite a few places where texture animations were on but shouldn't and even more places that did not check PASLVERS, although they were preparing some paletted rendering.
2018-12-07 02:53:18 +01:00
Christoph Oelckers
3dc9eab743 Renamed the operator() and [] methods in FTextureManager which take a name
The operators cannot be easily searched for so this makes it hard to do any evaluations on the use of this method.
2018-12-07 02:43:27 +01:00
Christoph Oelckers
9fedecbe60 Renamed FTextureManager::GetTexture to GetTextureID
It doesn't return a texture after all and I want to repurpose the name for something else.
2018-12-07 02:31:30 +01:00
Christoph Oelckers
3491182ac3 - fixed compilation 2018-12-07 02:21:39 +01:00
Christoph Oelckers
bde3558dc2 - moved the bit size variables to FSoftwareTexture
They are only needed by the software rasterizer.
2018-12-07 02:13:11 +01:00
Christoph Oelckers
18c1a3abe5 - make the FWarpTexture class local to the software renderer.
This class has only meaning for software-based warping so it doesn't have to be a part of the FTexture hierarchy.
Making it a subclass of FSoftwareTexture is fully sufficient.
2018-12-07 00:58:37 +01:00
Christoph Oelckers
4c67785c40 - moved the span and swtruecolor creation code into FSoftwareTexture. 2018-12-07 00:04:39 +01:00
Christoph Oelckers
32e245f2b9 - moved the software rendering specific parts of the sky setup to r_skyplane.cpp. 2018-12-06 20:52:03 +01:00
Christoph Oelckers
a4d61e6fb1 - everything compiles again.
As a bonus this already fixes several bugs caused by the botched texture scaling implementation the original texture manager came with.
System cursors are currently disabled because they rely on functionality that needs to be moved to different classes.
2018-12-06 20:12:15 +01:00
alexey.lysiuk
f6561ca23b - fixed native calls to LevelLocals.GetUDMF*() functions
https://forum.zdoom.org/viewtopic.php?t=62774
2018-12-06 17:04:41 +02:00
Rachael Alexanderson
9c023c78a4 - changing vid_scalefactor now always shows current scaling data unless it gets set to "1"
- vid_scaletoheight/width now works in all scaling modes, and can now also scale on custom resolutions directly
2018-12-06 09:20:01 -05:00
Magnus Norddahl
e83af15907 - remove some redundant variables 2018-12-06 04:34:19 +01:00
Magnus Norddahl
2aefeb6401 - Use static ifs (C++11 version of them, anyhow) for the triangle draw function 2018-12-06 03:10:14 +01:00
Christoph Oelckers
6eab4a882c - narrowing down the public interface of the texture class
Cannot refactor if the entire class is this wide open to everything.
Not complete yet, doesn't fully compile!
2018-12-06 01:11:04 +01:00
Christoph Oelckers
e22e249287 - this "genuine hack" was totally redundant... 2018-12-06 00:34:17 +01:00
Christoph Oelckers
aef882c137 - more direct native stuff, this is a week old but was almost forgotten. 2018-12-06 00:28:05 +01:00
Christoph Oelckers
e01306d403 - missed one definition for adding a direct native call. 2018-12-06 00:17:07 +01:00
Christoph Oelckers
494a113920 - 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.
2018-12-05 20:10:44 +01:00
Christoph Oelckers
2e7e6cba9d - scriptified P_CheckMeleeRange2. 2018-12-05 18:58:15 +01:00
Christoph Oelckers
e4e86dd4f8 - 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.
2018-12-05 18:41:19 +01:00
Christoph Oelckers
de5ab0b4b6 - deprecated a few functions that depend on AAPTR_* to be useful. 2018-12-05 18:33:59 +01:00
alexey.lysiuk
b8c4a506a7 - 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'
2018-12-05 18:10:22 +02:00
Christoph Oelckers
148d75251f - fix it 2018-12-05 17:41:25 +01:00
Christoph Oelckers
eb282c0d11 Merge branch 'master' of https://github.com/coelckers/gzdoom
# Conflicts:
#	src/scripting/vmthunks_actors.cpp
2018-12-05 17:34:53 +01:00
Christoph Oelckers
6c9d0b166a Added direct native entry points to a larger number of functions. 2018-12-05 17:34:11 +01:00
alexey.lysiuk
101ebe1731
- 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'
2018-12-05 10:25:07 +02:00
Christoph Oelckers
a846ed391e - fixed: ST_FormatMapName did not clear the string it wrote to before appending text. 2018-12-05 08:29:39 +01:00
Christoph Oelckers
5e1fc45816 fixed missing include. 2018-12-05 08:22:24 +01:00
Christoph Oelckers
2f2ce8126b - fixed definition of GetUDMFString export. 2018-12-05 08:18:07 +01:00
Rachael Alexanderson
0d891b6289 - Enforce CheckCheatmode() for cheat-enforced CVARs, allowing them to be changed in normal single player games 2018-12-05 00:21:39 +01:00
Christoph Oelckers
33db5792b4 - moved a large part of the VM thunks out of p_mobj.cpp. 2018-12-05 00:21:16 +01:00
Christoph Oelckers
a3265c2963 - more direct native entry points. 2018-12-04 23:12:16 +01:00
Christoph Oelckers
3b5ce4ecca - fixed: SBar_SetClipRect had a superfluous argument resulting in incorrect behavior 2018-12-04 19:14:14 +01:00
Christoph Oelckers
e928b94ab2 - missed the header... 2018-12-04 18:53:12 +01:00
Christoph Oelckers
d0f037d14f - the native APlayerPawn::PlayAttacking2 function is not needed anymore. 2018-12-04 18:51:03 +01:00
Christoph Oelckers
8025f02935 - fix bad return type. 2018-12-04 18:47:03 +01:00
Christoph Oelckers
d7da2d838f - 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.
2018-12-04 18:45:07 +01:00
Christoph Oelckers
45d7e5a038 - scriptified ASpecialSpot.
This only had two simple native methods so the class is not fully scripted.
2018-12-04 18:21:48 +01:00
Christoph Oelckers
de9805d5c7 - 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.
2018-12-04 18:21:00 +01:00
Christoph Oelckers
062528e0e2 - more direct native function calls. 2018-12-04 18:16:01 +01:00
Christoph Oelckers
5e4b366724 Removed all native components from AInventory. 2018-12-04 18:06:09 +01:00
Christoph Oelckers
d66516ec82 - scriptified A_SpawnSingleItem, which was the last piece of native code still referencing AInventory 2018-12-04 17:55:45 +01:00
Christoph Oelckers
2459b27895 - scriptified A_SelectWeapon and inlined the last remaining use of APlayerPawn::SelectWeapon. 2018-12-04 17:41:55 +01:00
Christoph Oelckers
44e43c48b5 - scriptified A_SelectWeapon 2018-12-04 17:31:25 +01:00
Christoph Oelckers
9348baeeb1 Removed all remaining references to AInventory
What remains is the class definition and one single reference that will be scriptified.
2018-12-04 17:11:36 +01:00
Christoph Oelckers
cd563cc4db Removed more literal references to AInventory. 2018-12-04 17:00:48 +01:00
Christoph Oelckers
3d28006eda - started removing literal references of AInventory, so far only simple stuff. 2018-12-04 00:41:39 +01:00
Christoph Oelckers
a573c63f60 - removed all direct access to AInventory's members.
We are getting closer to make class Inventory fully scripted.
2018-12-04 00:22:26 +01:00
Magnus Norddahl
14919f49ec - gcc/clang didn't like having this in a class 2018-12-03 23:39:03 +01:00
Magnus Norddahl
ae44b936eb - add bool and unsigned int to the allowed types
- fix one case where floats were used (the JIT always calls with doubles)
2018-12-03 23:09:23 +01:00
Magnus Norddahl
ba0c7652eb - perform compile time validation of direct native function signatures 2018-12-03 22:59:56 +01:00
Magnus Norddahl
5d9784f215 - fix VM native calls containing strings and enable them again 2018-12-03 21:58:01 +01:00
Magnus Norddahl
4f078dfcb3 - fix compile error 2018-12-03 21:57:07 +01:00
Magnus Norddahl
3ac2e74f1c - GetInventoryIcon must return an integer for it to work for VM native calls 2018-12-03 21:56:06 +01:00
Christoph Oelckers
7df8245102 - added missing min/max unsigned instructions for the VM. 2018-12-03 21:12:39 +01:00
Rachael Alexanderson
493ff5f089 - always apply vid_scalefactor now, even when vid_scalemode is not 0 or 1. 2018-12-03 13:38:18 -05:00
Christoph Oelckers
b6d0492478 - 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.
2018-12-03 18:51:24 +01:00
Christoph Oelckers
6faeadaceb - 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.
2018-12-03 18:10:36 +01:00
Christoph Oelckers
1b07bded47 - fixed: The static variant of PClass::FindFunction may only be used for actual static variables. 2018-12-03 17:41:05 +01:00
Christoph Oelckers
0e095b0c05 - removed all direct references of AInventory::Owner and AInventory::Amount from the C++ code. 2018-12-03 17:41:05 +01:00
Christoph Oelckers
53291b0abf Merge branch 'master' of https://github.com/coelckers/gzdoom 2018-12-03 15:54:09 +01:00
Christoph Oelckers
40a67b8c9a - 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.
2018-12-03 12:24:55 +01:00
Magnus Norddahl
1e30bc72fe - compare against the thing renderstyle since the local copy has been modified 2018-12-03 11:10:40 +01:00
Magnus Norddahl
4604c9379c - disable alpha test on models if the renderstyle isn't STYLE_Normal 2018-12-03 10:46:28 +01:00
Christoph Oelckers
39d90d022b - made the BUddha checks readable again. 2018-12-03 09:48:05 +01:00
Christoph Oelckers
d7bb1726ab - fixed compile warning 2018-12-03 09:14:11 +01:00
Christoph Oelckers
099b278f18 - removed assert that got triggered in an edge case that must pass here. 2018-12-02 23:35:18 +01:00
Christoph Oelckers
d222e82bbc - implemented missing 'exact' parameter for ThinkerIterator.Next. 2018-12-02 23:15:34 +01:00
Christoph Oelckers
bfcd714186 - 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.
2018-12-02 21:35:55 +01:00
Major Cooke
6fd3bea38c - 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.
2018-12-02 21:14:22 +01:00
Christoph Oelckers
807df33e1a - 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.
2018-12-02 20:58:15 +01:00
Magnus Norddahl
d88d173b38 - ptest is a SSE 4.1 instruction 2018-12-02 20:44:36 +01:00
Christoph Oelckers
2e383073e8 - 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.
2018-12-02 19:45:45 +01:00
Christoph Oelckers
3182569fb8 - 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.
2018-12-02 18:43:38 +01:00
Christoph Oelckers
93f91d1039 - scriptified P_DropItem. 2018-12-02 18:31:18 +01:00
Christoph Oelckers
a5fc26b37c - scriptified the no-spawn flag check for armor and health items. 2018-12-02 18:04:44 +01:00
Christoph Oelckers
319f8743db - 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.
2018-12-02 16:53:12 +01:00
Christoph Oelckers
ee08412e49 - scriptified G_PlayerFinishLevel.
Outside of SBARINFO this was the biggest remaining piece of code that referenced AInventory internals.
2018-12-02 16:26:02 +01:00
Christoph Oelckers
719598aae4 - scriptified AActor::ClearInventory 2018-12-02 15:24:44 +01:00
Christoph Oelckers
2cb0b2db87 - took the last methods aside from Tick and Serialize out of AInventory. 2018-12-02 14:56:10 +01:00
Christoph Oelckers
db814dc333 - properly hook up the alt HUD with the status bar. 2018-12-02 14:34:10 +01:00
Christoph Oelckers
d11b33e8fd - 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.
2018-12-02 14:34:10 +01:00
Christoph Oelckers
ba905321b0 - scriptified the main drawer for the in-game HUD and removed all intermediate VM calls from the native source. 2018-12-02 14:34:09 +01:00
Christoph Oelckers
fe39236ee1 - scriptified the AltHUD'S powerup drawer. 2018-12-02 14:34:09 +01:00
Christoph Oelckers
ddaab4d2ab - 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.
2018-12-02 14:34:09 +01:00
Christoph Oelckers
4431ec06fd - scriptified the AltHUD's inventory drawer and fixed the InvPrev CCMD. 2018-12-02 14:34:09 +01:00
Christoph Oelckers
714ca9b2ce - scriptified the AltHUD's weapon drawer. 2018-12-02 14:34:08 +01:00
Christoph Oelckers
1406c11f8e - 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.
2018-12-02 14:34:08 +01:00
Christoph Oelckers
fbc441673a - AltHUD ammo drawer scriptified. 2018-12-02 14:34:08 +01:00
Christoph Oelckers
0cd93c14af - allow %*d etc. format specifiers in ZScript, but only for numeric types. 2018-12-02 14:34:08 +01:00
Christoph Oelckers
4a1f011dc1 - Alt HUD scriptification, part 1. 2018-12-02 14:34:08 +01:00
Magnus Norddahl
edc05111cd - don't use SSE for integer min/max 2018-12-02 09:58:08 +01:00
Magnus Norddahl
706a923884 - Use SSE2 for min/max instead 2018-12-02 07:35:02 +01:00
Christoph Oelckers
c66dae9f2c - this was wrong... 2018-12-02 00:08:19 +01:00
Christoph Oelckers
117537339d - fixed script call in PickNewWeapon. 2018-12-01 23:36:48 +01:00
Christoph Oelckers
2d0b90deb1 - fixed: P_Massacre without a class restriction no longer worked. 2018-12-01 22:44:06 +01:00
Christoph Oelckers
577af8860c - scriptified invnext and invprev CCMDs. 2018-12-01 22:37:12 +01:00
Christoph Oelckers
5c647de70c - moved ValidateInvFirst to the script side because this was one of the major functions that directly reference AInventory. 2018-12-01 17:46:20 +01:00
Christoph Oelckers
bc1990b6d7 - moved AInventory::DoRespawn fully to the script side. 2018-12-01 17:29:37 +01:00
Christoph Oelckers
3922f817fb - 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.
2018-12-01 17:21:40 +01:00
Christoph Oelckers
7b63e088e1 - moved the GetBlend script call to the one single place where it is needed to get rid of one native AInventory method. 2018-12-01 17:21:20 +01:00
Christoph Oelckers
a14b0c58bf - 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
2018-12-01 17:20:52 +01:00
Christoph Oelckers
7301bbc58e - scriptified GiveAmmo and the one remaining piece of native code still using it. 2018-12-01 17:20:23 +01:00
Christoph Oelckers
2c59172c42 - scriptified DropInventory. 2018-12-01 17:18:26 +01:00
Christoph Oelckers
09129e0113 - scriptified UseInventory and several functions using the already scriptified ones, 2018-12-01 17:17:08 +01:00
Christoph Oelckers
588ddd185b - scriptified TakeInventory, including the ACS/FS interfaces. 2018-12-01 17:11:09 +01:00
Christoph Oelckers
e7d309cb96 - code consolidation in invnext and invprev. 2018-12-01 17:09:43 +01:00
Christoph Oelckers
023efc7685 - scriptified RemoveInventory and Inventory.OnDestroy. 2018-12-01 17:09:23 +01:00
Christoph Oelckers
eb47fb9adc - 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.
2018-12-01 17:07:09 +01:00
Christoph Oelckers
a426655d61 - scriptified AddInventory. 2018-12-01 17:03:58 +01:00
Christoph Oelckers
d812b94d57 - disabled direct native functions for now until the problems with string arguments are fixed. 2018-12-01 16:56:55 +01:00
Christoph Oelckers
691652042c - added direct native variants to nearly all status bar function.
I skipped ValidateInvFirst because that one will have to be scriptified soon.
2018-12-01 16:54:31 +01:00
Magnus Norddahl
5169a5b119 - minor code cleanup now that it is working 2018-12-01 14:35:21 +01:00
Christoph Oelckers
85a3edf583 - removed the no longer needed exception prevention hack.
# Conflicts:
#	src/scripting/vm/vmframe.cpp
2018-12-01 14:27:18 +01:00
Christoph Oelckers
067e9de00a - fixed: V_FindFontColor is not suitable for direct calls from JIT code, thanks to its FName parameter. 2018-12-01 14:26:53 +01:00
Christoph Oelckers
aa32acae25 - 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.
2018-12-01 14:18:28 +01:00
Magnus Norddahl
83c011740c - fix augmentation length bug 2018-12-01 14:14:28 +01:00
Magnus Norddahl
b428136866 - unwind data is now working on macOS 2018-12-01 12:46:35 +01:00
Christoph Oelckers
a7e472b4b3 - 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.
2018-12-01 10:30:50 +01:00
Christoph Oelckers
ea3d26aafd - fixed character to int conversion for UTF8-characters. 2018-12-01 10:30:50 +01:00
alexey.lysiuk
8d9b4f5a17 - previous fix attempts done right 2018-12-01 09:44:14 +02:00
SanyaWaffles
6dd73e43fd 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
2018-12-01 07:31:25 +01:00
Magnus Norddahl
c41603c171 - 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.. 2018-12-01 01:14:15 +01:00
Christoph Oelckers
42b9a41421 - 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.
2018-11-30 21:30:14 +01:00
Christoph Oelckers
b26b16e4b7 Merge remote-tracking branch 'remotes/origin/master' into asmjit 2018-11-30 21:29:12 +01:00
Christoph Oelckers
a0c0e8bdfe Merge remote-tracking branch 'remotes/origin/weapon_scriptification' into asmjit
# Conflicts:
#	src/g_inventory/a_pickups.cpp
2018-11-30 21:28:44 +01:00
Christoph Oelckers
32f7e9a9ea -add a dummy definition for vm_jit in 32 bit. 2018-11-30 20:50:31 +01:00
Christoph Oelckers
62f649b4f6 - fixed: the direct native GetTextureSize used the wrong calling convention. 2018-11-30 19:28:24 +01:00
Player701
b79e3f8904 - Added a flag to make bouncing objects disappear when hitting sky surfaces 2018-11-30 18:53:57 +01:00
Christoph Oelckers
8e46cb3a21 Merge remote-tracking branch 'remotes/origin/master' into asmjit 2018-11-30 18:49:28 +01:00
Christoph Oelckers
00d97197db - removed deprecated method to retrieve OpenGL extensions
Since we force a core profile and this was explicitly disabled for core profiles, this code has no use anymore
2018-11-30 17:16:21 +01:00
Christoph Oelckers
a3df67bdd4 - 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
2018-11-30 17:12:36 +01:00
Christoph Oelckers
25ad71a113 - Changed a few allocations into usin TArrays
S_SoundCurve in particular looked like a candidate for leaking memory.
2018-11-30 17:07:42 +01:00
Christoph Oelckers
024870ba11 - merged DCanvas and DSimpleCanvas and use a TArray to hold its memory. 2018-11-30 17:02:39 +01:00
Magnus Norddahl
cb1153272a - fix native call crash and assertion error 2018-11-30 16:55:22 +01:00
Magnus Norddahl
6e598274f7 - hook up unix unwind info (still not working) 2018-11-30 02:06:40 +01:00