Commit Graph

1677 Commits

Author SHA1 Message Date
terminx d3f93fc00f EDuke32-specific libdivide customizations
git-svn-id: https://svn.eduke32.com/eduke32@7716 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:38 +02:00
terminx db7a2bd0db Update libdivide from git
git-svn-id: https://svn.eduke32.com/eduke32@7715 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:36 +02:00
terminx 4a09e2a183 Patch from Nuke.YKT to improve the appearance of slopes in software mode
git-svn-id: https://svn.eduke32.com/eduke32@7714 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:34 +02:00
terminx d5d1f0a0ea Patch from Nuke.YKT to implement q16 angle and horiz in software mode
git-svn-id: https://svn.eduke32.com/eduke32@7713 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:32 +02:00
terminx fe2fe0c2cf Patch from Fox:
Polymost visibility: compensate for the classic mode "truncating" the lookup shades by moving the fog ramp by the equivalent of 1/2 shade

Fix some issues with negative shade in GL fog.

git-svn-id: https://svn.eduke32.com/eduke32@7712 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:29 +02:00
terminx ff4449638e Use #if DEBUGGINGAIDS>=2 for the assertions in the structure trackers
git-svn-id: https://svn.eduke32.com/eduke32@7711 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:27 +02:00
terminx 2114abcedd Don't force APLAYER to have the default action when shown through a viewscreen in EDUKE32_STANDALONE builds
git-svn-id: https://svn.eduke32.com/eduke32@7710 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:24 +02:00
terminx cf915a142c Cosmetic change
git-svn-id: https://svn.eduke32.com/eduke32@7709 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:22 +02:00
terminx 29b626fc5d Get rid of DYNALLOC_ARRAYS
It's garbage and the "functionality" it provided is something that will be able to be achieved in a better way in a future commit.

git-svn-id: https://svn.eduke32.com/eduke32@7708 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:20 +02:00
terminx d2b3691e22 Remove FIXMATH_NO_64BIT
This codebase doesn't work on any platforms where int64_t isn't even a type.

git-svn-id: https://svn.eduke32.com/eduke32@7707 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:17 +02:00
terminx 7f32add116 It looks like this works in MSVC
git-svn-id: https://svn.eduke32.com/eduke32@7706 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:07:14 +02:00
terminx ccdba037b5 Added Xfree() function to accompany the Xmalloc() family of functions and change all uses of Bfree() to Xfree()
This was necessary because everything is already allocated with the Xmalloc() functions, but a future commit will make blocks allocated with those functions no longer compatible with the system implementation of free(), which Bfree() wraps.

git-svn-id: https://svn.eduke32.com/eduke32@7705 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/build.cpp
#	source/build/src/mdsprite.cpp
#	source/build/src/polymer.cpp
#	source/build/src/polymost.cpp
#	source/build/src/texcache.cpp
#	source/build/src/voxmodel.cpp
2019-09-20 12:07:10 +02:00
terminx dc62b986e8 Update miniz from 2.0.8 to 2.1.0--not much of a change
git-svn-id: https://svn.eduke32.com/eduke32@7703 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:02:41 +02:00
terminx 87b136eb79 Fix bug with sprite heights and autoaim targeting
git-svn-id: https://svn.eduke32.com/eduke32@7702 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:02:38 +02:00
terminx 2f9ca17507 Fix integer overflows in rintersect() and optimize a bit of the logic
Some of the variable initialization ordering may look counterintuitive at first, but it's intended to avoid read-after-write memory access penalties.

git-svn-id: https://svn.eduke32.com/eduke32@7701 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:02:36 +02:00
terminx 4ff7ec4a45 Minor pragmas.h cleanups
git-svn-id: https://svn.eduke32.com/eduke32@7700 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:02:33 +02:00
terminx 126088f035 Remove ifdef'd out Gv_DivVar() generation with VM_GAMEVAR_OPERATOR macro because LIBDIVIDE_ALWAYS is going away
git-svn-id: https://svn.eduke32.com/eduke32@7699 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:02:31 +02:00
terminx d34224a3de "Fix" editor clipping bug allowing movement into null space
This doesn't so much fix the issue as band-aid over it--it appears to be an OG BUILD bug that has happened since long before I ever began improving the clipping, I don't know what causes it, and I don't want to fuck everything up trying to fix it right now.

git-svn-id: https://svn.eduke32.com/eduke32@7698 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:02:29 +02:00
terminx 02ef02872a Replace manual casts of sprite and wall pointers to vec2/3_t with use of the anonymous union
git-svn-id: https://svn.eduke32.com/eduke32@7697 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/build.cpp
#	source/build/src/polymost.cpp
2019-09-20 12:02:26 +02:00
terminx 8141fbd692 Fix alpha blending bug when switching from Polymost to software mode
git-svn-id: https://svn.eduke32.com/eduke32@7696 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 12:01:39 +02:00
terminx 26a266dfe5 Rename STRUCT_TRACKERS_ENABLED preprocessor definition to USE_STRUCT_TRACKERS
This may also fix a minor performance regression introduced in Polymer sometime after we switched to building as C++, caused by confusion between STRUCT_TRACKERS_ENABLED and UNTRACKED_STRUCTS. UNTRACKED_STRUCTS is now named UNTRACT_STRUCTS__ to dissuade use outside of buildtypes.h.

git-svn-id: https://svn.eduke32.com/eduke32@7695 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymer.cpp
2019-09-20 12:01:36 +02:00
Christoph Oelckers 33b122d88a - renamed remaining vec2s_t's. 2019-09-20 11:47:21 +02:00
terminx 9d7e5d9970 Rename vec2s_t to vec2_16_t
git-svn-id: https://svn.eduke32.com/eduke32@7694 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-20 11:28:57 +02:00
Christoph Oelckers f8b17e98f3 - sadly this crap is really needed... :( 2019-09-20 11:26:37 +02:00
terminx bd80cec462 Add anonymous union between separate coordinate variables and vec2/3_t in basic map structs
git-svn-id: https://svn.eduke32.com/eduke32@7693 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/include/buildtypes.h
2019-09-20 10:42:09 +02:00
terminx 1a4afe09a8 Add missing ifdef
git-svn-id: https://svn.eduke32.com/eduke32@7692 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:15:21 +02:00
terminx 5be379c6b0 This benchmarks as just the tiniest bit faster on my machine
git-svn-id: https://svn.eduke32.com/eduke32@7691 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:15:19 +02:00
terminx 0556fe1738 Simplify map structure tracker overloads
Due to less branching, this is actually faster than trying to be clever.

git-svn-id: https://svn.eduke32.com/eduke32@7690 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:15:17 +02:00
terminx dd2e35eab3 EDUKE32_STANDALONE crap
git-svn-id: https://svn.eduke32.com/eduke32@7689 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:15:14 +02:00
hendricks266 ff204ff034 Fix macOS -Wdeprecated-declarations warnings
git-svn-id: https://svn.eduke32.com/eduke32@7688 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	.gitignore
2019-09-20 10:15:10 +02:00
hendricks266 5fc9868c6a Add support for E0LXY to game defs music token
git-svn-id: https://svn.eduke32.com/eduke32@7687 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:14:40 +02:00
hendricks266 ecf990253b Fix OOB access in polymost_spriteHasTranslucency
git-svn-id: https://svn.eduke32.com/eduke32@7686 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:14:37 +02:00
hendricks266 3598e79dc7 Fix OOB access in clipmove
git-svn-id: https://svn.eduke32.com/eduke32@7685 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:14:35 +02:00
hendricks266 849b095b26 Audiolib: Fix use-after-frees in Vorbis, FLAC, XA decoding
git-svn-id: https://svn.eduke32.com/eduke32@7684 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:14:33 +02:00
hendricks266 19a5e86a35 Audiolib: Clean up samples handling
git-svn-id: https://svn.eduke32.com/eduke32@7683 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:14:30 +02:00
pogokeen f92ec7bb89 polymost.cpp: fix issue where GL_ALPHA_TEST could be enabled in certain instances when executing polymost_drawrooms() and better handle when we are drawing without a texture in polymost_drawpoly()
git-svn-id: https://svn.eduke32.com/eduke32@7682 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-20 10:14:28 +02:00
pogokeen 9b621c0ef2 Add GL debugging event annotations for Polymost functions
git-svn-id: https://svn.eduke32.com/eduke32@7681 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/include/polymost.h
#	source/build/src/mdsprite.cpp
#	source/build/src/polymost.cpp
2019-09-20 10:14:12 +02:00
hendricks266 5cd7f18dab !
git-svn-id: https://svn.eduke32.com/eduke32@7680 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:05:37 +02:00
hendricks266 d2609f07a9 Restore file loading
git-svn-id: https://svn.eduke32.com/eduke32@7679 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:05:34 +02:00
hendricks266 dd5f1338c5 Revert "Improve file loading"
This reverts commit bfc6b7589e.

git-svn-id: https://svn.eduke32.com/eduke32@7678 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:05:31 +02:00
hendricks266 a9e0c9afe1 Allow CON-specified actions to override hardcoded tsprpicnum behavior of PLAYERONWATER, CAMERA1, and RAT
git-svn-id: https://svn.eduke32.com/eduke32@7677 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:05:29 +02:00
terminx a4b30b5b90 Move S_Update() out of game loop and into Net_GetPackets()
This improves, but doesn't fix, the issue with sound popping when the player angle changes.

git-svn-id: https://svn.eduke32.com/eduke32@7676 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:05:26 +02:00
terminx 91b9a605fa "horizon offset should not be affected by projection hack"
git-svn-id: https://svn.eduke32.com/eduke32@7675 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-20 10:05:22 +02:00
terminx 9df490434d Gamevar system maintenance
This removes some of the error handling for gamevar reads and writes and trades it for simpler code and a small-but-benchmarkable performance increase.

git-svn-id: https://svn.eduke32.com/eduke32@7674 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:04:27 +02:00
terminx b0a4b6a1ee Convert loops using unsigned integers as iterators to use regular signed ints instead
https://kristerw.blogspot.com/2016/02/how-undefined-signed-overflow-enables.html

Doing this as cleanly as possible involved demoting several function parameters concerning object sizes and counts from size_t to int--I'm fine with this change as the functions in question are not actually capable of handling input with sizes larger than what can be stored in a signed 32-bit integer, making the use of size_t here misleading at best.

git-svn-id: https://svn.eduke32.com/eduke32@7673 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
#	source/build/src/texcache.cpp
#	source/build/src/tilepacker.cpp
2019-09-20 10:04:24 +02:00
terminx 79752ee168 Move call to S_Update() to after G_MoveLoop()
git-svn-id: https://svn.eduke32.com/eduke32@7672 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:53 +02:00
terminx 605d88bb41 Better stupid names for stupid macros in stupid function
git-svn-id: https://svn.eduke32.com/eduke32@7670 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:48 +02:00
terminx c3f7c26708 Sanitize A_GetFurthestAngle() return value
git-svn-id: https://svn.eduke32.com/eduke32@7669 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:46 +02:00
terminx f62d6c919c Patch from Fox to access the player's subweapon member as a bitfield
"Add 'bsubweapon' player structure. Same as 'subweapon', except that it writes a bit for each weapon. For example, 'ife player[].bsubweapon GROW_WEAPON 1' has the same result as 'ifand player[].subweapon 2048'."

git-svn-id: https://svn.eduke32.com/eduke32@7668 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:44 +02:00
terminx 509febe25a Fix actor z position update bug
git-svn-id: https://svn.eduke32.com/eduke32@7667 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:42 +02:00
terminx 549ef41eb7 EDUKE32_STANDALONE stuff
git-svn-id: https://svn.eduke32.com/eduke32@7666 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:40 +02:00
terminx 90cf239650 Add GAMEVAR_RAWQ16PTR, functioning the same as GAMEVAR_INT32PTR
git-svn-id: https://svn.eduke32.com/eduke32@7665 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:37 +02:00
terminx 22759d8a5e Make CLIPMASK0 and CLIPMASK1 regular defined tokens instead of read-only gamevars
I don't remember if there was any particular reason they were added as gamevars in the first place.

git-svn-id: https://svn.eduke32.com/eduke32@7664 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:35 +02:00
terminx bf6730d8a3 Minor optimization to avoid read-after-write in Gv_DivVar()
git-svn-id: https://svn.eduke32.com/eduke32@7663 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:33 +02:00
terminx 9aa1030a09 Promote `display_mirror` from char to int32_t and remove GAMEVAR_UINT8PTR handling since nothing else was using it
git-svn-id: https://svn.eduke32.com/eduke32@7662 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:31 +02:00
terminx 0becd69e91 Tweak EDUKE32_PRE_XALLOC thing used when DEBUGGINGAIDS is defined
git-svn-id: https://svn.eduke32.com/eduke32@7661 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:29 +02:00
terminx badf4eab6d Add EDUKE32_PREDICT_TRUE to our *alloc macros and flip the condition around so the true branch is first
git-svn-id: https://svn.eduke32.com/eduke32@7660 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:27 +02:00
terminx 6395909290 Add preprocessor check for __OPTIMIZE__ to EDUKE32_PREDICT_TRUE and EDUKE32_PREDICT_FALSE
git-svn-id: https://svn.eduke32.com/eduke32@7659 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:24 +02:00
terminx efa3022d07 CON VM maintenance
git-svn-id: https://svn.eduke32.com/eduke32@7658 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:22 +02:00
terminx 7659e816fa CON_USE_COMPUTED_GOTO eval macro micro-optimization
This is almost as fast as ditching the bounds check here entirely.

git-svn-id: https://svn.eduke32.com/eduke32@7657 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 10:01:19 +02:00
Christoph Oelckers 61d2e31610 - fixed another bad merge 2019-09-20 09:44:58 +02:00
terminx 5e470e8a5b Neat Polymost y-shearing patch from Nuke.YKT
git-svn-id: https://svn.eduke32.com/eduke32@7656 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-20 09:43:17 +02:00
terminx 9ba2a3b719 Fix old issue with VM_CONDITIONAL macro
git-svn-id: https://svn.eduke32.com/eduke32@7655 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:38:46 +02:00
terminx e69fb3934e Rename Gv_GetArrayCountFromFile() to Gv_GetArrayCountForAllocSize()
git-svn-id: https://svn.eduke32.com/eduke32@7654 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:38:43 +02:00
terminx 52dde4ef32 Rename Gv_SetVarX() to Gv_SetVar() (overloaded)
git-svn-id: https://svn.eduke32.com/eduke32@7653 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:38:41 +02:00
terminx 0ff1188b59 Rename Gv_GetVarX() to Gv_GetVar() (overloaded)
git-svn-id: https://svn.eduke32.com/eduke32@7652 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:38:38 +02:00
terminx a1556e9da7 Fix a bunch of boolean cvars that weren't flagged as CVAR_BOOL, preventing them from working with the "toggle" console command
git-svn-id: https://svn.eduke32.com/eduke32@7651 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-20 09:38:14 +02:00
Christoph Oelckers dcc3e2b94e - removed code duplication from last cherry-pick 2019-09-20 09:35:09 +02:00
terminx 410da8a085 Polymost shade table interpolation patch from Nuke.YKT
git-svn-id: https://svn.eduke32.com/eduke32@7650 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-20 09:32:22 +02:00
terminx 6db4ac3b01 const correctness that I didn't have another commit to squash into
git-svn-id: https://svn.eduke32.com/eduke32@7648 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:27:31 +02:00
terminx 0cbb1df2d1 Rename "loopcnt" to "vm_execution_depth" and CON_DIRECT_THREADING_DISPATCH to CON_USE_COMPUTED_GOTO
Also removes a redundant "break" statement in builds not using CON_USE_COMPUTED_GOTO.

git-svn-id: https://svn.eduke32.com/eduke32@7647 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:27:29 +02:00
terminx 058c1a8060 Simplify the beginning of VM_Execute()
This also moves the loop control stuff into #ifndef CON_DIRECT_THREADING_DISPATCH blocks, since we don't actually need a loop anymore when using the computed goto stuff.

git-svn-id: https://svn.eduke32.com/eduke32@7646 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:27:26 +02:00
terminx db8bcba93a Minor changes similar to the VM_Execute() maintenance commit
No user-facing changes.

git-svn-id: https://svn.eduke32.com/eduke32@7645 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:27:24 +02:00
terminx b854ddff41 Fix a potentially funny bug in the CON parser
I don't think anyone actually ran into this.

git-svn-id: https://svn.eduke32.com/eduke32@7644 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:27:21 +02:00
terminx 9ac1ce04d6 Simplify CON_FINDNEARACTOR family of functions and restore the original behavior of returning the nearest sprite instead of any sprite that satisfies the condition
git-svn-id: https://svn.eduke32.com/eduke32@7641 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:48 +02:00
terminx 271cdeaf5d Fix errant "continue" found remaining in the CON_FINDNEARACTOR family of functions
git-svn-id: https://svn.eduke32.com/eduke32@7640 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:46 +02:00
terminx 6a458273a0 Replace a handful of accesses to sprite[vm.spriteNum] with accesses to vm.pSprite
It looks like these were simply missed when vm.pSprite was initially added.

git-svn-id: https://svn.eduke32.com/eduke32@7639 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:44 +02:00
terminx d1af530b01 Add VM_ASSERT() macro for handling VM error conditions
This is for errors that simply check a condition (surrounded with EDUKE32_PREDICT_FALSE) and bail out with CON_ERRPRINTF() and abort_after_error(). Not everything that fits this description has been transitioned to use the new macro yet.

git-svn-id: https://svn.eduke32.com/eduke32@7638 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:41 +02:00
terminx f8fba45117 Tweak inlined VM_OnEvent() internals, biggest change being the removal of two instances of EDUKE32_PREDICT_FALSE
git-svn-id: https://svn.eduke32.com/eduke32@7637 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:39 +02:00
terminx 562e6f419c Use function overloading to clean up some of the CON event execution function names
git-svn-id: https://svn.eduke32.com/eduke32@7636 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:37 +02:00
terminx 078ef9b871 Optimize A_Execute() control flow
git-svn-id: https://svn.eduke32.com/eduke32@7635 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:35 +02:00
terminx de695f22bc Better VM_DummySprite()
git-svn-id: https://svn.eduke32.com/eduke32@7634 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:33 +02:00
terminx 3577d8a032 Clean up Lunatic stuff in VM_AlterAng()/VM_Move()/VM_UpdateAnim()/A_Execute()
git-svn-id: https://svn.eduke32.com/eduke32@7633 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:30 +02:00
terminx e2f43a59a7 Add EDUKE32_PREDICT_FALSE to EVENT_ANIMATESPRITES check in G_SaveMapState() and G_RestoreMapState()
git-svn-id: https://svn.eduke32.com/eduke32@7632 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:28 +02:00
terminx 92174a0cf9 Minor VM_Execute() maintenance
git-svn-id: https://svn.eduke32.com/eduke32@7631 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:21:26 +02:00
terminx 3db7512c69 Templatize bfirst_search_init() and bfirst_search_try() so they can be used with types other than int16_t
git-svn-id: https://svn.eduke32.com/eduke32@7629 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/build.cpp
2019-09-20 09:20:14 +02:00
terminx 74c44125f8 This is more efficient
This commit brought to you by 4/20.

git-svn-id: https://svn.eduke32.com/eduke32@7628 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:19:42 +02:00
pogokeen 78d08b3ac2 engine.cpp: fix sprite sorting/adjustment issue introduced in r7612 that caused sprites with the same y value at the end of the sorted array to not be adjusted properly
git-svn-id: https://svn.eduke32.com/eduke32@7627 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:19:39 +02:00
pogokeen fc636b53ca polymost.cpp: Fix issue where state would not be reset properly in polymost_drawmaskwall() when rendering translucent maskwalls with no texture
git-svn-id: https://svn.eduke32.com/eduke32@7626 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:19:29 +02:00
pogokeen 40737f44cc polymost.cpp: fix polymost_dorotatesprite() alpha test/blend issue introduced in r7619
git-svn-id: https://svn.eduke32.com/eduke32@7625 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:19:27 +02:00
pogokeen 775a0de6c1 polymost.cpp: fix issue where floors & ceilings with DAMETH_MASKPROPS were not being blended
git-svn-id: https://svn.eduke32.com/eduke32@7624 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 09:19:25 +02:00
Christoph Oelckers 0254bf82d3 - added NBlood source. 2019-09-20 00:42:45 +02:00
Christoph Oelckers 23bc385393 - everything works again, some changes were apparently lost in the last merge. 2019-09-19 23:39:35 +02:00
Christoph Oelckers 8074d8251e - can be compiled again but crashes. 2019-09-19 23:02:57 +02:00
Christoph Oelckers dd7ce38cbb - adjustments for the Blood merge. 2019-09-19 22:26:44 +02:00
Christoph Oelckers 53335f20ec - Blood merge
# Conflicts:
#	source/build/include/polymost.h
#	source/build/src/build.cpp
#	source/build/src/engine.cpp
#	source/build/src/polymost.cpp
#	source/build/src/voxmodel.cpp
2019-09-19 22:06:49 +02:00
Christoph Oelckers 52edcc7e91 - adjustment to mact. 2019-09-19 20:32:35 +02:00
Christoph Oelckers c2e4a6cb64 - sound system additions from NBlood, except for the backing code for OPL playback. 2019-09-19 20:22:09 +02:00
pogokeen 5865d96306 engine.cpp: fix bug in killsprite where sprites were not being removed properly after sorting changes
git-svn-id: https://svn.eduke32.com/eduke32@7623 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 15:03:05 +02:00
pogokeen d2ebc8a29c Reduce state changes and fix translucent maskwall depth buffer issue
git-svn-id: https://svn.eduke32.com/eduke32@7619 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-19 15:01:13 +02:00
terminx be86eb779b This is a few less instructions
git-svn-id: https://svn.eduke32.com/eduke32@7618 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 15:00:57 +02:00
terminx 968ebdef84 Fix TROR clipping issue
git-svn-id: https://svn.eduke32.com/eduke32@7617 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 15:00:55 +02:00
pogokeen 2228af8658 Fix maskwall array indirection bug and two if conditional oversights from r7612
git-svn-id: https://svn.eduke32.com/eduke32@7615 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:58:14 +02:00
terminx aa4cfed3f1 Fix longstanding player hitscan and decal z coordinate offset bug
This one traces back to the original DOS code.

git-svn-id: https://svn.eduke32.com/eduke32@7614 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:58:12 +02:00
pogokeen 9534bb1578 polymost.cpp: switch from writing gl_FragColor to writing gl_FragData[0] in order to reduce VGPR usage on AMD cards
git-svn-id: https://svn.eduke32.com/eduke32@7613 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-19 14:58:09 +02:00
pogokeen 2765ebec87 Fix depth buffer issue causing translucent sprites to not render properly in Polymost.
Use polymost_spriteHasTranslucency() and polymost_maskWallHasTranslucency() to determine if a sprite has translucency.
Optimize sprite rendering when in Polymost by only sorting sprites with translucency.

git-svn-id: https://svn.eduke32.com/eduke32@7612 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-19 14:56:47 +02:00
terminx 61b3a65e79 Improve check_floor_curb()
This should fix several remaining clipping bugs.

git-svn-id: https://svn.eduke32.com/eduke32@7611 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:52:41 +02:00
terminx 12eb413f9c Fix SOS check in clipmove()
git-svn-id: https://svn.eduke32.com/eduke32@7610 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:52:40 +02:00
terminx 60ea578a8c Add support for returning the closest point in the sector to getsectordist()
git-svn-id: https://svn.eduke32.com/eduke32@7609 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:52:37 +02:00
terminx 8d85e8d934 Add new findwallbetweensectors() function and change sectoradjacent() to use it
git-svn-id: https://svn.eduke32.com/eduke32@7608 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:52:35 +02:00
terminx e25a197f3e Piddly fart bullshit changes that don't really do anything
git-svn-id: https://svn.eduke32.com/eduke32@7606 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:52:31 +02:00
terminx e9116bd23a Add SFLAG_QUEUEDFORDELETE, to handle detection and manipulation of things like decal sprites marked for deletion
git-svn-id: https://svn.eduke32.com/eduke32@7604 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:51:41 +02:00
terminx 301ac48ccd Utilize the types added in the previous commit
This patch is a bit large.

git-svn-id: https://svn.eduke32.com/eduke32@7603 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/include/mdsprite.h
#	source/build/src/build.cpp
#	source/build/src/polymer.cpp
#	source/build/src/polymost.cpp
#	source/build/src/voxmodel.cpp
2019-09-19 14:46:31 +02:00
terminx 5948513d76 Introduce a few "new" types for convenience when dealing with pointers to sprites, walls, and sectors that bypass the StructTracker stuff
git-svn-id: https://svn.eduke32.com/eduke32@7602 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:37:07 +02:00
terminx ab857c4e8f This should fix updatesector/updatesectorz performance while retaining the benefits of breadth-first search
git-svn-id: https://svn.eduke32.com/eduke32@7601 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:37:06 +02:00
terminx a89c260592 Add optional output parameter to getwalldist(), to return the coordinates of the closest point on the wall
git-svn-id: https://svn.eduke32.com/eduke32@7600 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:37:04 +02:00
terminx 0dcceb9147 Fix EDUKE32_STANDALONE crash when calling G_DeleteOldSaves() at startup in debug builds
git-svn-id: https://svn.eduke32.com/eduke32@7599 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:37:03 +02:00
terminx 879cb550a6 Whitespace
git-svn-id: https://svn.eduke32.com/eduke32@7598 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:37:02 +02:00
terminx 5052addc67 Remove useless unused "sqr" function
git-svn-id: https://svn.eduke32.com/eduke32@7597 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:36:59 +02:00
terminx e35e516c02 Make editor no longer mask off sprite cstat bits when set from script
git-svn-id: https://svn.eduke32.com/eduke32@7596 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:36:58 +02:00
terminx 2d01182ef0 Update libdivide.h with a couple of fixes for obscure problems from their git repo
git-svn-id: https://svn.eduke32.com/eduke32@7595 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:36:56 +02:00
terminx 1fae340426 Fix a bunch of improperly defined bitmap arrays
git-svn-id: https://svn.eduke32.com/eduke32@7594 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/build.cpp
2019-09-19 14:36:54 +02:00
terminx a628b8d9f7 Add bounds checking for renderSetTarget()
I'm not aware of this problem actually occurring anywhere, but too many consecutive calls to renderSetTarget() without the appropriate calls to renderRestoreTarget() between them would overflow 5 different arrays.

git-svn-id: https://svn.eduke32.com/eduke32@7593 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:36:44 +02:00
terminx 80d77f64cf This version of equation() compiles into fewer instructions
git-svn-id: https://svn.eduke32.com/eduke32@7592 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:36:42 +02:00
terminx 413d68f1f8 Replace yax_getclosestpointonwall() with getclosestpointonwall_internal() and use it in both yax_walldist() and getwalldist()
This commit also adds a getsectordist() but we aren't using it anywhere yet.

git-svn-id: https://svn.eduke32.com/eduke32@7591 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:36:40 +02:00
terminx ea826fb117 Move NEXTWALL and POINT2 macros into build.h
git-svn-id: https://svn.eduke32.com/eduke32@7590 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:30:26 +02:00
terminx 51e5e41830 Remove obsolete "msinttypes" headers
git-svn-id: https://svn.eduke32.com/eduke32@7589 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:30:24 +02:00
terminx e59f8e3b71 Use FORCE_INLINE and CONSTEXPR where appropriate in the Q16 fixed point math library
git-svn-id: https://svn.eduke32.com/eduke32@7588 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	platform/Windows/build.vcxproj.filters
2019-09-19 14:30:22 +02:00
terminx e5bd221746 auto/const/constexpr bullshit
git-svn-id: https://svn.eduke32.com/eduke32@7587 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:49 +02:00
terminx f9e866d32d Rename clipwalldist() to getwalldist() and move both it and sectoradjacent() to engine.cpp
git-svn-id: https://svn.eduke32.com/eduke32@7586 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:48 +02:00
terminx bb517b73e3 clip.cpp usectortype cleanup
git-svn-id: https://svn.eduke32.com/eduke32@7585 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:45 +02:00
terminx d04c4203c5 Fix a really stupid bug in r7574
git-svn-id: https://svn.eduke32.com/eduke32@7584 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:43 +02:00
terminx 5a814eb261 Make getceilzofslopeptr/getflorzofslopeptr/getzsofslopeptr not invoke the structure trackers
git-svn-id: https://svn.eduke32.com/eduke32@7583 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:41 +02:00
terminx b46bc73322 Add a distance check to clipupdatesector() to prevent traversing through portals that are outside the wall distance passed to clipmove()
git-svn-id: https://svn.eduke32.com/eduke32@7582 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:40 +02:00
terminx 76d7fec2ff Expose yax_getclosestpointonwall() for use outside of engine.cpp
git-svn-id: https://svn.eduke32.com/eduke32@7581 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:38 +02:00
terminx e2be7183b4 Fix addclipsect() accidentally being nested under #ifdef HAVE_CLIPSHAPE_FEATURE
git-svn-id: https://svn.eduke32.com/eduke32@7580 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:36 +02:00
terminx e5c979c997 CON_UPDATESECTOR/CON_UPDATESECTORZ: only use sprite[vm.spriteNum].sectnum if the initial value of the input/output parameter is outside the range of 0 - MAXSECTORS-1
git-svn-id: https://svn.eduke32.com/eduke32@7579 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:34 +02:00
terminx a32597464f Use uwalltype in inside() to avoid invoking the struct trackers
git-svn-id: https://svn.eduke32.com/eduke32@7578 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:32 +02:00
terminx bcf8ae4d84 Revert "Clean up clip.cpp struct casting including but not limited to r7466 changes"
git-svn-id: https://svn.eduke32.com/eduke32@7577 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:30 +02:00
hendricks266 f96e1c8e24 Clean up clip.cpp struct casting including but not limited to r7466 changes
git-svn-id: https://svn.eduke32.com/eduke32@7576 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:29 +02:00
hendricks266 cd499b2089 Fix clipshape regression in r7466
git-svn-id: https://svn.eduke32.com/eduke32@7575 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:27 +02:00
terminx 9af816af52 Replace manual search of clipsectorlist[] in clipmove() and friends with a bitmap
git-svn-id: https://svn.eduke32.com/eduke32@7574 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:25 +02:00
terminx 74944c9ed0 Fix clipupdatesector()
git-svn-id: https://svn.eduke32.com/eduke32@7573 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:23 +02:00
terminx ad59875fa3 Improve warnings spewed by clipmove() when attempting to consider too many things for clipping
git-svn-id: https://svn.eduke32.com/eduke32@7572 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:21 +02:00
terminx 8a68bffdb0 Clean up clip.h and declare a bunch of stuff in clip.cpp static
git-svn-id: https://svn.eduke32.com/eduke32@7571 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:19 +02:00
terminx 7d0faa5752 Reduce MAXCLIPSECTORS to 512
git-svn-id: https://svn.eduke32.com/eduke32@7570 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:17 +02:00
terminx c754ac6e62 Limit lastwall() to 'numwalls' iterations instead of MAXWALLS
git-svn-id: https://svn.eduke32.com/eduke32@7569 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:15 +02:00
terminx c8eb1d0368 Simplify conditions in bfirst_search_try()
git-svn-id: https://svn.eduke32.com/eduke32@7568 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:14 +02:00
terminx b7d06c0bd8 clipmove/pushmove parameter const correctness
git-svn-id: https://svn.eduke32.com/eduke32@7567 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:12 +02:00
hendricks266 1ab7175c90 Duke: Fix -Wparentheses
git-svn-id: https://svn.eduke32.com/eduke32@7566 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:26:10 +02:00