Commit Graph

197 Commits

Author SHA1 Message Date
Christoph Oelckers 8cdfbeea01 - made AActor::__pos a genuine float vatiable. 2016-03-25 15:43:20 +01:00
Christoph Oelckers 8b6b5e7b1c - preparation for upcoming work: rename the fixed point versions of PosRelative. 2016-03-25 14:18:50 +01:00
Christoph Oelckers 7a26318bf0 - floatified friction. 2016-03-24 22:50:03 +01:00
Christoph Oelckers 7c87479eea - parameter rework of several spawning functions. 2016-03-23 13:31:12 +01:00
Christoph Oelckers f60eac8dc0 - floatified FMapThing, dropoffz and GetBobOffset 2016-03-23 12:21:52 +01:00
Christoph Oelckers 301f5abadc - floatified the decal code. 2016-03-22 22:07:38 +01:00
Christoph Oelckers 6b3c0ecbd3 - floatified viewheight variables and some related code. 2016-03-22 18:06:08 +01:00
Christoph Oelckers 1eb106e2c5 - floatification of some alpha parameters. 2016-03-22 13:35:16 +01:00
Christoph Oelckers a652c061f6 - converted g_strife to full floating point use, except the floor height changing stuff in A_LightGoesOut. 2016-03-22 12:42:27 +01:00
Christoph Oelckers afa5f22b31 - added two floating point special variables, because the two existing ones are integers and unusable for storing doubles. 2016-03-20 21:51:09 +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 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 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 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
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 3c25b2c066 - some redesign of P_CheckSight to handle portals.
Portal stuff not tested yet.
2016-03-07 21:59:32 +01:00
Randy Heit 55142078d8 Normalize line endings 2016-03-01 09:47:10 -06: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 451cac457b - added NULL pointer check in AActor::ClearInterpolation. 2016-02-26 18:05:58 +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
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 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 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 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 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 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 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 ae02b2fcaf - added NextHighestCeiling/NextLowestFloorAt functions. Not tested yet! 2016-02-16 21:00:34 +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 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 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 bf03ea496e - fixed: instant sector movement actions must actually delete the created interpolation right away and not wait until it deletes itself. 2016-02-11 22:03:09 +01:00
Christoph Oelckers e88901f4b7 - added the EE-Extradata parser I wrote for GZDoom so I can use the Vaporware demo map for testing portal stuff. 2016-02-05 23:51:28 +01:00
Christoph Oelckers 94b7ef72ca - more cleanup on portal implementation:
- store portal data in a separate structure.
- store portal data in savegames because some of this will be changeable later.
- run a cleanup pass after all portals have been created to weed out broken ones.
- add a definition type that's compatible with Eternity Engine's line portal types.
- swapped arg[2] and arg[3] of Line_SetPortal, because the type is more significant than the alignment.
2016-02-05 23:15:56 +01:00
Christoph Oelckers a85a8c1465 - changed mirror handling so that it works without attaching a portal to the mirror line and removed line_t::portal_mirror member.
- did some cleanup on the portal interface on linedefs: All checks should go through isLinePortal (gameplay related) and isVisualPortal (renderer related) which then can decide on the actual data what to return.
- removed portal_passive because it won't survive the upcoming refactoring.
- removed all direct access to portal members of line_t.
- always use the precise (and fast) version of P_PointOnLineSide inside the renderer.
2016-02-05 16:14:45 +01:00
Christoph Oelckers 76c5039c63 Merge branch 'master' of https://github.com/rheit/zdoom 2016-02-05 10:41:05 +01:00
Christoph Oelckers 8da6483223 - fixed some places where FStrings were incorrectly used.
- replace all implicit conversions from FString to const char * in the header files (so that it can be test compiled with the implicit type conversion turned off without throwing thousands of identical errors.)
2016-02-05 10:40:45 +01:00
Braden Obrzut ba54d73e07 Merge branch 'portals2_visual' 2016-02-05 00:10:46 -05:00
Christoph Oelckers 2b5e5b6bc3 - next round of refactoring.
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.
2016-01-18 16:49:24 +01:00
Braden Obrzut f3f77a1ba0 Merge branch 'master' into portals2_visual 2016-01-18 09:45:42 -05:00
Christoph Oelckers e8ee8c5c97 - fixed: secspecial_t was left uninitialized, causing its damage type being an invalid name. 2016-01-18 01:21:20 +01:00
Christoph Oelckers 3e446ea04d - replaced access to AActor's coordinate members with access functions
(first 200 compile errors down...)
2016-01-17 13:48:16 +01:00
Christoph Oelckers 37f18055af - turned sector_t::FloorSkyBox and CeilingSkyBox into an array.
- removed unused SpreadCeilingPortal function.
2016-01-12 21:34:41 +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