Commit graph

67 commits

Author SHA1 Message Date
Christoph Oelckers
aab13addb7 -renamed spritetype’s owner field to ‚intowner‘
Mainly for easier searching.
Also remove the duplicate ‚detail‘ field.
2022-05-24 00:30:41 +02:00
Christoph Oelckers
4e2a9f6e59 - use float wall positions in portal code. 2022-02-15 22:18:26 +01:00
Christoph Oelckers
651c25a7be - do the 'inside' check with integers.
Using floats and multiplications is not robust enough. This is a bit slower, but doesn't run the risk of underflows and other nasties.
Q: How many bits of fractional precision should we use? 16 seems fine
2022-02-15 22:18:26 +01:00
Christoph Oelckers
7374364527 - doFurniture floatified and inside rewritten as a floating point algorithm that works without bit masking. 2022-02-15 22:18:25 +01:00
Christoph Oelckers
6fbecf2348 - RR: cleaned up and floatified the mine cart code 2022-02-15 22:18:25 +01:00
Christoph Oelckers
6e96b1ee81 - floatify SW's sector object rotation. 2022-02-15 22:18:25 +01:00
Christoph Oelckers
a12093af04 - use full precision math for rotating sectors in Blood. 2022-02-15 22:18:24 +01:00
Christoph Oelckers
a781517780 - renamed PlanesAtPointf to PlanesAtPoint
The old PlanesAtPoint is not needed anymore.
2022-02-15 22:18:24 +01:00
Christoph Oelckers
f44736a5b6 -use an access function for reading wall positions so that we have a non-modifiable value wherever this is possible. 2022-02-15 22:18:23 +01:00
Christoph Oelckers
89ef81da55 - renamed walltype::pos as preparation for refactoring.
no functional changes here
2022-02-15 22:18:22 +01:00
Christoph Oelckers
276597fc36 - normalize line endings. 2022-01-22 14:37:17 +01:00
Christoph Oelckers
e892de21ec - preparations for unlimited tsprites.
Right now it is a no-op because Polymost cannot deal with this properly.
2022-01-11 00:12:32 +01:00
Christoph Oelckers
91d51d518b - this hack is needed because dragging vertices around can randomly create wall intersection.
In clear English: Geometry in Build maps is always broken by design. :(
2022-01-09 20:38:07 +01:00
Christoph Oelckers
415dc5246d - fixed sprting of non-translucent sprites. 2022-01-08 21:18:18 +01:00
Christoph Oelckers
1849fe541e - fixed alignment of sloped sprites.
The offset fields are not valid for them so thwy may not be used for offsetting.
2021-12-31 11:55:25 +01:00
Christoph Oelckers
717dd123e5 - fixed slope sprite flag getting cleared by some leftover code.
Also merged copyfrom into the one single function that called it.
2021-12-31 10:55:55 +01:00
Christoph Oelckers
4bc32e2777 - use actors in the sloped sprite utilities. 2021-12-30 16:11:14 +01:00
Christoph Oelckers
44d2cc1951 - eliminated usectorptr_t. 2021-12-30 11:45:58 +01:00
Christoph Oelckers
3fee8f3c4e - replaced dragpoint (both the generic and the Blood variant) with a newly written vertexscan function.
This is a template allowing to run any task on a set of walls with equivalent start point.
Code was redesigned from scratch to be more clear than the existing variants.

The idea here is to reuse the base algorithm for other things that need to operate on the equivalent set of a given wall's start point.
2021-12-30 09:58:15 +01:00
Christoph Oelckers
6766a5922a - pass actors to calcChaseCamPos. 2021-12-30 09:57:18 +01:00
Christoph Oelckers
f602cf3806 - deal with s() in shared code.
clip.cpp was left alone, except for the actual call.
2021-12-30 09:57:14 +01:00
Mitchell Richters
cecb8dc48e - Replace spritetypebase y with pos.Y calls. 2021-12-30 09:57:05 +01:00
Mitchell Richters
33ca55023f - Replace spritetypebase x with pos.X calls. 2021-12-30 09:57:05 +01:00
Mitchell Richters
09e00a69fe - Replace walltype y with pos.Y calls and eliminate walltype pos union. 2021-12-30 09:57:04 +01:00
Mitchell Richters
51b647da87 - Replace walltype x with pos.X calls. 2021-12-30 09:57:04 +01:00
Mitchell Richters
b2ab64bb62 - Capitalise vec3_t z variable. 2021-12-30 09:57:03 +01:00
Mitchell Richters
68e2691be7 - Capitalise vec3_t y variable. 2021-12-30 09:57:03 +01:00
Mitchell Richters
c549cc5276 - Capitalise vec3_t x variable. 2021-12-30 09:57:02 +01:00
Mitchell Richters
118ceb18ca - Capitalise vec2_t y variable. 2021-12-30 09:57:02 +01:00
Mitchell Richters
3c9cd926ba - Capitalise vec2_t x variable. 2021-12-30 09:57:02 +01:00
Christoph Oelckers
beddf1e1ca - add slope sprite support to the new renderer.
Some fudging was needed to avoid positioning problems as the renderer is more sensitive to this than Polymost.
2021-12-30 09:56:55 +01:00
Christoph Oelckers
65bc6e6aef - removed the now redundant wall() and sector() interator helper functions.
With both wall and sector now being TArrays they are not needed anymore.
2021-12-30 09:56:53 +01:00
Christoph Oelckers
82fb03e399 - another batch of search&replace, with smaller results. 2021-12-30 09:56:48 +01:00
Christoph Oelckers
1edccf1423 - added slope setter methods to sectortype.
To make sure that setting the slope flags is always done properly. (Why are the flags even needed?)
As a nice side effect, this, plus use of other inlines made the align*slope functions implode into virtually nothing.
2021-12-30 09:53:56 +01:00
Christoph Oelckers
24a6d45f97 - minor slope math optimization.
May save one division and merges the '<< 5' into the main calculation.
2021-12-30 09:53:56 +01:00
Christoph Oelckers
5f18109371 - consolidated all getslope code into a single function.
This also caches a wall's length to avoid taking the square root every single time for a slope calculation.
2021-12-30 09:53:55 +01:00
Christoph Oelckers
838bed7800 - final cleanup of sectnum related stuff.
Made sure that remaining uses of sector indices are safe to be kept and deleted a few redundant functions.
2021-12-26 23:10:01 +01:00
Christoph Oelckers
eaff9e359f - refactored the owner index in tspritetype.
This is now a separate type from spritetype which contains an actor pointer instead so that sprite display can be handled without requiring a static sprite array.
2021-12-26 23:09:53 +01:00
Christoph Oelckers
12f6b05cbe - use access functions, all done by search & replace. 2021-12-26 23:09:44 +01:00
Christoph Oelckers
129ce0aea8 - migrated Blood's hitscan calls and its global gHitInfo struct. 2021-12-26 23:08:56 +01:00
Christoph Oelckers
9380819e4e - initialize actorArray for all games.
- the foundation for an actor aware backend.
2021-12-26 23:08:56 +01:00
Christoph Oelckers
40ae38c173 - calcChaseCamPos. 2021-12-25 21:29:03 +01:00
Christoph Oelckers
999ec3c95a use validSectorIndex checks where appropriate.
Let’s hope that this sloppiness doesn’t have negative effects with broken maps.

# Conflicts:
#	source/games/sw/src/sprite.cpp

# Conflicts:
#	source/games/duke/src/prediction.cpp
#	source/games/duke/src/render.cpp
2021-12-25 21:28:37 +01:00
Christoph Oelckers
7111b2470c - SW: use BFSSearch in TraverseBreakableWalls 2021-11-29 00:55:45 +01:00
Christoph Oelckers
a79f7a3784 - SW: use a dynamic array to track already visited sectors in TraverseBreakableWalls. 2021-11-11 21:57:55 +01:00
Christoph Oelckers
5ba005276f Revert "- redid the 'inside' function."
This reverts commit c034c2a299.

While the function works, it is subtly different for points exactly on a line - enough to cause problems with Shadow Warrior's waypoint implementation.
2021-11-08 23:11:20 +01:00
Christoph Oelckers
c034c2a299 - redid the 'inside' function.
This is based on external information and does not use any of the original Build code.
Despite being a lot clearer than Build's bit masking voodoo and using 64 bit math to avoid overflows it is roughly 10% faster. :)

Code was moved to gamefuncs.cpp because this no longer falls under the Build license.
2021-11-08 21:29:21 +01:00
Christoph Oelckers
d20aa47adf - made sector parameter of updatesectorz an int and deprecated the short version. 2021-11-06 19:27:51 +01:00
Christoph Oelckers
e8187b4a99 - fixed bad serializers for vec2_t and vec3_t. 2021-09-12 18:42:58 +02:00
Christoph Oelckers
1168341d5a - fixed more warnings in 'core'. 2021-05-12 21:47:32 +02:00