Christoph Oelckers
6e3b6028e9
- reinstated bug in pushmove not to check the first wall when scanning backwards.
...
For real this time
2021-12-30 09:56:53 +01:00
Christoph Oelckers
c546bfc1ca
- reinstated bug in pushmove not to check the first wall when scanning backwards.
...
Seems we need this in a few places.
2021-12-30 09:56:53 +01:00
Christoph Oelckers
986fccfddc
- use symbolic constants for all places where globalorientation is checked for the alignment bits.
2021-12-30 09:56:51 +01:00
Christoph Oelckers
8f0f0e8816
- manual sprite flag replacements in Duke.
2021-12-30 09:56:49 +01:00
Christoph Oelckers
ace01d02bc
- alignment flags and a few leftovers.
2021-12-30 09:56:48 +01:00
Christoph Oelckers
82fb03e399
- another batch of search&replace, with smaller results.
2021-12-30 09:56:48 +01:00
Christoph Oelckers
c5ae454207
- another big batch of automatic replacements.
2021-12-30 09:56:48 +01:00
Christoph Oelckers
8f012d1beb
- made wall flags type safe
2021-12-30 09:56:47 +01:00
Christoph Oelckers
1e30f461e6
- flags in Polymost
2021-12-30 09:56:47 +01:00
Christoph Oelckers
adbf5177a7
- flag combo stuff.
2021-12-30 09:56:46 +01:00
Christoph Oelckers
d0a06ae961
- deal with most of CSTAT_SECTOR_SKY and CSTAT_SECTOR_SLOPE
2021-12-30 09:56:45 +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
11f41a97d5
- made gotpic a FixedBitArray.
...
gets rid of some inline garbage.
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
dddf48fd3e
- cleaned up and renamed buildtypes.h.
...
Content was reordered so that the file can contain the inlines belonging to the map data types that previously had to be stored elsewhere.
Also moved out of the Build folder because virtually everything in here can be traced to content available in Duke Nukem 3D's and Shadow Warrior's source releases.
2021-12-30 09:53:46 +01:00
Christoph Oelckers
4a5de6f56e
- make sure that all changes of wall coordinates invalidate associated data.
...
walltype::move should be the preferred function to be used for this, otherwise walltype::moved needs to be called.
2021-12-30 09:53:11 +01:00
Christoph Oelckers
69593fd5c7
- Triangulation WIP
...
# Conflicts:
# source/core/sectorgeometry.cpp
2021-12-30 09:53:07 +01:00
Christoph Oelckers
a255e90c96
- more work on the new section creator.
2021-12-30 09:53:06 +01:00
Christoph Oelckers
504bb08a64
- we do not really need the old rintersect function.
...
Its only difference is using potentially overflowing 32 bit math for demo compatibility. Aside from that it has no real-life advantage.
2021-12-26 23:10:07 +01:00
Christoph Oelckers
a23d2ae656
- fixed OOB access in pushmove.
...
The backwards search loop starts at one element behind the data it is supposed to check. If this is the last wall in the map it accesses undefined memory.
This tripped the range check in TArray for wall[].
2021-12-26 23:10:06 +01:00
Christoph Oelckers
d8ccfa1a5f
- cleaned up nextsectorneighborz, added a safe variant and use this in all places where the sector pointer is not validated.
2021-12-26 23:10:05 +01:00
Mitchell Richters
1ee1c0c920
Revert "- fixed: updatesectorneighborz may not return -1."
...
This reverts commit c074b0995648a4057c516e5646f5fe7a11719317.
* The commit notes talk about `updatesectorneighborz()`, but the change is applied to `nextsectorneighborz()`. Further to this, `nextsectorneighborz()` is only called from some ptr wrappers in `build.h` and they both test against `-1` return values.
```
inline sectortype* nextsectorneighborzptr(int16_t sectnum, int32_t refz, int16_t topbottom, int16_t direction)
{
auto sect = nextsectorneighborz(sectnum, refz, topbottom, direction);
return sect == -1? nullptr : §or[sect];
}
inline sectortype* nextsectorneighborzptr(sectortype* sectp, int32_t refz, int16_t topbottom, int16_t direction)
{
auto sect = nextsectorneighborz(sector.IndexOf(sectp), refz, topbottom, direction);
return sect == -1? nullptr : §or[sect];
}
```
* Also fixes broken Duke elevators and possibly a whole raft of issues.
2021-12-26 23:10:04 +01:00
Christoph Oelckers
8e2d324e85
- fixed: updatesectorneighborz may not return -1.
...
This value gets never validated by any caller and isn't really what is wanted in this situation.
2021-12-26 23:10:03 +01:00
Christoph Oelckers
b8c4354691
- got rid of the MAX... constants and adjusted all places still using them.
2021-12-26 23:10:02 +01:00
Christoph Oelckers
1a3b9f8ac0
- made several arrays holding sector related data dynamic.
2021-12-26 23:10:02 +01:00
Christoph Oelckers
2a07159c8d
- removed some unused and obsolete content from engine files.
2021-12-26 23:10:02 +01:00
Christoph Oelckers
923a2b6a79
- unlimit the number of sectors/walls for real.
...
All remaining 16 bit values storing indices have been widened to 32 bit.
2021-12-26 23:10:01 +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
6d432fca0a
- made spritetype::sectnum a pointer.
2021-12-26 23:10:01 +01:00
Christoph Oelckers
2d913982da
- changed map loader to work without relying on spritetype::sectnum.
...
All access to this field is done through access functions now.
2021-12-26 23:10:01 +01:00
Christoph Oelckers
0dd756fa32
- added GC handling for all backend pointers in the map data.
...
GC is not active yet!
2021-12-26 23:10:00 +01:00
Christoph Oelckers
30786360bb
- derive spritetype and tspritetype from a common base class to consolidate their common content.
2021-12-26 23:09:57 +01:00
Christoph Oelckers
a2e280e188
- use wallsofsector in 4 more places.
...
# Conflicts:
# source/build/src/polymost.cpp
2021-12-26 23:09:57 +01:00
Christoph Oelckers
d088ab05a9
- eliminate storage of actors in the sector's hitag for some of Duke's sector effectors.
...
Also demoted Blood's upperLink and lowerLink to DCoreActor pointers and use static_cast for access to avoid savegame problems. The core code cannot safely serialize a DBloodActor anymore.
2021-12-26 23:09:56 +01:00
Christoph Oelckers
d3b1e34d78
- moved sprite[], spriteext[] and spritesmooth[] into DCoreActor.
...
Also removed the last remaining sprite pointer in saveable data.
2021-12-26 23:09:55 +01:00
Christoph Oelckers
f855b1020f
- actor lists refactored.
...
No more shorts, no more static arrays.
This was one of the biggest blockers for unlimiting the engine.
2021-12-26 23:09:54 +01:00
Christoph Oelckers
87ac9bee44
- 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.
# Conflicts:
# source/build/src/polymost.cpp
2021-12-26 23:09:54 +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
793dd032b0
- getzrange cleanup.
2021-12-26 23:09:53 +01:00
Christoph Oelckers
bcc532d36f
- eliminated the getzrange wrapper.
2021-12-26 23:09:53 +01:00
Christoph Oelckers
2541425b9d
- getzrange is free of hack values, too.
2021-12-26 23:09:53 +01:00
Christoph Oelckers
9d85859a80
- finally got rid of the 16 bit hack return value of clipmove.
2021-12-26 23:09:53 +01:00
Christoph Oelckers
d34a5179f1
- sprite cleanup in clip code.
...
Just using already available data instead of the indices.
2021-12-26 23:09:53 +01:00
Christoph Oelckers
19236b2526
- removed compatibility handling for the oldest level from hitscan.
...
This stuff isn't even slope aware so the only legitimate reason for keeping it would be demo playback.
2021-12-26 23:09:52 +01:00
Christoph Oelckers
183f554733
- hitscan cleanup.
...
Also removed a bit of leftover TROR code.
2021-12-26 23:09:52 +01:00
Christoph Oelckers
8c90f48b61
- cleanup of neartag, plus direct return of a HitInfoBase struct.
2021-12-26 23:09:52 +01:00
Christoph Oelckers
6600f55543
- separate map loading from actor spawning for the other games, too.
...
It still uses the horribly messed up original spawn logic, though.
2021-12-26 23:09:51 +01:00
Christoph Oelckers
a3493048e7
- refactoring of spawn code to prepare for the other games.
...
Map hacks do not work in this commit!
2021-12-26 23:09:51 +01:00
Christoph Oelckers
379c4f1a60
- merged the cansee wrapper into the actual function and added sector validation.
2021-12-26 23:09:50 +01:00
Christoph Oelckers
2654a19cfd
- got rid of setspritez(x) and moved the implementation to SetActor(Z) without referencing the sprite array.
2021-12-26 23:09:49 +01:00
Christoph Oelckers
58cd933d74
- pass sprite array to map hack parser as parameter.
...
This will later allow it to work on temporaries.
2021-12-26 23:09:49 +01:00
Christoph Oelckers
f9b1164747
- use point2Wall wherever possible.
2021-12-26 23:09:48 +01:00
Christoph Oelckers
83cf2f3baf
-more index stuff.
2021-12-26 23:09:48 +01:00
Christoph Oelckers
ee1b574830
- engine stuff
2021-12-26 23:09:48 +01:00
Christoph Oelckers
a22634f228
- sectnum reduction.
2021-12-26 23:09:47 +01:00
Christoph Oelckers
ed659df9d8
- pass sector pointer to Polymost's SectorVisibility function.
2021-12-26 23:09:47 +01:00
Christoph Oelckers
9213eae606
- deleted unused functions.
2021-12-26 23:09:46 +01:00
Christoph Oelckers
d33ae89c4a
- minor backend cleanup.
2021-12-26 23:09:45 +01:00
Christoph Oelckers
befc4572e9
- minimal backend array removal.
2021-12-26 23:09:45 +01:00
Christoph Oelckers
12f6b05cbe
- use access functions, all done by search & replace.
2021-12-26 23:09:44 +01:00
Christoph Oelckers
6748a39c8f
- deprecate the sector index variant of pushmove
2021-12-26 23:09:43 +01:00
Christoph Oelckers
2aefe4398b
- sector[tspr->sectnum] globally replaced.
2021-12-26 23:09:43 +01:00
Christoph Oelckers
70d7e81f4f
- adapted getzrange to the new interface.
...
This was mainly removing game side solutions in favor of a common one in the backend.
2021-12-26 23:09:42 +01:00
Christoph Oelckers
91e2391911
- adapted neartag in Duke.
2021-12-26 23:09:42 +01:00
Christoph Oelckers
4788c7ba5e
- made Collision derive from a common base class and refactored clipmove to a single engine-side entry point.
...
Done for Doom so far.
2021-12-26 23:08:57 +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
52c80f187a
- added coreactor.h
2021-12-26 23:08:55 +01:00
Christoph Oelckers
a93dbaf5fe
- SW: simplified rotation interpolation functions.
2021-12-26 23:08:40 +01:00
Christoph Oelckers
33c707c708
- Duke: getangle simplification
2021-12-26 23:08:40 +01:00
Christoph Oelckers
94671c5b05
- MoveMissile + GetZRangeXYZ
2021-12-25 21:29:13 +01:00
Christoph Oelckers
759a8428fa
- dragPoint
2021-12-25 21:29:11 +01:00
Christoph Oelckers
7a7537961b
- Blood: remove GetWallAngle variant with index parameter
2021-12-25 21:29:05 +01:00
Christoph Oelckers
40ae38c173
- calcChaseCamPos.
2021-12-25 21:29:03 +01:00
Christoph Oelckers
109ff8c3cb
- Above and Below
2021-12-25 21:29:01 +01:00
Christoph Oelckers
0b254255e2
- sector ambience
2021-12-25 21:28:59 +01:00
Christoph Oelckers
38d64fc437
spritetype::setsector
2021-12-25 21:28:57 +01:00
Christoph Oelckers
69a7b4d0bc
- final cleanup before replacement
2021-12-25 21:28:55 +01:00
Christoph Oelckers
312b1fd39f
- cursectnum first half
2021-12-25 21:28:55 +01:00
Christoph Oelckers
323b5441d5
— New utilities for better abstraction added.
2021-12-25 21:28:54 +01:00
Christoph Oelckers
2979fb9e03
- new access methods for spritetype and DDukeActor.
2021-12-25 21:28:54 +01:00
Christoph Oelckers
d30bf8c8bb
- fixed Blood's mirror render hack for Polymost.
...
This adds 4 walls and 1 sector without counting them, so we must adjust allocations and array access to handle OOB access and temporarily increase the counter for the mirror render pass.
The new renderer does not need this stuff.
2021-12-25 21:28:50 +01:00
Christoph Oelckers
8cca55c24a
- made wall a TArray.
2021-12-25 21:28:50 +01:00
Christoph Oelckers
fded90c491
- SW: deleted SECT_USER.
2021-12-25 21:28:49 +01:00
Christoph Oelckers
7d2404ce76
- made sector a TArray.
2021-12-25 21:28:49 +01:00
Christoph Oelckers
e034635e12
- migrated Blood's xsector and got rid of the static global array.
2021-12-25 21:28:48 +01:00
Christoph Oelckers
993821b75f
- migrated Blood's other non-X sector properties.
2021-12-25 21:28:48 +01:00
Christoph Oelckers
f7e61eeef7
- migrated Blood's portal links into sectortype.
2021-12-25 21:28:48 +01:00
Christoph Oelckers
14907a9a97
- sector extension basics.
2021-12-25 21:28:48 +01:00
Christoph Oelckers
94a37dfcdc
- extended walltype to directly manage Blood's XWALL.
...
Unfortunately this had to be done in the base class so that we can still maintain the walls in a global array.
The tradeoffs of better abstractions would be far too costly here than the added 16 bytes to the wall struct.
2021-12-25 21:28:47 +01:00
Christoph Oelckers
5cda292d98
- lots of search& replace actions.
...
This takes care of roughly 2/3 of the SectUser accesses.
2021-12-25 21:28:46 +01:00
Christoph Oelckers
32f141ad39
- XSECTOR::reference is gone.
2021-12-25 21:28:42 +01:00
Christoph Oelckers
19f3365efc
- Blood: add x-access functions to spritetype and walltype.
...
This is merely a refactoring aid to get everything in a state that later allows merging these into one.
2021-12-25 21:28:40 +01:00
Christoph Oelckers
47e207f158
- eliminated spritetype::index.
...
# Conflicts:
# source/games/sw/src/swactor.h
2021-12-25 21:28:38 +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
ae8e642785
- templated updatesectorneighborz to eliminate redundancy with updatesectorneighbor
2021-12-25 21:28:36 +01:00
Christoph Oelckers
0c83d299f2
- removed compat.h entirely, all that was left was redundant #includes.
2021-12-14 12:27:41 +01:00
Christoph Oelckers
4daad25e5c
- use WORDS_BIGENDIAN directly in place of B_BIG_ENDIAN
2021-12-14 12:27:41 +01:00
Christoph Oelckers
7c4233bcf7
- replaced fallthrough__ with [[fallthrough]] as we are requiring C++17 and don't need workarounds for that.
2021-12-14 12:27:28 +01:00
Christoph Oelckers
7daa501a4d
- removed all #include "compat.h" except the one in build.h
...
Still all compiles fine.
2021-12-14 12:24:10 +01:00
Christoph Oelckers
7e2431ebd8
- replaced the remaining content from compat.h
2021-12-14 10:15:58 +01:00
Christoph Oelckers
016a907c20
- replaced vec2_t with FVector2.
2021-12-14 10:07:06 +01:00
Christoph Oelckers
7546cf3a4b
- replaced vec3f_t with FVector3.
2021-12-14 09:58:01 +01:00
Mitch Richters
63a19bbb15
- Port spritetype::insector()
over from develop and use with sector nullptr checks in 6539d72663
.
2021-12-07 19:56:50 +11:00
Christoph Oelckers
00d54fa11a
- fixed return value of updatesector pointer variant.
2021-11-30 16:44:52 +01:00
Christoph Oelckers
64cad55d73
- fixed updatesector and changed updatesectorz to use the same search algorithm.
...
The initial distance check in updatesectorneighbor had a far too low threshold which would skip the breadth-first search for relatively small distances already.
Exhumed's LEV1 and Duke's Lunatic Fringe were the most obvious candidates where this could cause problems.
Changed to use a mixture of the original updatesector with the revised algorithm so that all immediate neighbors of the start sector will get visited unconditionally.
updatesectorz was still the original function from Shadow Warrior, this also was changed to use the same algorithm as uodatesector.
2021-11-30 00:15:25 +01:00
Christoph Oelckers
f765783437
- various small bits of cleanup.
2021-11-29 00:57:11 +01:00
Christoph Oelckers
35c2d6d14e
- fixed translucent voxel rendering.
2021-11-29 00:57:10 +01:00
Christoph Oelckers
7d3b604361
- fixed sky rendering in paletted sectors for Polymost.
2021-11-29 00:57:10 +01:00
Mitchell Richters
5630fd8763
- Repair other possible OOB access issues with spriteext[]
.
2021-11-29 00:57:09 +01:00
Mitchell Richters
8c679f2e17
- Repair OOB access to spriteext[]
array accidentally introduced in d572e56839
. This repairs stability issues with models enabled under Linux environments.
2021-11-29 00:57:09 +01:00
Christoph Oelckers
d5a6be3d96
- cleaned up Duke's spawn code.
...
The paths for initializing a map placed sprite and spawning a new actor at run time are now fully separate aside from the actual initialization of the actor.
2021-11-29 00:56:31 +01:00
Christoph Oelckers
baf36a321b
- inside, haskey and removed unused processmove functions.
2021-11-29 00:56:30 +01:00
Christoph Oelckers
adf3133fdc
- use sectnum and wallnum to get an index from pointers instead of subtracting the array base.
2021-11-29 00:56:26 +01:00
Christoph Oelckers
3a259c9c46
- use BFSSearch in cansee and deleted the old variant originally used by Exhumed.
...
This old variant is only useful for demo compatibility, its main difference is that it does not handle slopes, which even for Exhumed is wrong with some custom maps.
2021-11-29 00:56:25 +01:00
Christoph Oelckers
4e31360fe4
- cleaned up dragpoint
...
This still contained some code for EDuke32's TROR and used a shared static global array.
It now uses the BFSSearch class to manage its bit array to unlimit the size of its working set and to avoid reallocation.
2021-11-29 00:56:25 +01:00
Christoph Oelckers
7126aa22f4
- preparations in the map loader for dynamically sized data storage.
...
This also consolidates these parts for Blood with the other games.
2021-11-29 00:56:25 +01:00
Christoph Oelckers
7b1345d3e5
- Exhumed: wall stuff in AddFlash
2021-11-29 00:56:24 +01:00
Christoph Oelckers
c79dace730
- eliminated sector[] in position checkers
2021-11-29 00:56:24 +01:00
Christoph Oelckers
b68c66dae6
-Duke/RR: started migrating hitscan to pointer usage.
2021-11-29 00:56:21 +01:00
Christoph Oelckers
730b7492cb
- moved bitmap_set and bitmap_test into clip.cpp and deleted unused inside_exclude_p function.
...
No longer used anywhere else and to be replaced with BitArray.
2021-11-29 00:55:45 +01:00
Christoph Oelckers
ae63bcd80b
- use BFSSearch in updatesectorneighbor.
...
The old bfirst_* helpers are gone now.
2021-11-29 00:55:45 +01:00
Christoph Oelckers
22e554e88a
- use BFSSearch in clipupdatesector
2021-11-29 00:55:45 +01:00
Christoph Oelckers
53998c9cb7
- Blood: remove unneeded replacement functions.
...
changespritesect is the only one called from the engine.
2021-11-29 00:55:42 +01:00
Christoph Oelckers
ad030d7e23
- Duke: SE20 + SE128 are wall-free
...
Also use symbolic constantfor SE_128 to make it easier to find.
2021-11-29 00:55:39 +01:00
Christoph Oelckers
312bf5bf95
- Duke: use wall utilities in bounce and queball
2021-11-29 00:55:39 +01:00
Christoph Oelckers
01abe7b2ac
- addressed most unused/uninitialized variable warnings from MSVC.
2021-11-29 00:55:30 +01:00
Christoph Oelckers
0437d92f3e
- girlninj.cpp
2021-11-29 00:55:18 +01:00
Christoph Oelckers
ec9ab56ece
- use collision struct in ActorMoveHitReact
2021-11-29 00:55:03 +01:00
Christoph Oelckers
2a897c0582
- SW hit code abstraction.
2021-11-29 00:55:03 +01:00
Christoph Oelckers
642088ed80
- let ValidateSprite print better messages when developer mode is set to warning and also call it for Blood.
2021-11-11 21:28:53 +01:00
Christoph Oelckers
f2e344a235
- removed magic flags added to sector indices in Polymost.
...
These are better done as separate function arguments.
2021-11-11 21:28:53 +01:00
Christoph Oelckers
c46c8a68cd
- fixed nextsectorneighborzptr
2021-11-09 17:29:03 +01:00
Christoph Oelckers
a35900362e
- only use un-deprecated variants of updatesector(z) in SW.
2021-11-09 00:09:48 +01:00
Christoph Oelckers
94b2b0af31
- widen sector index in engineLoadBoard to 32 bit
2021-11-09 00:07:00 +01:00
Christoph Oelckers
762ebafc2a
- made clipmoveboxtracenum a function argument of clipmove
...
There’e zero need for hackery here.
2021-11-08 23:22:48 +01:00
Christoph Oelckers
0ffe52791e
- delete deprecated pushmove variants
2021-11-08 23:22:06 +01:00
Christoph Oelckers
4aa0477574
- make internal pushmove use a 32 bit sector index.
2021-11-08 23:17:40 +01:00
Christoph Oelckers
52a2862963
- removed the deprecated clipmove wrappers.
2021-11-08 23:15:05 +01:00
Christoph Oelckers
a5f51cfd88
- SW: migrate everything to the main clipmove function
2021-11-08 23:11:30 +01:00
Christoph Oelckers
16f9d4ec36
- got rid of COVERupdatesector
...
Not needed as it just forwards to the engine’s updatesector - and it gets in the way of other changes
2021-11-08 23:11:30 +01:00
Christoph Oelckers
2e1ff313b0
- Duke: only use the main clipmove function and match clipmove_ex’s interface
2021-11-08 23:11:29 +01:00
Christoph Oelckers
567d054d42
- remove unused clipmovex function, extend clipmove sector return to 32bit, mark obsolete clipmove variants deprecated
2021-11-08 23:11:29 +01:00
Christoph Oelckers
5510efd920
- removed TROR specific parts of updatesectorz
...
None of this is ever called, in particular the parts that muck around with the sectorindex and add magic bits to it.
2021-11-08 23:11:29 +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
5cfc418c5f
- did some tests with the inside function and decided to only retain the 'old' one.
...
The one from EDuke32 is ambiguous - it considers any point on a wall to be part of both sectors touching that wall. This wasn't used anyway with the current engine compatibility settings.
I was not able to get different values out of the 'ps' version - this seems to only be important for demo playback concerns, for regular playback the differences appear to be totally irrelevant.
Ultimately this should be replaced anyway with a license-unencumbered variant of the same basic common algorithm.
2021-11-08 19:46:22 +01:00
Christoph Oelckers
eeaa7f98f0
- inlines for validating sector and wall indices.
2021-11-08 18:56:10 +01:00
Christoph Oelckers
477a2a23e6
- nextSector in runlist
2021-11-08 18:37:21 +01:00
Christoph Oelckers
ae08ae1d8d
- some leftover shorts plus utilities that ended up unused but may be useful later.
2021-11-07 16:46:23 +01:00
Christoph Oelckers
fd2764dc6e
- Duke: eliminated all local short variables in actors*.cpp.
2021-11-07 16:30:55 +01:00
Christoph Oelckers
e2faeec2ce
renamed all signed and unsigned chars to int8_t/uint8_t.
2021-11-07 16:30:55 +01:00
Christoph Oelckers
0eba3335c6
- eliminated some leftover 16 bit values used for storing indices.
2021-11-07 16:30:44 +01:00
Christoph Oelckers
a594e6465c
- added nextSector access function to walltype and used it to eliminate a few more sector[] references.
2021-11-07 15:56:29 +01:00
Christoph Oelckers
1c0e3d849b
- addressed the updatesector related deprecation warnings with Duke.
2021-11-06 20:46:08 +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
13306e900d
- silence some warnings.
2021-11-06 18:26:47 +01:00
Christoph Oelckers
83fe41e71e
- made updatesector receive a 32 bit int pointer and deprecated the 16 bit variant.
2021-11-06 15:53:16 +01:00
Christoph Oelckers
ba2d4acc18
- added a sector() method to spritetype.
...
For making game code working with sectors a bit easier to read.
2021-11-06 14:19:55 +01:00
Christoph Oelckers
389f760d45
- address C++20 deprecation warnings with enums in floating point arithmetic.
2021-11-02 23:32:31 +01:00
Mitch Richters
f0a347263a
- SW: Replace use of getzrange_old()
inline wrapper with getzrange()
and remove inline wrappers.
2021-10-30 17:30:02 +02:00
Mitch Richters
add3481e40
- SW: Replace use of pushmove_old()
inline wrapper with pushmove()
and remove inline wrappers.
2021-10-30 17:30:02 +02:00
Mitch Richters
adcdbdc931
- SW: Replace use of clipmove_old()
inline wrapper with clipmove()
and remove inline wrappers.
2021-10-30 17:30:02 +02:00
Mitch Richters
9894729fc2
- Replace MAX()
from templates.h
with version provided in STL.
...
# Conflicts:
# source/common/textures/hw_ihwtexture.cpp
# source/common/utility/templates.h
2021-10-30 10:36:02 +02:00
Christoph Oelckers
57b638f26f
- use std::clamp instead of our homegrown version.
2021-10-30 10:35:00 +02:00
Mitch Richters
879e2f3ce4
- Build: Promote sintable[]
array values to precision Blood uses in prep for replacing Blood's costable[]
.
2021-10-30 10:24:15 +02:00
Christoph Oelckers
c4ea5cf336
- restore original krand formula.
...
Note: The only game module actually using this is Duke/RR.
2021-10-26 18:48:54 +02:00
Christoph Oelckers
86c58649ba
- fixed black rendered sectors in Exhumed/Polymost.
...
More a hack than a fix, thanks to Polymost's poor state handling
2021-10-16 15:36:34 +02:00
Christoph Oelckers
62d0d3712e
- use a sprite flag to mark mapped sprites.
...
This avoids another global array which needs to be addressed by sprite index.
2021-10-14 15:09:43 +02:00
Christoph Oelckers
29769dd673
- fixed engine code warnings pointed out by XCode 13.
2021-10-08 19:06:41 +02:00
Christoph Oelckers
7f485bfab1
- split off the extended sprite flags into their own word.
...
Some code overwrites the cstat field entirely (thanks Duke, for being sloppy with this...!)
2021-09-12 18:26:35 +02:00
Christoph Oelckers
99ecfe133d
- flag sprites for automapping regardless of the 'automapping' variable's value.
...
Duke should show its floor sprites, too.
2021-09-12 18:22:38 +02:00
Christoph Oelckers
0bd0923f44
- cleaned up some dirty code.
2021-08-30 08:07:40 +02:00
Mitchell Richters
4298399e00
- Build: Change MAXSPRITESONSCREEN
from constant of 2560 to 1/4 of MAXSPRITES.
...
* Mods like Blood's Eviction are pushing these limits hard. Bumping the onscreen limit resolved recurring crash on `sstation.map` with no apparent ill-effects.
2021-07-25 15:38:51 +10:00
Dino Bollinger
8dd0f947f7
Remove useless code introduced in bad17f29
2021-07-07 21:31:32 +02:00
Mitchell Richters
1dbf34fe56
- Repair some potential issues from 1354d52c05
that might be causing issues with #455 .
2021-07-04 21:06:13 +10:00
Christoph Oelckers
5b38343407
- fixed sprite exclusion logic in getzrange.
...
This was using the wrong flag.
2021-06-09 00:31:54 +02:00
Christoph Oelckers
7fa690082e
- fixed cherry picked commit.
...
# Conflicts:
# source/core/gamecontrol.h
2021-06-02 20:52:47 +02:00
Christoph Oelckers
dc846dcd49
- Duke: avoid clipping against self when executing script logic for floor sprites.
...
A good place to see the result is a kitchen knife in E4L2 that went missing due to the faulty check.
2021-06-01 21:21:39 +02:00
Christoph Oelckers
454816299e
- reorganized loading of textures.
...
Due to dependencies on initializing some data in app_init it was not possible to cleanly set up the fonts.
This adds a game-side function for loading the entire palettes before starting with the texture data and another one for loading game-side texture data.
This now allows fully setting up the palettes before starting with the textures and to fully set up the textures before reading the .def files.
All this is needed because to properly initialize, the fonts need to be able to access the fully initialized texture state, including replacements and hires substitutions from the .def files.
2021-06-01 11:05:26 +02:00
Brian Koropoff
e4e949877d
Fix buffer overflow at maploader.cpp:392
2021-05-22 22:31:16 +02:00
Christoph Oelckers
d572e56839
- removed the indirection for the global arrays.
...
No idea what part of EDuke32 needed this, but it is not necessary.
2021-05-21 14:32:01 +02:00
Christoph Oelckers
d4eb54d686
- render free standing wall sprites without depth bias.
...
Otherwise they can end up badly ordered with walls.
2021-05-20 12:36:35 +02:00
Christoph Oelckers
5ae1c334fa
- Duke: fixed bad check in 'ifnotmoving' CON command.
2021-05-14 10:03:07 +02:00
Christoph Oelckers
b6dd834420
- fixed warnings in Build code.
2021-05-12 21:47:32 +02:00
Christoph Oelckers
7283de0084
- fixed some very noisy warnings in two headers.
2021-05-12 21:47:32 +02:00
Christoph Oelckers
e40ed2262e
- cleanup of 'gotpic' handling.
2021-05-10 20:13:28 +02:00
Christoph Oelckers
e74aca291c
- position tweaking for Nam's skies.
...
Why is this such an utter mess to get skies placed correctly? :(
2021-05-10 20:13:28 +02:00
Cacodemon345
36b910a253
Fix compilation on OpenBSD
2021-05-10 08:25:14 +02:00
Christoph Oelckers
34a5fb5a6a
- make testnewrenderer persistent.
2021-05-06 18:12:23 +02:00
Christoph Oelckers
d54a8724b5
- default 'testnewrenderer' to false.
2021-05-06 17:04:48 +02:00
Christoph Oelckers
020a636c2f
- removed some more useless stuff from headers.
2021-05-03 19:16:26 +02:00
Christoph Oelckers
0db8fc6163
- removed UNREFERENCED_PARAMETER macro.
...
Using C++ standard of not naming such parameters instead.
2021-05-03 19:10:53 +02:00
Christoph Oelckers
7d77b2315f
- merged the few remaining contents of mmulti.h into d_net.h
2021-05-03 19:01:00 +02:00
Christoph Oelckers
8c379f7a44
Merge branch 'master' into newrenderer
2021-04-25 11:33:47 +02:00
Christoph Oelckers
3ad4a869c1
- handle the case that a deleted sprite has inserted its bogus sector reference into the clip list.
...
We got one report of Blood crashing on this.
2021-04-23 20:11:46 +02:00
Christoph Oelckers
db7527fa43
- fix sky palette in Polymost mode.
2021-04-22 22:03:16 +02:00
Christoph Oelckers
9092b5c392
- removed some unused stuff from engine.
2021-04-21 22:32:27 +02:00
Mitchell Richters
98a9963bb5
- Fix release builds of project and remove old def_.cpp
stub file.
2021-04-22 06:30:44 +10:00
Christoph Oelckers
ba5e7d419c
- cleaned up the remains of the old def parser.
2021-04-21 18:15:55 +02:00
Christoph Oelckers
1ea25e5d0e
- reworked the def parser's main loop.
2021-04-21 18:15:25 +02:00