Commit graph

6241 commits

Author SHA1 Message Date
Randy Heit
2a394d0cb8 Do not copy lemon grammars to the output directory
- Having my edits to the grammar disappear because Visual Studio had
  opened the copy instead of the original was super annoying. Using the -C
  option with Lemon, this problem is avoided because there are no copies
  to worry about.
2016-03-20 14:34:44 -05:00
Christoph Oelckers
8362c6a856 - conversion of floorz to double. 2016-03-20 19:52:35 +01:00
Randy Heit
1c592c9601 Lemon update 2009-11-03 19:18:32 on branch trunk
- Enhancements to lemon to generate more compact action tables and to avoid making array bounds tests that can never fail on action table calculations. (user: drh)
- Update zcc-parse.lemon: YY_SZ_ACTTAB is now YY_ACTTAB_COUNT
2016-03-20 13:06:43 -05:00
Randy Heit
288f01a0c2 GCC fixes for zcc_compile.(cpp|h) 2016-03-20 11:34:41 -05:00
Christoph Oelckers
b81080ce08 - converted most of g_heretic to float. 2016-03-20 16:51:42 +01:00
Christoph Oelckers
0bdb65c477 - made AActor::radius a double.
This means that all files in g_doom are now fully converted.
2016-03-20 15:04:13 +01:00
Christoph Oelckers
ec58e70078 - replaced ceilingz with a floating point variable, also in FCheckPosition. 2016-03-20 13:32:53 +01:00
Christoph Oelckers
6e2421bd37 - use a set of specific conversion functions to convert from and to ACS script variables so that these cases do not get caught when searching for fixed point math in the source. 2016-03-20 12:37:21 +01:00
Christoph Oelckers
ada5097e34 - converted scale variables in AActor, FMapThing and skin to float. 2016-03-20 12:13:00 +01:00
Christoph Oelckers
5875e91f39 - finished conversion of most of g_doom.
Only things left here are accesses to AActor::ceilingz and radius in A_PainShootSkull, plus scaleX and scaleY in the ScriptedMarine sprite setting code.
Most is still using wrapper functions around the fixed point versions.
2016-03-20 10:52:10 +01:00
Christoph Oelckers
f1d2c7755a - fixed z-offset handling of A_SkelMissile.
I can't believe I missed this for more than 10 years, considering that A_CustomMissile explicitly implements this case:
It makes a crucial difference whether P_SpawnMissileZ is used or the actual z-position is temporarily changed.
Reverted this function to the position changing method of the original.
2016-03-20 02:08:05 +01:00
Christoph Oelckers
a4f5846c7c - replaced all uses of P_ThrustMobj with the already implemented AActor::Thrust method and deleted this function.
- for quakes, making a distinction between circular and elliptic thrust is pointless, so the checks were removed and both paths consolidated. The elliptic code will do exactly the same for circles and there isn't even a performance difference.
2016-03-20 01:25:47 +01:00
Christoph Oelckers
a43dccaa86 Merge branch 'master' into floatcvt
# Conflicts:
#	src/g_hexen/a_heresiarch.cpp
#	src/g_shared/a_quake.cpp
2016-03-20 00:56:09 +01:00
Christoph Oelckers
51b05d331d - replaced AActor::vel and player_t::Vel with a floating point version.
- Converted P_MovePlayer and all associated variables to floating point because this wasn't working well with a mixture between float and fixed.

Like the angle commit this has just been patched up to compile, the bulk of work is yet to be done.
2016-03-20 00:54:18 +01:00
Christoph Oelckers
0ef9ee23b1 - fixed: When the intensity values of DEarthquake were converted to fixed point, its uses in DEarthquake::Tick were not changed along. 2016-03-19 12:01:10 +01:00
Christoph Oelckers
2adf8d524c - fixed: A_SpawnFizzle used the 'speed' property incorrectly.
This is now a fixed point value, even for monsters, so using it as a modulus on a random value cannot possibly work.
2016-03-19 09:36:20 +01:00
Randy Heit
aaae9f2e05 Store known but uncompiled nodes in the symbol table
- Don't bother keeping track of uncompiled nodes in a special table. Use
  the regular symbol table instead. This should in the future make
  compiling nodes referenced deeper than (and before) their definitions
  fairly straightforward.
- Also, break up the compiler's Message() function into Warn() and Error()
  and get rid of zcc_errors.h. I can't really see having a set of error
  numbers being useful.
2016-03-18 19:34:32 -05:00
Christoph Oelckers
51a98d0e5d - cleaned up the mugshot code's angle checks (I hope these are correct because the old code was so confusing...) 2016-03-18 10:08:18 +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
Christoph Oelckers
39de225fa7 - restored old FaceMovementDirection. 2016-03-17 00:46:12 +01:00
Christoph Oelckers
aa09cbdada - renamed some functions and fixed a few more conversion errors. 2016-03-17 00:07:37 +01:00
Christoph Oelckers
ec3be2531a Merge branch 'master' into float
# Conflicts:
#	src/g_hexen/a_fighterplayer.cpp
2016-03-16 22:45:55 +01:00
Christoph Oelckers
9b134a78e3 - fixed: The TEXTURES parser wanted a redundant comma after parsing a color. 2016-03-16 22:42:41 +01:00
Christoph Oelckers
9b1442915f - fixed: AdjustPlayerAngle should not use the angle that gets passed in the attack target struct. This is the actual angle of the attack but this function needs to adjust to the actual direction between player and victim. 2016-03-16 22:38:08 +01:00
Christoph Oelckers
b140d71c49 - several fixes. 2016-03-16 22:29:35 +01:00
alexey.lysiuk
b20956e207 Made FMOD Ex stream buffer size customizable
Use snd_streambuffersize to set size of stream buffer in KB, default is 64
See http://forum.zdoom.org/viewtopic.php?t=51230
2016-03-16 22:15:13 +02:00
Christoph Oelckers
29a7fe33f3 - fixed some minor issues found during reviewing the code. 2016-03-16 14:10:13 +01:00
Christoph Oelckers
671291227e - first stage of converting actor angles to float complete
Patched up everything so that it compiles without errors again. This only addresses code related to some compile error. A large portion of the angle code still uses angle_t and converts back and forth.
2016-03-16 12:41:26 +01:00
alexey.lysiuk
91ad7f5f2e Fixed broken Strife conversations
Check for in-combat flag was inverted
See http://forum.zdoom.org/viewtopic.php?t=51224
2016-03-16 12:37:41 +02:00
Christoph Oelckers
c64eee5b15 Merge branch 'master' into float
# Conflicts:
#	src/g_heretic/a_hereticweaps.cpp
#	src/p_map.cpp
#	src/p_mobj.cpp
#	src/p_things.cpp
#	src/portal.cpp
2016-03-15 00:16:13 +01:00
Blue-Shadow
a07f264782 Added a NULL check for activator in Warp(). 2016-03-14 20:52:44 +03:00
Christoph Oelckers
d07bf08e56 - fixed: 3D floor ceiling calculation didn't take into account that an actor's top may just be slightly inside a 3D floor and returned the next highest one instead.
For floors this change is deliberately not done because it might cause problems with the movement code.
2016-03-14 16:38:17 +01:00
alexey.lysiuk
801ac9128a Replaced comparisons with assignments in 3D floor tracing
No more 'equality comparison result unused' warnings
2016-03-14 01:25:57 +01:00
alexey.lysiuk
6c94c49d6f Removed extra Printf() conversion specification
No more 'more % conversions than data arguments' warning
2016-03-14 01:25:56 +01:00
Christoph Oelckers
df63dd288a - fixed: Visual-only portals could initiate a teleport. 2016-03-13 21:55:47 +01:00
Christoph Oelckers
448e66f19b - fixed: P_PointInSectorBuggy must handle the single-subsector special case. 2016-03-13 16:57:02 +01:00
Christoph Oelckers
51ab60178a - added portal overlays to automap. 2016-03-13 12:33:58 +01:00
Braden Obrzut
93be5aca05 - Fixed: Modern versions of GCC on PowerPC inserted padding to the end of pragma packed structures.
- Worked aorund modern GCC bug where C++ exceptions in Objective-C++ code would result in an ICE (bug is already on their tracker, but I doubt it will be fixed unless I decide to dig into the issue myself).
- Turn off fused floating point instructions since these can cause slight deviations in floating point code.
- Use -static-libgcc when compiling on the Mac with GCC since we need to use a custom version of GCC to do so now.
- Note: ZDoom will currently still crash on exit on PowerPC since it seems to be deciding that NameManager needs to be destructed before the console commands.
2016-03-13 01:14:08 -05:00
Christoph Oelckers
0040b272ed - fixed portal counting.
This was creating a large number of unused portal groups.
2016-03-13 02:54:55 +01:00
Christoph Oelckers
b73d6e42af - fixed: FMultiBlockLinesIterator must reset the current sector when doing the final up and downwards check from the start position. 2016-03-13 02:31:47 +01:00
Randy Heit
8a03b99b9c Use ScriptMessage to warn about missing patches in a TEXTURES texture 2016-03-12 19:23:49 -06:00
Randy Heit
4a295dfa3d Accept constant definitions in structs.
- We already need to handle them for enums, so there's really nothing to
  be gained by not accepting constant definitions directly.
2016-03-12 19:11:34 -06:00
Christoph Oelckers
8c027aef8b - added NULL pointer check to portal rotation calculation function. 2016-03-12 22:38:46 +01:00
Christoph Oelckers
0a92138edf - fixed: The portal link table was not created when there were no sector portals.
- fixed: P_TryMove could loop endlessly over a list of static portals when there was an error during portal creation.

# Conflicts:
#	src/gl/models/gl_models.cpp
#	src/gl/scene/gl_sprite.cpp
2016-03-12 20:36:38 +01:00
Christoph Oelckers
651817fad7 - made AActor::velx/y/z and player_t::velx/y fixedvec's.
(This commit is 95% search & replace with only a few places where velz was used as a local variable changed.)
2016-03-12 14:11:43 +01:00
Christoph Oelckers
4116719a5a - fixed: P_CheckSplash shifted the fixed_t distance another 16 bits to the left. 2016-03-12 12:34:43 +01:00
alexey.lysiuk
c7c2beee2c Fixed A_Blast parameter type and default values
Default values for strength and speed parameter are fixed type, not integers
Also strength parameter needs to have floating point type
2016-03-12 13:11:46 +02:00
Christoph Oelckers
161d03231a - added custom math routines for reliability. 2016-03-11 15:45:47 +01:00
Christoph Oelckers
7edd5e2dac renamed 'exp' in xlat_parser.y to 'expr' because this gets in the way of searching for calls of the exp(x) function. 2016-03-11 13:43:17 +01:00
Christoph Oelckers
9843f16cc0 - some rework of vectors.h, mostly to remove all those silenced double->float conversions. 2016-03-10 22:36:28 +01:00
Christoph Oelckers
f8ebfb541e - use typedefs for TVector<double> etc.
(Better have this out of the way before messing around with this stuff...)
2016-03-10 20:45:45 +01:00
Randy Heit
2e588c2099 Add missing SEMICOLON to declarator_no_fun 2016-03-10 10:33:19 -06:00
Christoph Oelckers
3d367d585d - did some profiling which revealed that P_PointInSector was called needlessly often. Did some optimization to the MultiBlock iterators to avoid this problem. 2016-03-10 14:22:18 +01:00
alexey.lysiuk
3063312f7f Fixed resurrection distance check
See http://forum.zdoom.org/viewtopic.php?t=51177
2016-03-10 10:25:44 +02:00
Christoph Oelckers
a605913f42 - fixed: When passing through a teleporter or portal that alters the angle, it is not sufficient that P_XYMovement adjusts the position in case a second P_TryMove call is needed, it must also change the precalculated movement vector. 2016-03-09 12:49:49 +01:00
Christoph Oelckers
40ceb0fef6 - fixed: NextHighestCeilingAt and NextLowestFloorAt need to check if a 3D floor is outside the sector's boundaries before reporting it as the best match. 2016-03-09 12:00:07 +01:00
Christoph Oelckers
b3f7a57518 - yet another case of adding a workaround to preserve a side effect in Doom's original movement code that's bound to be inadvertently exploited:
When a spechit results in teleportation, P_TryMove never accounted for that, so that subsequent spechits either failed or succeeded, depending on where the teleport ends up.
With portal-aware positions stored within the spechit this no longer worked, so some handling is needed to revert to the original behavior in case there's no portals to consider.

The ideal solution would have been to stop checking spechits (or to block further teleports) once this happens but the likelihood of some old maps depending on this is high.
2016-03-09 11:44:01 +01:00
Randy Heit
03118d441f Don't use _FPU_GETCW if it won't do what we want
- _FPU_GETCW is defined for more than just x87. Don't use it if the
  control word for the target architecture doesn't support _FPU_EXTENDED
  or _FPU_DOUBLE defined, e.g. pretty much anything but x87. If I had been
  using glibc on PowerPC instead of Apple's libc, I probably would have
  noticed this sooner, since _FPU_GETCW is part of glibc.
2016-03-08 22:00:16 -06:00
Randy Heit
76489e7638 More gracefully handle travelling to a map without matching player starts
- First, don't crash when travelling to a map in a hub that doesn't have
  any player starts that match the position given to Teleport_NewMap (or
  equivalent).
- Seconed, move the player to the location they were at when the left the
  level. At least that way, they shouldn't be in random geometry or off
  the map entirely.
2016-03-08 21:51:12 -06:00
Randy Heit
174e00afe7 Add NULL mthing check to P_SpawnPlayer 2016-03-08 21:42:24 -06:00
Randy Heit
48b6b6e057 Clip portals to viewheight, not screen height
- Aside, but is this even neccessary? The arrays being copied from should
  already be clipped properly.
2016-03-08 19:53:37 -06:00
Christoph Oelckers
015cbb1061 - revert accidentally committed debug code. 2016-03-08 21:29:13 +01:00
Christoph Oelckers
0a1e22aa7a - fixed: FPathTraverse::init kills the intercepts array so PortalRelocate needs to store the line before calling that function. 2016-03-08 18:45:52 +01:00
Christoph Oelckers
42521ffd6f - fixed some mixed up variables in a few blockmap iterators. 2016-03-08 18:34:58 +01:00
alexey.lysiuk
209b495e10 Fixed potential crash in DeHackEd loading
The patch content was destructed and then accessed when loading DeHackEd file of old/unsupported version
Do not print the whole patch content to console but only a filename
2016-03-08 16:28:11 +02:00
Christoph Oelckers
899389e6a4 - link actors into blockmap through linked line portals.
Links through sector portals are not done because nearly all the checks can be performed without doing this so if it works without there's no need to add more processing time.
Will have to see if there's cases left where such a link is needed and if so, whether there's better options to do it.

For line portals such links are necessary to have proper collision detection with actors that are currently transitioning the portal.
2016-03-08 14:41:37 +01:00
Christoph Oelckers
9d877f75e3 - second part of last commit. This file was accidentally unselected. 2016-03-08 14:35:36 +01:00
Christoph Oelckers
1815b076ee - don't show the IWAD picker upon restart. This doesn't work with fullscreen mode. Instead just pick the first IWAD from the list until a better solution can be implemented.
- handle a 'restart' CCMD a bit more controlled. Instead of throwing an exception in the CCMD handler it now just flags D_DoomLoop to return.

If the exception is thrown within the CCMD this can easily happen deep inside the renderer when it calls NetUpdate. But since the software renderer with its use of global variables is not equipped to be yanked out of lile this it could leave broken data behind that caused glitches or even crashes on subsequently played maps.
2016-03-08 13:07:21 +01:00
Christoph Oelckers
e11a0986ce - encountered a strange crash that after changing a map, InSubsector was not NULL and pointing to invalid data. So let's better NULL this variable explicitly each time a render loop is started. 2016-03-08 12:27:01 +01:00
Christoph Oelckers
4ebdcb7b6d - fixed: The result condition of a hitscan subtrace was never checked. 2016-03-08 11:55:40 +01:00
Christoph Oelckers
f852ead99a - fixed: The initial check for ceiling and floor portals must be done when the trace's start position and its sector has been calculated. SightCheck::init is too early for that. 2016-03-08 10:44:03 +01:00
Christoph Oelckers
f35d966799 - don't allow any ceiling portal that has a lower position than a floor portal in the same sector. The will inevitably lead to problematic situations. 2016-03-08 10:09:02 +01:00
Christoph Oelckers
50d2145ba0 - fixed typo in portal init code. 2016-03-08 09:41:54 +01:00
Christoph Oelckers
2cd74118f6 - fixed sight checking through portals.
Notes:
 * It is actually not enough to disable the early-out condition for the current block if there's a portal. It must be disabled for the entire rest of the trace because otherwise the collected lines never get processed.
 * The block bounds check cannot be done globally with portals in the game. The actual trace can easily end up outside the blockmap bounds if portal offsets are factored into the distance between the two actors.
2016-03-08 01:26:13 +01:00
Christoph Oelckers
bd29f0994f - restored accidentally deleted line. 2016-03-07 23:41:16 +01:00
Christoph Oelckers
cc2885c2de - fixed int/fixed_t mixup with P_RadiusAttack's 'bombdistance' parameter. (Why is this thing even an int...?) 2016-03-07 22:05:19 +01:00
Christoph Oelckers
3c25b2c066 - some redesign of P_CheckSight to handle portals.
Portal stuff not tested yet.
2016-03-07 21:59:32 +01:00
Randy Heit
f82c217047 Fixed: In multiplayer, players could spawn at voodoo doll starts
- This could happen in co-op games that did not have enough player starts
  for all the players spawning. Voodoo doll starts were not excluded from
  the set of possible starts as they should have been.
2016-03-07 10:58:16 -06:00
Randy Heit
e277fbe81d Fixed some incorrectness with some Hexen crushing specials
- The following Hexen specials all stop 8 units above the floor:
  * Ceiling_CrushRaiseAndStay
  * Ceiling_CrushAndRaise
  * Ceiling_LowerAndCrush
  We only and Ceiling_LowerAndCrush correct. Clearly, I should have paid
  more attention when the Hexen source was released for the parts that I
  had already reverse engineered.
2016-03-07 10:24:30 -06:00
Randy Heit
8b9a0da5ef That was hard to read 2016-03-07 09:58:52 -06:00
MajorCooke
af50a79e55 - Fixed: ScaleY was not defaulting to ScaleX when specified as 0, which is how the behavior originally was in 2.8. This behavior can now be toggled with a new boolean, 'usezero'. 2016-03-07 09:02:34 -06:00
Christoph Oelckers
fe4bc31d59 - fixed some bad offset calculations. 2016-03-07 11:36:51 +01:00
Randy Heit
72edd7d455 Fixed: GetVarAddrType() bounds check was inverted 2016-03-06 22:17:30 -06:00
Christoph Oelckers
13a7507c4d - should have saved that... 2016-03-07 01:48:13 +01:00
Christoph Oelckers
8f71906fc3 - added portal support to P_RadiusAttack.
This currently only works for linked portals. For other types some major refactoring may be necessary because it not only requires multiple passes of P_RadiusAttack but also an alteration of how sight checks work.
2016-03-07 01:02:48 +01:00
Christoph Oelckers
7d7112f427 - added portal support to A_ThrustImpale, P_PushUp and P_PushDown. 2016-03-07 00:17:52 +01:00
Christoph Oelckers
5175d56129 - made adjustments to P_LineAttack and P_RailAttack to deal with altered angles by passing through a non-parallel portal.
- fixed: P_FindFloorCeiling set the floorsector for a new ceilingheight.

Note: P_DrawRailTrail still needs to be changed, at the moment rail trails through portals will not work correctly.
2016-03-06 21:58:36 +01:00
Christoph Oelckers
90553bb61c - deal with portals in P_AimCamera.
This will most likely need some more testing and refining but at least it should work through line portals now.
2016-03-06 13:10:42 +01:00
Christoph Oelckers
a0b2915b8f - added a heightsec change when aborting the main trace due to having found a target in a subtrace.
- be a bit smarter about what to copy from a subtrace. There's 3 distinct pieces of information here: The hit itself, the CrossedWater setting for Boom-transfers and the CrossedWater setting for 3D floors.

Note: Ideally this should return all water hits it can detect, not just the first one.
2016-03-06 02:07:04 +01:00
Christoph Oelckers
74592334e4 - fixed return conditions of Trace() so that it always returns something valid. Due to the portal related changes the default initialization for TRACE_HitNone must be inside TraceTraverse. 2016-03-06 01:41:52 +01:00
Christoph Oelckers
ae4cc9669b - added line portal support to Trace(). 2016-03-06 01:04:19 +01:00
Christoph Oelckers
983e8bc6a5 - explicitly check NAME_Null in P_FindTerrain so that it cannot get rendered inoperable by mods which hijack this name. This name must be reserved so that there is some means to disable a sector's terrain. 2016-03-05 22:39:53 +01:00
Christoph Oelckers
97577dc2d7 - added sector portal support to Trace()
Note that at the moment only the function itself has been changed, the calling parts still need to be redone.
2016-03-05 21:44:31 +01:00
Christoph Oelckers
c455c60480 - fixed: calculating open.range requires signed math.
- fixed: FMultiBlockLinesIterator initialized continueup twice but forgot continuedown.
- fixed: One of the debug messages in P_AimLineAttack was missing an if (aimdebug).
2016-03-05 01:23:27 +01:00
Christoph Oelckers
b9c72e372b - fixed bad loop handling in FWeaponSlots::SetFromGameInfo(). 2016-03-04 16:25:23 +01:00
Christoph Oelckers
d1f17e0b46 - fixed: The checks in P_IsThingSpecial was broken. 2016-03-04 16:23:40 +01:00
Christoph Oelckers
e290bc6fd0 - fixed: In Hexen, ThrustThing can not be triggered from the backside of a line.
This gets only activated when the HEXENHACK flag is set. For ZDoom maps there is a specific line flag to handle this condition explicitly.
2016-03-04 15:24:13 +01:00
Christoph Oelckers
caf2ca0df7 - fixed: CallStateChain must never allow a jumping function to set the chain's overall result to successful. 2016-03-04 15:11:20 +01:00
Christoph Oelckers
b427f27e3b - fixed: line portal rotations were not set for all types. 2016-03-04 14:09:26 +01:00
alexey.lysiuk
9b23b41021 Added detection for broken WAD files
Do not try to allocate nonsensical amount of memory and bail out when broken WAD is detected
See http://forum.drdteam.org/viewtopic.php?t=6844
2016-03-04 11:32:15 +01:00
Randy Heit
e4a74f4bbe Fix memory leak from ZCC_OpInfo operator prototypes 2016-03-03 20:26:41 -06:00
Randy Heit
964ff46063 Add new state options to parser and actually enable them
- Added new state options that DECORATE got to the lemon parser.
- Enable token generation for state options. They were previously not
  generated, so the grammar treated them as function calls instead.
2016-03-03 18:33:07 -06:00
Randy Heit
078d37e073 Pretty sure this was a typo 2016-03-03 18:33:07 -06:00
Christoph Oelckers
0c37a90e32 - moved the initial 3D floor check from Trace to TraceTraverse, because that's where it will be needed for handling portals. 2016-03-04 01:13:17 +01:00
Christoph Oelckers
9f805daa73 - added missing handling of ALF_PORTALRESTRICT flag. 2016-03-04 01:13:16 +01:00
Christoph Oelckers
81b634a798 - preparation for making Trace portal aware: Added a new flag Trace_PortalRestrict, so that I could disable portals without static offset for P_LinePickActor and A_CheckLOF, because both depend on the target info being retainable which requires a static offset. 2016-03-04 01:13:16 +01:00
Randy Heit
3c2ed52442 Fix 21:9 base width and height values 2016-03-03 18:00:06 -06:00
Randy Heit
16d8af6b77 Add some 21:9 resolutions 2016-03-03 17:59:55 -06:00
Randy Heit
79f0714341 Update ratios[] tables for SDL and Cocoa 2016-03-03 17:32:30 -06:00
Michael Labbe
a28c8091fc UI support for 21:9
- Can specify aspect ratio 21:9 in video menu
 - menu_screenratios cvar can now force 21:9
2016-03-03 17:31:12 -06:00
Michael Labbe
a4705c8404 vid_listmodes crash fix 2016-03-03 17:31:12 -06:00
Michael Labbe
3ac4968218 Slightly improve 21:9 ar 2016-03-03 17:31:12 -06:00
Michael Labbe
afb1d438c2 21:9 fix for black bars overlapping fullscreen images 2016-03-03 17:31:12 -06:00
Michael Labbe
73c7e51391 fix: 21:9 AR stretching in intermission, end level screens 2016-03-03 17:31:12 -06:00
Michael Labbe
97821a3036 21:9 aspect ratio support
- vid_aspect 6 forces 21:9
2016-03-03 17:31:12 -06:00
Randy Heit
e3d35f4fe8 PClassPointer should use its own type as the metatype in the type table
- I don't remember why I thought using PPointer as the metatype for
  PClassPointer would be preferable, but it means that PPointer's MatchID
  can potentially be called for PClassPointer entries.
2016-03-03 17:31:01 -06:00
Randy Heit
6d68f69674 Use lambdas for more concise code 2016-03-03 13:27:52 -06:00
Christoph Oelckers
2587e82a67 . removed some redundant computation of a trace's hit position. 2016-03-03 16:15:42 +01:00
Christoph Oelckers
b8abafb486 - disabled all the debug messages in P_AimLineAttack but left them in with a CVAR check so that the debug output can be reenabled, should some problem require it in the future. 2016-03-03 13:31:21 +01:00
Christoph Oelckers
ec258c9588 - redid P_ClipLineToPortal with revised visibility rules:
* any line completely parallel to the portal is rejected
 * any line with one end on the same straight line than the portal is solely decided by the other vertex.
 * any line with both ends behind the portal cannot be visible inside, so there's no need to check for an intersection with the view range.
 * due to the above P_IntersectLines could be removed as it was redundant.
 * for any line that does intersect with the portal straight, do a reverse check: If both ends of the portal lie on the other side of the line than the viewpoint, the line is between viewpoint and portal and needs to be rejected.

This fixes nearly all the phantom wall glitches in the demo map.
2016-03-03 13:07:11 +01:00
Christoph Oelckers
14a0567343 - optimized the portal translation functions by precalculating the rotation angle, sine and cosine. 2016-03-03 11:58:04 +01:00
Christoph Oelckers
ede07f93b2 - fixed: Failure to open bots.cfg would throw an exception that prevented the level from starting. Catch it in FCajunMaster::LoadBots instead and handle it non-disruptively. 2016-03-03 11:11:25 +01:00
Christoph Oelckers
74c326e9b2 - fixed: An option value with an invalid value type would eat all key events when being selected. 2016-03-03 10:52:56 +01:00
Christoph Oelckers
4d2b9fbe1b - don't freeze if the menu item search can't find anything selectable. 2016-03-03 10:47:11 +01:00
Christoph Oelckers
d8c009bb41 - fixed: A_Blast read the blast radius as an int, but used it as fixed_t. Also changed the definition of this parameter to float. 2016-03-03 10:23:04 +01:00
MaxED
81a5273b58 Added "Miscellaneous Options" -> "Save/Load confirmation" option (defaults to true). When disabled, confirmation dialog won't be shown when performing quicksave/quickload. 2016-03-03 09:59:26 +01:00
MajorCooke
59ad6206de Added CBF_NOACTORS to A_CheckBlock.
- Self explanatory, doesn't count actors as blocking them.
2016-03-02 20:35:54 -06:00
MajorCooke
7f672039bf Cleanup. 2016-03-03 02:58:44 +01:00
MajorCooke
fb3769a730 Added offsetforward to A_CheckLOF.
- offsetforward is to A_SpawnItemEx's x offset property, just like offsetwidth is to y offset.
2016-03-03 02:58:43 +01:00
Christoph Oelckers
90cad80422 - fixed some issues with FPathTraverse:
* when starting directly on a blockline the trace was offset by one map unit. Do this only for the internal block trace calculations but not for the variable that's being exposed to the outside because in rare situations that can create incorrect values.
 * using startfrac could lead to an actor whose inside was right at that positon to be missed.
 * when using startfrac the adjusted trace start was not used for all calculations, which could cause the trace to fail.

With these issues fixed, P_AimLineAttack can now successfully navigate line portals.
2016-03-03 02:50:48 +01:00
Christoph Oelckers
6b1485a89f - refactored those unwieldy intercept position calculations into a subfunction. 2016-03-03 02:50:47 +01:00
Christoph Oelckers
4b23a1c0c7 - added handling for line portals to P_AimLineAttack. 2016-03-03 02:50:45 +01:00
Christoph Oelckers
63d838c0a7 - fixed: P_CollectConnectedGroups could crash when being called before P_FinalizePortals.
- fixed: Entering a sector portal did not properly set up the starting sector of the cloned trace.
2016-03-03 02:50:44 +01:00
Christoph Oelckers
f5fd0df077 - made P_AimLineAttack work through sector portals.
Note: Test output not removed yet!
2016-03-02 20:44:02 +01:00
Randy Heit
c160121f45 Add float casts to DECORATE for the sake of completeness 2016-03-01 11:36:15 -06: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
a16f92c508 Convert "lump" names from directories to lowercase
- Zip and 7z already do this. Directories should too.
2016-03-01 08:49:43 -06:00
Christoph Oelckers
44a6cafd4b - we are using C++11 now, so all those old VC 2005 project files are of no use anymore. 2016-03-01 09:38:49 +01:00
Randy Heit
7c9fd12fc0 Don't generate code to call DECORATE cast functions
- All the cast functions do is return their parameter, so skip the
  function call and use the parameter directly.
2016-02-29 22:26:05 -06:00
Randy Heit
92f74634d6 Remove FxParameter and use a single function instead 2016-02-29 22:08:06 -06:00
Randy Heit
fb8d8dc775 Remove "state" from "Invalid state parameter" error message
- It's confusing to see this from inside an anonymous function. Actually,
  maybe it should be reworded altogether?
2016-02-29 21:44:12 -06:00
Randy Heit
cb1d9597f2 Allow if {} else if {} with DECORATE
This is as opposed to `if {} else { if {} }`, which is what was required
previously to express the same construct.
2016-02-29 21:40:10 -06:00
Randy Heit
f23c0121c5 Use new type system with DECORATE 2016-02-29 21:11:59 -06:00
Christoph Oelckers
15b6c11748 - did some cleanup on FPathTraverse::PortalRelocate. 2016-03-01 02:06:31 +01:00
Christoph Oelckers
5e7ecb3c44 - hm. I thouggr thia has been saved before committing. 2016-03-01 01:53:09 +01:00
Christoph Oelckers
2584108200 - removed the one-sided line portals on polyobjects only limitation. Using Eternity's polyportal testmap shows that it expects one-sided crossable portals on non-polyobject walls.
- converted the P_TranslatePortal* functions to use floating point trigonometry. The combination of R_PointToAngle and finesine even created discrepancies with perfectly parallel portals which is just not acceptable.
- added a function to FPathTraverse to relocate the trace and restart from the new position.
- made P_UseLines portal aware. Traversal through line portals is complete (all types, even teleporters), whether sector portals need better treatment remains to be seen - at the moment it only checks the range at the player's vertical center.
2016-03-01 01:36:36 +01:00
Christoph Oelckers
0c7aea88db - made particles portal-aware. 2016-02-29 16:40:28 +01:00
Christoph Oelckers
07771bd56e - changed parameter of P_GetOffsetPosition to a simple coordinate so that it can be used for other things than actors. 2016-02-29 16:29:51 +01:00
Christoph Oelckers
38c1b8588c - made spawning of teleport fog portal aware. 2016-02-29 16:21:05 +01:00
alexey.lysiuk
2b74ee1eef Fixed assertion failure caused by a missing class to spawn
This fixes debugging troubles with states that have action functions like A_SpawnItem("MissingClass")
2016-02-29 12:54:30 +01:00
Christoph Oelckers
2321c9973f - fixed some serious efficiency problems with clipping masked geometry against portals.
The function to do the work scanned the full list of drawsegs to find portals, which with a large amount of masked geometry and/or drawsegs could become extremely slow.
Changed it so that R_DrawMasked collects all portal related drawsegs up front so that the actual clipping code can
 a) scan a far shorter list and
 b) can skip half of the validation.

Also using P_PointOnLinePrecise to shave off a small bit of additional time.
2016-02-29 12:39:03 +01:00
Christoph Oelckers
0cf9cae7f3 - added some #pragma warnings to i_crash.cpp to silence a warning message in Microsoft's headers. 2016-02-29 10:48:51 +01:00
Christoph Oelckers
6c37ab2310 - changed: If the IWAD contains a MENUDEF lump the one in zdoom.pk3 should not print texture warnings.
The reason is that in such a case it is very likely that the IWAD defines its own menu and will most likely not provide all assets for the base definitions. See 'Adventures of Square' for an example.
2016-02-29 10:45:14 +01:00
Christoph Oelckers
7242a0ef94 - fixed: Rendering 2-sided walls with 3D floor light effects had the 'is3dfloor' flag of GetLightLevel inverted. 2016-02-29 10:26:07 +01:00
Christoph Oelckers
fadc7de636 - added a sight check to A_Blast for cross-portal effects. 2016-02-29 01:36:39 +01:00
alexey.lysiuk
0822485593 Used ISO Latin 1 encoding for text in startup window on OS X
Attempts to output errors with bad characters encountered during text lumps parsing were failed miserably because of UTF-8 conversion
Example: loading of GZ-Models-r16.pk3 with GZDoom caused 'NSConcreteAttributedString initWithString:: nil value' exception
2016-02-28 23:15:23 +01:00
alexey.lysiuk
243f59d96d Made sure that the last text line is always visible in OS X startup window
These case are handled specifically:
* When waiting for clients or host to join
* When showing a fatal error
2016-02-28 23:15:22 +01:00
alexey.lysiuk
067b421f39 Fixed default width of progress bar in OS X startup window
If window was resized before progress bar appears it will have hardcoded and so incorrect width
2016-02-28 23:15:21 +01:00
alexey.lysiuk
64f80456ad Initialized scroll view with the same rectangle as other controls in OS X startup window 2016-02-28 23:15:20 +01:00
alexey.lysiuk
145b7be0a1 Fixed particular slowdown in OS X startup window
During loading of .pk3 that stores hundred of .wad's significant amount of time were spent on scrolling text to the last line
The same applies to other cases like output of thousands warnings/errors
2016-02-28 23:15:19 +01:00
alexey.lysiuk
c687394f72 Added generic way to do periodic updates of OS X startup window
It's used to avoid updating of window (progress bar in particular) too often
Most of time were spent on UI events processing but not on data loading
2016-02-28 23:15:18 +01:00
alexey.lysiuk
0fba6563c7 Disabled fullscreen mode for OS X startup window
There is no use for auxiliary fullscreen window because it behaves really weird
2016-02-28 23:15:17 +01:00
Christoph Oelckers
d4f87203bd - added portal awareness to several functions.
* Arch-Vile resurrection
 * Boom point pushers (due to complete lack of z-handling only for line portals.)
 * A_RadiusGive

These also require a more thorough collection of portal groups than simple position checks.
2016-02-28 23:08:32 +01:00
Christoph Oelckers
8be690fbf2 - fixed type truncation warning. 2016-02-28 21:16:16 +01:00
Christoph Oelckers
27ac207f4c - added oortal handlong to P_RecursiveSound. 2016-02-28 18:03:42 +01:00
Christoph Oelckers
4bb0ca5889 - consolidated some nearly identical code repetitions in Hexen's attack functions. 2016-02-28 16:06:48 +01:00
Christoph Oelckers
c390b98966 - fixed: Not all paths in A_CStaffCheck did proper checks on the player's health. 2016-02-28 15:14:05 +01:00
Christoph Oelckers
94f37bde30 - Forgot changing two comparisons when cleaning up the if statement in FindRefPoint. 2016-02-28 14:03:57 +01:00
Christoph Oelckers
e9fa53c54d - fixed dropoff calculation over portals.
It can easily happen that the lower sector has no lines below the checked area, in which case it would not set the dropoffz correctly. To prevent this, P_LineOpening must, when it checks the opening over a sector portal, actually calculate the dropoff to the lower portal itself by calling sector_t::NextLowestPointAt. It also means that FindRefPoint must calculate a proper reference point when one side of the line to be checked is part of a floor portal.
2016-02-28 13:59:15 +01:00
Christoph Oelckers
b0f1e9b8f3 - fixed typo in portal blockmap code. 2016-02-28 12:16:58 +01:00
Christoph Oelckers
9e3bde0913 - fixed: invisible line within a portal could affect floor height checks in P_CheckPosition. 2016-02-28 12:14:37 +01:00
Christoph Oelckers
3272f180cb - added missing damagemod sector property to extradata parser. 2016-02-28 09:32:10 +01:00
Edoardo Prezioso
cd85f6768c - Improve Mac GCC errors fix to work only for GCC.
This fixes Clang complaining about unknown command option '-Wno-unused-but-set-variable' when compiling dumb.
Also I got no new warnings on Clang by excluding '-Wno-unused-result'.
2016-02-27 23:49:02 +01:00
Christoph Oelckers
a9ca53bc00 - added a check for the destination of a portal to P_CheckPosition. This needs to run a separate BlockLinesIterator that only sets selected fields. 2016-02-27 23:35:13 +01:00
Christoph Oelckers
047070d180 - made arbitrary portals passable.
This includes:

* allow one sided portal linedefs to be crossable when part of a polyobject. Due to the limitations, two-sided linedefs won't work here. For general use this is still not allowed because making them passable would require some crippling fudging.
* delay portal finalization until after polyobjects have been spawned.
* the camera interpolation also needs to handle angle differences.

The code is still not 100% complete - the most important thing that is still missing is proper handling of P_CheckPosition through arbitrary portals.
2016-02-27 18:07:39 +01:00
alexey.lysiuk
fcb38a9419 Made index of VM intrinsic functions unsigned
No more 'comparison of integers of different signs: int and unsigned long' warning
2016-02-27 15:14:13 +02:00
alexey.lysiuk
d49f4a5d84 Removed redundant comparison
No more 'comparison of unsigned expression >= 0 is always true' warning
2016-02-27 15:05:01 +02:00
alexey.lysiuk
3c044ebd5e Removed usage of register keyword
No more 'register storage class specifier is deprecated' warnings
2016-02-27 15:03:44 +02:00
alexey.lysiuk
9e016bbfc3 Removed useless operations from OS X system code
No more 'expression result unused' warnings
2016-02-27 12:48:26 +02:00
alexey.lysiuk
202aea61e5 Fixed incorrect comparison in OS X console window
No more 'comparison between pointer and integer' error
2016-02-27 12:48:12 +02:00
Braden Obrzut
6baa1b0674 - Compile with -std=c++14 or -std=c++11 on GCC/Clang.
- Fixed initialization crossing goto.
2016-02-27 02:20:34 -05:00
Christoph Oelckers
8d58d63b60 - implemented line portal transition. Not yet tested for arbitrary portals but for static ones it is working - including camera interpolation. 2016-02-27 01:23:43 +01:00
Christoph Oelckers
451cac457b - added NULL pointer check in AActor::ClearInterpolation. 2016-02-26 18:05:58 +01:00
Christoph Oelckers
7da8112f12 - now that C++11 is allowed, these annoying 'narrowing conversion' warnings can finally be fixed... 2016-02-26 18:03:45 +01:00
Christoph Oelckers
f7a3314a0a - added an iterator to TArray so that it can be used with range-bases 'for' statements. 2016-02-26 16:20:27 +01:00
Christoph Oelckers
60c2a55ec4 - added P_GetOffsetPosition calls to all needed functions. 2016-02-26 11:52:53 +01:00
Christoph Oelckers
d46e109a5b - prevent Visual C++ from making stupid code. 2016-02-26 11:52:52 +01:00
Christoph Oelckers
eafd2519b4 - fixed a few incorrect uses of AngleTo function.
- added portal offsetting to all AproxDistance, AngleTo and Vec*To members of AActor.
- optimized displacement retrieval so that the most common case with no offset retrieves a constant null-vector which can be optimized away fully by the compiler.
- early out in P_GetOffsetPosition if there's no portal lines nearby, so that the common case can skip the traverser completely even on maps with line portals.
2016-02-26 11:52:50 +01:00
Randy Heit
fd78686679 Add clamp() to DECORATE 2016-02-25 14:31:37 -06:00
Randy Heit
7f57f68ce1 Added GetSpawnHealth() and GetGibHealth() for DECORATE 2016-02-25 10:08:08 -06:00
Randy Heit
a862f728b6 Add remaining VM-supported floating point operations to DECORATE
- These are:
  * exp
  * log
  * log10
  * ceil
  * floor
  * acos
  * asin
  * atan
  * tan
  * cosh
  * sinh
  * tanh
2016-02-25 09:41:49 -06:00
Randy Heit
8ee820042f Tablified the DECORATE floating point operations (sqrt,cos,sin) 2016-02-25 09:23:46 -06:00
Christoph Oelckers
d8d3889452 - removed PortalGroup == 0 check. This would only be valid if there's only linked portals in the map. 2016-02-25 13:36:27 +01:00
Christoph Oelckers
c7bce8b346 - added a special portal blockmap. This only contains all lines which have a crossable line portal assigned. This is to speed up offset calculations because those are quite frequent and would be too inefficient with the full blockmap.
- made some minor changes to FPathTraverse so that the Add*Intercepts methods can be virtually overridden.
- removed the PortalTracer class because in its existing form it was too costly. Replaced with a P_GetOffsetPosition function that does the minimum required work to get to the translated destination and that's better suited for being called from the Vec*Offset methods. Other use cases will require some changes to FPathTraverse anyway, or some wrapping class like the FMultiBlock iterators.
2016-02-25 13:00:23 +01:00
Christoph Oelckers
a9db998700 - did some refactoring on FPathTraverse to allow inheriting from that class with different collection functions.
This will be needed to implement an efficient portal checker that doesn't run through the entire blockmap to find the portals.
2016-02-25 09:54:09 +01:00
Christoph Oelckers
208ad14bad - this wasn't saved when I committed the interpolation stuff. 2016-02-25 01:24:09 +01:00
Christoph Oelckers
e11da06e69 - some preparations for actor interpolation through wall portals. 2016-02-25 00:41:31 +01:00
Christoph Oelckers
58d3b04590 - fixed some places in p_pillar.cpp where sector plane z's were calculated at (0, 0) which could cause overflows if the actual plane is too far away from the origin.
- renamed sector_t::soundorg in centerspot, changed the type to a fixedvec2 and removed the CenterSpot #define.

Since this thing was used in lots of places that have nothing to do with sound the name made no sense. Having it as a fixed_t array also made it clumsy to use and the CenterSpot #define used a potentially dangerous type cast.
2016-02-24 14:49:59 +01:00
Christoph Oelckers
21c55a090a - fixed: "take armor" cheat should only deplete the armor, not destroy it.
- fixed: Hexen armor cannot be depleted by the common function, it needs an override to achieve that.
2016-02-24 10:50:42 +01:00
alexey.lysiuk
8ba6f6ced5 Fixed crash when spawning decal without texture
See http://forum.zdoom.org/viewtopic.php?t=50977
2016-02-24 10:37:14 +01:00
Christoph Oelckers
51da78ba29 - added a compatibility option to allow multiple exits to be triggered.
This is required by Daedalus's travel tubes which contain a faulty script with some leftover debug code.
2016-02-24 10:35:29 +01:00
Christoph Oelckers
b01e0fa06e - removed debug output from portal transition code.
- handle the case where a portal transition crosses more than a single boundary in one move.
2016-02-24 10:08:23 +01:00
Randy Heit
326907f6ab Cleanup parsing of DECORATE intrinsics
- Split specific parsing for each intrinsic out of ParseExpression0 and
  into their own functions.
- Instead of reserving keywords for intrinsics, identify them by name
  within TK_Identifier's handling.
2016-02-23 19:39:29 -06:00
Christoph Oelckers
01bdd8a7da - actor transition through a sector portal is working. 2016-02-24 01:16:07 +01:00
Christoph Oelckers
58839200e5 - fixed some line clipping issues with portals
* Blocking lines above or below the current sector should only block if they actually intersect with the currently checking actor.
 * Sectors above a ceiling portal should not change current floor information and vice versa.
2016-02-24 01:16:06 +01:00
Randy Heit
1f09341d2b Let min/max pre-solve for 2+ constants, even if there are non-constants 2016-02-23 16:37:52 -06:00
Randy Heit
1ffb7ad109 Add min and max to DECORATE 2016-02-23 16:26:00 -06:00
DaMan
78552cc676 Disable UAC virtualization 2016-02-22 17:56:18 -06:00
MajorCooke
c3ffeb1e9d A_RadiusGive Missile check fix
- Don't use isMissile(). Check directly for the flag at the moment of calling and not the default. Otherwise, things changing themselves will still be ineligible for non-missile checks.
2016-02-22 11:30:44 -06:00
Christoph Oelckers
49bfe717ce Merge remote-tracking branch 'remotes/origin/portal' 2016-02-22 15:54:07 +01:00
Christoph Oelckers
62f6a5e4bf - fixed: GetFloorCeilingZ used the actor's actual position, not the tmf.x, tmf.y for which information is supposed to be retrieved. 2016-02-22 15:51:19 +01:00
Christoph Oelckers
4b0af5967e - use proper constructor for FMultiBlockLinesIterator in P_CheckPosition. 2016-02-22 15:51:18 +01:00
Christoph Oelckers
ed2b107bc9 - fixed: P_LineOpening_XFloors set some floor-related info in the ceiling case so that it never reached the point where it is needed.
- fixed: FMultiBlockLinesIterator/FMultiBlockThingsIterator need to treat radius=-1 as 'use default from actor.'
2016-02-22 15:51:18 +01:00
alexey.lysiuk
89ca14a587 Fixed memory leak caused by return statement parsing 2016-02-22 14:24:34 +02:00
Christoph Oelckers
31cf712db3 - replaced R_PointToAngle2 in blood splatter functions. 2016-02-22 12:33:13 +01:00
Christoph Oelckers
730145d1fc - more transition to FMultiBlock* iterators:
* removed all code for dealing with z-displacing portals in the iterator loops. This would cause too many problems so I decided to scrap any provisions for allowing interactive portals with z-displacement. They will remain restricted to pure teleporter portals.
 * changed spechit to carry a position along with the special line. If something is activated through an interactive portal this is needed to calculate movement.
 * pass the abovementioned position to CheckForPushSpecial.
 * collect touched portal lines in a second array analogous to spechit.
 * use FMultiBlockThingsIterator in P_TestMobjZ.
2016-02-22 12:05:38 +01:00
Christoph Oelckers
ca2fc47fa3 - refactoring of PIT_CheckThing. 2016-02-22 12:05:37 +01:00
Christoph Oelckers
98c7fabb89 - untested partial refactoring of P_CheckPosition.
(This is just a safety commit before doing some more extensive behind-the-scenes refactoring.)

Notable changes here:

 * use the same logic for determining whether a 3D floor is 'below' or 'above' the actor as all the other functions.
 * removed the broken code which tried to detect whether an actor was touching a steep slope. Better use P_LineOpening to find the correct planes and store the results.
 * improved detection whether the slopes on both sides of a plane are identical, using the same data as for steep slope detection.
2016-02-22 12:05:37 +01:00
Christoph Oelckers
abcc6049b9 - made the z coordinate part of the CheckResults for the MultiBlock iterators and use these for all height checks in the iterator loops. This will later make it easier to support arbitrary portals with height displacements. 2016-02-22 12:05:36 +01:00
Randy Heit
70c663b253 Revert "Add PARAM_STATE_NOT_NULL for the A_Jump* functions"
- This reverts commit cab39973df.
  I was wrong. DoJump never allowed jumping to NULL states.
2016-02-21 19:21:39 -06:00
Randy Heit
19af8a3a82 Change error message for missing return 2016-02-20 23:14:14 -06:00
Randy Heit
e7b9e7e955 Rename A_Int/A_Bool/A_State to int/bool/state
- This is an effort to emphasize that these are just type casts. Now they
  look like function-style casts with no action function styling.
  They do no magic joojoo at all. The only reason they exist is because
  the DECORATE parser can only parse return statements that call a
  function, so these satisfy that requirement. i.e. *return int(666);* is
  identical to *return 666;* (if the parser could handle the latter).
2016-02-20 22:05:17 -06:00
Randy Heit
cab39973df Add PARAM_STATE_NOT_NULL for the A_Jump* functions
- Now that state jumps are handled by returning a state, we still need a
  way for them to jump to a NULL state. If the parameter processed by this
  macro turns out to be NULL, Actor's 'Null' state will be substituted
  instead, since that's something that can be jumped to.
2016-02-20 21:52:29 -06:00
Randy Heit
5e298173f7 Redo ACTION_RETURN macros so they can be treated like return statements 2016-02-20 21:34:58 -06:00
Randy Heit
81314a6cd6 Revert "- fixed a few occurences where ACTION_RETURN_* eliminated the side effect of its argument when no return value was requested."
This reverts commit 7ede77c1d2.
2016-02-20 21:27:42 -06:00
Christoph Oelckers
26967bd0ee - migrated P_PlayerStartStomp to FMultiThingIterator.
Note: This replaces AActor::intersects with a direct calculation. Although that function could be adjusted it'd mean some redundant distance calculations which are easily avoided.
2016-02-21 00:21:42 +01:00
Christoph Oelckers
f8a8d8eed2 - fixed use of wrong position variable in P_TeleportMove's thing iterator. 2016-02-21 00:21:42 +01:00
Christoph Oelckers
58fcd8d742 - implemented the FMultiBlockThingsIterator and converted P_TeleportMove to use it. 2016-02-21 00:21:41 +01:00
m-x-d
d2630dee8c Fixed: warp and warp2 texture effects now work for NPo2 textures. 2016-02-20 21:45:09 +01:00
MaxED
1ba526d4de Added #region / #endregion handling (should affect all text lumps, let me know if there are text lumps unaffected by this). 2016-02-20 21:45:08 +01:00
nukeykt
4b0aac9816 Backport OPL2 KSL table fix from MAME v0.150. 2016-02-20 20:08:02 +01:00
John Palomo Jr
92697659be Expose SafeCommand confirmation string to language. 2016-02-20 20:04:30 +01:00
alexey.lysiuk
7b49d9d92c Fixed crash when accessing undefined user variable
Presence of DECORATE user variable was not checked before attempting to read or write its value from ACS
2016-02-20 20:02:32 +01:00
Christoph Oelckers
b8f8daf1c1 - fixed:In P_ChangeSector, floorOrCeil==2 means that only 3D midtextures moved. This means that
* no 3D floor movement can take place
 * no portal changes can occur.
2016-02-20 15:52:19 +01:00
Edoardo Prezioso
166687d971 - Added optional 'z' parameter to the 'warp' CCMD.
Now it's possible to warp above 3dfloors.
2016-02-20 13:32:27 +01:00
Christoph Oelckers
7ede77c1d2 - fixed a few occurences where ACTION_RETURN_* eliminated the side effect of its argument when no return value was requested.
This macro should not be used on function calls that actually perform an action aside from calculating the return value!
2016-02-20 13:13:53 +01:00
Edoardo Prezioso
d1502b1086 - Simplify expressions inside some else/endif.
We aren't bound to old cmake anymore.
2016-02-20 11:38:30 +01:00
Edoardo Prezioso
3dcc6d0330 [fmod] Improve the checks for fmod 4.44.
- The FMOD 4.44 linux package contains both 32 and 64-bit versions, with the folder name without the '64' suffix for 64-bit.
- Add minor version '61' so that the latest FMOD package (at the time of this commit) can be detected and compiled successfully.
2016-02-20 11:38:29 +01:00
Randy Heit
c3432a1ddb Fix CustomInventory never succeeding
- A != should have been ==.
2016-02-19 22:09:35 -06:00
Christoph Oelckers
cfbb3bcbb2 - completed work on P_FindFloorCeiling and all functions it calls.
Note: The debug output is left in so that in cases of an error it can still be used.
2016-02-20 02:22:10 +01:00
Christoph Oelckers
d876a95152 - set floor and ceiling sector when it comes from a 3D floor.
There's code in p_mobj.cpp which needs this to pick the correct plane.
2016-02-20 02:22:09 +01:00
Christoph Oelckers
6132f6971a - added support for FFCF_NOPORTALS and FFCF_3DRESTRICT to FindNextLowestFloorAt and FindNextHighestCeilingAt
- use these functions in P_GetFloorCeiling instead of duplicating all this code.
- removed some debug CCMDs.
2016-02-20 02:22:09 +01:00
Christoph Oelckers
dc37f78566 - fixed: Old portal data must be deleted before loading a new level. 2016-02-20 02:22:09 +01:00
Christoph Oelckers
cb0e7c6ca5 - fixed some issues with P_FindFloorCeiling rework. 2016-02-20 02:22:08 +01:00
Randy Heit
4770dc2dfb Fix improper detection of if statements returning 2016-02-19 16:38:30 -06:00
Randy Heit
80d49d6bb9 Fix crash when parsing an empty action list for DECORATE 2016-02-19 16:31:53 -06:00
Christoph Oelckers
28799c4b51 - some logic fixes in FMultiBlockLinesIterator. 2016-02-19 16:13:36 +01:00
Christoph Oelckers
02d7572343 - some header dependency cleanup so that it is no longer needed to include portal.h to get the inline functions. Portal.h has been reduced of most dependencies now so that including it is cheap and can be done in other headers.
- some consolidation in p_map.cpp. PIT_CheckLine and PIT_FindFloorCeiling had quite a bit of redundancy which has been merged.
- čontinued work on FMultiBlockLinesIterator. It's still not completely finished.
2016-02-19 14:08:41 +01:00
Christoph Oelckers
15040c955e Merge branch 'master' into portal 2016-02-19 10:40:07 +01:00
Christoph Oelckers
3841a5f626 - implemented FMultiBlockLinesIterator for checking a position across portals. This is not fully tested yet. 2016-02-19 10:39:40 +01:00
Randy Heit
a31bd78abe Fix definitions of A_State/A_Int/A_Bool
- These aren't action functions, so PARAM_ACTION_PROLOGUE is
  inappropriate.
2016-02-19 00:29:19 -06:00
Randy Heit
cb0fd5967f Oops. Had FxCastStateToBool backwards. 2016-02-18 22:53:18 -06:00
Randy Heit
a399f40e5f Support casting states to booleans
- This is so that you can call an A_Jump-type function from inside an if
  statement and do something other than jump if the jump condition was
  met. e.g.

    {
        if (A_Jump(128, "Foo"))
	{
            A_Log("The function would have jumped");
	}
	else
	{
	    A_Log("The function would not have jumped");
	}
    }
2016-02-18 22:40:04 -06:00
Randy Heit
aa58c5f519 Declare VMFunction::Proto to the garbage collector 2016-02-18 22:26:37 -06:00
Randy Heit
eace79ccad Add some functions for use with DECORATE return
- Since DECORATE's return statement can only return the results of
  function calls (I do not want to spend the time necessary to make it
  return arbitrary expressions), here are three functions to get around
  this limitation:
  * A_State - Returns the state passed to it. You can simulate A_Jump
    functions with this.
  * A_Int - Returns the int passed to it.
  * A_Bool - Returns the bool passed to it.
- e.g. If you want to return the number 3, you use this:

    return A_Int(3);

  If you want to jump to a different state, you use this:

    return A_State("SomeState");
2016-02-18 22:15:03 -06:00
Randy Heit
fbbaae781b Merge remote-tracking branch 'origin/master' 2016-02-18 22:05:40 -06:00
Randy Heit
b1098ede93 Restore "direct" call optimization for DECORATE 2016-02-18 22:05:16 -06:00
Randy Heit
ade780d810 Redo ACustomInventory::CallStateChain to check return types 2016-02-18 22:05:10 -06:00
Randy Heit
b8a16600ac Braces around ACTION_RETURN used in an if are no longer optional 2016-02-18 21:39:13 -06:00
Randy Heit
b2ccd0bd28 Use action function return value to make state jumps happen
- The A_Jump family of action functions now return the state to jump
  to (NULL if no jump is to be taken) instead of jumping directly.
  It is the caller's responsibility to handle the jump. This will
  make it possible to use their results in if statements and
  do something other than jump.
- DECORATE return statements can now return the result of a function
  (but not any random expression--it must be a function call). To
  make a jump happen from inside a multi-action block, you must
  return the value of an A_Jump function. e.g.:
    { return A_Jump(128, "SomeState"); }
- The VMFunction class now contains its prototype instead of storing
  it at a higher level in PFunction. This is so that
  FState::CallAction can easily tell if a function returns a state.
- Removed the FxTailable class because with explicit return
  statements, it's not useful anymore.
2016-02-18 20:39:40 -06:00
Edoardo Prezioso
f338e5f1c4 - Apply the fast math flags for non-MSVC, too.
Move the fast flags string creation in the main cmake file and use it where needed.
2016-02-18 23:13:02 +01:00
Christoph Oelckers
884a265d4a - refactored P_FindFloorCeiling to be portal aware and cleaned up its interface.
A big problem with this function was that some flags required setting up some variables before calling it and others did not. It will now set everything up itself so all initializations to AActor::floorz and ceilingz that were made before these calls (which were all identical to begin with) could be removed and the internal initialization logic streamlined.
2016-02-17 21:57:52 +01:00
Christoph Oelckers
bd09664d85 Merge branch 'master' into portal 2016-02-17 12:37:11 +01:00
Christoph Oelckers
f2125ea420 - this needs a return value... 2016-02-17 12:36:56 +01:00
Christoph Oelckers
022ab95817 Merge branch 'master' into portal 2016-02-17 11:46:24 +01:00
Christoph Oelckers
5a779cc1f4 Merge branch 'master' of https://github.com/rheit/zdoom 2016-02-17 11:43:03 +01:00
Christoph Oelckers
42c6245a50 - restored A_CountdownArg to what it looked like before the scripting branch.
The new version did not work as expected anymore.
2016-02-17 11:42:45 +01:00
Christoph Oelckers
10a3d75556 - reviewed and adjusted ZatPoint calls in p_map.cpp. 2016-02-17 11:39:14 +01:00
Christoph Oelckers
6e4cf9699a Merge branch 'portal' of https://github.com/rheit/zdoom into portal 2016-02-17 02:21:46 +01:00
Christoph Oelckers
0948448988 - some more checking and refactoring of ZatPoint calls.
- removed Plane/Floor/CeilingAtPoint functions because they are overkill for the problem they were meant to solve. Calling ZatPoint with adjusted coordinates created with AActor::PosRelative is just as easy in the few places where this is needed.
- made P_HitWater and P_CheckSplash portal aware.
2016-02-17 02:21:26 +01:00
Christoph Oelckers
5611df1f3e - fixed the portal aware ceiling and floor functions. 2016-02-17 00:31:29 +01:00
Christoph Oelckers
fd7e6ae604 - fixed copy&paste error in LowestFloorAt. 2016-02-16 23:11:20 +01:00
Christoph Oelckers
8d53f6176e - fixed conditions for PortalBlocksView. Created a new function PortalBlocksSight that's relevant for playsim-related sight checks. 2016-02-16 22:57:03 +01:00
Christoph Oelckers
93b3982c62 Merge branch 'zmaster' into portal 2016-02-16 22:05:50 +01:00
Christoph Oelckers
6d8879f302 - missing #includes. 2016-02-16 22:04:32 +01:00
Christoph Oelckers
ae02b2fcaf - added NextHighestCeiling/NextLowestFloorAt functions. Not tested yet! 2016-02-16 21:00:34 +01:00
Christoph Oelckers
5fd6ccb970 - fixed incorrect #include. 2016-02-16 20:53:52 +01:00
Randy Heit
0f70d10521 Add 'float' and 'state' as possible return types for action functions 2016-02-16 12:09:00 -06:00
Christoph Oelckers
1b88052bba - started refactoring ZatPoint calls which need to be portal aware.
To summarize, anything that just works with map geometry doesn't need to bother, as does the renderer. (i.e. nearly all r_* files, p_floor.cpp, p_ceiling.cpp et.al)
But all calls that are somehow related to actor positions need to be made aware of potential portal transitions:

 * added FloorAtPoint, CeilingAtPoint and PlaneAtPoint methods to sector_t, which can be used to calculate a plane's height with relation to a given actor, even if that actor is on the other side of a portal.
 * added HighestCeilingAt and LowestFloorAt methods which traverse all ceiling/floor portals until they find an impassable plane.
2016-02-16 16:40:53 +01:00
Christoph Oelckers
45108e9bb8 - added two missing files to CMakeLists.txt. 2016-02-16 12:52:45 +01:00
Christoph Oelckers
22e8678903 - refactored P_CollectConnectedGroups to avoid frequent heap allocations for the common cases
* the temporary checking arrays are now static
 * the array that gets the returned values only starts allocating memory when the third touched sector group is found. The most common cases (no touched portal and one touched portal) can be handled without accessing the heap.

- did some streamlining of AActor::LinkToSector:

 * there's only now version of this function that can handle everything
 * moved the FIXMAPTHINGPOS stuff into a separate function.
 * removed LinkToWorldForMapThing and put all special handling this function did into P_PointInSectorBuggy.
2016-02-16 12:51:10 +01:00
Christoph Oelckers
b9037ef3ee - added a check to detect self-referencing sectors in the portal setup code because those are problem cases. 2016-02-15 21:49:46 +01:00
Christoph Oelckers
f24bf7e622 - separated FCheckPosition and its FPortalGroupTable substructure into its own header because this was creating too many dependencies on other headers with FCheckPosition in p_local.h and FPortalGroupTable in portals.h. 2016-02-15 13:40:31 +01:00
Christoph Oelckers
5664cee2e5 - fixed: The check for leftover portal sectors was not correct. It only checked the sectors the portal thing was in and those were already processed in the first phase.
- improved: If there's an offset mismatch, do not print group numbers as they are utterly meaningless. Instead look for a sector in each group and report those.
- added a copyright notice and some comments to portals.cpp.
2016-02-15 12:35:40 +01:00
Christoph Oelckers
afc631b537 - this wasn't saved for last night's commit. 2016-02-15 09:25:48 +01:00
Christoph Oelckers
6adb069506 - rewrote p_local.h so that it doesn't pull in the entire bunch of headers.
This was to resolve some circular dependencies with the portal code.
The most notable changees:

 * FTextureID was moved from textures.h to doomtype.h because it is frequently needed in files that don't want to do anything with actual textures.
 * split off the parts from p_maputl into a separate header.
 * consolidated all blockmap related data into p_blockmap.h
 * split off the polyobject parts into po_man.h
2016-02-15 02:14:34 +01:00
Christoph Oelckers
405db83393 - added a function which collects all portal group an actor would touch if standing in a given position. 2016-02-15 00:53:59 +01:00
Christoph Oelckers
0dce22ce85 - some portal considerations. 2016-02-14 21:02:18 +01:00
Christoph Oelckers
5af53c0e62 - fixed a few more sector movers which calculated their movement at (0,0) instead of inside the sector. 2016-02-14 18:53:00 +01:00
Christoph Oelckers
126c80d597 - create the portal group table. 2016-02-14 18:16:59 +01:00
Christoph Oelckers
c338b9cde3 - some more portal preparation . 2016-02-14 16:26:27 +01:00
Christoph Oelckers
d5a1004c41 - some preparations for portal stuff:
* set up linked sector portals so that everything that will eventually have to be considered is present, even though the software renderer currently can't handle those adequately.
* tag all skybox things with a type so that they can easily be distinguished at run time.
* fill in the linked portal types in xlat/eternity.txt.
2016-02-14 13:12:03 +01:00
Christoph Oelckers
993a840630 - bring formatting in line with GZDoom's version of this function. 2016-02-14 12:33:47 +01:00
Christoph Oelckers
e42dbb5087 Merge branch 'master' of https://github.com/rheit/zdoom
# Conflicts:
#	src/sound/oalsound.cpp
2016-02-13 14:56:03 +01:00
Christoph Oelckers
340faef1ec - fixed a few 64-bit warnings. 2016-02-13 13:37:28 +01:00
alexey.lysiuk
ce8b2974a3 Handle inability of OpenAL implementation to return number of available sources
OpenAL specification doesn't require alcGetIntegerv() to return meaningful values for ALC_MONO_SOURCES and ALC_MONO_SOURCES.
At least Apple's OpenAL implementation returns zeroes, although it can generate reasonable number of sources.
2016-02-13 11:11:02 +02:00
Randy Heit
01bed05275 Do not use fast math for the node builder
- The node builder generates data used by the playsim, so should be as
  consistant as we can manage across compilers and architectures.
2016-02-12 16:27:47 -06:00
Christoph Oelckers
f7e27032dc - fixed: The default vertical spread for the BFG tracers was set to 32*FRACUNIT instead of 32*ANGLE_1. 2016-02-12 18:55:18 +01:00
Christoph Oelckers
b818624f58 - enabled fast math for all known non-playsim files in the CMake project. 2016-02-12 12:51:09 +01:00