Commit graph

7155 commits

Author SHA1 Message Date
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
Christoph Oelckers
ed070cfe06 - updated xlat/eternity.txt. 2016-04-21 13:01:57 +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
Randy Heit
074bce643a Fixed: A_SetAngle had accidentally had the "action" specifier removed 2016-04-20 20:03:05 -05: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
30a530b178 - fixed: TAG_BLASTERP was on the wrong actor. 2016-04-19 02:06:36 +02:00
Christoph Oelckers
e48c4d3e44 - added tag strings for Heretic's powered weapon versions. 2016-04-19 01:00:09 +02: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