Commit Graph

9258 Commits

Author SHA1 Message Date
Christoph Oelckers b31b6589e7 - fixed: PPointer was unable to handle pointers to class types for savegames. 2017-01-02 13:37:09 +01:00
Christoph Oelckers 7c3c886a90 - use the attenuated light definitions from QZDoom.
- apply them also to Freedoom.
- to compensate for the increase in light size required for attenuated lights to look correct, when running in legacy mode, they to be reduced in size to 2/3 of their defined size because the textured lighting method does not support real attenuation.
- removed the ancient size limit of 255 for light sizes which comes from a time when args were bytes.
2017-01-02 13:17:03 +01:00
Christoph Oelckers 6ab8e90911 - parse GLDEFS and its game-specific variants in lump order instead of both names sequentially. 2017-01-02 00:28:30 +01:00
Christoph Oelckers 9948189193 - scriptified PowerProtection and PowerDamage.
- made ModifyDamage calls iterative instead of recursive. With going through the VM they'd be too costly otherwise.
- small optimization: Detect empty VM functions right when entering the VM and shortcut them. This is to reduce the overhead of virtual placeholders, which in a few cases (e.g. CanCollideWith and ModifyDamage) can be called quite frequently.
2017-01-01 23:11:48 +01:00
Christoph Oelckers 1d3afce59b - let SBARINFO treat 'null' as 'untranslated'. Strictly speaking this wasn't a bug but apparently some people tend to use 'null' as a general placeholder for 'nothing', even where not intended. 2017-01-01 22:52:11 +01:00
Christoph Oelckers 5de3d662cb - re-added the glow properties for UDMF which somehow got lost. 2017-01-01 19:36:51 +01:00
Christoph Oelckers 66cc68606f - scriptified the methods of APowerMorph.
- made some changes to PowerMorph to better deal with recursive calls from UndoPlayerMorph. The flag hackery was only needed because the 'alternative' pointers were cleared far too late.
2017-01-01 19:23:43 +01:00
Christoph Oelckers 2d2963ead4 - fixed: The StripRight fix left some code from a previous fix in that no longer applies. 2017-01-01 16:55:45 +01:00
Christoph Oelckers 5d9cea9e0e - fixed: FString::StripRight's space checking counter was broken and would cause deletion of the last valid character in the string. 2017-01-01 14:44:16 +01:00
Christoph Oelckers 356c5f2e08 - removed the ZScript warning. 2017-01-01 12:29:03 +01:00
Edoardo Prezioso 9575715b1e - Added support to GCC/Clang sanitizers. 2017-01-01 00:17:42 +01:00
Christoph Oelckers e4c63563e3 - fixed: The 3D floor light splitting code for sprites did not copy the sector's fog density.
- fixed: fog calculations for fuzz effects were wrong.
2017-01-01 00:16:53 +01:00
Edoardo Prezioso 6b943043d1 - Update the list of dummy actor flags from Zandronum. 2016-12-31 23:02:01 +01:00
Christoph Oelckers 28d79cc2b0 - added some profiling code to the VM. 2016-12-31 17:59:48 +01:00
ZZYZX c845fc126a Enabled user shader for a cameratexture 2016-12-31 12:17:24 +01:00
Christoph Oelckers 267b1842b4 - scriptified a few more of the simpler powerups. 2016-12-31 01:08:09 +01:00
Christoph Oelckers 3b524cbed4 - scriptified PowerInfiniteAmmo to test the exported functions. 2016-12-31 00:20:02 +01:00
Christoph Oelckers fe0f19e1e0 - exported Powerup.InitEffect and EndEffect to scripting. 2016-12-30 23:32:43 +01:00
Christoph Oelckers 5e34bad03b - fixed: AActor::Tick must call CallDoEffect, not DoEffect for its inventory items or scripted overrides won't be called. 2016-12-30 21:32:06 +01:00
Christoph Oelckers a105a08bd6 - restored the original implementation of DONTOVERLAP, because Heretic depends on it being somewhat broken.
A side effect of the incorrect implementation is that Gargoyles hitting other Gargoyles won't call P_DamageMobj.
2016-12-30 20:00:24 +01:00
Christoph Oelckers a000b57204 - fixed player visibility determination by tracking and translating the actual actor position in addition to the camera position through portals. I hope this fixes the randomly appearing player sprites for good. 2016-12-29 22:19:09 +01:00
Christoph Oelckers f52744e8a4 - fixed: When looking through a plane mirror the portal plane exclusion logic needs to be flipped, because the mirror inverts the vertical view direction. 2016-12-29 19:54:38 +01:00
Christoph Oelckers 125a30307a Merge branch 'master' of https://github.com/rheit/zdoom 2016-12-29 14:34:13 +01:00
Christoph Oelckers a3070e8846 - fixed: FGLTexture::CreateTexBuffer needs to be more careful with setting the texture's translucency information.
First, if it has already been determined the value should be left alone and second, for translated textures the generated buffer is inconclusive so in that case it cannot be used at all.
2016-12-29 14:33:53 +01:00
Christoph Oelckers 4f21ff275c - removed duplicate portal_ceil_alpha and portal_floor_alpha UDMF properties.
These already existed as 'alphafloor' and 'alphaceiling' and got accidentally duplicated by Eternity.
2016-12-29 11:44:07 +01:00
Rachael Alexanderson 605a60d1d6 - Removed headers from c_functions.cpp, added forward struct declaration for FTranslatedLineTarget in c_functions.h. 2016-12-29 01:30:54 +01:00
Rachael Alexanderson cab1b60ffc - Some cleanups for c_cmds.cpp, exported some functions as well as functions used for "print/targetinv" to their own file. 2016-12-29 01:30:54 +01:00
Christoph Oelckers d748b6ad70 - added explicit fog density as a sector property, accessible through UDMF and ACS.
- allow changing sector glow information through ACS.
2016-12-29 01:12:17 +01:00
Christoph Oelckers 11bea8249a . added SetMusicVolume script function. 2016-12-28 21:41:06 +01:00
Christoph Oelckers 02c3b3613f - added UDMF properties to set glows per sector.
- for explicitly defined glows, use the one for the current animation frame, if an animated texture is active. For default glows it will still use the base texture's to avoid inconsistencies.
2016-12-28 21:35:42 +01:00
alexey.lysiuk 5dff3d5af0 Do not apply viewport scaling in fullscreen mode
See https://forum.drdteam.org/viewtopic.php?t=7339
2016-12-28 16:11:24 +02:00
alexey.lysiuk efaaefcb70 gl_scale_viewport CVAR is now saved to config file
See https://forum.drdteam.org/viewtopic.php?t=7339
2016-12-28 16:11:10 +02:00
ZZYZX ed2b73833b Enabled simple intermission for hubs 2016-12-28 14:06:28 +01:00
alexey.lysiuk c03cb2c97a Added support for long lines in config file
Single line key-value pair can now exceed 255 characters
Long path names and additional command line parameters (macOS only) are no longer cut off
2016-12-28 11:38:38 +01:00
Christoph Oelckers 6322c81719 - added UDMF_fields for sector plane reflectiveness. 2016-12-28 01:09:42 +01:00
Christoph Oelckers 80f1661931 - fixed: The player checking code after loading a savegame was not changed when tracer was replaced with alternative for holding the player's unmorphed version. 2016-12-27 22:44:22 +01:00
Christoph Oelckers 721b2fb21d - fixed: Instant floor movers should disable z-interpolation for all affected actors. 2016-12-27 21:16:42 +01:00
Christoph Oelckers 8708c69f83 - added GetClassName script function. 2016-12-27 19:25:55 +01:00
Christoph Oelckers 2478cd0467 - changed locking mechanism for ACS strings.
It will now store the level numbers that lock a string instead of just incrementing a counter. This should make it more robust because each level can lock a string only once and some possible leftover garbage data won't be able to cause a lock decrease when a savegame is being reloaded.
2016-12-27 18:53:30 +01:00
Christoph Oelckers e956d19769 - preserve the factor set by I_SetMusicVolume when starting new music. 2016-12-27 15:44:06 +01:00
Christoph Oelckers 4bf19fb665 - don't let monsters block teleports of non-solid inventory items. Doom's code never considered such a possibility and would consider the move blocking, despite the item being non-solid. 2016-12-27 15:34:44 +01:00
Christoph Oelckers 4da8b1a3b7 - delete r_ headers from portal.cpp. 2016-12-27 13:04:46 +01:00
alexey.lysiuk 2f9d5e285d Removed deprecated code from macOS SDL backend 2016-12-27 13:18:33 +02:00
Christoph Oelckers a37db1c4d7 - fixed: All missiles which can bounce off actors need the CANPASS/PASSMOBJ flag so setting this in the 'bouncetype' property is insufficient, it needs to be done when the actor has been completely parsed. 2016-12-27 00:32:54 +01:00
Christoph Oelckers e9574276a5 - added CanCollideWith calls to a few more places where they are needed. 2016-12-26 22:33:07 +01:00
Christoph Oelckers 58316c821d - fixed: The pitch shifting info for sounds needs to be taken from the sfxinfo currently being played, not the one it links to. 2016-12-26 21:07:21 +01:00
Christoph Oelckers 5327055495 - fixed: Source for nailbomb damage in A_Explode should be the caller's target, if defined and the caller is a missile. 2016-12-26 20:37:04 +01:00
Christoph Oelckers b9f7e0eb36 Merge remote-tracking branch 'remotes/zdoom/master' 2016-12-26 19:33:16 +01:00
Edoardo Prezioso 3f7c057f92 - Fixed heap use after free issue with lights. 2016-12-26 18:23:17 +01:00
Christoph Oelckers 625e97dfd1 - fixed: UpdateRenderSectorList needs to reset the sector before traversing floor portals. 2016-12-26 16:22:28 +01:00
alexey.lysiuk aeee80c8fa Fixed endianness issue in script VM
See https://forum.zdoom.org/viewtopic.php?t=54549
2016-12-26 15:31:59 +01:00
Christoph Oelckers be508bc670 - adjust to using msecnode_t's. 2016-12-26 12:11:55 +01:00
Christoph Oelckers 9cb2a8f931 Merge remote-tracking branch 'remotes/zdoom/master' 2016-12-26 12:04:13 +01:00
Christoph Oelckers 7f72de6b71 - use msecnode_t's for the touching_renderlists instead of std::forward_list.
- preparations for checking the proper sector to get a sprite's lighting info.
2016-12-26 11:58:08 +01:00
ZZYZX 6f16597668 GL renderer now uses RenderRadius links too 2016-12-25 23:46:03 +01:00
Christoph Oelckers 19856d6ccb Merge branch 'master' of https://github.com/rheit/zdoom 2016-12-25 22:56:35 +01:00
Christoph Oelckers c5d75c18b4 - make gl_finishbeforeswap more useful by handling the case where it causes stalls on NVidia. 2016-12-25 22:56:18 +01:00
Christoph Oelckers 04ff4282ef - removed the global 'sector_list' variable.
If the calling code wants to recycle this it will have to pass a container variable to AActor::UnlinkFromWorld and AActor::LinkToWorld.
This was changed because keeping such data in a global variable is dangerous for a set of functions that can be called from a script.
Note that the scripted versions do not yet support saving of the touching_sectorlist.
2016-12-25 22:40:26 +01:00
Christoph Oelckers 5723f10cc3 - use 'for' iterator syntax to check touching_renderlists. 2016-12-25 19:37:07 +01:00
Christoph Oelckers 663b305eec - include proper headers for std::find. 2016-12-25 19:25:19 +01:00
Christoph Oelckers 2ce55e5416 - fixed: non-damaging attacks should not cause infighting, unless some relevant pain flags are being set. 2016-12-25 19:19:49 +01:00
Christoph Oelckers 89b7cf4262 - fixed: RenderRadius needs to be serialized.
- fixed: CustomBridge can be visible so it shouldn't be completely excluded from the render lists.
2016-12-25 14:35:35 +01:00
Christoph Oelckers ad2993950a - fixed light level calculation for low light levels. 2016-12-25 12:58:29 +01:00
ZZYZX 44c19b5ad9 Changed zero RenderRadius logic - negative values now used for 'no rendering', restored old logic with max(radius, renderradius) 2016-12-25 13:40:21 +02:00
ZZYZX 40a180c15f Changed zero RenderRadius logic - thing should still link to own sector 2016-12-25 13:37:45 +02:00
ZZYZX fcd8a0ce92 Reverted STYLE_None change to P_LinkRenderSectors, implemented zero RenderRadius that effectively disables rendering of an actor entirely 2016-12-25 13:35:03 +02:00
ZZYZX 98657f6844 STYLE_None actors are no more subject to P_LinkRenderSectors 2016-12-25 13:19:45 +02:00
ZZYZX 87b23d160b Ported RenderRadius and related code from gzdoom branch 2016-12-25 13:09:32 +02:00
Christoph Oelckers 4ee2d4a1a4 - print proper information in zcc_compile.cpp. 2016-12-24 23:52:52 +01:00
alexey.lysiuk 5d8d15ecc3 Fixed additional format string warning reported by GCC/Clang
See https://forum.zdoom.org/viewtopic.php?t=54541
2016-12-24 23:51:08 +01:00
alexey.lysiuk e825918451 Fixed format strings warnings reported by GCC/Clang
See https://forum.zdoom.org/viewtopic.php?t=54541 and https://forum.zdoom.org/viewtopic.php?t=54709
2016-12-24 23:51:08 +01:00
Christoph Oelckers 54822c29eb - changed pitch math in P_RailAttack to avoid having to deal with bogus math throughout the entire function. Effectively the only thing this changes is passing the correct pitch to P_DrawRailTrail. 2016-12-24 18:24:44 +01:00
Christoph Oelckers 39d2945016 fixed two more places where a negative pitch was calculated:
- A_CustomRailgun when missing the target.
 - A_FaceMovementDirection which ironically had some bad compensation inside. It is not restored to how the code looked in 2.8.1.
2016-12-24 18:10:37 +01:00
Christoph Oelckers 287974968a - renamed A_FireCustomMissile and added a deprecated compatibility wrapper to deal with the inverted pitch this function used. 2016-12-24 16:34:45 +01:00
Christoph Oelckers b807f50bde - fixed: AimBulletMissile used negative pitch to calculate the projectile's trajectory, presumably because A_Face calculated it wrong in recent devbuilds. 2016-12-24 15:10:07 +01:00
Christoph Oelckers d4c0ee9e43 - address bad use of pitch in A_CustomMissile.
This function calculated everything correctly but ultimately set the vertical velocity wrong. Most importantly this meant that the actual velocity vector and actor pitch - if CMF_SAVEPITCH was used - did not match.
Since this bug has been present since the pitch parameter was added, this deprecates A_CustomMissile and replaces it with a properly implemented A_SpawnProjectile function and handling the compatibility case with a new flag and a scripted wrapper function.
All internal uses of A_CustomMissile have been replaced as well.
2016-12-24 14:46:34 +01:00
Christoph Oelckers 78737f9bc7 - fixed: The cycler for a pulse light needs to be reinitialized when new light properties get applied.
- do not clamp the cycler's output to a byte.
2016-12-23 15:25:39 +01:00
alexey.lysiuk 2327359d74 Fixed sector floor offset compatibility parameter after floatification
See https://forum.zdoom.org/viewtopic.php?t=54690
2016-12-23 10:21:53 +01:00
Christoph Oelckers a825d1d92f Merge branch 'ssao' of https://github.com/dpjudas/dpDoom 2016-12-22 12:40:57 +01:00
Christoph Oelckers 3b823fa3eb Merge branch 'master' of https://github.com/rheit/zdoom
# Conflicts:
#	wadsrc/static/compatibility.txt
2016-12-22 11:29:44 +01:00
Rachael Alexanderson 3810328193 - More options for the IWAD picker.
- Rearranged some options around a bit.
- Disable auto load is now an archived cvar.

# Conflicts:
#	src/win32/zdoom.rc
2016-12-22 11:26:23 +01:00
Rachael Alexanderson cb2c1e591a - Added Zandronum-specific copyright notices for IWAD picker. 2016-12-22 11:26:23 +01:00
Rachael Alexanderson 5fa6094e4f - Changed QZDoom messages to GZDoom. 2016-12-22 11:26:23 +01:00
Rachael Alexanderson 240f973f0c - Implemented Gez's suggestion for disable autoload checkbox on the IWAD selection box.
(cherry picked from commit 578e3270e2)
2016-12-22 11:26:23 +01:00
Rachael Alexanderson 8a9ea2eda8 - Mostly implemented Zandronum's IWAD selection box. Currently, this change only affects Windows.
(cherry picked from commit b3bed807de)
2016-12-22 11:26:23 +01:00
Christoph Oelckers 36f87b7135 - removed gl_light_ambient.
This really serves no use anymore and is mostly a remnant of old times with dark CRT monitors. The default ambient level was set at 20, meaning a sector light level of 40. This is a value actual levels rarely get to, except when using some lighting effects - but it's for those that the ambient clamping did the most damage.
2016-12-22 11:14:13 +01:00
alexey.lysiuk 7dd51d6d1c Fixed infinite execution of error CCMD
https://forum.zdoom.org/viewtopic.php?t=54659
2016-12-22 10:33:21 +01:00
Christoph Oelckers b15e620ea8 - fixed: Phased light setup did not check if a sector had been already visited and could cause infinite recursion. 2016-12-20 18:27:24 +01:00
alexey.lysiuk 9f6d8d2ba7 Set goal values in decal stretcher to zeros even if they are not used
See https://forum.zdoom.org/viewtopic.php?t=54592
2016-12-20 12:19:12 +01:00
alexey.lysiuk a0595f17e8 Serializer now writes floating point zero if special value is encountered
See https://forum.zdoom.org/viewtopic.php?t=54592
2016-12-20 12:19:12 +01:00
Magnus Norddahl 2676ca1284 Rename wall drawer args and functions to closer match the general naming convention 2016-12-19 21:39:16 +01:00
Rachael Alexanderson 5d85990d5f - Implementing RGB666-to-Palette colormatching for textures. 2016-12-19 13:46:08 +01:00
alexey.lysiuk 94f7bef2ff Added compatibility parameter to set sector special 2016-12-19 12:18:43 +01:00
Christoph Oelckers 1fa37aaeb7 - fixed code generation for if statements with empty 'true' part. For those the jump statement backpatching was not done correctly. 2016-12-18 14:09:16 +01:00
Christoph Oelckers 8dd91f7129 - added a missing null pointer check to FxIfStatement::Emit. 2016-12-18 12:18:03 +01:00
Major Cooke 1bcebb091a Added option to check the location for resizing, changing the return into a bool. 2016-12-18 11:59:24 +01:00
Major Cooke 3023af8223 - Added A_SetSize(double newradius, double newheight = -1).
- Changes the calling actor's radius and height.
2016-12-18 11:59:24 +01:00
Magnus Norddahl 2fea46a719 Removed leftovers from QZDoom 2016-12-18 11:58:32 +01:00
Magnus Norddahl 9ac7a07be6 - Set colormap light info using R_SetColorMapLight and R_SetDSColorMapLight rather than manually calculating it
- Move texture and span management into R_DrawMaskedColumn
2016-12-18 11:58:32 +01:00
Christoph Oelckers 98e549246d Merge branch 'master' of https://github.com/rheit/zdoom 2016-12-17 17:39:57 +01:00
Christoph Oelckers 7ca5851f78 - fixed a second spot in RapidJSON where a bad NaN check was done. 2016-12-16 08:05:29 +01:00
Christoph Oelckers 9ef551b84a - fixed: Start items for players were never actually checked for their type and could cause crashes if non-inventories were given. 2016-12-16 00:28:16 +01:00
Rachael Alexanderson 8fede44c3d - fixed: Some RenderStyles would crash ZDoom. 2016-12-15 18:55:20 +01:00
Magnus Norddahl c3cb9d20fb Fix uncleared buffer when upscaling the cursor 2016-12-15 09:30:45 +01:00
Rachael Alexanderson 5e171824ac - "myinfo" - executes info on oneself
- "targetinv" - executes "printinv" at current crosshair target
2016-12-12 15:22:56 +01:00
Christoph Oelckers 56a42a26b2 - fixed: DPSprite's constructor did not initialize the 'Sprite' member variable. This can cause problems if some weapon starts with a placeholder sprite in the first state. 2016-12-12 12:32:48 +01:00
Christoph Oelckers 77d9978b27 - fixed: Non-Actors cannot act as activators for action specials and must pass null when acticating one. 2016-12-11 21:39:35 +01:00
Christoph Oelckers e61ae9a1f9 - pass a proper self pointer to BuiltinCallActionSpecial instead of making bogus assumptions about a function's parameters. 2016-12-11 21:32:19 +01:00
Christoph Oelckers 71fd949f26 Merge branch 'master' of https://github.com/rheit/zdoom 2016-12-11 14:45:42 +01:00
Christoph Oelckers b43609c701 - fixed: The weapon sprite fudge offset should not be added when just interpolating the position and calculating the delta. 2016-12-11 14:45:20 +01:00
Christoph Oelckers 40355f6298 - allow A_M_Refire to be called without state label because this seems to have been used in existing DECORATE mods. This way of calling it will revert to the old behavior of jumping one state forward instead of to a state label. 2016-12-11 13:07:25 +01:00
Christoph Oelckers aa758159c9 - renamed Actor.NoiseAlert to Actor.SoundAlert to deconflict with the same-named action special. 2016-12-11 12:10:05 +01:00
Christoph Oelckers d2d960672c Revert "Fixed: A_CustomMissile's CMF_AIMDIRECTION's pitch calculations were also backwards."
This reverts commit b17bd65279.

This would break too many existing mods.
2016-12-11 11:39:46 +01:00
Christoph Oelckers 952e47cfe4 - renamed internal MELEERANGE constant to deconflict with Actor's MeleeRange member. 2016-12-10 16:36:19 +01:00
Edoardo Prezioso d92a814e8c - Fixed wrong argument format in voxeldef parser code.
It got revealed by the GCCPRINTF format addition to FScanner::ScriptMessage.
2016-12-10 14:02:12 +01:00
Edoardo Prezioso 8036719f45 - Add GCCPRINTF to ZScript compiler code.
This will help spotting errors in code using ZCCCompiler::{Warn,Error}.
2016-12-10 14:02:12 +01:00
Edoardo Prezioso 810c632beb - Added missing GCCPRINTF to FileWriter::Printf.
Luckily, this has shown no problems.
2016-12-10 14:02:12 +01:00
Edoardo Prezioso 45e5e5c6ee - Add missing GCCPRINTF to FraggleScript script_error function.
This will help spotting errors inside FraggleScript.
2016-12-10 14:02:12 +01:00
Edoardo Prezioso d4a674740e - Add missing GCCPRINTF to timidity cmsg function.
Luckily, this has shown no problems.
2016-12-10 14:02:12 +01:00
Edoardo Prezioso b78b8662dc - Add missing GCCPRINTF in scanner code.
This will help spotting erroneous usage of FScanner::{ScriptError,ScriptMessage} and FScriptPosition::Message.
2016-12-10 14:02:12 +01:00
Christoph Oelckers 7d4a5898ac - removed most inline assembly. Integer multiplication gets handled fine by all current compilers and fixed point division is too infrequently used to justify this mess.
That only leaves the Scale function which is still being used in a few places and which would create considerably worse code without assembly on 32 bit platforms. This is also far too primitive (2 or 3 assembly instructions) to claim any copyright on it, so I think m_fixed.h can now be considered free of Build-related issues. The deficated inline headers have been removed because that sole remaining function could be easily moved into m_fixed.h.
2016-12-10 13:58:18 +01:00
Christoph Oelckers 3563718049 - removed all fixed point inlines that aren't used anywhere. Note that most of the rest are only being used in one single function: R_DrawVoxel. 2016-12-10 12:12:29 +01:00
Christoph Oelckers 6c86a33f5d - fixed compilation of cursor scaling code. This reported 'std::vector' not defined, so now it just uses TArray, like the rest of ZDoom. 2016-12-10 12:05:46 +01:00
WilliamFeely 0e448a6450 Change DPI Awareness to per-monitor on Windows8.1+ 2016-12-10 10:30:23 +01:00
Magnus Norddahl 54759782b3 Fix cursor size 2016-12-10 10:29:43 +01:00
Magnus Norddahl c4ca70101d Fix console window geometry size 2016-12-10 10:29:43 +01:00
Christoph Oelckers a7c80ae858 - fixed: The message for invalid class extensions did not pass the class name to the error function. 2016-12-10 10:22:13 +01:00
Christoph Oelckers 902a4b839c - fixed: Type determination of multi-dimensional arrays failed, apparently because ZCCCompiler::Simplify is too broken to leave the node's ring list intact.
Instead of trying to fix Simplify, which seems to be a lost cause, the ring list now gets unraveled into an array which is immune from this type of problem.
2016-12-09 23:01:12 +01:00
Major Cooke b17bd65279 Fixed: A_CustomMissile's CMF_AIMDIRECTION's pitch calculations were also backwards. 2016-12-09 16:27:29 +01:00
Christoph Oelckers c7cddcac0b - removed Build notice from r_segs.cpp because there is no Build code left in this file. 2016-12-09 15:12:16 +01:00
Magnus Norddahl 6806b498f8 Fix null pointer crash in rt column drawers if rt_init is not called before the first draw 2016-12-09 15:07:49 +01:00
Christoph Oelckers 5da9f71589 - renamed the WallMost functions because again: No more Build code -> no Build names! 2016-12-09 14:46:05 +01:00
Christoph Oelckers 356e55f0a2 - made the general entry point to the wall drawer a single function instead of requiring the caller to check for NPOT textures.
- renamed all functions in r_walldraw.cpp to give them names more in line with Doom's naming conventions. Since this is not Build code anymore it also shouldn't use Build names to avoid giving a false impression.
2016-12-09 14:25:51 +01:00
Christoph Oelckers b709db3fd3 Merge branch 'master' of https://github.com/rheit/zdoom 2016-12-09 13:32:05 +01:00
Christoph Oelckers 86909ecdb2 - removed several unused fixed point math functions from the inlines headers. 2016-12-09 13:27:30 +01:00
Christoph Oelckers eab06ef086 - more Build cleanup: Moved clearbufshort out of Build derived headers, removed the inline version for GCC 32 bit which was actually Build derived and renamed the C-version of this function, which does not originate from Build to 'fillshort'.
- cleaned out a lot the SafeDivScale stuff in m_fixed.h. The only SafeDivScale variant still in use was #16 for FixedDiv, so all the SafeDivScale stuff has been removed and the 16 variant renamed to FixedDiv because that's the only form in which it is still being used. (2x in R_DrawVoxel and 1x in ACS's FixedDiv PCode.)
- removed Build notice from m_fixed.h because aside from the inlines includes there is nothing here from Build anymore.
2016-12-09 13:04:53 +01:00
Christoph Oelckers 12a99c3f3c - got rid of clearbuf.
This was used in only 4 places, 3 of which could easily be replaced with a memset, and the fourth, in the Strife status bar, suffering from a pointless performance optimization, rendering the code unreadable - the code spent here per frame is utterly insignificant so clarity should win here.
2016-12-09 12:48:10 +01:00
Christoph Oelckers f3389ff5b7 - let's be a bit clearer and not name non-Build stuff with Build terms. 2016-12-09 12:21:27 +01:00
Christoph Oelckers 34d551fe1f - moved wallscan code into its own file so that it can get an appropriate copyright notice and does not inflate an already large source file even more. 2016-12-09 11:49:18 +01:00
Christoph Oelckers 8748b9ef6d - removed some unused functions from m_fixed.h.
- removed the Build license note from r_bsp.cpp.

This note was for code in R_AddLine which had been both refactored into several subfunctions and completely replaced with a floating point version. What is left is just some basic common math without any traits that resemble anything in Build.
2016-12-09 10:31:17 +01:00
Christoph Oelckers 5536184bee - got rid of ksgn.
Because every bit of Build code that can be removed is a good thing.
This was only used in two places, one of which could be done better, the other one in the voxel drawer setup now uses a local C-inline version.
2016-12-09 00:43:54 +01:00
Edoardo Prezioso 67b2e2f52e - Remove valgrind code, now that the assembly stuff is gone. 2016-12-08 22:44:23 +01:00
Christoph Oelckers 8a6d3b8e7b - sprites.cpp 2016-12-08 21:05:53 +01:00
Christoph Oelckers 3fbe41957d - removed GZDoom call. 2016-12-08 21:05:31 +01:00
Christoph Oelckers 6c628c9584 - changed sprite setup to work without global work variables. 2016-12-08 19:27:49 +01:00
Christoph Oelckers ee09219c08 Merge branch 'master' of https://github.com/rheit/zdoom 2016-12-08 19:08:25 +01:00
Christoph Oelckers d46ceafd35 - fixed: A_Face* had the sign for the pitch inverted (In Doom, negative pitch is upward, this had positive pitch upward.) 2016-12-08 19:07:50 +01:00
Christoph Oelckers 14400c41b6 Merge branch 'zmaster' 2016-12-08 17:53:41 +01:00
Christoph Oelckers a4d2468d34 - disable weapon interpolation for offset changes.
This has been causing far too many problems so now it will only be done if a A_Weaponoffset is either used with WOF_ADD or WOF_INTERPOLATE.
2016-12-08 17:52:59 +01:00
Christoph Oelckers 8f45664089 - fixed: Fog boundaries were not drawn on line portals.
There's two restrictions, though:

* on one-sided-line portals fog boundaries will not be drawn.
* the filler sector behind the portal may not have a sky ceiling texture. This is because the drawing code contains several sky checks which get in the way here.
2016-12-08 17:00:15 +01:00
Magnus Norddahl fb4e34d178 Fix crash reporter for 64 bit 2016-12-08 14:36:17 +01:00
Christoph Oelckers 715bdd69af Merge branch 'master' of https://github.com/rheit/zdoom 2016-12-08 12:50:57 +01:00
Christoph Oelckers 3558b2234c - fixed: The dynamic light setup for walls did not portal-translate the light's coordinate.
- changed ADynamicLight::CollectWithinRadius to work iteratively to avoid the high stack overhead of 64 bit code.
2016-12-08 12:50:45 +01:00
Christoph Oelckers d741e0eb26 - fixed: P_CheckSight returned incorrect results when having to traverse the collected lines just for adding more portals to the list. 2016-12-08 11:23:08 +01:00
Christoph Oelckers 0720dd9816 Merge branch 'master' of https://github.com/rheit/zdoom
# Conflicts:
#	src/p_map.cpp
2016-12-08 10:17:12 +01:00
Christoph Oelckers 66d287ea81 - fixed: Stepping through a ceiling portal on a two-sided line did not work.
- fixed: Stepping up an actor checked against the sector's own ceiling, even if it was a crossable portal.
2016-12-08 10:16:22 +01:00
Christoph Oelckers 12f0b56036 - fixed: Stepping up through a portal did not work when the step line was two-sided. This special case was only implemented for one-sided lines
- fixed: The portal collector set bad flags for collected lower portals.
2016-12-08 00:59:04 +01:00
Christoph Oelckers 1e950d75bd - made dynamic light attenuation completely opt-in. This can be done either by setting a MAPINFO option for lights that do not automatically specify it and with a light property. The light property will always take precedence, if set. 2016-12-07 23:17:18 +01:00
Christoph Oelckers aa939ef17a Merge branch 'master' of https://github.com/coelckers/gzdoom 2016-12-07 22:53:06 +01:00
Christoph Oelckers f547daccc8 Merge branch 'master' of https://github.com/rheit/zdoom
# Conflicts:
#	src/CMakeLists.txt
2016-12-07 22:51:05 +01:00
Christoph Oelckers 6adcba3c4b - fixed linkage for fuzzviewheight
- fixed naming conflict with GCC's virtual table.
2016-12-07 18:39:09 +01:00
Edoardo Prezioso e4c208602d - Fixed GCC/Clang warning/error. 2016-12-07 16:07:25 +01:00
Christoph Oelckers 2677976cae - r_drawt.cpp is no longer needed. 2016-12-07 15:44:25 +01:00
Christoph Oelckers a118903e3e - complete removal of assembly stuff. Nothing of this gets used anymore. 2016-12-07 14:41:21 +01:00
Christoph Oelckers ed141943e1 - removed use of BestColor_MMX because there is no measurable improvement at all on a modern system. On top of that this function does not get called nearly often enough to justify the hassle. Like DoBlending this would require hundreds of calls per frame to make any impact that would be measurable. 2016-12-07 14:40:19 +01:00
Christoph Oelckers 5910067c44 - discontinue using the MMX assembly version of DoBlending.
Some benchmarking shows that on SSE systems it only harms performance and compared to the intrinsics version the gains are too marginal for something this infrequently called.
Doing 100000 calls of DoBlending results in a 5 ms decrease of using assembly vs intrinsics on a 3.4 GHz Core i7, meaning that even on a computer that is 10x slower you can still do 1000 or so blends per frame without a speed hit.
2016-12-07 14:40:18 +01:00
Rachael Alexanderson 2200f6eda3 - fixed: compile error with SDLGLVideo class macro 2016-12-07 13:21:28 +01:00
Christoph Oelckers 42346c58d3 - disabled assembly entirely to make the MT drawer submission compile.
This still requires a review of the two non-drawer functions that get 'lost'.
2016-12-07 12:31:43 +01:00
Christoph Oelckers 1e42c6f227 - added copyright headers to two files missing them. 2016-12-07 11:40:59 +01:00
Magnus Norddahl 3ff91807b8 Move swrenderer into a namespace, add multithreading framework, and move drawers to commands 2016-12-07 09:34:49 +01:00
Christoph Oelckers 56f67726f0 - seems a Linux file was missed when refactoring the IMPLEMENT_CLASS macros. 2016-12-07 00:54:40 +01:00
Christoph Oelckers 6271ecf2af Merge remote-tracking branch 'remotes/zdoom/master' 2016-12-06 22:47:53 +01:00
Christoph Oelckers c3fb43db3a Merge branch 'gz-zscript' 2016-12-06 22:47:37 +01:00
Christoph Oelckers 52645afb4b - for the time being, make ZScript command line switch locked so that everybody understands that it's not ready for use in released mods yet. 2016-12-06 22:42:10 +01:00
Christoph Oelckers a3ae05299b - fixed: glPolygonOffset was not called for flat sprites. 2016-12-06 19:17:02 +01:00
Christoph Oelckers c115c0a5b2 - fixed: Random flicker lights must set up their size on the first tic they are run. If not they will keep the radius of the previous effect which may be too large. 2016-12-06 18:35:34 +01:00
Christoph Oelckers d04c37101e Merge branch 'master' of https://github.com/coelckers/gzdoom 2016-12-06 12:59:03 +01:00
Christoph Oelckers 17698467d7 - made application of dynamic lights to additively blended surfaces a MAPINFO option. In most cases this is not wanted but sometimes this can be used to good effect so it should be there as an option. 2016-12-06 12:58:45 +01:00
Christoph Oelckers fb7b49bba1 Merge branch 'master' of https://github.com/rheit/zdoom 2016-12-06 12:35:22 +01:00
Christoph Oelckers e41e404143 Merge branch 'zscript' of https://github.com/rheit/zdoom into gz-zscript 2016-12-06 12:33:52 +01:00
Christoph Oelckers b2d1b0d7a6 - fixed: FTranslatedLineTarget::angleFromSource returned the attack angle, not the angle between actors when returned from P_LineAttack.
For most attack functions this is wrong, it's only the Hexen fighter attack needing this particular value, so it has been split up into two return values now.
2016-12-06 11:04:54 +01:00
Christoph Oelckers daaa6e7831 - fixed bad parameter in AActor::ModifyDamage. 2016-12-06 00:00:56 +01:00
Rachael Alexanderson 824705eaca - Fixed compile errors with maxviewpitch update 2016-12-05 22:32:18 +01:00
Rachael Alexanderson c53a20aea6 - Notify gamesim of maxviewpitch change. 2016-12-05 22:32:18 +01:00
Christoph Oelckers 092461ed34 - make dynamic object casts a dedicated VM instruction instead of a builtin function.
This can see some heavy use in iterators where saving several hundreds of function calls can be achieved. In these cases, using a function to do the job will become a significant time waster.
2016-12-05 14:52:34 +01:00
Christoph Oelckers f722967abe - added automatic type deduction capabilities for local variables. If you type 'let variable = value;' the type of 'variable' will be deduced from the given value. This is mostly of interest for type casting pointers, because 'let p = Classtype(objectvar);' does not require writing the class type name twice. 2016-12-05 13:24:42 +01:00
Christoph Oelckers 67bdac5227 Merge branch 'master' into zscript 2016-12-05 12:03:59 +01:00
Christoph Oelckers c0a622eb54 - removed pointless assignment. 2016-12-05 02:08:26 +01:00
Christoph Oelckers f6fb27b683 - deleted rt_copy*col and rt_map*col assembly versions after running benchmarks that show inferior performance to the C++ versions on both older and newer CPUs. 2016-12-05 00:46:58 +01:00
Christoph Oelckers 86fcc3fd21 - added a heavily optimized version of vlinec4 for x64. The original loaded everything from the global variables. While this is acceptable in 32 bit code because it has an immediate register load instruction, for 64 bit this does not exist. Accessing these variables from the stack or a register doubles the execution speed of this function and on a Core i7-3770 from 2012 is even faster than the assembly version. Right now the assembly version is still there, pending a benchmark run on an older 64 bit system. 2016-12-04 23:53:36 +01:00
Christoph Oelckers f4454d2e00 - minor, but very effective optimization for R_DrawSpanMasked: Do not store the texel value in a byte. Store it in a local int variable. This allows the compiler to read it with a zero extending instruction instead of using a byte reading instruction and then later having it to convert to an int anyway. This removes one instruction from the loop which results in a 10% performance increase on 32 bit. 2016-12-04 19:32:54 +01:00
Christoph Oelckers c9caaf08c8 - removed asm version of R_DrawFuzzColumn, because even on my 9 year old laptop this was significantly slower than the C version. 2016-12-04 18:38:38 +01:00
Christoph Oelckers 13efb34964 - removed the asm version of R_DrawColumn because it doesn't provide any significant benefit.
On modern systems it is actually slower than the C version, only on old ones it is marginally faster - but the overall execution time for this function is so low that even in the worst case scenario the minor loss of performance on older systems is still not relevant.
2016-12-04 18:05:34 +01:00
Christoph Oelckers 8fd03bc4a3 - fixed a few prototypes. 2016-12-04 16:57:10 +01:00
Christoph Oelckers 93163d12f1 - removed R_DrawColumnHorizP_ASM completely after discovering that the compiler generated code isn't really anything worse than the old assembly code. This looks like something that may have been relevant 10 years ago but today it looks like there's no need for hand optimization here anymore. And since it appears to be broken anyway, off this goes. 2016-12-04 15:31:08 +01:00
Christoph Oelckers d0cf34890c - disabled R_DrawColumnHorizP_ASM because that function appears prone to crashing when rendering decals. 2016-12-04 15:01:48 +01:00
Christoph Oelckers bf0aedfd9c Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-12-04 14:29:24 +01:00
Christoph Oelckers 5a08768eaf - removed unused label. 2016-12-04 14:29:03 +01:00
Magnus Norddahl 0ed0c47a45 Optimize capped sky rendering by writing 4 pixels at a time in 5 bands (solid, fade, texture, fade, solid) 2016-12-04 14:28:13 +01:00
Christoph Oelckers 18b953dd50 - fixed: Blasted objects should also be subject to being checked with CanCollideWith. 2016-12-04 10:34:36 +01:00
Christoph Oelckers 71e8f09126 Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-12-04 10:27:35 +01:00
Edoardo Prezioso 0cff443945 - Fixed missing linebreak in 'currentpos' error message. 2016-12-04 10:25:23 +01:00
Edoardo Prezioso c99a051a2a - Added lambda feature to FString::(Strip|Replace)Chars.
Use it in the other (Strip|Replace)Chars methods to show how it would work.
2016-12-04 10:24:49 +01:00
Christoph Oelckers 94287518e0 - added a virtual CanCollideWith script method that can be overridden to do class specific collision checks.
This will get called for both actors taking part in a collision, if one of the two calls returns false it will immediately abort PIT_CheckThing with no collision taking place at all.
2016-12-04 10:13:36 +01:00
Christoph Oelckers daf1a40521 - allow swapping the order of gl_finish and SwapBuffers calls, because some cards do not seem to like the correct order. 2016-12-03 20:09:25 +01:00
Christoph Oelckers 834802def3 - sanitized the old sprite offset adjustment feature and used it to redefine offsets for some sprites that have really bad ones. 2016-12-03 19:49:32 +01:00
Christoph Oelckers dc1f03ec13 Merge branch 'zscript' of https://github.com/rheit/zdoom into gz-zscript 2016-12-03 19:14:39 +01:00
Christoph Oelckers 04f5be6249 - zcc_compile.cpp needs to include version.h for the DYNLIGHT #define. 2016-12-03 19:14:20 +01:00
Christoph Oelckers 5dd63a86cf - removed excess arguments for IMPLEMENT_CLASS. 2016-12-03 18:59:28 +01:00
Christoph Oelckers fbc8d0e83c Merge branch 'zscript' of https://github.com/rheit/zdoom into gz-zscript
# Conflicts:
#	wadsrc/static/zscript.txt
2016-12-03 18:51:10 +01:00
Christoph Oelckers 34970c9b9c - removed hexenglobal include from GL files. 2016-12-03 18:49:52 +01:00
Christoph Oelckers 71bda99c3b - fixed: DECORATE didn't pass all needed arguments to FunctionBuildList.AddFunction. Removed the default parameter values from this function's declaration to prevent it from happening again. 2016-12-03 18:14:07 +01:00
Christoph Oelckers 21e3aba1c7 - optionally allow passing a script position object to V_GetColor and subfunctions for better error output. Implemented this for all occurences where this info was available. 2016-12-03 16:27:53 +01:00
Christoph Oelckers 1fc90b1ba9 - fixed: A_Face* should not require the target to be non-null. 2016-12-03 15:59:02 +01:00
Christoph Oelckers 6a4f867c91 Merge branch 'master' into zscript 2016-12-03 15:54:18 +01:00
Christoph Oelckers 30cbce051e - fixed: Custom automap colors were not invalidated on restart.
- fixed: D_DoomMain has 3 calls to D_DoomLoop but only the main call of these was capable of a clean restart.
2016-12-03 15:44:46 +01:00
Christoph Oelckers 5117b32431 - fixed: The math for emulating the old slop overflow was not correct and made the affected sectors in void.wad display incorrectly.
- set compat_polyobj for void.wad because its polyobjects glitch quite a bit with the normal setting.
2016-12-03 14:42:06 +01:00
Christoph Oelckers 28604bad62 - fixed: The polyobject init specials must be cleared after Polyobject initialization is done, because they can block usage of regular lines colinear with the polyobject 2016-12-03 14:06:51 +01:00
Christoph Oelckers 0da233a664 changed ZScript include mechanism.
* It will now use #include, just like most other definition formats and can be mixed with regular definitions. However, due to how the Lemon-generated parser works this will not recursively pull in all files, but store them in a list and process them sequentially. Functionally this shouldn't make a difference, because ZScript is mostly order-independent - the only thing where order is important is native classes, but these are completely internal to zdoom.pk3 where proper order is observed.
2016-12-03 13:16:09 +01:00
Christoph Oelckers 136e976b2a - added an error check for duplicate local variable definitions.
Note that this only applies if both are in the same block. Just like in C++, it is perfectly legal to have the same variable name in two different nested scopes.
2016-12-03 12:33:58 +01:00
Christoph Oelckers b3783a3850 redid the exception mechanism for script-side access violations to be of more use for diagnosing problems.
The original implementation just printed a mostly information-free message and then went on as if nothing has happened, making it ridiculously easy to write broken code and release it. Changed it to:

* Any VMAbortException will now terminate the game session and go back to the console.
* It will also print a VM stack trace with all open functions, including source file and line numbers pointing to the problem spots. For this the relevant information had to be added to the VMScriptFunction class.

An interesting effect here was that just throwing the exception object increased the VM's Exec function's stack size from 900 bytes to 70kb, because the compiler allocates a separate local buffer for every single instance of the exception object.
The obvious solution was to put this part into a subfunction so that it won't pollute the Exec function's own stack frame. Interesting side effect of this: Exec's stack requirement went down from 900 bytes to 600 bytes. This is still on the high side but already a lot better.
2016-12-03 12:23:13 +01:00
Christoph Oelckers d93b6e31d6 - fixed: The ammo and sister weapon type pointers were not properly declared as pointers to the type system. 2016-12-02 22:10:15 +01:00
Christoph Oelckers 211d9d92a1 Merge branch 'master' into zscript 2016-12-02 21:14:56 +01:00
Christoph Oelckers 60b1f5c25a - fixed: FPNGTexture::fr could be left uninitialized. 2016-12-02 19:38:30 +01:00
Christoph Oelckers 91c3ddf692 - fixed: When a tentative class is being replaced, the old one should be removed entirely so that it cannot cause any problems later. 2016-12-02 19:30:58 +01:00
Christoph Oelckers fbf8084999 - corrected the export signatures of several script exports to contain the correct classes, so that the fudging in FindFunction could be removed.
- fixed PARAM_ACTION_PROLOGUE to assign correct types to the implicit pointers. It gave the actual class to the wrong one, which until now did not matter because all functions were using 'Actor', regardless of actual class association.
- fixed the definition of IceChunk and removed some redundant code here. Since A_FreezeDeathChunks already calls SetState, which in turn calls the state's action function, there is no need to call it again explicitly.
2016-12-02 18:52:58 +01:00
Christoph Oelckers 1e01e6e4df - record all line numbers during function generation. This is useful for error reporting and eventually debugging.
- throw a useful exception when a VM abort occurs, the simple enum was incapable of reporting anything more than the barest minimum, which at least for array index out of bounds errors was insufficient.

The current exception mechanism is still insufficient. It really has to report a proper crash location and print a stack trace to the maximum extent possible. Instead it just prints a message and happily goes on. This is not a good solution.
2016-12-02 17:36:29 +01:00
Christoph Oelckers 967f6c0269 - use a separate exception type for reporting errors from FraggleScript.
CRecoverableError is used in other parts as well and it might create interference.
2016-12-02 16:56:50 +01:00
Edoardo Prezioso 9dbfa6d04e - Fixed uninitialized line number info in thing map parsing. 2016-12-02 14:54:32 +01:00
Christoph Oelckers f9441cd9d9 - added null pointer validation to any relevant exported function. In most cases null pointers were already being treated as 'do nothing', but there's several places where this can make the code silently fail so in these cases a VM exception will be raised, once the VM's exception handling has been repaired to provide useful diagnostics. (Right now all it does is catch the exception, print a useless message and return to the caller as if nothing has happened.) 2016-12-02 12:06:49 +01:00
Christoph Oelckers 05cc3dde72 - fixed: Dehacked did not copy the defaults for DehackedPickup replacements anymore. 2016-12-02 01:33:18 +01:00
Christoph Oelckers 4dd22d74dd - partial optimization of chained comparisons. 2016-12-02 01:16:32 +01:00
Christoph Oelckers fb7a8fb553 - branch optimization for for loops. 2016-12-02 00:56:54 +01:00
Christoph Oelckers 719be058e5 - use the immediate versions for loading integer constants when possible. 2016-12-02 00:54:40 +01:00
Christoph Oelckers 77192fa9dd - branch optimization. 2016-12-02 00:51:29 +01:00
Christoph Oelckers 96df8f6729 - another typo... 2016-12-01 10:38:43 +01:00
Christoph Oelckers 44d7d0b5f6 - fixed a typo in the bool cast.
- fixed a few places for unsigned values.
2016-12-01 09:44:52 +01:00
Christoph Oelckers 7688e14bec - added a boolean cast VM instruction.
Although this already helps a lot with the messed up code generated for comparisons it's not really a solution for this - it still needs a proper implementation to generate efficient code.
2016-12-01 01:13:53 +01:00
Christoph Oelckers 87484950cf - removed an assert from APowerMorph::EndEffect. With some recent changes to DestroyAllInventory it appears that the asserted condition no longer is true at this point when ending a game.
- fixed: When replacing a tentative class, the pointers in the morph objects were not replaced. Instead of adding more ReplaceClassRef methods I chose to integrate this part into the PointerSubstitution mechanism and delete ReplaceClassRef entirely. The code had some oversights anyway that would have caused problems, now that non-actors can be created.
2016-12-01 00:05:23 +01:00
Christoph Oelckers 0233c21e33 - fixed: When a bogus class is deleted from AllActorClasses, the entry should also be removed from the array instead of leaving a null pointer behind. 2016-11-30 19:48:52 +01:00
Edoardo Prezioso 07c110d5f7 - Fixed GCC compilation error.
It didn't like 'cvar' being declared between 'goto foundit' and the 'foundit' label.
2016-11-30 19:41:03 +01:00
Christoph Oelckers 1895feb185 - fixed two apparently bogus asserts with returning gloating point constants. 2016-11-30 19:22:56 +01: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 83d7f63364 - missed these in the last commit. 2016-11-30 18:43:10 +01:00
Christoph Oelckers 86544086df - allow the VM to run on one global stack per thread.
It is utterly pointless to require every function that wants to make a VM call to allocate a new stack first. The allocation overhead doubles the time to set up the call.
With one stack, previously allocated memory can be reused. The only important thing is, if this ever gets used in a multithreaded environment to have the stack being declared as thread_local, although for ZDoom this is of no consequence.

- eliminated all cases where native code was calling other native code through the VM interface. After scriptifying the game code, only 5 places were left which were quickly eliminated. This was mostly to ensure that the native VM function parameters do not need to be propagated further than absolutely necessary.
2016-11-30 17:15:01 +01:00
Christoph Oelckers 8a50004f55 - cleanup of the virtual function definitions for inventory items. Let's better use 'virtual' and 'override' everywhere to make sure that nothing gets overlooked.
- added call wrappers and script hooks for all relevant virtuals in AInventory.
- made GetSpeedFactor and GetNoTeleportFreeze entirely scripted because they are too trivial - also do them iteratively, just like HandlePickup, because it's just a better way to do this stuff.
2016-11-30 15:54:01 +01:00
Christoph Oelckers b0f3121bec - split up zscript/shared/inventory.txt.
- moved health items to their own file.
- scriptified ScoreItem and MapRevealer whose entire functionality was a small TryPickup method.
- fixed: bit fields in global variables were not correctly written.

This should conclude the inventory cleanup. It is now possible again to find things in there.
2016-11-30 13:36:13 +01:00
Christoph Oelckers 229c55ce61 - moved ammo to its own file, including the backpack.
- moved weapon declarations to their own header.
2016-11-30 12:24:50 +01:00
Christoph Oelckers 78fa076079 - moved armor class declarations to their own file and added necessary #includes only to those files actually using them.
- added copyright headers to a_armor.cpp and a_keys.cpp.
2016-11-30 10:55:03 +01:00
Christoph Oelckers 014e04ce82 - copied inventory files to their own folder.
It's about time this stuff is getting cleaned up seriously. Both a_pickups.cpp and a_artifacts.cpp are so overstuffed that it has become a chore finding stuff in there.
2016-11-30 10:28:02 +01:00
Christoph Oelckers b1910effd6 - remove debug code. 2016-11-30 09:54:37 +01:00
Christoph Oelckers 661692062d - fixed: FxIdentifier::Resolve checked all cases of what an identifier can be, even if it already found a proper match. 2016-11-30 09:53:16 +01:00
Christoph Oelckers 0cd6cec531 - scriptified the SectorFlagSetter. 2016-11-30 01:49:36 +01:00
Christoph Oelckers fb3bde0e0d - cleaned up and grouped the virtual function declarations in AActor to ensure that everything has been properly exported.
- removed the native parts of SpecialBlastHandling. Since this is called from the script side and the only remaining native remnant was an empty function it's now 100% scripted.
2016-11-30 01:39:06 +01:00
Christoph Oelckers bbf62132d8 - added a larger batch of function exports.
- cleaned up the virtual function interface of APlayerPawn which still had many virtual declarations from old times when class properties were handled through virtual overrides. None of this makes sense these days anymore.
2016-11-30 01:25:51 +01:00
Christoph Oelckers 4372a14479 - fixed: Giving several morph items in the same tic could lead to an invalid Owner pointer in APowerupGiver::Use. 2016-11-29 20:28:04 +01:00
Christoph Oelckers 9193466572 - scriptified ASecurityCamera and AAimingCamera.
This concludes this round of script converesions of internal classes.
2016-11-29 20:16:14 +01:00
Christoph Oelckers a13e23dbe6 - scriptified some trivial stuff from g_shared. 2016-11-29 19:50:34 +01:00
Christoph Oelckers 0c969746d0 - scriptified Hexen's spike, which was the last remaining item in the game directories.
- added a BlockThingsIterator for scripts.
2016-11-29 18:42:48 +01:00
Christoph Oelckers f17f6c30c2 - scriptified the Heresiarch. 2016-11-29 17:17:10 +01:00
Christoph Oelckers f5b3429274 - partial scriptification of the Heresiarch 2016-11-29 15:24:38 +01:00
Christoph Oelckers e01f680b72 - scriptified the Mauler, completing Strife. 2016-11-29 14:32:49 +01:00
Christoph Oelckers b625156df6 - scriptified Strife's flamethrower and grenade launcher. 2016-11-29 14:12:39 +01:00
Christoph Oelckers 5beebb83b7 - scriptified Strife's assault gun and missile launcher. 2016-11-29 13:28:43 +01:00
Christoph Oelckers be5ba70ed2 - scriptified Strife's dagger and crossbow. 2016-11-29 13:00:07 +01:00
Christoph Oelckers 3af9232fca - scriptified a_strifeitems.cpp and a_debris.cpp.
- Changed the glass shards so that they do not have to override FloorBounceMissile. It was the only place where this was virtually overridden and provided little usefulness.
- made 'out' variables work.
- fixed virtual call handling for HandlePickup.
2016-11-29 12:17:05 +01:00
Christoph Oelckers 55b549c0c6 - converted the rest of a_strifestuff.cpp.
- changed some very old A_Explode calls which passed all values as integer literals.
2016-11-29 00:16:30 +01:00
Christoph Oelckers edd8e51a69 - scriptified most of a_strifestuff.cpp. 2016-11-28 23:30:14 +01:00
Christoph Oelckers caef5344b0 - scriptified a_thingstoblowup.cpp.
- changed the power crystal floor movement to use DFloor instead of an incomplete in-place hack to ensure that everything is processed properly.
2016-11-28 21:33:14 +01:00
Christoph Oelckers dd5494d848 - scriptified Stalker and Sentinel. 2016-11-28 19:56:16 +01:00
Christoph Oelckers 360cbfba2a - scriptified Oracle, Programmer and Rebels. 2016-11-28 19:42:26 +01:00
Christoph Oelckers 119bcb924d - scriptified the Loremaster. 2016-11-28 18:59:57 +01:00
Christoph Oelckers bf1c2a7e51 - scriptified the Inquisitor. 2016-11-28 18:49:25 +01:00
Christoph Oelckers b8cf377d9e - scriptified the Crusader. 2016-11-28 18:36:13 +01:00
Christoph Oelckers 9064a5b0ac - scriptified Strife's coins.
- added a String class to allow attaching methods to the builtin string type. This works by checking if the left side of the member accessor is a string and just replacing the tyoe in this one place, all the rest is automatic.
2016-11-28 18:15:18 +01:00
Christoph Oelckers d2ce78fae7 - changed the return value of PickupMessage to an FString so that it can interface with scripts.
- use standard convention of prefacing localizable strings with "$" for C_MidPrint.
2016-11-28 16:19:01 +01:00
Christoph Oelckers 53318f4bde - scriptified Reaver and Templar. 2016-11-28 15:51:07 +01:00
Christoph Oelckers 8551a4f6e1 - scriptified the Sigil. This isn't fully tested yet. 2016-11-28 14:39:25 +01:00
Christoph Oelckers c9a4087c18 - scriptified a_entityboss.cpp. 2016-11-28 13:11:27 +01:00
Christoph Oelckers dc9ee0727a - scriptified a_spectral.cpp.
- consolidated A_Tracer and A_Tracer2.

Note that this commit temporarily disables a few features in order to make it compile.
2016-11-28 12:55:33 +01:00
Christoph Oelckers b171d6e21f - scriptified a_alienspectres.cpp. 2016-11-28 11:52:03 +01:00
Christoph Oelckers 7ea9f60464 - scriptified the Acolyte. 2016-11-28 10:41:36 +01:00
Magnus Norddahl bea113a908 Fix tonemap texture filtering (black screen) regression 2016-11-28 02:32:57 +01:00
Christoph Oelckers d4427e696d - scriptified Hexen's Banishment Device. 2016-11-28 01:30:36 +01:00
Christoph Oelckers ebd2c27e0a - scriptified Hexen's Bloodscourge and Serpent.
- merged the FrontBlock searcher for the Bloodscourge into RoughMonsterSearch. This also fixes the bug that the searcher was not initialized properly for the MageBoss.
2016-11-28 00:49:10 +01:00
Christoph Oelckers f9a1388066 - scriptified Hexen's lightning weapon. 2016-11-27 22:14:18 +01:00
Christoph Oelckers 7b5a589635 - scriptified Hexen's Frost shards.
- scriptified all SpecialMissileHit methods.
2016-11-27 21:41:04 +01:00
Christoph Oelckers 5ce5466e18 - scriptified hexenspecialdecs.
- made '->' a single token. Although ZScript does not use it, the parser tends to get confused and fatally chokes on leftover arrows so this ensures more robust error handling.
2016-11-27 20:14:43 +01:00
Christoph Oelckers de6969997a - scriptified Hexen's flies.
A few notes:

 * this accesses the lines array in sector_t which effectively is a pointer to an array of pointers - a type the parser can not represent. The compiler has no problems with it, so for now it is defined internally.
 * array sizes were limited to 65536 entries because the 'bound' instruction only existed as an immediate version with no provisions for larger values. For the static map arrays 65536 is not sufficient so now there are alternative instructions for these cases.
 * despite the above, at the moment there is no proper bounds checking for arrays that have no fixed size. To do this, a lot more work is needed. The type system as-is is not prepared for such a scenario.
2016-11-27 18:52:24 +01:00
Christoph Oelckers aab304c0cf - fixed: Lemon includes ParseTrace only in debug builds so the option to use it must be #ifdef'd. 2016-11-27 17:43:11 +01:00
Christoph Oelckers cc7120d5b6 Merge branch 'master' of https://github.com/rheit/zdoom into zscript 2016-11-27 16:34:55 +01:00
alexey.lysiuk 0488b18f8f Fixed junk character(s) left after removing portion of string
See http://forum.zdoom.org/viewtopic.php?t=54379
2016-11-27 16:33:25 +01:00
Christoph Oelckers b0ddba2240 Merge branch 'master' of c:\Programming\Doom-Dev\zdoom_\ into zscript 2016-11-27 16:31:26 +01:00
Christoph Oelckers 2e99681ced - fixed: When trying to calculate the damage for a blasted actor hitting another one, the velocity checks used the signed values, causing totally random damaging effects depending on the direction the objects were moving. This bug had been present in the original Hexen source as well. 2016-11-27 16:26:31 +01:00
Christoph Oelckers f409a24d2d - fixed: Readonly pointers never were flagged as such.
- fixed: Assignment from a readonly to a read-allowed pointer must be an error.
- made GetDefaultByType a builtin so that it can do proper type assignment to the result, which for a function would be problematic in this case, even if automatic type deduction was implemented. Since this returns the class defaults which are not a real object, the result cannot be subjected to a type cast.
- error out if a type cast of a readonly pointer is attempted.
- fixed: FxBooleanNot could clobber a local variable because it used the source register to manipulate the result.
2016-11-27 16:24:33 +01:00
Christoph Oelckers 3dd323ac0d - scriptified the Flechette. Not fully tested yet.
- fixed issues with the refactoring of the recent commits. This one starts again.
- added builtins for TextureID.

Note about builtins: Currently they are just hacked into the compiler backend. They really should be made part of the respective types to keep matters clean and allow more widespread use of builtins to create more efficient code.
2016-11-27 16:24:33 +01:00
Christoph Oelckers 36f559ecb7 - fixed bad definition of struct grammar which tried to resolve from right to left, creating large amounts of recursion and strange problems with PlayerInfo.
- added a command line option to generate a parser trace file.
- fixed a syntax error in player.txt.
2016-11-27 16:24:32 +01:00
Christoph Oelckers b10ffb5133 - exported a few more functions.
- refactored the ModifyDamage interface to be more scripting friendly.

In general it should be avoided having to call directly into chained inventory functions because they are very problematic and prone to errors. So this got wrapped into a single handler (on AActor, not AInventory!) which will later make it easier to refactor the parameters of ModifyDamage to work better for scripting and avoid the chaining.
2016-11-27 16:24:32 +01:00
Christoph Oelckers 096c51d546 - changed AInventory::HandlePickup to work iteratively instead of recursively.
Two reasons for this:

1. if this has to be routed through the VM each recursion will cost 1000 bytes of stack space which simply is not good.
2. having the virtual function only care about the item itself but not the entire inventory chain is a lot less error prone for scripting.

Since the scripting interface needs a separate caller function anyway this seemed like a good time to change it. The same will be done for the other chained inventory handlers as well.
2016-11-27 16:24:31 +01:00
Magnus Norddahl 057060022a Merge remote-tracking branch 'gzdoom/master' into ssao 2016-11-27 09:59:57 +01:00