Commit graph

767 commits

Author SHA1 Message Date
Christoph Oelckers
6a305748ff - removed some C cruft from compat.h. 2020-08-02 21:25:03 +02:00
Mitchell Richters
3d165ee182 - extend mulscale/divscale pragmas with double versions of each. 2020-08-02 21:20:54 +02:00
Mitchell Richters
9c8593018b - define new function calcSinTableValue() to calculate an equivalent sintable[] entry.
* Returns a true double result.
* Also supports fractional input for fractional input. That is, if `sintable[1]` = 50 and `sintable[2]` = 100, `calcSinTableValue(1.5)` = 75.
* Increased precision of `BANG2RAD` define to use double and not float.
* As such, revert addition of `sintablef[]`.
2020-08-02 21:20:54 +02:00
Mitchell Richters
4301706e00 - promote fclamp() and fclamp2() to double. 2020-08-02 21:20:06 +02:00
Mitchell Richters
7b8e40c7e1 - create sintable sintablef[2048] as sintables of doubles.
* Also change BANG2RAD define to be a double and not a float.
2020-08-02 21:20:06 +02:00
Mitchell Richters
4830989d32 - remove all code used to get current display's refresh rate.
* Serves no purpose in Raze or GZDoom and appears to only have been added to the backend to facilitate the older interpolation code that was excised in 893686709b.
2020-08-02 20:57:09 +02:00
Christoph Oelckers
b6cb0ce1a1 - consolidated shade to light conversion 2020-07-31 20:58:55 +02:00
Christoph Oelckers
b2f794bde5 - cache QAVs outside the file system as well.
- delete some voxel code that's software rendering only.
- apply Big Endian byte swapping for SFXs, as well, now that this no longer involves hacking the file system cache.
2020-07-27 19:37:02 +02:00
Christoph Oelckers
2dcaf25fea - put the entire CON parser into a class to make its state local to the caller 2020-07-20 18:43:49 +02:00
Christoph Oelckers
55feadd11c - render the weapons with the DrawTexture interface and properly handle rotatesprite's alignment modes 2020-07-16 13:23:26 +02:00
Christoph Oelckers
2fd2ad2212 - sky code cleanup and transitioning of Duke's. 2020-07-15 00:06:19 +02:00
Christoph Oelckers
1e9679aceb - removed faketimerhandler and the last static remains of EDuke's netcode. 2020-07-14 21:15:37 +02:00
Christoph Oelckers
af225abf80 ... 2020-07-14 21:05:26 +02:00
Christoph Oelckers
05abc262ba - removed libdivide for good and the unused C++ wrapper for fix16 along with it. 2020-07-14 20:57:42 +02:00
Christoph Oelckers
424716bb88 - say goodbye to libdivide! 2020-07-14 20:21:16 +02:00
Christoph Oelckers
f9c03760a3 - removed setuptile DEF command due to the hacky implementation and general uselessness of what can be done with it. 2020-07-14 17:47:11 +02:00
Christoph Oelckers
fedeec73c7 - cleaned out some unused parts of engine.cpp 2020-07-14 17:35:19 +02:00
Christoph Oelckers
5655015691 - YAX is also gone now. 2020-07-14 16:06:14 +02:00
Christoph Oelckers
1d9d1396ac - got rid of print.h (a.k.a. 'how not do design a text formatting library'.) 2020-07-14 15:41:19 +02:00
Christoph Oelckers
117e78cb3b - removed clipshape feature as it is a feature of modern EDuke32 maps only. 2020-07-14 15:36:25 +02:00
Christoph Oelckers
aa01adb2f1 - removed osd.h as it was merely a minimal wrapper around c_dispatch, giving some alias names.
Nothing that's needed when cutting ties to upstream.
2020-07-14 14:00:27 +02:00
Christoph Oelckers
2e05ff532b - got rid of the struct trackers.
They were only used for handling an undefined case in the renderer but the overhead and side effects were too severe.
2020-07-14 13:51:03 +02:00
Christoph Oelckers
7e261425bb - time to get rid of clockticks.hpp.
Aside from its non-existent license it was also not the correct way to handle more precise view interpolation.
2020-07-14 13:00:52 +02:00
Christoph Oelckers
481ac965cf - reverted ClockTicks to an integer so that interpolation can be reimplemented without it affecting the global game timer.
The entire method at use here is essentially not correct. Interpolation should be handled independently of the game timer directly based on the underlying clock, like in ZDoom.
There's interpolation bugs in the Build games that cannot be fixed if totalclock is used for it, but if we use something else we do not need a fractional totalclock.
2020-07-14 11:52:38 +02:00
Christoph Oelckers
6b86d7606f - safety commit - does not compile! 2020-07-07 13:19:09 +02:00
Christoph Oelckers
f2380f8829 - constant cleanup. 2020-07-06 13:26:26 +02:00
Christoph Oelckers
8a1206edbc Merge remote-tracking branch 'remotes/origin/master' into back_to_basics2 2020-07-05 11:55:41 +02:00
Mitchell Richters
bbacc9e816 - factor in xdimenscale and viewingrangerecip when calculating renderSetVisibility().
* Changes performed in 0bd460d9e3 didn't take into account xdimenscale and viewingrangerecip like the days of old and this wasn't picked up in d80a32d379 or d80a32d379, where the applied fixes only appeared to work because they worked for me at 2560x1440p.
2020-07-03 14:42:41 +02:00
Christoph Oelckers
fc017f5868 - removed unused editwall variable. 2020-06-26 20:28:57 +02:00
Christoph Oelckers
ed9b418db7 - deleted a bit more unused code.
# Conflicts:
#	source/games/duke/src/zz_config.cpp
2020-06-22 00:06:34 +02:00
Christoph Oelckers
e3153f143d hudweapon
# Conflicts:
#	source/build/src/engine.cpp
2020-06-22 00:05:07 +02:00
Christoph Oelckers
990cb2acb8 -'shoot' replaced.
# Conflicts:
#	source/build/src/palette.cpp
2020-06-21 23:24:49 +02:00
Christoph Oelckers
18d6a8e65d - another safety commit.
# Conflicts:
#	source/games/duke/src/zz_actors.cpp
2020-06-21 23:07:42 +02:00
Christoph Oelckers
e007b9bceb - safety commit 2020-06-21 23:07:41 +02:00
Christoph Oelckers
15c744f3da - movement code of the VM transitioned 2020-06-21 23:07:41 +02:00
Christoph Oelckers
577a800843 - the rest of sector.cpp, except for the input function. 2020-06-21 22:40:12 +02:00
Christoph Oelckers
92f5236b24 - more sector stuff. 2020-06-21 22:40:12 +02:00
Christoph Oelckers
c8cb0e4efd - the beginning of sector.cpp
The math backend functions have been moved out of Build because they originally have a good license.

# Conflicts:
#	source/build/src/mdsprite.cpp
#	source/build/src/polymost.cpp
2020-06-21 22:39:05 +02:00
Christoph Oelckers
8cc273955d - moveeffectors, actors.c complete. 2020-06-21 22:38:04 +02:00
Christoph Oelckers
7b75a0683a moveactors plus backing code. 2020-06-21 22:37:29 +02:00
Christoph Oelckers
89e555761d - guts and moves 2020-06-21 22:36:09 +02:00
Christoph Oelckers
c11963b41a - movesprite 2020-06-21 22:36:08 +02:00
Christoph Oelckers
1bb7da173a - removed a few more dependencies on Build includes. 2020-06-20 18:17:49 +02:00
Christoph Oelckers
686999381b - moved non-Build definitions out of baselayer.h. 2020-06-20 17:52:10 +02:00
Christoph Oelckers
15d869ccde -moved scancodes.h out of Build folder.
This file is from the Duke source and available under a good license so it can be moved to a better place.
2020-06-20 12:54:33 +02:00
Christoph Oelckers
198ed45357 - clean up redundancy 2020-06-20 10:58:47 +02:00
Richard C. Gobeille
1cab7b9765 engine: add divideu64()/divideu64_noinline() 2020-06-17 12:26:03 +02:00
Christoph Oelckers
2a29dbf793 - use backend independent code to render the camera textures. 2020-06-14 21:57:21 +02:00
Christoph Oelckers
a419181c36 - simplified screenshot code. 2020-06-12 00:39:06 +02:00
Christoph Oelckers
f2d075e0d0 - code cleanup. 2020-06-12 00:37:40 +02:00
Christoph Oelckers
a6545788a6 - do RR's lightning flash as a postprocessing effect. 2020-06-07 22:06:47 +02:00
Christoph Oelckers
f2a637418d - moved palette.cpp out of Build folder. 2020-06-07 13:06:18 +02:00
NY00123
ec11d22caf Use static instead of LUNATIC_EXTERN
# Conflicts:
#	source/build/include/build.h
#	source/duke3d/src/gamedef.cpp
2020-06-07 10:36:43 +02:00
NY00123
6a70389f1d Let's just use __fastcall instead of LUNATIC_FASTCALL
# Conflicts:
#	source/build/include/build.h
2020-06-07 10:36:04 +02:00
NY00123
cca922f023 Engine: Adjust krand for removal of LUNATIC
# Conflicts:
#	source/build/include/build.h
#	source/build/src/engine.cpp
2020-06-07 10:35:23 +02:00
NY00123
dba06d9601 Engine: Remove the LUNATIC-specific definitions
of engine_main_arrays_are_static, engine_v8 and Mulscale.

# Conflicts:
#	source/build/src/engine.cpp
2020-06-07 10:34:33 +02:00
Christoph Oelckers
f159496f6e - moved the ShadeDiv array into the lookup table and took the numshades-2 divisor out of the stored value.
The value was changed to allow easier reuse in scenarios where the size of the shade table does not matter anymore.
2020-06-05 23:18:21 +02:00
Christoph Oelckers
1e2a3da5fd - video base code unified.
# Conflicts:
#	source/core/rendering/v_video.cpp
2020-05-31 09:18:43 +02:00
Christoph Oelckers
cdcb25bc1f - use high level textures to render voxels. 2020-05-30 00:30:56 +02:00
Christoph Oelckers
cca4fc609f - texture code cleanup, mainly cppying layer data into the textures at startup to be able to use a real material system. 2020-05-29 23:33:26 +02:00
Christoph Oelckers
1bc744b77b - moved hictinting data into the lookup tables. 2020-05-29 20:15:42 +02:00
Christoph Oelckers
87a87c155d - moved to GZDoom's gl_hwtexture.cpp. 2020-05-29 01:03:01 +02:00
Christoph Oelckers
381e53017d - some hackery to make the camera textures in DN3D work again.
They depend on a deleted texture not writing to the depth buffer, but other parts in the engine like ROR surfaces depend on them writing a proper depth buffer value, so for now there is a global variable that allows to exclude a single tile from ever getting rendered.
2020-05-29 00:44:13 +02:00
Christoph Oelckers
72889540a5 - use GZDoom's gl_samplers.cpp 2020-05-28 23:48:50 +02:00
Christoph Oelckers
5e93b8f3e7 - fixed transparent color. 2020-05-28 08:31:08 +02:00
Christoph Oelckers
a3e6829817 - fixed Exhumed menu by adding a proper layout mode to the drawer instead of hacking the broken tile offsets. 2020-05-27 23:30:36 +02:00
Christoph Oelckers
193b940eef - palette code cleanup. 2020-05-27 22:19:02 +02:00
Christoph Oelckers
29db3febb8 - updated the platform code to be mostly identical with GZDoom 2020-05-26 00:08:26 +02:00
Christoph Oelckers
c4017de12f - updated to GZDoom's new texture management system. 2020-05-25 23:59:07 +02:00
Christoph Oelckers
55a3c62b59 - use GZDoom's 2D drawer.
Console and menu font colors are not ok yet, aside from that it works.
2020-05-25 17:11:32 +02:00
Christoph Oelckers
758e4ad7cb - stripped down the palette manager in the GL backend and let it use the data that's managed elsewhere.
This class is only needed to manage the palette textures used by the indexed render mode, all the rest is available globally.
2020-05-25 00:31:55 +02:00
Christoph Oelckers
531c68edfe - use GZDoom's font code to fix the crash issues and moved around some files in the PK3.
This pulls in a lot of Doom specific font setup, this can be sorted out later as it won't get into the way.

# Conflicts:
#	source/CMakeLists.txt

# Conflicts:
#	source/glbackend/hw_draw2d.cpp

# Conflicts:
#	source/CMakeLists.txt

# Conflicts:
#	source/glbackend/gl_texture.cpp

# Conflicts:
#	source/CMakeLists.txt

# Conflicts:
#	source/build/src/palette.cpp
#	source/core/gamecontrol.cpp
2020-05-24 23:28:44 +02:00
Christoph Oelckers
6bffdf80a1 - finally managed to merge in the original texture system commit.
Game compiles and runs but transparency doesn't work yet.

# Conflicts:
#	source/CMakeLists.txt
#	source/core/menu/menu.cpp
#	source/core/textures/buildtiles.cpp
2020-05-24 22:53:14 +02:00
Christoph Oelckers
7a84887fc4 - transitioned FTexture.
Mostly working. Note: Brightmaps must be per-translation!
2020-05-24 19:12:22 +02:00
Christoph Oelckers
266364fc2e - properly implement texture offsets 2020-05-24 13:26:45 +02:00
Christoph Oelckers
498b19873d - split up textures.h. 2020-05-24 07:58:56 +02:00
Christoph Oelckers
b8a289bf61 - move brightmap handling to the common code.
# Conflicts:
#	source/common/utility/basics.h

# Conflicts:
#	source/build/src/palette.cpp
2020-05-23 22:43:05 +02:00
Christoph Oelckers
ae6403a205 - added a level of abstraction to the lookup table code to ease later refactoring. 2020-05-23 22:43:05 +02:00
Christoph Oelckers
f929419a0a - refactoring of the lookup tables. 2020-05-23 22:43:04 +02:00
Christoph Oelckers
daf77e55f7 - fixed compilation.
Much of this commit will have to be undone later, once the texture manager becomes available.
2020-05-23 22:43:04 +02:00
Christoph Oelckers
b971bc2717 - avoid using global palette settings when drawing 2D content with a custom palette.
Instead pass the palette info with the render call to avoid stale global state.
2020-05-23 22:43:01 +02:00
Christoph Oelckers
8d3199514d - removed some 'pragma' cruft. 2020-05-23 13:08:10 +02:00
Christoph Oelckers
d0406e27b6 - all base palette data has been transitioned to GPalette. 2020-05-23 12:31:05 +02:00
Christoph Oelckers
6f9ee4b60f - store palettes in the palette container. 2020-05-23 12:31:05 +02:00
Richard C. Gobeille
e2d79b4682 engine: add yax_getflorzofslope() and yax_getceilzofslope() 2020-05-22 17:01:36 +02:00
Richard C. Gobeille
94d098f8ef Fix a crash with tabledivide64()
Fixes #1.
2020-05-22 16:50:02 +02:00
NY00123
6fcb8f7a6a Add gethiq16angle and the getq16angle wrapper to the engine 2020-05-21 18:47:37 +02:00
Mitchell Richters
3749a89d6a Build: Change renderSetRollAngle() to take a float and not an int32_t. 2020-05-13 15:12:44 +02:00
Mitchell Richters
68a0ead5f0
- fix Linux builds following reset of master branch. (#44)
* - fix Linux builds following reset of master branch.

* - fix Linux Clang CI failure.

* - change '#ifdef __linux__' to '#ifndef _WIN32' as requested/required.

* - initialise batchrun in proper spot.
2020-05-05 10:45:21 +03:00
Mitchell Richters
1ce4081d37 - change 'refreshfreq' from int to double.
A double is already used in CalcSmoothRatio. Further to this, displays that use TV standard frequencies do not use perfect 60Hz frequencies, but frequencies such as 59.94Hz, 23.976Hz (precisely, 24*(1000/1001) = 23.9760239760239760...) etc.

Reference: 'https://www.ghacks.net/2010/04/28/59-hertz-refresh-rate/', 'http://www.paradiso-design.net/videostandards_en.html'.

# Conflicts:
#	source/build/include/baselayer.h
#	source/platform/posix/cocoa/i_main.mm
2020-04-16 00:03:00 +02:00
Christoph Oelckers
156a225ff4 - renamed global palookup variable.
Since the same word gets used in text messages and local variables in the game code it is easier this way to search for it and facilitate its transition to the translation table management in PaletteContainer.
2020-04-13 23:58:46 +02:00
Christoph Oelckers
fda4293013 - draw the movie franes outside of the tile system to reduce the palette maintenance.
The movie code has always been the part causing the most issues because it alters the palettes - the rest treats them as static data.
2020-04-13 23:58:45 +02:00
Christoph Oelckers
fac004b4d2 - palette code cleanup 2020-04-13 23:58:44 +02:00
Christoph Oelckers
8e87674d4c - backend code matching with GZDoom 2020-04-12 08:30:40 +02:00
Christoph Oelckers
5584c726ba - file system update and adjustment. 2020-04-12 08:30:40 +02:00
Christoph Oelckers
f671eb622f - migrated to GZDoom's utility code. 2020-04-12 08:30:39 +02:00
Christoph Oelckers
797640c494 - use ZDoom's memory allocation wrapper instead of EDuke's.
This simply plays nicer with the compiler's diagnostics.
2020-04-12 08:30:38 +02:00
Christoph Oelckers
66ecb05eb8 - use Printf as the only command to print to the console.
All uses of OSD_Printf, initprintf etc. have been renamed.
2020-04-12 08:30:38 +02:00
Christoph Oelckers
6ef93ba514 - match cmdlib.cpp/.h with GZDoom. 2020-04-12 08:30:36 +02:00
Christoph Oelckers
5af0217db7 - got rid of the software rendering blend tables. 2020-03-29 17:23:57 +02:00