Commit Graph

420 Commits

Author SHA1 Message Date
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 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
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 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 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 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 d49f4a5d84 Removed redundant comparison
No more 'comparison of unsigned expression >= 0 is always true' warning
2016-02-27 15:05:01 +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 e11da06e69 - some preparations for actor interpolation through wall portals. 2016-02-25 00:41:31 +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
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 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
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
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
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 cb0e7c6ca5 - fixed some issues with P_FindFloorCeiling rework. 2016-02-20 02:22:08 +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 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 10a3d75556 - reviewed and adjusted ZatPoint calls in p_map.cpp. 2016-02-17 11:39:14 +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 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 c338b9cde3 - some more portal preparation . 2016-02-14 16:26:27 +01:00
Christoph Oelckers 158caf78a0 - more float to double conversion.
In particular this removes all assignments of FIXED2FLOAT to double variables because they not only lose precision but also generate unnecessary code.
2016-02-11 21:33:30 +01:00
Randy Heit b3b0886b64 Merge branch 'scripting'
Conflicts:
	src/actor.h
	src/g_doom/a_doomweaps.cpp
	src/g_hexen/a_blastradius.cpp
	src/p_enemy.cpp
	src/p_enemy.h
	src/thingdef/thingdef.h
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/constants.txt
2016-02-04 15:17:22 -06:00
Christoph Oelckers 46024398fe - fixed: Change FCheckPosition::LastRipped to a TMap so that it can track multiple overlapping actors being ripped during the same tic. 2016-01-30 22:06:04 +01:00
Christoph Oelckers 7b1fbe0a02 - fixed: P_TeleportMove was missing checks for THRUACTORS and THRUSPECIES flags. 2016-01-29 11:29:47 +01:00
Randy Heit 87dee5c611 Fixed: Co-op players could spawn at (0,0) if no start spots for them
- Check if a co-op start exists. If not, pick one at random.
- Don't telefrag other players when spawning in co-op games, since
  you're allowed to move out of other players now.
2016-01-28 20:08:09 -06:00
Randy Heit 9744b9e0d9 Merge branch 'master' into scripting
Conflicts:
	src/actor.h
	src/dobject.h
	src/dobjgc.cpp
	src/p_local.h
	src/thingdef/thingdef_codeptr.cpp
2016-01-21 12:45:06 -06:00
Christoph Oelckers 03d7418f51 - fixed: Since sector movement is done after P_PlayerThink is called, any player position change induced by this is not factored into player_t::viewz and needs to be added explicitly.
This fixes the infamous 'view squats down a bit when riding up an elevator' effect. It is also there in the other cases but far less pronounced.
2016-01-21 10:23:20 +01:00
Christoph Oelckers c78344c19d Merge branch 'master' into scripting
Conflicts:
	src/actor.h
	src/p_user.cpp
	src/thingdef/thingdef_expression.cpp
2016-01-20 15:16:06 +01:00
Christoph Oelckers 35271187a5 - took care of the rest of p_map.cpp. 2016-01-20 13:48:05 +01:00
Christoph Oelckers 4b9647e539 Merge branch 'master' into scripting
Conflicts:
	src/actor.h
	src/g_hexen/a_hexenspecialdecs.cpp
	src/g_strife/a_thingstoblowup.cpp
	src/thingdef/thingdef_codeptr.cpp
2016-01-20 11:45:57 +01:00