Commit Graph

181 Commits

Author SHA1 Message Date
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
Christoph Oelckers eb6c855a95 - handle intermediate special values in thinkers. They also need to take care of the related damage variables and flags. 2016-01-06 13:30:28 +01:00
Christoph Oelckers bd8513c063 - made sector_t::damageamount an int so that it can hold TELEFRAG_DAMAGE.
- marked all places where sector_t::special needs to be addressed for the damage overhaul.

NOTE: This commit will not compile!
2016-01-06 12:56:35 +01:00
Christoph Oelckers 5474e01de8 - removed FraggleScript's 'sectortype' function. This was GZDoom exclusive and never documented so it got no public exposure. Since this is incompatible with the damage related changes, it has no more use.
- major overhaul of the static sector damage system:

* consolidated special based damage, Sector_SetDamage and UDMF properties into one set of damage properties. The parallel handling that could lead to double damage infliction was removed. This also means that damage through sector specials can be retroactively changed through Sector_SetDamage.
* all special cases were turned into flags. The new system can switch between Strife's delayed damage and regular damage, and it can also set whether terrain splashes are used or not. It also has access to the special properties of the end-level type (i.e. switching off god mode and ending the level.)
* the damage related flags are accessible through Sector_ChangeFlags, not the damage functions themselves.
2016-01-06 12:12:47 +01:00
Christoph Oelckers b0db5d9b16 - added a SECF_SILENTMOVE flag.
Since Eternity got this it's a good candidate for a potential Super-Boom standard, and it's also useful for silencing a sector temporarily without removing the sound sequence.
2016-01-06 02:16:33 +01:00
Christoph Oelckers d34077a3ba - ... and finally the push flag. 2016-01-06 02:05:39 +01:00
Christoph Oelckers 3ffcec3eb3 - moved friction flag from special to Flags as well. 2016-01-06 02:01:59 +01:00
Christoph Oelckers 6a63effa1f - fixed: A_CheckTerrain did not use the proper damage type for processing an instant death sector.
- moved sector secret information from sector_t::special and secretsector to two flag bits in sector_t::Flags.

This is to get rid of the bit masking madness in the floor/ceiling thinkers which need to preserve this bit when they change a sector's type.
2016-01-06 01:50:45 +01:00
Christoph Oelckers 3e13e772ef - after realizing that changing the sector's MOD variable to an FNameNoInit doesn't do anything bad, I just went ahead and got rid of the last place in the engine that still used this data type for internal storage. 2016-01-05 16:10:04 +01:00
Christoph Oelckers d432df55e9 - changed Sector_SetDamage so that it can explicitly set the damage interval and the leakiness probability, instead of hardcoding it to fixed damage ranges.
- fixed: FCajunMaster::IsDangerous did not check for Heretic's sludge type.
2016-01-05 15:39:21 +01:00
Randy Heit c86cd53753 Merge branch 'master' of https://github.com/crimsondusk/zdoom into crimsondusk-master
Conflicts:
	src/am_map.cpp
2015-12-31 20:18:54 -06:00
Christoph Oelckers 7b017f472a - fixed: Due to the default skybox being moved to the global level data, there was insufficient information to distinguish between using the default skybox or the regular sky. Fixed by adding two new sector flags which get set by a 0-tid SkyPicker. 2015-11-25 11:49:34 +01:00
Teemu Piippo 2f027504b6 Show sector action boundaries on the automap like line specials are. 2015-09-12 04:47:49 +03:00
ZZYZX cd39c4b8a6 Merged mirrors with portals; Render part of mirrors done, render part of portals needs further testing 2015-06-07 04:19:17 +03:00
Christoph Oelckers db61c1cb57 - allow multiple line IDs as well using the same method as for sector tags. 2015-04-19 17:51:34 +02:00
Christoph Oelckers b921157f57 - uncouple sector tag storage from the sector data to allow multiple tags per sector.
Tags are now handled by a tag manager class which stores sector/tag pairs. This way multiple entries can be added per sector.
Since UDMF does not have any arrays the additional tags are stored as a space separated string as 'MoreIDs'.
2015-04-19 12:33:27 +02:00
Christoph Oelckers f65a07c952 - minor bit of cleanup of tags code. 2015-04-19 08:48:20 +02:00