Commit Graph

869 Commits

Author SHA1 Message Date
Christoph Oelckers 55a879fcc0 - put EDuke frontend source into a namespace.
This commit does not work yet!
2019-09-21 22:53:00 +02:00
Christoph Oelckers 30c47a8511 - include namespace file in all sources as the very first include. 2019-09-21 20:59:54 +02:00
Christoph Oelckers 5050716bc0 - removed most extern "C" from the rest of the code base. 2019-09-21 20:14:34 +02:00
Christoph Oelckers a2b429ffe0 - removed unused declaration. 2019-09-21 13:16:02 +02:00
Christoph Oelckers 998ac01157 - manual merge of all NBlood changes that couldn't get cherry picked. 2019-09-21 13:02:17 +02:00
nukeykt 81f78c24b7 Implement rotate parameter for voxel definitions
# Conflicts:
#	source/build/include/build.h
#	source/build/include/mdsprite.h
#	source/build/src/defs.cpp
2019-09-21 11:43:50 +02:00
nukeykt 90b005a44a Fix mouse centering in menu 2019-09-21 11:40:44 +02:00
nukeykt 78a3240c3e Fix flat sky y offset 2019-09-21 10:51:47 +02:00
nukeykt 68c7b8c402 Compile fix
# Conflicts:
#	source/build/include/build.h
2019-09-21 10:38:26 +02:00
nukeykt d3994b0801 Revise polymost HOM issue workaround in Duke's E1L1. Add code to remove very thin spans.
This commit does not gain noticeable rendering performance, but at least should prevent weird polygon leakages
2019-09-21 10:31:34 +02:00
nukeykt 935084ae52 More hacks to emulate old clipping
# Conflicts:
#	source/build/src/clip.cpp
2019-09-21 10:28:10 +02:00
nukeykt af2106c9d0 Finally Duke's DEMO1 is sync 2019-09-21 10:27:59 +02:00
nukeykt 05749679a8 I think this is enough 2019-09-21 10:27:59 +02:00
nukeykt 1aab7601df Add old lintersect implementation 2019-09-21 10:27:58 +02:00
nukeykt 5c099bea05 Start adding old collision code for demo compatibility.
DEMO2 and DEMO3 of Duke3D are sync again

# Conflicts:
#	source/build/src/clip.cpp
2019-09-21 10:27:58 +02:00
nukeykt e6ffc816c9 Fix blood crash
# Conflicts:
#	source/build/src/engine.cpp
2019-09-21 10:24:13 +02:00
nukeykt a90711f328 Add extra field to tilefromtexture
# Conflicts:
#	source/build/src/defs.cpp
2019-09-21 10:20:43 +02:00
nukeykt 14401ca694 Fix TROR NULL texture 2019-09-21 10:11:03 +02:00
nukeykt 107a630883 Add TROR rendering
# Conflicts:
#	source/blood/src/mapedit.cpp
#	source/build/include/editor.h
#	source/build/include/polymer.h
#	source/build/src/build.cpp
#	source/build/src/polymer.cpp
2019-09-21 10:11:02 +02:00
nukeykt 1fe344d273 Free cstat bit 14
# Conflicts:
#	source/blood/src/mapedit.cpp
#	source/build/src/build.cpp
#	source/build/src/engine.cpp
#	source/duke3d/src/astub.cpp
2019-09-21 10:10:15 +02:00
nukeykt 858da4351c Semi-working map save 2019-09-21 10:08:04 +02:00
nukeykt 140174d1ee Minor tweaks
# Conflicts:
#	source/blood/src/m32common.cpp
#	source/blood/src/mapedit.cpp
2019-09-21 10:08:04 +02:00
nukeykt 2867131c86 Add ability to load blood maps
# Conflicts:
#	platform/Windows/nmapedit.vcxproj
#	platform/Windows/nmapedit.vcxproj.filters
#	source/blood/src/mapedit.cpp
#	source/build/src/build.cpp
#	source/build/src/engine.cpp
2019-09-21 10:06:57 +02:00
nukeykt 8fd6e0e183 TROR related tweaks
# Conflicts:
#	source/blood/src/mirrors.cpp
2019-09-21 09:59:58 +02:00
nukeykt 388bf2665f Enable TROR code and rotated wall cstat bit for blood 2019-09-21 09:59:16 +02:00
terminx ce1a479ace Fix bugged height check in cliptestsector()
git-svn-id: https://svn.eduke32.com/eduke32@8118 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 23:25:39 +02:00
terminx 3e4f2de79a Add yax_getzsofslope(), based on getzsofslope_player()
git-svn-id: https://svn.eduke32.com/eduke32@8109 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 23:23:17 +02:00
terminx 062207b2e9 Fix polymost_dorotatesprite() clipping
git-svn-id: https://svn.eduke32.com/eduke32@8108 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 23:23:17 +02:00
hendricks266 47fc547532 Avoid a truncation warning in compat.h
git-svn-id: https://svn.eduke32.com/eduke32@8095 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 23:20:23 +02:00
hendricks266 1bd690c8c2 Fix warning in clip.cpp
git-svn-id: https://svn.eduke32.com/eduke32@8092 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 23:20:09 +02:00
hendricks266 475743424f Make sjson its own object
git-svn-id: https://svn.eduke32.com/eduke32@8091 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 23:19:58 +02:00
terminx 5708b36d26 Fix qradarang calculation
git-svn-id: https://svn.eduke32.com/eduke32@8088 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 23:18:47 +02:00
terminx d0a3b86c77 Fix relative aligned floor/ceiling texture wiggling
Patch from Nuke.YKT.

git-svn-id: https://svn.eduke32.com/eduke32@8087 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 23:18:00 +02:00
terminx aa8ce8d42a Fix USE_OPENGL=0 builds
git-svn-id: https://svn.eduke32.com/eduke32@8082 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 23:17:57 +02:00
terminx 7849693aef Bump BMAXPAGESIZE to 16384
x86 stuff will only ever return 4096, but 64-bit ARM supports 16K.

git-svn-id: https://svn.eduke32.com/eduke32@8077 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 23:17:21 +02:00
terminx c17db80734 Fix npot sky rendering in Polymost
Patch from Nuke.YKT.

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

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-20 23:16:01 +02:00
Christoph Oelckers d0a49c3278 - moved 4 more. 2019-09-20 23:12:07 +02:00
Christoph Oelckers b34c48962a - removed some unused files. 2019-09-20 22:55:44 +02:00
Christoph Oelckers 3b8b2b1fe0 - it compiles again. 2019-09-20 22:44:42 +02:00
Christoph Oelckers be29d3a2df - removed the remains of the polymer renderer.
This cannot be reused in its current form, maybe it can help later.
2019-09-20 22:37:24 +02:00
Christoph Oelckers 1b20e5d4da - 3 more files moved out of 'build' folder.
# Conflicts:
#	platform/Windows/build.vcxproj
2019-09-20 22:34:34 +02:00
Christoph Oelckers 977614dea8 - two more headers to move to Thirdparty. 2019-09-20 22:33:47 +02:00
Christoph Oelckers c9111a6c7a - one more.
# Conflicts:
#	platform/Windows/build.vcxproj.filters
2019-09-20 22:33:35 +02:00
Christoph Oelckers 0c6af775ad - got rid of editor.h.
# Conflicts:
#	source/build/include/editor.h
#	source/build/src/2d.cpp
#	source/build/src/softwarerenderer/engine_swr.cpp
2019-09-20 22:24:53 +02:00
Christoph Oelckers 46b4b6ffd4 - removed all editor related code from 2D.cpp.
# Conflicts:
#	source/build/include/build.h
#	source/build/src/2d.cpp
#	source/build/src/softwarerenderer/engine_swr.cpp
2019-09-20 22:24:03 +02:00
Christoph Oelckers a3b6485b5e - removed some more inline assembly. 2019-09-20 22:21:43 +02:00
Christoph Oelckers ce260526cb - moved fix16 to thirdparty as well and removed the now unused assembly files.
# Conflicts:
#	platform/Windows/build.vcxproj
2019-09-20 22:21:31 +02:00
Christoph Oelckers f3d01e8244 - moved compression utilities to a 'thirdparty' folder to get them out of the way.
# Conflicts:
#	platform/Windows/build.vcxproj
#	platform/Windows/props/build_common.props
2019-09-20 22:20:53 +02:00
Christoph Oelckers ba73268470 - removed GLES support and most related files.
My future plans do not include mobile support due tp poor support of modern APIs so this is essentially just baggage.

# Conflicts:
#	source/build/src/2d.cpp
#	source/build/src/dxtfilter.cpp
#	source/build/src/mdsprite.cpp
#	source/build/src/polymost.cpp
#	source/build/src/sdlayer.cpp
#	source/build/src/texcache.cpp
2019-09-20 22:16:21 +02:00
Christoph Oelckers 19bcfecc67 - get rid of the non-inlined assembly as well. 2019-09-20 22:11:01 +02:00
Christoph Oelckers 6299d2fe86 - removed all inline assembly crap.
Since no division function was handled here this is totally pointless on modern systems and will even on 32 bit cause performance degradation due to lack of optimizability.
The rest of that code in pragmas.h and pragmas.cpp should probably also be put under review. Much of it made sense 20 years ago but not anymore.
2019-09-20 22:10:35 +02:00
Christoph Oelckers b389c99bf5 - removed some SDL 1 parts. 2019-09-20 22:09:56 +02:00
Christoph Oelckers afe5128c70 - Blood fixes for changes in timer and mouse input interface- 2019-09-20 22:08:06 +02:00
Christoph Oelckers 5503ee98a0 - fixed bad merge 2019-09-20 22:06:15 +02:00
terminx c8d42af954 Flat parallax skies in Polymost
Patch from Nuke.YKT.

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

# Conflicts:
#	source/build/src/polymost.cpp
#	source/build/src/voxmodel.cpp
2019-09-20 21:15:14 +02:00
terminx 4b6123f303 Change a couple of memcpys to just clear the whole size of the array instead of computing the size at runtime
git-svn-id: https://svn.eduke32.com/eduke32@8073 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 21:10:43 +02:00
terminx c835219de0 Align cache1d memory blocks to system page size
git-svn-id: https://svn.eduke32.com/eduke32@8072 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 21:10:43 +02:00
terminx 4d20afa9ed Use integer math for Polymost rotatesprite
Patch from Nuke.YKT.

git-svn-id: https://svn.eduke32.com/eduke32@8069 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 21:10:41 +02:00
terminx de170848af Move r_borderless and r_displayindex definitions out of polymost.cpp and into baselayer
git-svn-id: https://svn.eduke32.com/eduke32@8065 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-20 21:10:39 +02:00
pogokeen b13c0f1b43 clockticks.hpp: Fix issue where higher precision comparisons would cause unexpected behaviour with game loop code due to ototalclock being incremented rather than set to totalclock (causing a lack of subtick precision and potential doubled up/dropped game updates).
Provide compareHighPrecision() for any code that needs higher precision comparisons.

git-svn-id: https://svn.eduke32.com/eduke32@8064 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 21:10:23 +02:00
terminx d0223fd744 Support fullscreening to the correct display in multiple monitor configurations
git-svn-id: https://svn.eduke32.com/eduke32@8063 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/include/baselayer.h
#	source/build/src/polymost.cpp
2019-09-20 21:10:22 +02:00
terminx f0ea646560 Fix SDL borderless windowed mode for real this time
Introduces r_borderless cvar. 0: never borderless, 1: always borderless, 2: borderless if resolution matches desktop resolution (default).

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

# Conflicts:
#	source/build/include/baselayer.h
#	source/build/src/baselayer.cpp
#	source/build/src/polymost.cpp
2019-09-20 21:09:56 +02:00
terminx cef3c33e5f clockticks header fix
git-svn-id: https://svn.eduke32.com/eduke32@8056 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 21:09:17 +02:00
pogokeen 222e593437 Change some clocks to support sub-tick precision using a new class, ClockTicks.
Using that higher precision, interpolate at a higher granularity.
Further, truncate the target interpolation time to vertical blank boundaries to avoid producing temporal artifacts.
Fix issues caused by interpolation calculations being handled differently in multiple places (and fix cases where smoothratios were being thrown away only to be redone without checking all proper conditions).
Ensure ClockTicks changes do not break other targets (EKenBuild, VoidSW), but note any interpolation there is not similarly updated.

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

# Conflicts:
#	source/build/src/build.cpp
#	source/build/src/sdlayer.cpp
2019-09-20 21:09:14 +02:00
terminx ec7fce9ff2 Ultra minor clipping stuff
git-svn-id: https://svn.eduke32.com/eduke32@8048 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 20:19:11 +02:00
terminx 8a01335c26 Don't consider CLIPCURBHEIGHT for ceiling clipping
git-svn-id: https://svn.eduke32.com/eduke32@8047 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 20:19:10 +02:00
terminx 1f5866295c This should be MAXSECTORS
git-svn-id: https://svn.eduke32.com/eduke32@8046 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 20:19:10 +02:00
terminx 6acf3a958e Remove EDUKE32_PREDICT_ macro usage in clip.cpp so the game doesn't stall if a weird clipping malfunction occurs
git-svn-id: https://svn.eduke32.com/eduke32@8045 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 20:19:09 +02:00
hendricks266 3b419e9d04 Fix mouse buttons 4 and 5 on Linux with SDL2, at least for 2.0.9 and up
git-svn-id: https://svn.eduke32.com/eduke32@8043 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 20:19:08 +02:00
terminx cbec65be68 Reduce stencil buffer size
Revert if it causes issues in anything.

git-svn-id: https://svn.eduke32.com/eduke32@8035 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 20:15:54 +02:00
terminx 78004b17de Ignore cstat 32768 sprites in map view
git-svn-id: https://svn.eduke32.com/eduke32@8034 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 20:15:53 +02:00
terminx 12cb46d94e Fix borderless windowed fullscreen mode
git-svn-id: https://svn.eduke32.com/eduke32@8020 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 20:14:07 +02:00
pogokeen fd41554ad7 timer.cpp: fix order of operations issue with timerUpdate()
git-svn-id: https://svn.eduke32.com/eduke32@8018 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 20:12:22 +02:00
pogokeen 0855428a0c timer.cpp: avoid using floating point arithmetic in timerUpdate()
git-svn-id: https://svn.eduke32.com/eduke32@8011 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 20:12:18 +02:00
Christoph Oelckers 20f5972b9b - fixed everything to compile again. 2019-09-20 19:37:29 +02:00
pogokeen 021e1358c7 timer.cpp: improve cross-platform & cross-compiler issues relating to precision & period.
Handle timerlastsample such that we don't throw away time & run slow in certain cases.
Ensure when calculating n, we do the double division first before multiplying for sake of floating point precision.

git-svn-id: https://svn.eduke32.com/eduke32@8009 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:12:31 +02:00
hendricks266 108a71cadb Update md3_vox_calcmat_common to solve a sporadic voxel flickering issue
Patch by Nuke.YKT.

git-svn-id: https://svn.eduke32.com/eduke32@8007 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:12:27 +02:00
terminx 7ea2e4de54 Revert "This should be enough for SDL controller hotplug support but I haven't tested it"
git-svn-id: https://svn.eduke32.com/eduke32@8005 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:12:23 +02:00
terminx 7ec6a6beca This should be enough for SDL controller hotplug support but I haven't tested it
git-svn-id: https://svn.eduke32.com/eduke32@8003 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:12:19 +02:00
terminx c72a69ff6f This timing stuff actually works
It doesn't help when it turns out the compiler is broken and implementing std::chrono::high_resolution_clock as something that only counts in ms instead of properly aliasing it to std::chrono::steady_clock!

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

# Conflicts:
#	source/build/src/sdlayer.cpp
2019-09-20 16:12:16 +02:00
hendricks266 25bdd9f6d5 Apply the BUILDART patch at long last.
git-svn-id: https://svn.eduke32.com/eduke32@8000 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:11:07 +02:00
hendricks266 1bbd251bff Rescan for controllers when toggling gamepads back on
git-svn-id: https://svn.eduke32.com/eduke32@7985 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:10:37 +02:00
terminx 04811f21f4 Replace separate timer implementations in SDL and Winlayer with a shared implementation based on std::chrono
git-svn-id: https://svn.eduke32.com/eduke32@7976 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	platform/Windows/build.vcxproj
#	platform/Windows/build.vcxproj.filters
#	source/build/src/mdsprite.cpp
2019-09-20 16:09:24 +02:00
terminx 55e3188afb There's no way this is correct.
git-svn-id: https://svn.eduke32.com/eduke32@7975 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/sdlayer.cpp
2019-09-20 16:08:12 +02:00
terminx f76ca0a361 Fix remaining casts to vec2_t/vec3_t
git-svn-id: https://svn.eduke32.com/eduke32@7973 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/build.cpp
2019-09-20 16:07:36 +02:00
hendricks266 b4362aa6a9 Implement controller defaults
git-svn-id: https://svn.eduke32.com/eduke32@7968 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:07:14 +02:00
hendricks266 3bfed33608 Add voxels option to menu, if at least one has been defined
git-svn-id: https://svn.eduke32.com/eduke32@7961 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/engine.cpp
2019-09-20 16:04:57 +02:00
hendricks266 284af9f5d9 Fix RENDERTYPE=WIN build
git-svn-id: https://svn.eduke32.com/eduke32@7960 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:04:43 +02:00
hendricks266 01fa02e1c0 Make use of SDL2's Game Controller API.
Thanks to JonoF for his take on this.

git-svn-id: https://svn.eduke32.com/eduke32@7958 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:03:49 +02:00
hendricks266 56998c4840 Report 16-bit analog axis precision to the game instead of arbitrarily truncating it to ~14.3 bits.
git-svn-id: https://svn.eduke32.com/eduke32@7956 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:03:45 +02:00
terminx 2ef83e4a71 This can overflow
git-svn-id: https://svn.eduke32.com/eduke32@7949 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:03:31 +02:00
hendricks266 e7723efcf4 Fix skipping to the end of def blocks
git-svn-id: https://svn.eduke32.com/eduke32@7938 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:03:06 +02:00
terminx 41ff733fcd Happier try_facespr_intersect()
I'm prejudiced against 30-line functions with statements nested 5 levels deep.

git-svn-id: https://svn.eduke32.com/eduke32@7933 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:02:56 +02:00
hendricks266 67b7d2408b newgamechoices
git-svn-id: https://svn.eduke32.com/eduke32@7930 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/defs.cpp
2019-09-20 16:02:49 +02:00
pogokeen 284adb6ac6 Fix issue with indexed colour textures where in the case that tiles entered the texcache while !waloff[picnum] & were later (re)loaded, the earlier pth pointing to the tilesheet containing the blank tile would never be properly replaced with an updated gl texture.
git-svn-id: https://svn.eduke32.com/eduke32@7929 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymost.cpp
2019-09-20 16:01:54 +02:00
hendricks266 ea79d74953 Revert r7908 because it introduces a race on dabuf
git-svn-id: https://svn.eduke32.com/eduke32@7928 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:01:27 +02:00
terminx 0d431a390f Reverse the order video modes are sorted in
git-svn-id: https://svn.eduke32.com/eduke32@7922 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 16:01:14 +02:00
terminx 32cd1ae4dd Tweak the fatal engine initialization error and game already running dialog boxes a bit
git-svn-id: https://svn.eduke32.com/eduke32@7921 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/build.cpp
2019-09-20 16:01:11 +02:00
terminx b8f668aa9b Polymost projection changes to correct the perspective in widescreen and ultrawide resolutions.
Patch from Nuke.YKT and Fox.

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

# Conflicts:
#	source/build/include/polymost.h
#	source/build/src/polymost.cpp
2019-09-20 15:48:55 +02:00
terminx 40e54fdbbb Tweak how the semaphore used to detect multiple running copies of the game is utilized
git-svn-id: https://svn.eduke32.com/eduke32@7912 1a8010ca-5511-0410-912e-c29ae57300e0
2019-09-20 15:46:43 +02:00