Commit Graph

231 Commits

Author SHA1 Message Date
Christoph Oelckers ec58e70078 - replaced ceilingz with a floating point variable, also in FCheckPosition. 2016-03-20 13:32:53 +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 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 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 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 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
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 3c25b2c066 - some redesign of P_CheckSight to handle portals.
Portal stuff not tested yet.
2016-03-07 21:59:32 +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 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 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 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 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 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 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
MajorCooke 35b7a5ccc1 Updated for scripting branch merge. 2016-02-04 22:41:02 -06: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
MajorCooke a1c1de9edb Fixed merge conflicts. 2016-02-02 18:26:20 -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
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
Edward Richardson e5c67cee83 Merge branch conflicts fix
- CONFLICT (content): Merge conflict in src/p_acs.cpp
- Updated position variables
2016-01-21 10:49:57 +13:00
Christoph Oelckers b73e1e65f5 Merge branch 'master' into scripting
Conflicts:
	src/actor.h
	src/p_local.h
	src/thingdef/thingdef_codeptr.cpp
2016-01-19 20:17:34 +01:00
Christoph Oelckers 7658111566 - refactoriung of thingdef_codeptr.cpp - probably the ugliest file in the entire project... 2016-01-19 20:15:45 +01:00
Christoph Oelckers 1faf68794b - fixed the merge. 2016-01-19 13:59:53 +01:00
Christoph Oelckers bc63b70d88 Merge branch 'master' into scripting
Conflicts:
	src/actor.h
	src/fragglescript/t_func.cpp
	src/g_doom/a_bossbrain.cpp
	src/g_doom/a_revenant.cpp
	src/g_heretic/a_hereticartifacts.cpp
	src/g_heretic/a_hereticweaps.cpp
	src/g_heretic/a_knight.cpp
	src/g_hexen/a_bishop.cpp
	src/g_hexen/a_clericholy.cpp
	src/g_hexen/a_dragon.cpp
	src/g_hexen/a_firedemon.cpp
	src/g_hexen/a_flechette.cpp
	src/g_hexen/a_heresiarch.cpp
	src/g_hexen/a_hexenspecialdecs.cpp
	src/g_hexen/a_iceguy.cpp
	src/g_hexen/a_korax.cpp
	src/g_hexen/a_magelightning.cpp
	src/g_hexen/a_serpent.cpp
	src/g_hexen/a_spike.cpp
	src/g_hexen/a_wraith.cpp
	src/g_raven/a_minotaur.cpp
	src/g_shared/a_bridge.cpp
	src/g_shared/a_pickups.cpp
	src/g_shared/a_randomspawner.cpp
	src/g_strife/a_alienspectres.cpp
	src/g_strife/a_crusader.cpp
	src/g_strife/a_entityboss.cpp
	src/g_strife/a_inquisitor.cpp
	src/g_strife/a_loremaster.cpp
	src/g_strife/a_programmer.cpp
	src/g_strife/a_sentinel.cpp
	src/g_strife/a_spectral.cpp
	src/g_strife/a_strifestuff.cpp
	src/g_strife/a_strifeweapons.cpp
	src/g_strife/a_thingstoblowup.cpp
	src/p_local.h
	src/r_utility.cpp
2016-01-19 13:43:11 +01:00
Christoph Oelckers 2326928ff7 - the last bits of Hexen refactored
This also fixes a problem with some of Hexen's Wraith's effects which did some repositioning without properly linking them into the blockmap.
2016-01-19 01:10:57 +01:00
Christoph Oelckers c1b44a5694 - let's make some use of AActor::Pos and get rid of some of those X() and Y() calls...
- restore proper actor.h file.
2016-01-18 21:01:52 +01:00
Christoph Oelckers bf747075e8 Merge branch 'master' into scripting
Conflicts:
	src/actor.h
	src/g_hexen/a_clericstaff.cpp
	src/p_enemy.cpp
	src/p_interaction.cpp
	src/p_local.h
	src/p_mobj.cpp
	src/thingdef/thingdef_codeptr.cpp
2016-01-17 20:57:55 +01:00
Christoph Oelckers fbaab5044d Merge commit '38df0665e3a2018cf1d0028a36357df6c7e908e9' into scripting
Conflicts:
	src/d_dehacked.cpp
	src/decallib.cpp
	src/g_hexen/a_clericstaff.cpp
	src/p_interaction.cpp
	src/p_local.h
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/constants.txt
	wadsrc/static/actors/shared/inventory.txt
2016-01-17 19:50:34 +01:00
Christoph Oelckers 5207aa6cc0 Merge commit '125afcf3defb901e23bd44d32fa86681ef1748f6' into scripting
Conflicts:
	src/p_local.h
	src/p_mobj.cpp
	src/thingdef/thingdef_codeptr.cpp
	wadsrc/static/actors/shared/inventory.txt
2016-01-17 19:09:05 +01:00
Christoph Oelckers 0e645ad173 - added a 'non-modify' mode to P_TeleportMove and let A_Respawn use that, rather than letting P_TeleportMove muck around with the actor properties and then have A_Respawn only partially and haphazardly restoring them afterward. 2016-01-16 16:30:53 +01:00
Christoph Oelckers 90e2dc5f5a - some minor optimizations to FPathTraverse:
* since we can trivially decide whether a line crosses the trace behind the end point from checking the return value of P_InterceptVector, there is no need to add those to the list of intercepts as they get discarded anyway in t
* maxfrac is always FRACUNIT so there's no need to waste some variable for a constant value.
2016-01-15 16:40:50 +01:00
Christoph Oelckers 867b7767ef - ignore COMPAT_POINTONSIDE in a few places where the side effects of the old P_PointOn*Side functions are either not needed or problematic:
* the sight checking code needs to be as precise as possible and should not depend on some old semi-broken routines. (This is more a precision issue of these routines - P_PointOnDivlineSide removes the lower 8 bits of each value - than having an issue with returning the wrong side in some cases.)
 * for slope creations it is flat out wrong to use the old routines at all.
 * also ignore this in the modern (box-shaped) case of FPathTraverse::AddLineIntercepts. This functionality is new to ZDoom and therefore not subject to compatibility concerns.
 * the line-to-line teleporter. It seems the hideous fudging code was just there to work around the design issues of these functions, so let's better not ever call them here in the first place.
 * A_PainShootSkull: Its usage here does not depend on these issues.
 * P_ExplodeMissile: New code exclusive to ZDoom.
 * FPolyObj::CheckMobjBlocking

All occurences in p_map.cpp have been left alone although most of them probably won't need the compatibility option either.
2016-01-15 12:56:27 +01:00
Christoph Oelckers 71c7f2b42c - added 'floorterrain' and 'ceilingterrain' sector properties for UDMF. These will take precedence over texture based terrain if used.
'ceilingterrain' is needed because the top of 3D-floors refers to the model sector's ceiling, so in order to give a 3D floor a terrain it must be assignable to the sector's ceiling.
Note that although it is basically the same property, its actual function bears no relevance to its use in Eternity.
2016-01-09 12:10:36 +01:00
Christoph Oelckers eafa394af4 - re-added and fixed terrain splashes for damaging sectors.
Turned out that P_HitWater wasn't even able to spawn the splashes, even after the call was re-added.
2016-01-06 16:42:21 +01:00
Braden Obrzut a8ac748123 Merge commit 'e2d874e343da34df6edfad0bb47370cbe10f4bae' 2015-10-25 15:00:43 -04:00
MajorCooke c5f433d80a No more BASETHRESHOLD. 2015-10-14 07:36:30 -05:00
Edoardo Prezioso 6678c3550e - Improve the TFlags code and fix the new errors.
The previous version didn't detect some real mistakes in code which used operator& with the wrong flagset (for now 'converted' to the correcly equivalent counterpart, waiting for the proper fix).
2015-10-13 00:30:06 +02:00
MajorCooke af9478f818 - Added Warp properties RadiusOffset and Pitch.
- RadiusOffset is a multiplier of the target actor's radius added onto the offsets x and y.
- Pitch is added to the warping actor's current pitch, provided WARPF_USEPITCH is supplied.
- Fixed WARPF_TOFLOOR not working as intended.
2015-10-03 17:28:54 -05:00
alexey.lysiuk fea2cb38cc Fixed compatibility flags comparison for point-on-line
Now it works in both cases: for compatibility mode set by user and for internal compatibility handler
2015-09-15 19:27:05 +03:00
alexey.lysiuk 39b18a3447 Improved point-on-line compatibility feature
P_PointOnLineSide() and P_PointOnDivlineSide() functions from the initial Doom source code release are used in compatibility mode
2015-09-15 18:21:05 +03:00
alexey.lysiuk ee7eb3253a Added compatibility flag for point-on-line algorithm
It's possible to use original but buggy implementations of P_PointOnLineSide() and P_PointOnDivlineSide() function
See http://forum.zdoom.org/viewtopic.php?f=2&t=49544
2015-09-15 16:45:20 +03:00
Xaser Acheron 8948f5dc2b Added FPF_NOAUTOAIM to A_FireCustomMissile 2015-09-08 10:40:21 -05:00
MajorCooke 87cc3f77f9 - Removed WARPF_ADDHEIGHT. 2015-08-10 16:05:44 -05:00
MajorCooke 54af1e379e - Removed WARPF_MULHEIGHT. Enable its ability by default.
- WARPF_ADDHEIGHT will simply change HeightOffset from multiplying to adding by default.
2015-08-10 15:03:29 -05:00