Commit graph

16284 commits

Author SHA1 Message Date
Kevin Caccamo
e04fc026ff Expand UDMF and ZScript API for side's own additive colors
Add 'useowncoloradd_{top,mid,bottom}' sidedef properties to the UDMF 
spec
Only use side's additive colors if 'useowncoloradd_(top|mid|bottom)' is 
set.
Rename UseOwnColors flag to UseOwnSpecialColors
Add UseOwnAdditiveColor flag to side_t::part
Add EnableAdditiveColor to side_t
Add Side.EnableAdditiveColor to ZScript API
2018-12-26 16:58:27 +01:00
Kevin Caccamo
286886e161 Minor fixes for additive colour ZScript API
Sector.SetAdditiveColor actually called Sector.SetSpecialColor
Add use boolean property, used to determine whether or not to override the sector's additive wall colour with the side's additive colour.
2018-12-26 16:58:27 +01:00
Kevin Caccamo
9622ca7517 Add additive color before applying object colors
Based on what I saw in this video (https://youtu.be/Yx1tflavea8), the 
additive colors are applied before the object colors
2018-12-26 16:58:27 +01:00
Kevin Caccamo
0773e6a98e Rework implementation as per the new specification
The new specification is more flexible, and allows assigning additive 
colors to individual parts of a sector (walls, sprites, flats) and even 
individual parts of a side (top, middle, bottom)

Add AdditiveColors arrays to sector_t and side_t::part
Initialize AdditiveColors arrays to 0
Export AdditiveColors to ZScript
Save AdditiveColors in saved game files
Use colors from AdditiveColors arrays when setting the additive color 
for the render state
Add code to parse the new UDMF additive color properties
Remove additive color slot from sector color/part enum
Add SetAdditiveColor to sector_t and side_t
Add GetAdditiveColor to side_t
Export new methods and additive color arrays to ZScript
2018-12-26 16:58:27 +01:00
Kevin Caccamo
60696c91a2 Change some of the names of the additive color properties 2018-12-26 16:58:27 +01:00
Kevin Caccamo
141a60b93d Update additive colour info in GZDoom UDMF specs 2018-12-26 16:58:27 +01:00
Kevin Caccamo
c165d0dc03 Add info about additive material colors to udmf_zdoom.txt 2018-12-26 16:58:27 +01:00
Kevin Caccamo
6485570c93 Implement additive colours on HUD sprites
Also, make sure the alpha for the additive colour is 255.
2018-12-26 16:58:27 +01:00
Kevin Caccamo
33723e8904 Implement additive colour on walls and sprites
Also, don't modify the alpha channel when adding the additive colour.
2018-12-26 16:58:27 +01:00
Kevin Caccamo
80bcac48ef Forcibly assign 0 to the additive special color 2018-12-26 16:58:27 +01:00
Kevin Caccamo
758cd77e55 Rename ColorAdd to AddColor, and use it ingame
Rename ColorAdd to AddColor
Add AddColor to FRenderState
Tweak SpecialColors array in ZScript to include the additive color
Add uAddColor to the shader compiler
Add uAddColor to the texel
2018-12-26 16:58:27 +01:00
Kevin Caccamo
e5d43a734a Initial work on Doom64-style fade/glow 2018-12-26 16:58:27 +01:00
Magnus Norddahl
094ef39d5f - dynamically update polyobj lines 2018-12-26 14:26:57 +01:00
Major Cooke
1e741446d7 Reduced redundancy by putting all function aftermath handling in a subfunction. 2018-12-26 11:55:42 +01:00
Major Cooke
6372cdaa41 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.
2018-12-26 11:55:42 +01:00
Major Cooke
2f7fae2fb0 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.
2018-12-26 11:55:42 +01:00
Ijon
d2d684a35a 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.
2018-12-26 11:49:17 +01:00
Magnus Norddahl
1bb2bb31d4 - fix first softpoly frame being empty 2018-12-25 16:50:11 +01:00
alexey.lysiuk
0584ecf65e - declared Actor's Morph() and UnMorph() functions virtual
They are expected to be virtual on C++ side
2018-12-25 16:27:33 +02:00
Rachael Alexanderson
dc05220abc - set vid_scalefactor to 1 when using vid_setscale 2018-12-25 00:18:44 -05:00
Christoph Oelckers
a40c617478 - 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.
2018-12-24 13:44:08 +01:00
Christoph Oelckers
c58f5095d9 - 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.
2018-12-24 10:18:58 +01:00
Magnus Norddahl
0c4602507e - remove shadow acne when dynlights perfectly align with planes 2018-12-23 15:13:38 +01:00
Magnus Norddahl
2cd1734de3 - improve softpoly 3d floor drawing somewhat 2018-12-23 14:59:47 +01:00
Christoph Oelckers
fcfccfe739 - fixed random number generation in SpawnFizzle.
This should now produce the same value range as Hexen's original code.
2018-12-23 12:40:26 +01:00
Christoph Oelckers
c1a86e9a4d - fixed bad attempt at restoring position in A_CustomBulletAttack. 2018-12-23 12:13:53 +01:00
Magnus Norddahl
38cffa7646 - fix null pointer crash, replace DONT_DRAW with a boolean, make rw_pic a local variable 2018-12-23 05:01:50 +01:00
Christoph Oelckers
9208fb9b77 - missed this. 2018-12-22 19:12:34 +01:00
Christoph Oelckers
36058df025 - gave the strifehumanoid's burn states dynamic lights.
Unlike everything else from the IWADs this had to use the 'light' keyword in ZScript because this is merely a base class for many others and the light definitions here need to be inheritable.
2018-12-22 16:11:18 +01:00
Christoph Oelckers
5e086ec384 - renamed back arguments of A_FireProjectile. 2018-12-22 16:11:18 +01:00
alexey.lysiuk
9446ddb318 - fixed default initialization of software warp textures
https://forum.zdoom.org/viewtopic.php?t=62979
2018-12-22 14:15:35 +02:00
alexey.lysiuk
fb540d6d2b - fixed multipatch texture resolving
https://forum.zdoom.org/viewtopic.php?t=62972
2018-12-22 11:21:04 +02:00
alexey.lysiuk
5c5b9eb044 - empty screenshot array is returned by base framebuffer
src/v_video.h:556:94: warning: control reaches end of non-void function [-Wreturn-type]
2018-12-21 14:59:25 +02:00
Christoph Oelckers
f6d9110c70 - removed the redundant GetOffsetPosition export and added direct native support to its existing variants 2018-12-21 13:52:30 +01:00
Christoph Oelckers
0770c0022c - cleaned up use of the random function in script files.
Many uses of random() & value have been turned into random(0, value).
This is not only more efficient, it also ensures better random distribution because the parameter-less variant only returns values between 0 and 255.
2018-12-21 12:40:05 +01:00
Christoph Oelckers
a44e63babd - fixed the decal translation handler truncated the translation ID
This was yet another of those old misguided 16 bit space 'optimizations'.
2018-12-21 12:40:05 +01:00
Christoph Oelckers
2c3c91ff42 - 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.
2018-12-21 12:40:05 +01:00
Christoph Oelckers
1deedd5671 - fixed PlayerInfo.FindMostRecentWeapon
returning multiple values from a subfunction is currently not working so this has to add an indirection.
2018-12-21 12:40:05 +01:00
Christoph Oelckers
ebaabcfb4f - a few more explicit local buffer allocations removed. 2018-12-21 12:40:05 +01:00
Christoph Oelckers
cf18dbdfa7 - use a TArray to pass the screenshot buffer
This also removes a few other explicit buffer allocations.
2018-12-21 12:40:05 +01:00
alexey.lysiuk
b3d6dfb55f - fixed lost settings controller state upon new game
https://forum.zdoom.org/viewtopic.php?t=62959
2018-12-21 13:14:21 +02:00
alexey.lysiuk
73d9751bb4 - cleaned up player reinitialization upon new game 2018-12-21 13:14:21 +02:00
Magnus Norddahl
b64dfb54a5 - fix decals looking blackened due to low lookup table precision when alpha is zero 2018-12-21 10:15:09 +01:00
Christoph Oelckers
9fab5f3b2c - fixed: For an initial weapon pickup, sv_unlimited_pickup wasn't checked for the included ammo. 2018-12-21 08:59:37 +01:00
Cacodemon345
789941f24d Export P_GetOffsetPosition and ADynamicLight::SetOffset to ZScript 2018-12-20 22:54:45 +01:00
Christoph Oelckers
66a2cdb6e9 - added missing null pointer checks to cheat code. 2018-12-20 22:09:41 +01:00
Player701
d049b3b3eb - Fixed the position of the soul sphere within one of the secret areas (sector 324) of Alien Vendetta MAP28. 2018-12-20 19:03:15 +01:00
Christoph Oelckers
e279214f5b - removed the hasglnodes variables.
Since the software renderer also requires GL nodes now this was always true.
2018-12-20 18:40:19 +01:00
Christoph Oelckers
d140d767a4 - changed last commit to let the replacement take the original's place and add the old texture at the end with its name cleared.
This is to ensure that this won't break ranged animations but aside from that should produce the same end result.
2018-12-20 18:20:25 +01:00
Christoph Oelckers
120b950291 - changed FTextureManager::ReplaceTexture to only append the new texture instead of replacing the old one.
This should ensure that other references to the original will remain valid.
2018-12-20 18:10:06 +01:00