Commit Graph

268 Commits

Author SHA1 Message Date
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 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 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 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
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
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
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 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 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 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
Christoph Oelckers 0254bf82d3 - added NBlood source. 2019-09-20 00:42:45 +02:00
Christoph Oelckers 8074d8251e - can be compiled again but crashes. 2019-09-19 23:02:57 +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
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
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 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 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 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 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 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 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 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 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 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 0c7a7e1bd6 compat.h: Factor some repeated conditional_t statements into a new take_sign_t
git-svn-id: https://svn.eduke32.com/eduke32@7559 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:23:32 +02:00
hendricks266 fb0443db69 Replace `#if CXXSTD >= 2011 || EDUKE32_MSVC_PREREQ(1800)` with `#ifdef HAVE_CXX11_HEADERS`
git-svn-id: https://svn.eduke32.com/eduke32@7557 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:23:29 +02:00
terminx 84c43dc99c Fix warnings with TrackedType
git-svn-id: https://svn.eduke32.com/eduke32@7551 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:23:22 +02:00
terminx 7abfcd28be Add clipupdatesector(), a special version of updatesector() that only searches and returns results that are already in clipsectorlist[]
git-svn-id: https://svn.eduke32.com/eduke32@7546 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:20:47 +02:00
hendricks266 664c1ed38e Fix extern "C" error in kplib.h affecting the Build tools
git-svn-id: https://svn.eduke32.com/eduke32@7543 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:20:40 +02:00
hendricks266 c2921abe4a SW: Address -Woverflow warnings resulting from the struct tracker templates being too restrictive
git-svn-id: https://svn.eduke32.com/eduke32@7526 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-19 14:05:59 +02:00