Commit graph

6366 commits

Author SHA1 Message Date
Christoph Oelckers
35a6994d0a - remove the 'F' prefix from the floating point access function to the sidedef texture info, now that the fixed point versions are gone. 2016-04-23 10:55:55 +02:00
Christoph Oelckers
be8d1b46a7 - remove the deleted functions, now that they are no longer needed. 2016-04-23 10:51:58 +02:00
Christoph Oelckers
4d4f31fd83 - floatified sidedef texture info and fixed two bugs involving this data. 2016-04-23 09:41:59 +02:00
Randy Heit
f1b3f59bcc Renderer floatification: Use floating point for wall scale and yrepeat 2016-04-22 23:12:53 -05:00
Randy Heit
1f97488945 Renderer floatification: Use floating point for decals 2016-04-22 23:12:53 -05:00
Randy Heit
cb0fe38dfe Renderer floatification: "fix for signed divide" isn't needed when using xs_RoundToInt 2016-04-22 23:12:53 -05:00
Randy Heit
b2b3e50c5c Renderer floatification: Use floating point for geometry Zs 2016-04-22 23:12:53 -05:00
Randy Heit
3ef5a678d5 Renderer floatification: Use floating point for texturemids and Y scales 2016-04-22 23:12:53 -05:00
Randy Heit
4a1cc61822 Renderer floatification: Restore playersprite rendering 2016-04-22 23:12:27 -05:00
Randy Heit
ec8d038c99 Renderer floatification: Use floats for lighting values 2016-04-22 23:10:34 -05:00
Randy Heit
4416d88eb2 Renderer floatification: Use floating point for visibility values 2016-04-22 23:10:02 -05:00
Randy Heit
ded3f92452 Commence renderer floatification 2016-04-22 23:09:13 -05:00
Christoph Oelckers
3c7d0c971f - fixed: It seems it is not allowed to serialize any thinker before the actual thinker chain is serialized. This means that sector_t::floordata, ceilingdata and lightdata's handling had to be moved to P_SerializeWorldActors. 2016-04-22 17:48:25 +02:00
Christoph Oelckers
382a6e8b9f - link actors to touching line portals, for use by the renderer. 2016-04-21 22:59:07 +02:00
Edoardo Prezioso
afa3009f93 - Fixed a GCC/Clang compiler error and a warning. 2016-04-21 16:11:03 +02:00
Edoardo Prezioso
6cfd82f500 - Simplify more, found by code inspection. 2016-04-21 16:03:33 +02:00
Edoardo Prezioso
6aca7604eb - Clean the code by using AActor::GiveInventory.
This fixes also a bug in FraggleScript GiveInventory, which tried to access the 'SaveAmount' member of 'ABasicArmorBonus' with the wrong cast.
2016-04-21 16:02:43 +02:00
Edoardo Prezioso
7b35f32f3d - Added the 'GiveInventory' method to the actor.
This will help cleaning up the item giving code. Returns a bool, in case the pickup failure might turn to be interesting in the future.
2016-04-21 15:59:23 +02:00
Edoardo Prezioso
ad9b9479ec - Fixed erroneous P_UndoPlayerMorph calls.
In some places, P_UndoPlayerMorph was called with the 'force' argument placed in the 'unmorphflag' parameter, so that 'forced' unmorphs would be not completely forceful.

I hope no mod relied on this weirdness...
2016-04-21 11:25:08 +02:00
Christoph Oelckers
27cc3d6289 - fixed: ACS's GetActorLightLevel didn't check 3D floors. 2016-04-21 11:17:28 +02:00
Christoph Oelckers
ba7260c176 - fixed overflow issue with large damage values in P_RadiusAttack. 2016-04-21 10:51:41 +02:00
Christoph Oelckers
c3eec6db4d -fixed warnings 2016-04-21 10:38:42 +02:00
Christoph Oelckers
e5dc92f998 - some reshuffling of save data so that the actors won't get restored before the sectors.
Note that this required splitting P_SerializeWorld, because sector_t and FSectorPortal contain some actor pointers, for which the same rule applies: Portal linking can only be done after all sectors have been read, meaning it cannot be done along with the rest of the data in these structures.

Obviously such a change breaks savegame compatibility so the min. savegame version had to be increased again.
2016-04-20 19:42:00 +02:00
Christoph Oelckers
082042818b - refactored sector portal data so that it does not rely on actors.
This is necessary because otherwise the level data cannot be serialized before the actors.
2016-04-20 19:20:11 +02:00
Christoph Oelckers
3532dd9ea1 - fixed coordinate correctness issues with P_CheckFor3DFloor/CeilingHit. 2016-04-20 13:28:19 +02:00
Randy Heit
60966f472f Revert "Revert "Remove "action" from Actor functions that don't actually need it""
- This reverts commit 06216d733e.
- I don't know what I was thinking. Since stateowner is always available
  to the wrapper function, and this code is only generated for the wrapper
  function, it's a nonissue. The state is already located before calling
  any function that uses it.
2016-04-19 21:09:15 -05:00
Randy Heit
06216d733e Revert "Remove "action" from Actor functions that don't actually need it"
- This reverts commit 39df62b20e.
- Anything that needs to lookup a state also needs stateowner. See
  FxMultiNameState::Emit(). I will need to be more selective when
  de-actionifying functions.
2016-04-19 20:56:43 -05:00
Randy Heit
05843d3b13 Use "%#g" when disassembly floating point constants
- With "%g", there would be no decimal point if the number had no
  fractional part, making the output indistinguishable from integers.
2016-04-19 20:48:12 -05:00
Randy Heit
5d3e413d42 Make A_Stop an action function again
- A_Stop takes no parameters, so it should be an action function to avoid
  creating the wrapper when called.
2016-04-19 20:46:30 -05:00
Randy Heit
39df62b20e Remove "action" from Actor functions that don't actually need it
- An actor function really only needs to be an action function if:
  1. It can be called with no parameters specified, either because it takes
     none or because all its parameters are optional. This lets SetState()
     call it directly without creating a wrapper function for it.
  2. It wants access to the callingstate or stateowner parameters. Most
     functions don't care about them, so passing them is superfluous.
2016-04-19 20:28:49 -05:00
Christoph Oelckers
322b9fc0ae - wrap access to portal properties into sector_t:: member functions. 2016-04-19 11:35:28 +02:00
Randy Heit
c795f29cc4 Reduce calling overhead for A_SetUser* functions by making them non-action functions 2016-04-18 23:18:34 -05:00
Randy Heit
e83bc53678 Add atan2, which was conspicuously absent, to the VM
- DECORATE now has atan2(y,x) and VectorAngle(x,y) functions. They are
  identical except for the order of their parameters. The returned angle
  is in degrees (not radians).
2016-04-18 23:06:17 -05:00
Christoph Oelckers
69cbb7a382 - fixed: The pitch calculation did not check the calling actor's height when retrieving the position to calculate the pitch from. 2016-04-19 00:52:08 +02:00
Christoph Oelckers
d2735d7632 - fixed: Trace considered any water surface a hit if nothing else was found. 2016-04-18 18:31:19 +02:00
Christoph Oelckers
5e822fd60b - fixed: The starting position of sight checks was inconsistent in different parts of p_sight.cpp. 2016-04-18 16:46:56 +02:00
Edoardo Prezioso
8dee0be9ab - Fixed the morphed player actor friendliness.
It wasn't inherited from the original player actor object.
2016-04-18 16:30:13 +02:00
nashmuhandes
a30eb4d709 Fixed a potential NULL assignment in FOptionMenuItemSafeCommand::Activate 2016-04-18 16:30:13 +02:00
nashmuhandes
6bfdd10a5c Show the command label when choosing a SafeCommand (like Reset2Defaults) in the menu. 2016-04-18 16:30:12 +02:00
Christoph Oelckers
2327107f32 - fixed: Actors cannot be linked into the world until after all actors and sectors have been deserialized.
Two issues:

Portal linking requires all skyboxes in the sectors to be present, without them some info is not there when needed.
UpdateWaterLevel was called in AActor::Serialize, which operated on the freshly loaded level where lots of things haven't been set up yet and plane heights may be wrong.
2016-04-18 15:27:19 +02:00
Christoph Oelckers
961a4c8524 - optimized sector portal checks.
All the PortalBlocks* functions were turned into real function calls which for such a frequent check should be avoided. So now any linked portal sets a flag in the attached sectors so that it isn't necessary to check the skybox pointer each time which makes the functions subject to inlining again.
2016-04-18 13:40:09 +02:00
Christoph Oelckers
42e88ef120 - removed sector_t::FloorDisplacement and CeilingDisplacement.
Using the values these return directly is just as much code.
2016-04-18 13:40:09 +02:00
Christoph Oelckers
c30d5d42a2 - fixed: UpdateSectorRenderList may not be called when spawning mapthings.
At this time the portals have not been initialized yet and doing this here would trash the cached previous coordinate.
2016-04-18 13:40:08 +02:00
Christoph Oelckers
8c1eb201eb - optimized P_PointInSubsector.
It costs more to convert the floating point coordinate for each node check than to convert it once up front and only use fixed point math afterward.
2016-04-18 13:40:08 +02:00
Randy Heit
c5c032911c Let the temporary vissprite be stack local 2016-04-17 20:59:08 -05:00
Randy Heit
66c4bc1fee Fixed various problems when drawing psprites in a camera texture
- When the camera texture for a player view was rendered, its psprites
  would overwrite the ones stored for hardware acceleration.
  * Use a temporary vissprite in R_DrawPSprite() until it's known that it
    will be accelerated.
  * Do not write to any of the VisPSprites*[] arrays until it's known that
    the sprite will be accelerated.
2016-04-17 20:55:07 -05:00
Randy Heit
bf629d2590 Use a range instead of strict equality when deciding head sounds
- See http://forum.zdoom.org/viewtopic.php?f=7&t=51583
2016-04-17 20:14:25 -05:00
Christoph Oelckers
2661a94fe9 - call UpdateSectorRenderList from LinkToWorld as well, because this can be called from outside the actor's Tick function. 2016-04-18 01:35:37 +02:00
Christoph Oelckers
89b2cc45a2 - reverted P_CreateSecNodes to the regular FBlockLinesIterator.
This got accidentally committed. Even if this gets extended to reach through portals it needs to be done differently. FMultiBlockLinesIterator can't guarantee to get every sector that's being touched.
2016-04-18 00:02:07 +02:00
Christoph Oelckers
54d78df267 - added a new sector list to AActor that collects all portal-linked sectors the actor's center is in. (Inspired by Eternity's solution to the same problem.)
This is for rendering the sprite properly in all areas the actor touches. The original thinglist is not sufficient for this and Boom's touching thinglist has other purposes and collects too much data.
This new list will only get filled in when the actor is actually crossing a portal plane, for the normal sector thinglist will still be used.
This piggybacks on the msecnode_t code which has been extended to be able to handle more than one list by passing the sector's membert pointers as parameters.
2016-04-17 23:48:04 +02:00
Christoph Oelckers
f66202aef1 - fixed: If due to portal transitions, the chasecam cannot be interpolated, the entire view interpolation must be disabled for the current frame. 2016-04-17 18:42:54 +02:00
Christoph Oelckers
08514de768 - fixed A_WraithFX2 which had an incomplete floating point conversion. 2016-04-17 18:19:46 +02:00
Christoph Oelckers
3ed7a25d61 - added polyportal offset updates.
- removed the nodebuilder message for splitting polyobject subsectors because it is no longer relevant.
2016-04-17 17:10:11 +02:00
Christoph Oelckers
f27c762319 - fixed: The Heresiarch's check for full rotation of its balls depended on BAM semantics so it should still be checked as such to ensure consistent behavior. 2016-04-17 12:28:35 +02:00
Christoph Oelckers
a199fe1825 - fixed: loading polyobjects from a savegame was incomplete. 2016-04-17 12:04:32 +02:00
Christoph Oelckers
a1e8d83724 - added SetMusicVolume ACS function. 2016-04-17 10:56:46 +02:00
Christoph Oelckers
5e73cdc670 - deleted leftover label in trace code. 2016-04-17 10:41:13 +02:00
Christoph Oelckers
bc2a5b3f16 - fixed typo in automap background position calculation. 2016-04-17 10:19:56 +02:00
Christoph Oelckers
6a27267500 - changed handling of one-time, one-way door polyobjects to be more efficient.
The old code kept the dead thinker, resulting in constant deletion and recreation of the subsector links and PolyBSP because the interpolation kept running.
Changed it so that the thinker is destroyed and the polyobject gets blocked by setting a new flag.
2016-04-17 01:24:07 +02:00
Christoph Oelckers
7ac0cfbbb9 - added support for angle changing portals to P_AimCamera. 2016-04-16 22:54:47 +02:00
Christoph Oelckers
e7c0fd26ba - restored an accidentally deleted line in the Heresiarch code. 2016-04-16 21:28:08 +02:00
Christoph Oelckers
0f6a567055 - added portal-awareness to the railgun trail.
This required some changes to the Trace function because it turned out that the original was incapable of collecting the required information:

* actors are now also linked into blockmap blocks on both sides if they occupy the boundary of a sector portal.
* Trace will no longer set up parallel traces in all parts connected with sector portal, but only use one trace and relocate that on the actual boundary.
2016-04-16 19:41:33 +02:00
Christoph Oelckers
eb30bf6e14 - fixed: Offsetting a vector by portals did not properly adjust the trace after crossing a portal. 2016-04-16 00:17:12 +02:00
Christoph Oelckers
cd75a46917 - fixed incorrect use of 'frac' in Trace's EnterLinePortal function.
How did this go wrong...?
2016-04-15 22:22:38 +02:00
Christoph Oelckers
6dfb4bdd41 - changed floor and ceiling movers so that portal planes do not block movement of the opposite plane, even if they are on the wrong side of it.
This fixes the cross-portal lift to the blue key in Vaporware.
2016-04-15 20:42:40 +02:00
Christoph Oelckers
b73c6e847a - fixed: A_CheckRange calculated the square twice, resulting in a far too large value that got checked. 2016-04-15 18:46:31 +02:00
Christoph Oelckers
24776edd13 - fixed one of the most glaring omissions in the portal code: The wall clipper completely ignored portals when deciding how to treat a sector boundary, and ended up merging portal with non-portal planes.
This check is only active for linedef based portals, due to the large amount of maps that did it wrong with thing based portals.
Although it may well be that there are some maps that abuse this omission for linedef portals as well, these are better handled with a compatibility option if the need arises.

The main reason this was added is to streamline and optimize the portal handling between renderers in ZDoom and GZDoom. For that both need to show the same general behavior and for linedef portals it is also important to handle the same as in Eternity.
2016-04-15 16:39:58 +02:00
Christoph Oelckers
94cec02acc - fixed: FPNGTexture must readjust the file pointer after deciding to skip the tRNS chunk. 2016-04-15 15:15:34 +02:00
Christoph Oelckers
ed211ecbab - fixed positioning of portal things
In some situations it can happen that the sector here is not the frontsector of the anchor linedef, because some colinear node line with opposite direction causes this to be positioned on the wrong side. The only remedy here is to explicitly set the correct sector after spawning these things.
2016-04-15 15:02:28 +02:00
Christoph Oelckers
f0c2cd2d50 - fixed: 24 bit PNGs with transparent color need to set transpal to true in FPNGTexture::CopyTrueColorPixels. 2016-04-15 10:45:31 +02:00
Christoph Oelckers
77f05a0010 - fixed spawn positions for Korax's missiles. 2016-04-14 00:21:38 +02:00
Christoph Oelckers
0f7fce8bbb - removed portal offsetting from the sprite distance check.
This isn't necessary. When rendering no actors from other groups may ever come into view directly - only when the respective part of the level is rendered through a portal. But at that point the camera is in a position where it's already correctly placed with relation to that actor.
2016-04-13 19:32:54 +02:00
Christoph Oelckers
d88a5ac353 - make distancecheck 3D and use the actual view position for calculation. 2016-04-13 10:48:39 +02:00
Christoph Oelckers
45cfea17f5 - removed unused variable. 2016-04-13 10:34:04 +02:00
Christoph Oelckers
21b45fc0eb - fixed: distancecheck as a class property needs to be copied manually to subclasses. 2016-04-12 22:42:02 +02:00
Christoph Oelckers
3f0ed5d252 - added a distancecheck property to AActor that allows a given CVAR to be used as maximum display distance for actors of this type.
This is for WolfenDoom: BOA, which has some scripted sprite distance checks that very negatively affected performance.
2016-04-12 19:44:12 +02:00
Christoph Oelckers
e1a683b9ec - fixed minimum damage check in PowerDamage. 2016-04-12 15:49:13 +02:00
Christoph Oelckers
5d528fe317 - fixed: PCD_ENDTRANSLATION was missing a NULL pointer check. 2016-04-12 01:23:12 +02:00
Christoph Oelckers
a97f67edb6 - fixed: P_GetMidTexturePosition needs to divide by scale, not multiply, to get the proper offset. 2016-04-11 23:12:35 +02:00
Christoph Oelckers
aec1c85c08 - fixed: alpha for patches needs to be multiplied by 65536, not divided by. 2016-04-11 22:21:17 +02:00
Christoph Oelckers
ae6df617ba - fixed: The FPathTraverse call in P_UsePuzzleItem was missing the PT_DELTA flag. 2016-04-11 22:10:46 +02:00
Christoph Oelckers
e72bfa8add - fixed: For finding the listener's sector the sound code used the wrong coordinate. 2016-04-11 21:02:44 +02:00
Christoph Oelckers
99ca649930 - fixed NULL pointer access in SetAmmoCapacity. 2016-04-11 20:42:43 +02:00
Christoph Oelckers
77bfffaee0 - removed a few __cdecl's from the source. 2016-04-11 12:46:48 +02:00
Christoph Oelckers
db86385cf6 - removed STACK_ARGS.
The only reason this even existed was that ZDoom's original VC projects used __fastcall. The CMake generated project do not, they stick to __cdecl.
Since no performance gain can be seen by using __fastcall the best course of action is to just remove all traces of it from the source and forget that it ever existed.
2016-04-11 10:46:30 +02:00
MajorCooke
76f00131ff - Fixed: A_CheckBlock's dropoff check ignored the specifications of NOACTORS and NOLINES due to P_CheckMove blindly failing if P_CheckPosition failed. This lead to false positives such as blocking actors being detected when they shouldn't be. 2016-04-10 20:11:04 +02:00
Christoph Oelckers
76c18820cb - moved the declarations for the lighting thinkers to p_light.cpp.
Aside from the init function they are not needed anywhere else and that could also be placed into this file.
2016-04-10 18:29:23 +02:00
Christoph Oelckers
c12a85ee85 - removed some unused content from p_spec.h 2016-04-10 18:14:01 +02:00
alexey.lysiuk
93c334059a Made title text always visible in OS X startup window
Added temporary solution for the same foreground and background colors of the title in OS X startup window
It's used in graphical startup screen, with Hexen style in particular (for example WolfenDoom - Blade of Agony)
Native OS X backend doesn't implement this yet
2016-04-10 14:06:18 +02:00
Christoph Oelckers
fe973ba442 - tried to add precompiled headers to fastmath sources as well, but VC++ doesn't seem to want to play along. So I left this stuff in but disabled the precompilation until a solution can be found. 2016-04-10 13:54:42 +02:00
Christoph Oelckers
08b0be11a6 - add the precompiled header file for the previous commit. 2016-04-10 13:10:41 +02:00
Christoph Oelckers
9cc873ecdd - enable use of precompiled headers for MSVC. Thanks to a small CMake script I recently found this could be done non-invasively.
Due to the VC++ 2015 headers being rather bloated (the average include size per source is 400-500kb) this provides a noticable compile speedup, although right now this only covers the game code, so there should be more room for improvement.
2016-04-10 13:08:54 +02:00
Christoph Oelckers
12129b0f07 - added a system-include independent wrapper for Windows's OutputDebugString, so that this can be used more easily in files that cannot include windows.h. 2016-04-10 13:03:44 +02:00
Christoph Oelckers
ef08e29d51 - remove windows header #include from gameconfigfile.cpp, because it isn't needed. 2016-04-10 12:33:35 +02:00
Christoph Oelckers
d48c0ce25c - fixed some particle positioning errors. 2016-04-10 10:57:48 +02:00
Christoph Oelckers
9a48adf81a - fixed: The software 2D drawer expected its translation pointer to be initialized by ParseDrawTextureTags. Removed the variable from DrawParms and made it and its initialization local to the software rendering code. 2016-04-09 22:56:12 +02:00
MajorCooke
c79a1b6a45 thing->floorz --> thing->dropoffz 2016-04-09 22:33:55 +02:00
MajorCooke
8b8c879994 - CBF_DROPOFF Fixes
- Fixed: CBF_DROPOFF didn't actually check the coordinates passed to it for dropoff height values. It only checked to see if it was stuck in lines.
2016-04-09 22:33:54 +02:00
Christoph Oelckers
dc72e7f3c2 - removed the check for VA_COPY from CMakeLists.txt.
This is because nothing uses va_copy anymore and it's a mandatory part of C++11, therefore always available.
2016-04-09 22:07:14 +02:00
Christoph Oelckers
1f1a0ca847 - fixed incorrect check for negative damage in APowerProtection::ModifyDamage. 2016-04-09 21:57:35 +02:00