Commit graph

13818 commits

Author SHA1 Message Date
drfrag
5c8b0a1e53 - Bumped ZScript version. 2019-04-27 12:35:41 +02:00
alexey.lysiuk
35867a1c29 - fixed 'overriding core lump' error
Wrong container was reported for overriding lump
2019-04-27 12:27:29 +02:00
Christoph Oelckers
0ed3ac740a - fixed: The rail attack only considered the puff's decal if it had ALWAYSPUFF set. 2019-04-27 12:16:34 +02:00
drfrag
e2d24d177f - fixed: application of fake contrast should never result in a light level of 0 unless the sector's own light level is 0.
(patch by Graf)
2019-04-27 12:16:10 +02:00
Christoph Oelckers
9c2a784ca1 - normalize the pitch in ACS's SetActorPitch.
Apparently some people have to pass positive numbers in here to get a negative pitch, e.g. 350.0 instead of -10.0...
This prevents clamping of such out-of-range values that would otherwise constitute valid pitches with the wraparound in place.
2019-04-27 12:10:42 +02:00
Christoph Oelckers
90b57ed808 - fixed: TVector3::Pitch() got the sign inverted.
This caused bad calculations with CMF_OFFSETPITCH. Note that to compensate for the fix, the SphericalCoords function had to have its own inversion of the value removed so that it calculates the same result as before.
2019-04-27 12:10:41 +02:00
alexey.lysiuk
583e1103a0 - workaround MSVC 2015 code generation issue, x64 only
With optimization turned on illegal instructions were generated for turbo CVAR handler function

https://forum.zdoom.org/viewtopic.php?t=63157
2019-04-27 12:09:36 +02:00
drfrag
ea688fc613 - recalculate the line deltas if a nodebuild is needed
One potential cause is moving around vertices in which case these do not match anymore. (patch by Graf)
2019-04-27 12:07:49 +02:00
Christoph Oelckers
e2c2837aa5 - allow assignment of line IDs through LevelCompatibility. 2019-04-27 11:38:41 +02:00
drfrag
a6d5e58886 - Partial port of "made some changes to how the compatibility code works" to allow exporting to ZScript. 2019-04-27 11:38:37 +02:00
Christoph Oelckers
ddf5e009e5 - fixed default alpha for sector colors
It has to be 0, not 255.
2019-04-26 18:18:11 +02:00
alexey.lysiuk
53a1fb5705 - fixed potentially missing event handlers
Event handlers linked list might skip an entry if its order was in a middle of existing handlers

https://forum.zdoom.org/viewtopic.php?t=63258
2019-04-26 18:14:58 +02:00
alexey.lysiuk
db0928be4d - fixed wrong self type in Array.Resize()
https://forum.zdoom.org/viewtopic.php?t=63275
2019-04-26 18:14:56 +02:00
alexey.lysiuk
37ce3e90de - relaxed caller type check for states modified by Dehacked
https://forum.zdoom.org/viewtopic.php?t=63178
2019-04-26 18:14:53 +02:00
alexey.lysiuk
a08bc271fa - fixed script line numbers after multi-line raw string literal
https://forum.zdoom.org/viewtopic.php?t=63210
2019-04-26 18:14:51 +02:00
alexey.lysiuk
a082a09ebe - unary minus operator propagates boolean operand to integer
https://forum.zdoom.org/viewtopic.php?t=63214
2019-04-26 18:14:49 +02:00
Christoph Oelckers
f90dadba44 - fixed some merging issues.
# Conflicts:
#	src/g_shared/a_decals.cpp
2019-04-26 18:12:32 +02:00
alexey.lysiuk
67c4317d54 - fixed compilation errors
src/scripting/decorate/thingdef_parse.cpp:80:11: error: no viable conversion from 'const FName' to 'FString'
src/scripting/zscript/zcc_compile.cpp:1359:26: error: use of undeclared identifier 'Name_globalfreeze'; did you mean 'NAME_globalfreeze'?

# Conflicts:
#	src/scripting/zscript/zcc_compile.cpp
2019-04-26 18:12:31 +02:00
Christoph Oelckers
d0c609eeee - ensure proper emission of deprecations.
For global variables this wasn't implemented.

# Conflicts:
#	src/namedef.h
#	src/scripting/backend/codegen.cpp
#	wadsrc/static/zscript/base.txt
2019-04-26 18:12:29 +02:00
Christoph Oelckers
120069890d - added the fix for BuiltinNew which I missed when cherry-picking. 2019-04-26 18:10:28 +02:00
Christoph Oelckers
21e4f0b817 - made OP_NEW a builtin function instead of an opcode.
The code was present 3 times due to the JIt, and this is not something that benefits from being a real opcode, even in the interpreted case.
2019-04-26 17:23:33 +02:00
Marrub
af27d579ac Make LevelLocals::ExecuteSpecial return int
# Conflicts:
#	wadsrc/static/zscript/base.txt
2019-04-26 17:20:44 +02:00
Marrub
73e174af4d Fix return value of native BuiltinCallLineSpecial 2019-04-26 17:20:42 +02:00
Chronos Ouroboros
e9ca5d6eff Fixed multidimensional array definitions. 2019-04-26 17:20:40 +02:00
alexey.lysiuk
494dc20088 - increased range of valid sound positions and velocities
https://forum.zdoom.org/viewtopic.php?t=61420
2019-04-26 17:20:37 +02:00
alexey.lysiuk
d8d290cd51 - fixed many compilation errors with GCC and Clang
# Conflicts:
#	src/dobjgc.h
2019-04-26 17:14:12 +02:00
Christoph Oelckers
d6b18e5792 - same for the ambient sound
# Conflicts:
#	src/s_advsound.cpp
2019-04-26 17:14:06 +02:00
Christoph Oelckers
381eb7a407 - removed dependency on global time in sound sequence code.
This can better use a countdown timer that doesn't depend on external behavior.
2019-04-26 17:14:04 +02:00
alexey.lysiuk
039b91859a - fixed key number assignment during parsing of locks
https://forum.zdoom.org/viewtopic.php?t=63171
2019-04-26 17:14:02 +02:00
Chronos Ouroboros
56be11bbe3 Added support for implicitly-sized initialized arrays.
Also fixed dynamic arrays not being cleared before initializing.
2019-04-26 17:13:59 +02:00
drfrag
e751476957 - Fixed compilation with MinGW-w64 but now the 64 bit executable crashes. 2019-04-26 17:03:29 +02:00
Major Cooke
f136650e81 Fixed Thing_ProjectileAimed being broken.
- It was calling the fallback aiming in the wrong place when it should have been outside the speed check.
- Credit to _mental_ for the base code, but no gotos involved.
2019-04-26 01:39:56 +02:00
Chronos Ouroboros
df3f074b0a Fixed some issues in the ZScript array compilation code. 2019-04-26 01:33:09 +02:00
Christoph Oelckers
99f6d2a177 - replaced some NULLs with nullptr.
# Conflicts:
#	src/fragglescript/t_script.cpp
2019-04-26 01:33:07 +02:00
Chronos Ouroboros
541fd0097b Implemented compound initializers for arrays. 2019-04-26 01:31:23 +02:00
Christoph Oelckers
ff9fe5f4d0 - changed AFuncDesc initialization to avoid generating initializer functions.
Visual C++ will never statically initialize a class instance where a member field has a default value set, so the DEFINE_ACTION_FUNCTION variants without a direct native call need to be handled differently. The easiest way to do this is to leave out the nullptr default and omit the value in the initializer list. For trailing fields this will always get them nulled.
2019-04-26 01:31:21 +02:00
Player701
99a5f86364 - Fixed spawn height of projectiles created by SpawnPlayerMissile. 2019-04-26 01:31:18 +02:00
Christoph Oelckers
30f55ccf7d - converted the ACS Stringbuilder macros into inline functions. 2019-04-26 01:31:16 +02:00
Christoph Oelckers
b00a039af8 - let RunHealth clamping respect the newly added global properties. 2019-04-26 01:31:12 +02:00
Christoph Oelckers
bb129fd929 - bumped savegame version because the recent scriptification of APlayerPawn will render all old savegames unusable. 2019-04-26 01:31:10 +02:00
Christoph Oelckers
9a99d55896 - made forwardmove and sidemove defaults configurable through the gameinfo section. 2019-04-26 01:31:07 +02:00
Christoph Oelckers
edfb814957 - fixed delete calls on FDynamicLight.
This isn't allocated from the system heap so it cannot be freed by it.
2019-04-26 01:29:03 +02:00
Christoph Oelckers
e6ae9984ff - fixed: GetSoundClass must be able to handle non-players. 2019-04-26 01:29:01 +02:00
Christoph Oelckers
094aa245e6 - fixed: G_StartTravel must remove all dynamic lights from the actors it is about to carry over to the next level. 2019-04-26 01:20:05 +02:00
Christoph Oelckers
251b096b48 - removed all remaining native parts of APlayerPawn.
Unlike the other classes, the places where variables from this class were accessed were quite scattered so there isn't much scriptified code. Instead, most of these places are now using the script variable access methods.
This was the last remaining subclass of AActor, meaning that class Actor can now be opened for user-side extensions.
2019-04-26 01:20:02 +02:00
drfrag
15bcc4c6a1 - Missed some castings. 2019-04-26 01:15:11 +02:00
Christoph Oelckers
8fecfb8f85 - properly handle passing of the light flags.
Since these can be changed on the placed light actor they have to be read from there, so this is now a pointer in FDynamicLight, just like the other properties that can be user-changed.
Also did some cleanup on the interface so that external code doesn't need to dereference the lightflags pointer but can use utility functions for all flags.

# Conflicts:
#	src/hwrenderer/dynlights/hw_dynlightdata.cpp
#	src/swrenderer/line/r_walldraw.cpp

# Conflicts:
#	src/g_level.cpp
#	src/gl/compatibility/gl_20.cpp
2019-04-26 00:42:05 +02:00
Christoph Oelckers
17b13f1a60 - fixed: DeactivateLight called Activate instead of Deactivate. 2019-04-26 00:28:08 +02:00
drfrag
1bb9b3b861 - Fixed compilation of previous commit.
# Conflicts:
#	src/gl/compatibility/gl_20.cpp
2019-04-26 00:27:39 +02:00
Christoph Oelckers
f261ec7d53 - rewrote dynamic lights to not use actors for the internal representation and made DynamicLight a purely scripted class.
This should be less of a drag on the playsim than having each light a separate actor. A quick check with ZDCMP2 showed that the light processing time was reduced to 1/3rd from 0.5 ms to 0.17 ms per tic.
It's also one native actor class less.

# Conflicts:
#	src/g_shared/a_dynlight.cpp
#	src/g_shared/a_dynlight.h
#	src/hwrenderer/dynlights/hw_dynlightdata.cpp
#	src/hwrenderer/dynlights/hw_dynlightdata.h
#	src/hwrenderer/scene/hw_renderhacks.cpp
#	src/namedef.h
#	src/scripting/thingdef_data.cpp
#	src/swrenderer/line/r_walldraw.cpp

# Conflicts:
#	src/d_main.cpp
#	src/g_levellocals.h
#	src/g_shared/a_dynlight.cpp
#	src/g_shared/a_dynlight.h
#	src/gl/dynlights/gl_dynlight.h
#	src/gl/dynlights/gl_dynlight1.cpp
#	src/gl/scene/gl_spritelight.cpp
#	src/gl/scene/gl_walls.cpp
#	src/hwrenderer/dynlights/hw_shadowmap.cpp
#	src/hwrenderer/dynlights/hw_shadowmap.h
#	src/hwrenderer/scene/hw_flats.cpp
#	src/p_setup.cpp
2019-04-26 00:19:03 +02:00
Christoph Oelckers
08c75efb10 - fixed: ADynamicLight's shadowmap index must be reset when loading a savegame. 2019-04-25 21:20:56 +02:00
Christoph Oelckers
bc8af1cab8 Fixed initialization issues with dynamic lights.
Actors get initialized from their defaults so anything done in the constructor or some explicit member initialization will be overwritten.
They must use their properties for setting up configurable fields and do the rest in BeginPlay.
2019-04-25 20:59:06 +02:00
alexey.lysiuk
81cb8cb60b Fixed applying of dynamic lights to models
https://forum.zdoom.org/viewtopic.php?t=60301

# Conflicts:
#	src/gl/scene/gl_sprite.cpp
2019-04-25 20:48:17 +02:00
Christoph Oelckers
b3a8dcdbd4 store shadow map index in the light actor instead of a separate TMap
This frees another file of a direct renderer dependency and generally also should be faster
2019-04-25 20:14:00 +02:00
drfrag
e335a48009 - Fixed bad merge of "- changed handling of attenuated lights in the legacy renderer to be adjusted when being rendered instead of when being spawned.". 2019-04-25 19:11:40 +02:00
Christoph Oelckers
99dd234d10 - exported all native components of APlayerPawn.
Only the class definition itself remains and needs to be taken care of.

# Conflicts:
#	src/g_statusbar/sbarinfo_commands.cpp
#	src/hu_scores.cpp
#	src/scripting/thingdef_data.cpp

# Conflicts:
#	src/actorinlines.h
#	src/hu_scores.cpp
2019-04-25 17:42:11 +02:00
Christoph Oelckers
94eb0ecdda - scriptified the remaining PlayerPawn methods. 2019-04-25 17:35:44 +02:00
Christoph Oelckers
b28faa6793 - took several methods out of the native PlayerPawn implementation, either by scriptification or moving them to other places. 2019-04-25 17:34:56 +02:00
Christoph Oelckers
6f2a32ecbe - scriptified PlayerPawn.ResetAirSupply. 2019-04-25 17:34:53 +02:00
Christoph Oelckers
1c577e4c97 - scriptified APlayerPawn's DamageFade handling. 2019-04-25 17:34:51 +02:00
Christoph Oelckers
cf890a24c3 - scriptified P_CalcHeight.
This was the only code using the ViewBob member variable.
This also moves the range check for this variable to its application, because a badly behaved mod can just as easily change it at run time instead of just setting an absurdly large value in the class definition.
2019-04-25 17:34:49 +02:00
Christoph Oelckers
8e376754fc - did some more lightening on the PlayerPawn class. 4 more properties and one native member function have been handled. 2019-04-25 17:34:47 +02:00
Christoph Oelckers
c762757aca - initialize the PlayerPawn members only used by scripts through the script variable interface.
The goal here is to eliminate the native PlayerPawn class, after all, so this will be needed anyway.
2019-04-25 17:34:45 +02:00
Christoph Oelckers
cb2e46a4fe - scriptified A_SkullPop and ObtainInventory.
These were the last relevant items to access PlayerPawn.InvFirst.
2019-04-25 17:34:43 +02:00
Christoph Oelckers
08e2a86f64 - made ColorRangeStart and ColorRangeEnd meta properties of APlayerPawn.
These are only used during initialization and they should have been readonly from the start.
2019-04-25 17:34:41 +02:00
Christoph Oelckers
51499e167d - scriptified useflechette CCMD's item finding code. 2019-04-25 17:34:39 +02:00
Christoph Oelckers
4be9217215 - scriptified the declaration of AmbientSound
Most of the code is still native, but this means that PlayerPawn is the last remaining child of AActor.

# Conflicts:
#	src/g_shared/a_dynlight.cpp
2019-04-25 17:34:37 +02:00
alexey.lysiuk
70e7f9f853 - added missing range checks to level compatibility handler
# Conflicts:
#	src/compatibility.cpp
2019-04-25 16:50:28 +02:00
Christoph Oelckers
990aad3b0c - fixed: The player sound lookup would fail if a sound was only available for the last gender in the list.
This is an ancient bug, but it never registered before - only after making 'other' the default gender for nonsense input it became apparent.
2019-04-25 16:32:19 +02:00
Christoph Oelckers
0c1fc45df8 - fixed A_Chase default detection. 2019-04-25 16:31:58 +02:00
Christoph Oelckers
96d40ac403 - fixed the direct native variant of DynamicLight.SetOffset. 2019-04-25 16:26:40 +02:00
Major Cooke
2e6382f55e - Fixed: NODAMAGE was not accounted for with pain. 2019-04-25 13:10:51 +02:00
Timo Myyrä
b561b72fd0 fix Unix builds without backtrace functions in their libc
backtrace functions are not present in all libc implementations. Cmake has
module to add external libraries into build if needed so use it to fix build on
Unix systems without backtrace in libc.
2019-04-25 13:10:47 +02:00
Christoph Oelckers
1669e10f6e - fixed memory leaks in network code.
ReadString allocates a buffer, so saving it in a local variable and then forgetting it will not free the buffer afterward.
(This should probably be refactored to use some safer methods to read the string than this old-school method...)
2019-04-25 13:10:39 +02:00
player701
77633415f9 - Fixed settings_controller not updating properly when a player becomes the new arbitrator in a netgame. 2019-04-25 13:03:47 +02:00
Christoph Oelckers
6371d3f88b - added missing return in P_RemoveThing. 2019-04-25 13:03:45 +02:00
Christoph Oelckers
d54ef75311 - added missing null pointer check to SBarInfo's inventory bar drawer. 2019-04-25 13:03:42 +02:00
Christoph Oelckers
08dd81ed36 - use a TArray to store the sprite model hash to get rid of one atterm call. 2019-04-25 12:55:22 +02:00
Christoph Oelckers
7259cd44ee - reworked the lock code to remove the 255 locks limit and to allow it to automatically deinitialize.
# Conflicts:
#	src/fragglescript/t_func.cpp
2019-04-25 12:55:19 +02:00
Christoph Oelckers
e4bf84b015 - treat non-existent arrays in the savegame as zero length. 2019-04-25 12:55:13 +02:00
Christoph Oelckers
8c38a7c05f - fixed precaching of switches.
The backwards animation accessed the wrong array which in case of sequences with different length could crash
2019-04-25 12:52:02 +02:00
Major Cooke
5e183d8718 Fixed: IsFakePain received the modified damage instead of the raw, preventing ALLOWPAIN from working as intended. 2019-04-25 12:51:46 +02:00
Christoph Oelckers
f00ec3bfb9 - use TArrays for all local allocations in the map loader.
# Conflicts:
#	src/p_setup.cpp
2019-04-25 12:44:28 +02:00
drfrag
df251be921 - Fixed compilation of previous commit.
# Conflicts:
#	src/textures/textures.h
2019-04-18 20:16:30 +02:00
Christoph Oelckers
f29408e199 - fixed precaching to consider animations and switches 2019-04-18 20:13:35 +02:00
Ijon
50d8993e6e NOFRICTION now applies to Z friction when flying or swimming 2019-04-18 19:57:44 +02:00
alexey.lysiuk
33067deb86 - fixed crash in Actor.Warp() with null destination
https://forum.zdoom.org/viewtopic.php?t=63031
2019-04-18 19:57:30 +02:00
Christoph Oelckers
e4f5160f66 - remove some obsolete bit of cruft from the class type system.
This was a remnant of putting the meta data directly into the class descriptor which turned out to be an unworkable approach
2019-04-18 19:57:28 +02:00
Christoph Oelckers
a82d60bb71 - fixed 3D floor initialization for actor spawning.
Since actors are being spawned before the renderer gets set up this needs to fully initialize the list before spawning the actors, then take it down again for creating the vertex buffer and then recreate it.
2019-04-18 19:57:09 +02:00
Major Cooke
0635dc1416 Reduced redundancy by putting all function aftermath handling in a subfunction. 2019-04-18 19:56:40 +02:00
Major Cooke
662b2ed759 Split off pain chance triggering from ReactToDamage into its own function and gave ZScript access to it.
- TriggerPainChance(Name mod, bool forcedPain)
- One exception: PainThrehold is only checked in ReactToDamage, since this function does not require checking damage amount.
2019-04-18 19:56:38 +02:00
Major Cooke
f98c194431 DamageMobj Refactor
- Split off all reactive functionality (pain, infighting, etc) into its own function, ReactToDamage.
- Refactored all DamageMobj's damage <= 0 values.
 - Any unconditional cancellations now return -1. ReactToDamage will not be called if values < 0.
 - All pain/wound/target changing allowances return 0.
2019-04-18 19:56:36 +02:00
Ijon
49dd94f65a Add NOFRICTION and NOFRICTIONBOUNCE flags
NOFRICTION disables all friction effects on the thing it's set on
(including the speed cap from water/crouching), and NOFRICTIONBOUNCE
disables the "bounce off walls on an icy floor" effect on the thing
it's set on.
2019-04-18 19:56:33 +02:00
Rachael Alexanderson
286eacb088 - set vid_scalefactor to 1 when using vid_setscale 2019-04-18 19:20:28 +02:00
drfrag
708952e615 - initialize the index field for particles.
This won't contribute to sort order so it should be the same for all particles, which it wasn't because it was never set.
(patch by Graf)
2019-04-18 19:02:29 +02:00
Christoph Oelckers
cd8791d68c - fixed sprite sorting in the hardware renderer.
This did no longer sort sprites in the same position reliably since the feature to render sprites which only partially are inside a sector was added.
With this, sprites in the same position are no longer guaranteed to be added to the render list in sequence.
Fixed by adding an 'order' field to AActor which gets incremented with each spawned actor and reset when a new level is started.

The software renderer will also need a variation of this fix but its data no longer has access to the defining actor when being sorted, so a bit more work is needed here.

# Conflicts:
#	src/hwrenderer/scene/hw_drawlist.cpp
#	src/hwrenderer/scene/hw_sprites.cpp
2019-04-18 18:53:10 +02:00
Magnus Norddahl
14f7efece7 - improve softpoly 3d floor drawing somewhat
# Conflicts:
#	src/polyrenderer/scene/poly_plane.cpp
2019-04-18 17:49:41 +02:00
Christoph Oelckers
e6af596af0 - removed the redundant GetOffsetPosition export and added direct native support to its existing variants 2019-04-18 17:01:17 +02:00
Christoph Oelckers
15f78039c3 - fixed the decal translation handler truncated the translation ID
This was yet another of those old misguided 16 bit space 'optimizations'.
2019-04-18 17:01:11 +02:00
Christoph Oelckers
89a17d4257 - fixed: The random sound handler was using 16 bit storage throughout
Changed to use 32 bit and also fixed the random number call which was using the byte value variant of the access operator, effectively limiting the number of choices to 256.
2019-04-18 17:01:09 +02:00