- started converting g_hexen.
Most importantly this removes CHolyWeave as it is just a specialized version of A_Weave with far more convoluted use of parameters.
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.
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.
- 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.
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.
- 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.
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.
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.
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
Converting a floating point value that is out of range for a signed integer will result in 0x80000000 with SSE math, which is used exclusively for this purpose on modern Visual C++ compilers, so this cannot be used anywhere.
On ARM there's problems with float to unsigned int conversions.
xs_Float does not depend on these
Issues this fixes:
* all original Doom attack functions unconditionally altered the flash state.
* A_FireOldBFG, A_RailAttack and A_Blast never checked for a valid ReadyWeapon.
* CustomInventory items could deplete an unrelated weapon's ammo.
Note about A_SkelMissile: The direct change of the missile's position was changed to use SetOrigin. If this is later supposed to be portal-aware, such direct coordinate changes are a no-go to ensure that everything is properly maintained.
This contains some advance work for handling line-to-line portals in A_PainShootSkull.
This function is special because it performs a map check itself instead of using one of the common functions from p_map.cpp, like most of the rest of the game code.
* 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.