Commit graph

67 commits

Author SHA1 Message Date
Magnus Norddahl
1d941c9839 Merge remote-tracking branch 'gzdoom/master' into qzdoom
# Conflicts:
#	src/r_plane.cpp
#	src/win32/zdoom.rc
2017-01-13 13:21:10 +01:00
Christoph Oelckers
7b7623d2c4 - split DObject::Destroy into the main method, a native OnDestroy and a scripted OnDestroy method and made the main method non-virtual
This was done to ensure it can be properly overridden in scripts without causing problems when called during engine shutdown for the type and symbol objects the VM needs to work and to have the scripted version always run first.
Since the scripted OnDestroy method never calls the native version - the native one is run after the scripted one - this can be simply skipped over during shutdown.
2017-01-12 22:49:18 +01:00
Magnus Norddahl
e91c5ac54d Merge branch 'master' into OverlayExtension10 2016-12-27 04:32:13 +01:00
Major Cooke
ff3487d389 Merge branch 'OverlayAlpha' into OverlayExtension9
# Conflicts:
#	src/p_pspr.cpp
#	src/r_draw.cpp
#	wadsrc/static/actors/actor.txt
#	wadsrc/static/actors/constants.txt
2016-12-26 14:37:22 -06:00
Christoph Oelckers
c927aca2a0 Merge branch 'zscript' of https://github.com/rheit/zdoom into gz-zscript
# Conflicts:
#	wadsrc/static/zscript.txt
2016-11-30 18:46:23 +01:00
Christoph Oelckers
66d28a24b8 - disabled the scripted virtual function module after finding out that it only works if each single class that may serve as a parent for scripting is explicitly declared.
Needless to say, this is simply too volatile and would require constant active maintenance, not to mention a huge amount of work up front to get going.
It also hid a nasty problem with the Destroy method. Due to the way the garbage collector works, Destroy cannot be exposed to scripts as-is. It may be called from scripts but it may not be overridden from scripts because the garbage collector can call this function after all data needed for calling a scripted override has already been destroyed because if that data is also being collected there is no guarantee that proper order of destruction is observed. So for now Destroy is just a normal native method to scripted classes
2016-11-25 00:25:26 +01:00
Christoph Oelckers
099b9970ef - added proper definitions for all exported native fields.
- synthesize native fields for all declared flags, not just for AActor.
2016-11-22 23:43:32 +01:00
Christoph Oelckers
0b70df88d8 - scriptified A_FireShotgun and A_FireChaingun. 2016-11-19 16:39:45 +01:00
Christoph Oelckers
d50da34664 - scriptified the pistol to test if struct member functions work.
- made APlayerPawn::PlayAttacking(2) virtual script functions so that mods have better control over player animations. Note that these have no native base so they skip the templated interface for managing virtual functions.
2016-11-19 13:56:29 +01:00
Christoph Oelckers
d86f03e2e0 - reverted most of the last commit after realizing that trying to manage constructing/destructing per variable is not going to work because it'd require some extensive exception management in the compiled VM code.
- instead add a list of SpecialInits to VMScriptFunction so this can be done transparently when setting up and popping the stack frame. The only drawback is that this requires permanent allocation of stack objects for the entire lifetime of a function but this is a relatively small tradeoff for significantly reduced maintenance work throughout.
- removed most #include "vm.h", because nearly all files already pull this in through dobject.h.
2016-11-17 13:10:19 +01:00
Christoph Oelckers
6e223ebc21 Merge branch 'zscript' of https://github.com/rheit/zdoom into gz-zscript
# Conflicts:
#	src/CMakeLists.txt
#	wadsrc/static/actors/doom/doomarmor.txt
#	wadsrc/static/decorate.txt
2016-11-15 11:36:59 +01:00
Christoph Oelckers
ac86a535e7 - fixed: State labels were resolved in the calling function's context instead of the called function one's.
This could cause problems with functions that take states as parameters but use them to set them internally instead of passing them through the A_Jump interface back to the caller, like A_Chase or A_LookEx.
This required some quite significant refactoring because the entire state resolution logic had been baked into the compiler which turned out to be a major maintenance problem.
Fixed this by adding a new builtin type 'statelabel'. This is an opaque identifier representing a state, with the actual data either directly encoded into the number for single label state or an index into a state information table.
The state resolution is now the task of the called function as it should always have remained. Note, that this required giving back the 'action' qualifier to most state jumping functions.

- refactored most A_Jump checkers to a two stage setup with a pure checker that returns a boolean and a scripted A_Jump wrapper, for some simpler checks the checker function was entirely omitted and calculated inline in the A_Jump function. It is strongly recommended to use the boolean checkers unless using an inline function invocation in a state as they lead to vastly clearer code and offer more flexibility.

- let Min() and Max() use the OP_MIN and OP_MAX opcodes. Although these were present, these function were implemented using some grossly inefficient branching tests.
- the DECORATE 'state' cast kludge will now actually call ResolveState because a state label is not a state and needs conversion.
2016-11-14 14:12:27 +01:00
Christoph Oelckers
747b612860 Merge branch 'master' of https://github.com/rheit/zdoom 2016-11-03 19:42:03 +01:00
Christoph Oelckers
f940216c17 Merge branch 'master' into zscript
# Conflicts:
#	src/p_actionfunctions.cpp
#	wadsrc/static/actors/actor.txt
2016-11-02 11:08:51 +01:00
Christoph Oelckers
6e6249f896 - reverted WEAPONTOP to its original value of 32 and made the added fudging bit part of the render side.
This is needed so that 'offset(0,32)' does what it is supposed to do.
2016-10-31 18:53:28 +01:00
Christoph Oelckers
b1a83bfd26 - started with cleanup and separation of DECORATE code.
* everything related to scripting is now placed in a subdirectory 'scripting', which itself is separated into DECORATE, ZSCRIPT, the VM and code generation.
 * a few items have been moved to different headers so that the DECORATE parser definitions can mostly be kept local. The only exception at the moment is the flags interface on which 3 source files depend.
2016-10-12 19:22:33 +02:00
Christoph Oelckers
a4a00435e2 Merge branch 'master' of https://github.com/rheit/zdoom 2016-10-12 08:42:37 +02:00
Major Cooke
3de83b8943 Added PSPF_FLIP.
Flips the overlay on the X axis.
2016-10-11 17:20:58 -05:00
Major Cooke
8cfeca655d Added priority renderstyles, and added PSPF_FORCE(ALPHA / STYLE).
- Renderstyles now override alpha based on which is used.
- The new flags will override whatever renderstyle and alpha is currently being utilized.
2016-10-02 21:19:56 -05:00
Major Cooke
4865e7109c Fixed merge conflicts. 2016-10-02 21:18:01 -05:00
Christoph Oelckers
6bfbe30b99 Merge branch 'master' of https://github.com/rheit/zdoom
# Conflicts:
#	src/CMakeLists.txt
#	src/g_level.cpp
#	src/p_saveg.cpp
#	src/r_defs.h
#	src/version.h

(note that this commit will not compile!)
2016-09-24 00:40:15 +02:00
Christoph Oelckers
cf1e6d5275 - converted FBehavior::StaticSerializeModuleStates.
- removed some code which is no longer needed.
2016-09-20 11:35:25 +02:00
Christoph Oelckers
af6404f763 - all DObjects converted.
- cleaned out some old cruft that's no longer needed.
2016-09-20 10:27:53 +02:00
Christoph Oelckers
bce9929c22 Merge branch 'master' of https://github.com/rheit/zdoom 2016-07-16 19:57:09 +02:00
Christoph Oelckers
c150116f79 - fixed: When changing weapons due to starting or ending a Tome of Power effect, the PSprite's caller needs to be changed.
In this case the PSprite animation won't be changed, only the ReadyWeapon. But in order to work, the PSprite's caller needs to change as well so that the next weapon check does not fail.
2016-07-16 19:55:00 +02:00
Christoph Oelckers
943a799aee Merge branch 'master' of https://github.com/rheit/zdoom 2016-07-16 08:30:33 +02:00
Leonard2
75cb8c00a6 Fixed: the flags weren't properly reset if a mod used the old layers before the code used them 2016-07-13 13:01:32 +02:00
Christoph Oelckers
92e2ce2aef - adjustments for weapon rendering in GL.
This adds support for the new weapon state code and fixed some lighting calculations.
Note that this currently will not allow combination of HUD models with other sprite frames yet.
2016-06-17 17:21:42 +02:00
MajorCooke
c9f4620702 Reimplemented P_SetPsprite. 2016-06-16 07:24:00 -05:00
Leonard2
0b88bae458 The strife firehands now make proper use of the psprite layers 2016-06-03 19:46:31 +02:00
Leonard2
afa708c138 Allow psprite layers to be manipulated directly from the player's own body 2016-06-03 19:18:58 +02:00
Leonard2
543414d31f Added 2 new layer flags: PSPF_CVARFAST and PSPF_POWDOUBLE
These flags allowed to easily restore a lost part of the targeter layers
behavior
2016-06-03 00:50:11 +02:00
Leonard2
8668719bbc Revert "- re-added P_SetPSrite."
This reverts commit e6d89b9f71.
2016-06-02 20:02:03 +02:00
Leonard2
2f5ae3b51e Changed the default layer indices and renamed them
Note that this doesn't compile yet
2016-05-28 01:19:41 +02:00
Leonard2
c82620129c Added A_OverlayFlags
Allows psprites to follow the weapon and/or the player's bobbing
2016-05-28 01:19:40 +02:00
Leonard2
8f360f3bea Small refactor 2016-05-27 23:37:35 +02:00
Christoph Oelckers
e6d89b9f71 - re-added P_SetPSprite.
For debugging purposes it's better to have this as a function.
2016-05-24 13:05:43 +02:00
Christoph Oelckers
d767d10322 - made PSprites submission GC aware. 2016-05-21 13:11:43 +02:00
Leonard2
1966b61b8f Generalized the psprites implementation 2016-05-20 17:04:44 +02:00
Christoph Oelckers
ef98757c7c - replaced finesine for texture warping with a smaller custom table, based on the old 2005 FP code, but fixes the generation of the sine table.
- removed all remnants of finesine and deleted tables.c and tables.h.
2016-04-28 15:59:37 +02:00
Christoph Oelckers
7ebb961917 - added weapon bobbing interpolation.
This was so ridiculously simple that I really fail to understand why the previous attempt was so overcomplicated that it just failed for that.
2016-04-07 11:48:23 +02:00
Christoph Oelckers
6557f3b8c8 - floatified quake and weapon code 2016-03-23 20:45:48 +01:00
Christoph Oelckers
2d2eeb49f0 - make weapon sprite offsets floats. 2016-03-21 01:16:34 +01:00
Christoph Oelckers
f332a098cd - reworked calls to P_SpawnPlayerMissile, P_AimLineAttack and P_LineAttack to use floating point angles. 2016-03-18 00:43:05 +01:00
Randy Heit
55142078d8 Normalize line endings 2016-03-01 09:47:10 -06:00
Christoph Oelckers
b4a002a07f - preparations for allowing hitscans through portals.
To allow processing the hit through an arbitrary portal without reference to the portal group table, P_AimLineAttack and P_LineAttack need to pass some more info than just the linetarget.
We need the relative positions of shooter and target within the visual reference of the other to calculate proper angles and we need to know if such a portal was crossed at all, because a few things, e.g. seeker missiles won't work with them.

- fixed setup of target acquisition for the Mage Staff.

The pre-acquired seeker target was never passed to the spawned projectiles.
2016-03-01 16:39:31 +01:00
Randy Heit
459ad5abff - Updated scripting branch to latest version in trunk.
SVN r4337 (scripting)
2013-06-07 03:31:30 +00:00
Randy Heit
445bc148b7 - Fixed: r4067 completely disabled weapon switching via A_ReFire.
SVN r4157 (trunk)
2013-02-22 02:42:42 +00:00
Randy Heit
562cf04db2 - Update scripting branch to trunk.
SVN r3758 (scripting)
2012-07-14 03:04:41 +00:00
Randy Heit
19ec79d4f3 - Apply patch to prevent the flash state from being processed twice after using A_GunFlash.
SVN r3500 (trunk)
2012-04-01 02:49:04 +00:00