Commit graph

362 commits

Author SHA1 Message Date
terminx
a6e60e9723 Move pow2char and pow2long to build.h and make them constexpr
git-svn-id: https://svn.eduke32.com/eduke32@7146 1a8010ca-5511-0410-912e-c29ae57300e0
2018-11-18 18:05:26 +00:00
terminx
786a0cc6a3 Rename the implementation of _lrotl() found at the top of kplib.cpp to klrotl() and use it unconditionally on platforms other than Win32 (it's only used in .bmp rendering).
git-svn-id: https://svn.eduke32.com/eduke32@7145 1a8010ca-5511-0410-912e-c29ae57300e0
2018-11-18 18:05:20 +00:00
terminx
f60c353810 Improve OSD_Dispatch() a little
git-svn-id: https://svn.eduke32.com/eduke32@7143 1a8010ca-5511-0410-912e-c29ae57300e0
2018-11-18 18:05:10 +00:00
hendricks266
fd175086a3 Move the LZW compression functions out of cache1d.cpp into their own object, klzw.cpp.
This eliminates the hackiness of libcache1d.so (now libkzlw.so) and CACHE1D_COMPRESS_ONLY.

git-svn-id: https://svn.eduke32.com/eduke32@7140 1a8010ca-5511-0410-912e-c29ae57300e0
2018-11-05 07:28:07 +00:00
hendricks266
de5d358d32 Refresh BUILDLIC copyright headers
git-svn-id: https://svn.eduke32.com/eduke32@7139 1a8010ca-5511-0410-912e-c29ae57300e0
2018-11-05 07:28:01 +00:00
terminx
e7798d12dc Additional const and constexpr usage in compat.h and pragmas
git-svn-id: https://svn.eduke32.com/eduke32@7132 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:33:52 +00:00
terminx
ad7d61baa1 Use range-based loops for simplicity
git-svn-id: https://svn.eduke32.com/eduke32@7130 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:33:40 +00:00
terminx
3b782aba60 Add CSTAT_SPRITE_ALIGNMENT_MASK. It's identical to CSTAT_SPRITE_ALIGNMENT_SLAB, but should be used in cases where you're checking either CSTAT_SPRITE_ALIGNMENT_WALL or CSTAT_SPRITE_ALIGNMENT_FLOOR rather than checking for a slab (voxel).
git-svn-id: https://svn.eduke32.com/eduke32@7129 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:33:32 +00:00
terminx
4059e1918e Mark libdivide constructors explicit
git-svn-id: https://svn.eduke32.com/eduke32@7128 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:33:26 +00:00
terminx
5c1e350d79 sdlayer: don't add windowed modes that are larger than the monitor's actual resolution
git-svn-id: https://svn.eduke32.com/eduke32@7115 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:32:00 +00:00
terminx
9447d2c3ff Fix issue with Bgetsysmemsize() on some platforms after the changeover to ::min and ::max.
git-svn-id: https://svn.eduke32.com/eduke32@7113 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:31:49 +00:00
terminx
a6e7f601d3 Fix HIGH_PRECISION_SPRITE, broken when switching to std::min and std::max.
git-svn-id: https://svn.eduke32.com/eduke32@7111 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:31:40 +00:00
terminx
59196c42ea This commit is useless
git-svn-id: https://svn.eduke32.com/eduke32@7109 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:31:30 +00:00
terminx
a7746f9cd2 Make tabledivide64 actually return an int64_t...
git-svn-id: https://svn.eduke32.com/eduke32@7108 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:31:25 +00:00
terminx
8461fb0cb9 Use _strlwr and _strupr with MSVC
git-svn-id: https://svn.eduke32.com/eduke32@7105 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:31:10 +00:00
terminx
385562d143 Fix bounds checks occurring after array access in tessectrap() and polymost_precache() with very minor cleanup of surrounding lines.
git-svn-id: https://svn.eduke32.com/eduke32@7104 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:31:05 +00:00
terminx
ad8a65d154 Small cleanups to fogcalc() and fogcalc_old()
git-svn-id: https://svn.eduke32.com/eduke32@7103 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:31:01 +00:00
terminx
ffab1f7d71 Slightly simplify TrackedType operator stuff
git-svn-id: https://svn.eduke32.com/eduke32@7102 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:30:56 +00:00
terminx
3d7a827b3d Update miniz to 3616bf804b1e7b9be5e2769b1e4a7d74d575b13c
git-svn-id: https://svn.eduke32.com/eduke32@7097 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:30:32 +00:00
terminx
175ac6dc6b This looks dumb as fuck, but it tells static analysis tools that our memory allocation functions literally never return a null pointer
git-svn-id: https://svn.eduke32.com/eduke32@7095 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:30:22 +00:00
terminx
b65120200a Clean up Bgethomedir() and a few of the other directory functions
git-svn-id: https://svn.eduke32.com/eduke32@7094 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:30:17 +00:00
terminx
7bd8c55e32 Useless warning silencing
git-svn-id: https://svn.eduke32.com/eduke32@7091 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:30:03 +00:00
terminx
4c57c4dd46 imo auto is cleaner here because the cast of the rvalue makes the resulting type explicitly clear
git-svn-id: https://svn.eduke32.com/eduke32@7089 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:29:54 +00:00
terminx
9079beadb4 Remove some dead statements, useless assigments, etc
git-svn-id: https://svn.eduke32.com/eduke32@7086 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:29:38 +00:00
terminx
1d71ea3fc0 polymost_setTexturePosSize() and polymost_setHalfTexelSize(): pass vec4f_t and vec2f_t by const reference instead of by value
git-svn-id: https://svn.eduke32.com/eduke32@7085 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:29:30 +00:00
terminx
4bb9a4b792 sscanf format parameter fixups
git-svn-id: https://svn.eduke32.com/eduke32@7083 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:29:20 +00:00
terminx
75e141ec81 Fix potential buffer overruns in sdlayer
git-svn-id: https://svn.eduke32.com/eduke32@7080 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:29:04 +00:00
terminx
1f8b23152e Replace remaining instances of regular malloc/calloc/realloc/strdup with our memory error handler versions
git-svn-id: https://svn.eduke32.com/eduke32@7079 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-25 23:28:56 +00:00
terminx
9613bbac33 Use std::min and std::max instead of min and max macros.
git-svn-id: https://svn.eduke32.com/eduke32@7078 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-16 06:09:54 +00:00
terminx
ebcebbde5e Update engine headers so that argument names in function declarations match the actual function definitions. This also removes const from function declarations in cases when it isn't meaningful.
git-svn-id: https://svn.eduke32.com/eduke32@7073 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-16 06:09:20 +00:00
terminx
2e2731c119 Same sort of thing as the previous commits, but for the engine. Forward declaration cleanup and constification.
git-svn-id: https://svn.eduke32.com/eduke32@7072 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-16 06:09:09 +00:00
pogokeen
4b89c095e2 engine.cpp: fix crash when calling setrendermode 3 where PolymostProcessVoxels would be called before Polymost is initialized.
PolymostProcessVoxels would call videoNextPage during processing which would attempt to render the OSD and lead to a segfault due to Polymost not being properly initialized.

git-svn-id: https://svn.eduke32.com/eduke32@7067 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-10 21:04:42 +00:00
terminx
3e380309ce Replace error condition in rejectQueue_remove() with an assertion, because the NULL pointer it would return if something was fucked up would be unconditionally dereferenced in kdtree_add().
git-svn-id: https://svn.eduke32.com/eduke32@7058 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-10 19:14:56 +00:00
terminx
bcb1374391 Static analyzer says this condition is never true
git-svn-id: https://svn.eduke32.com/eduke32@7057 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-10 19:14:51 +00:00
terminx
15008d7aec Revert r7017. I misread the code mismeasured the result.
git-svn-id: https://svn.eduke32.com/eduke32@7056 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-10 19:14:46 +00:00
terminx
7763a379ef Revert part of r7031 and fix the issue a different way
git-svn-id: https://svn.eduke32.com/eduke32@7053 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-10 19:14:31 +00:00
pogokeen
f876e8ad0c polymost.cpp: temporarily disable experimental r_enablepolymost2 cvar
git-svn-id: https://svn.eduke32.com/eduke32@7050 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-10 15:08:08 +00:00
pogokeen
0b41a17f6b polymost.h: fix order of parameters to match polymost.cpp
git-svn-id: https://svn.eduke32.com/eduke32@7049 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-10 14:37:06 +00:00
pogokeen
d291a81ccd polymost.cpp: fix lockup bug that would occur with polymost_waitForSubBuffer() when glClientWaitSync consistently returned GL_WAIT_FAILED on certain hardware/drivers.
Additionally, fix conditional check for r_persistentStreamBuffer requirements in polymost_glinit().

git-svn-id: https://svn.eduke32.com/eduke32@7048 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-10 14:37:03 +00:00
terminx
3689f9c70c Useless yet innocuous sdlayer fixes
git-svn-id: https://svn.eduke32.com/eduke32@7045 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:23:44 +00:00
terminx
78a3797295 Use a local variable in SDL_GL_ATTRIBUTES macro instead of relying on it being declared in the function calling the macro
git-svn-id: https://svn.eduke32.com/eduke32@7044 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:23:39 +00:00
terminx
f5928ad5c7 Correct some fuckery in inflineintersect()
git-svn-id: https://svn.eduke32.com/eduke32@7042 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:23:29 +00:00
terminx
f7c8eab261 Further revise a couple of null pointer checks in Polymost
git-svn-id: https://svn.eduke32.com/eduke32@7041 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:23:25 +00:00
terminx
217849b2a3 OSD strtoken maintenance
git-svn-id: https://svn.eduke32.com/eduke32@7040 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:23:20 +00:00
terminx
e6039031fe Variable scope reduction. This commit is boring as fuck.
git-svn-id: https://svn.eduke32.com/eduke32@7032 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:22:41 +00:00
terminx
3082d381b9 Fix more possible null pointer dereferences in mdsprite
git-svn-id: https://svn.eduke32.com/eduke32@7031 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:22:36 +00:00
terminx
a3bfaed262 Mostly useless const-ifying and minor variable scope reduction in cache1d
git-svn-id: https://svn.eduke32.com/eduke32@7030 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:22:32 +00:00
terminx
c2f26439d1 Fix filename string bounds check in kzipopen()
git-svn-id: https://svn.eduke32.com/eduke32@7029 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:22:27 +00:00
terminx
eb08f1443e Pass vec2_ts to get_screen_coords() by reference instead of by value
git-svn-id: https://svn.eduke32.com/eduke32@7027 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:22:17 +00:00
terminx
eeba7847eb Hoist strlen() outside loop in kzopen()
git-svn-id: https://svn.eduke32.com/eduke32@7025 1a8010ca-5511-0410-912e-c29ae57300e0
2018-10-07 05:22:08 +00:00