Commit graph

1236 commits

Author SHA1 Message Date
Christoph Oelckers
94f40d11ae - SparseArrayView class
We need this to merge the game specific sector/wall extensions with the base but still allow the engine to access such arrays. For that they need a runtime settable stride.
2021-11-08 18:55:35 +01:00
Christoph Oelckers
13306e900d - silence some warnings. 2021-11-06 18:26:47 +01:00
Christoph Oelckers
9a1bcdbc84 - let's hope this works better.
CI complained about the iterator but the messages were very unclear about the problem.
2021-11-06 17:18:07 +01:00
Christoph Oelckers
19363ac23e - project contortions to make MSVC print our own deprecations but silence the ones from the compiler.
Since everything uses the same warning number, the old setup resulted in [[deprecated]] being silenced.
So this explicitly adds the needed #defines to silence the very noisy warning from the MSVC headers but leaves warning 4996 active otherwise.

In particlular this does:

* silence all warnings in the subprojects
* do not derive TIterator from std::iterator anymore as C++17 deprecates this.
* silence the above for RapidJSON because altering that code is not desirable.
* explicitly disable warning 4996 in some Windows files that call the deprecated (but still needed) GetVersionEx function.
* define _CRT_SECURE_NO_DEPRECATE, _CRT_SECURE_NO_WARNINGS and _CRT_NONSTDC_NO_WARNINGS through CMake to disable the CRT's deprecation and security warnings.

Currently this will print several (intended) deprecation warnings about 'updatesector' that point to code that needs to be changed but cannot yet without other refactorings being done first.
2021-11-06 16:48:31 +01:00
Christoph Oelckers
389f760d45 - address C++20 deprecation warnings with enums in floating point arithmetic. 2021-11-02 23:32:31 +01:00
Christoph Oelckers
86166f5e67 Revert "- xs_Float.h: Make all inlines return an unsigned value, and change previous unsigned inlines to signed."
Revert "- `xs_Float.h`: Add `getint()` getter to `_xs_doubleints` struct."
Revert "- SW: When adjusting horizon in `DoPlayerDeathHoriz()`, just use integer horizon values and not Q16.16."
Revert "- Duke (RR): Clean up some unnecessary `FixedToFloat()` usage with the `fixedhoriz` `asbuildf()` method."
Revert "- `binaryangle.h`: Use `constexpr` on inline functions where it was previously not possible to do so."
Revert "- `m_fixed.h`: Use `constexpr` on inline functions where it was previously not possible to do so."
Revert "- `xs_Float.h`: Convert header to `constexpr`."

This does nor work as it violates the constexpr rules for unions. The code will error out on compilation for accessing an inactive member of a union.
2021-11-01 20:25:38 +01:00
Mitch Richters
d9bbe1fa61 - xs_Float.h: Make all inlines return an unsigned value, and change previous unsigned inlines to signed.
* Removes situations where calling `xs_CRoundToUInt()` and other unsigned inlines would go through extra casts (`uint32_t` > `int32_t` > `uint32_t`).
* Because the native data in the `_xs_doubleints` struct is a union of a double and `uint32_t`, it makes sense to do everything unsigned and convert to `int32_t` if needed instead.
2021-11-01 23:57:40 +11:00
Mitch Richters
d1274e76dc - xs_Float.h: Add getint() getter to _xs_doubleints struct. 2021-11-01 23:42:49 +11:00
Mitch Richters
306c0a3ebb - m_fixed.h: Use constexpr on inline functions where it was previously not possible to do so. 2021-11-01 23:37:31 +11:00
Mitch Richters
a84aa84838 - xs_Float.h: Convert header to constexpr.
* Allow use of this library in static initialisers.
* Required re-arranging a little bit to order everything so inlines could be used without prototypes.
2021-11-01 23:37:31 +11:00
Christoph Oelckers
c7da8ca9d4 - fixed compilation on non-Windows.
In this header we must explicitly use the std:: namespace for min/max.
2021-10-30 11:38:55 +02:00
Christoph Oelckers
6e0fbb2043 - removed templates.h includes. 2021-10-30 10:51:03 +02:00
Mitch Richters
b02a6a3ec9 - Replace MIN() from templates.h with version provided in STL. 2021-10-30 10:36:15 +02:00
Mitch Richters
9894729fc2 - Replace MAX() from templates.h with version provided in STL.
# Conflicts:
#	source/common/textures/hw_ihwtexture.cpp
#	source/common/utility/templates.h
2021-10-30 10:36:02 +02:00
Christoph Oelckers
57b638f26f - use std::clamp instead of our homegrown version. 2021-10-30 10:35:00 +02:00
Christoph Oelckers
9071949a46 - backend upate from GZDoom
* Vulkan SDK and dependencies updated.
* better interface for buffers in the render backend.
2021-10-30 09:34:38 +02:00
Emile Belanger
14ebe23f0d Fix compilation with USE_GLES2 = 1 2021-10-25 17:50:48 +02:00
Emile Belanger
ff009cbf7a Re-enable depth clamping 2021-10-24 12:06:54 +02:00
Christoph Oelckers
d101a2b51f - removed pointless address check.
This array was once a pointer but the check was forgotten.
2021-10-24 08:26:10 +02:00
Emile Belanger
2a905e8026 Fix palette mode for GLES 2021-10-16 18:42:02 +02:00
Christoph Oelckers
46d2c52b19 - use correct math to access a texel's center for rendering voxels.
No idea if this was causing problem, but it surely wasn't 100% correct.
2021-10-13 00:12:58 +02:00
Christoph Oelckers
39319a9582 - fixed warnings in common code. 2021-10-08 19:07:56 +02:00
Christoph Oelckers
2348dd8848 - backend update from GZDoom
* GLES backend fixes.
* font colorization fixes.
* option menu spacing fix
2021-10-07 22:46:45 +02:00
Christoph Oelckers
49e0c461c2 - Backend update from GZDoom.
This is mainly bringing the GLES backend up to date.
2021-10-07 22:46:45 +02:00
Christoph Oelckers
a3d9cd9a68 - Backend update from GZDoom - mainly for GLES2 support. 2021-09-18 12:20:28 +02:00
Christoph Oelckers
585f841f96 - core shader override block, backported from GZDoom. 2021-09-12 18:18:26 +02:00
Christoph Oelckers
bad57f6a5f - clear pspAsArray at the beginning of a save/load operation, not at the end.
If done at the end it may leave behind some stale data if saving or loading fails for some reason.
2021-09-12 18:17:50 +02:00
Christoph Oelckers
6d958135e0 - give TMap a proper move constructor and assignment operator. 2021-08-23 19:05:31 +02:00
Mitchell Richters
1d0924e45a - Fix invocation name in FileSystem::GetLongName() error output.
* Thanks to @Gaerzi for spotting this.
2021-08-23 18:55:42 +10:00
Mitchell Richters
1ee6fd76c4 Merge branch 'blood-qavrework'
# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
#	source/games/blood/src/weapon.cpp
2021-08-23 11:02:09 +10:00
Mitchell Richters
907e0974e9 - Add GetLongName() method to FileSystem class. 2021-08-22 15:03:28 +10:00
Mitchell Richters
20ea0acbec - Add Contains() method to TArray class, returning a true/false bool as appropriate. 2021-08-21 13:34:58 +10:00
Christoph Oelckers
a5e3a85c98 - changed palette lookup to consider the remapping of color 0 to 255.
This is to ensure that black maps to the proper index, even if there's duplicates.
2021-08-14 10:26:04 +02:00
Christoph Oelckers
bad2c2e55f - backend update from GZDoom
* replacement of 'long' in string code.
* palette removal in V_GetColor.
* fixes to DShape2D buffer management.
2021-08-14 10:04:45 +02:00
Christoph Oelckers
c4c9f4acbe - call ColorMatcher.Pick instead of BestColor when remapping a voxel.
This was the only place in the engine using BestColor directly with the game palette.
2021-08-14 09:49:03 +02:00
Christoph Oelckers
5aa27bad3b - flag SW's cutscenes as 'boss death only'. 2021-08-13 22:25:13 +02:00
Christoph Oelckers
23b8707fc2 - added means to define resource IDs in all container formats allowing long file names.
To define these, construct a file name like "basename.{resourceid}.extension", e.g. blaster.{65}.qav will define 'blaster.qav' with a resource ID of 65.
2021-08-11 12:04:53 +02:00
Christoph Oelckers
b2f7eb5b4f - fixed: Raze did not have gl_lights yet, but recent additions need this CVAR.
Put it in v_video.cpp so that it is in a common backend file.
2021-08-11 12:02:56 +02:00
Christoph Oelckers
8106d788f6 - backend update from GZDoom.
Fixes:
* do not strip 'filter' as a directory prefix.
* proper spacing for scaled sheet fonts.
* fix of transparent color in BMF fonts.
* fix restart button on error pane in Windows.
* do not skip over empty 'if's with a condition that would error out.
2021-08-11 10:28:21 +02:00
Mitchell Richters
4a70f6efd0 - Allow ticrate to be specified to timer code, while still defaulting to GameTicRate. Move out I_GetBuildTime() from common code to gamefuncs.h as part of this.
* Allow specification of floating point ticrates as it's possible Blood's QAVs could have a fractional ticrate.
2021-08-05 14:52:55 +10:00
Mitchell Richters
0d9afc1aaf - Extend menu's ImageScroller ZScript class with mAnimated and use with Blood for the help and credits menu. 2021-08-05 14:52:51 +10:00
Mitchell Richters
1ed1222e10 - Extend menu's ListMenu ZScript class with mAnimated already natively available, and use with Blood where BloodDripDrawer is defined.
* Finalises the interpolated blood dripping code changes from 9884d5f396.
2021-08-04 10:31:45 +10:00
Christoph Oelckers
888f8888bb - backported some fixes in the common backend from GZDoom 2021-08-03 13:00:09 +02:00
Christoph Oelckers
c69efe5817 - fix crash issue with empty VOCs.
Pointer to empty data causes undefined behavior if length is 0.
2021-07-25 12:43:42 +02:00
Christoph Oelckers
c51c6fa524 - adapted the Zip root folder eliminator to deal with archives that do not add proper folder records to their central directory. 2021-07-25 12:18:53 +02:00
Christoph Oelckers
ccce75667e Revert "- Remove CVAR_NOINITCALL bit from gl_texture_hqresize* CVARs."
This reverts commit e03d532670.
2021-07-24 09:08:29 +02:00
Mitchell Richters
e03d532670 - Remove CVAR_NOINITCALL bit from gl_texture_hqresize* CVARs.
* Fixes https://forum.zdoom.org/viewtopic.php?f=340&t=72466.
2021-07-24 15:58:05 +10:00
alexey.lysiuk
56d313f08d - use SDL Vulkan window flag directly 2021-07-21 17:37:52 +03:00
Vanfanel
2aea69b48a Pass the missing fullscreen flag when creating a Vukan window. 2021-07-21 14:41:28 +03:00
Christoph Oelckers
a614f741fd - relaxed consistency checks for VOC files.
Rampage Warrior contains a few sounds that failed validation so this check does not exist in the original 3D Realms sound code.
2021-07-14 23:22:41 +02:00
Christoph Oelckers
8a8379f5fc - Backend update from GZDoom. 2021-07-11 09:50:36 +02:00
Christoph Oelckers
a98507f737 - fixed endless loop in replay gain analyzer when getting passed music with an unhandled sample rate. 2021-07-11 09:11:59 +02:00
Christoph Oelckers
e5cb1976d3 - disable texture name truncation for textures/ directory.
Unlike Doom, a similar limit does not exist here and must not be enforced. Any texture from this folder needs to be usable by its full name without extension to be able to replace named tiles.
2021-07-05 22:39:24 +02:00
Christoph Oelckers
5d67987fe1 - don't attempt to decode animation frames at offsets beyond the end of the current page.
Copied from EDuke32.
2021-07-02 20:33:53 +02:00
Christoph Oelckers
f0d2aef9d9 - fixed hires replacements for colorized font characters. 2021-06-01 11:29:39 +02:00
Christoph Oelckers
454816299e - reorganized loading of textures.
Due to dependencies on initializing some data in app_init it was not possible to cleanly set up the fonts.
This adds a game-side function for loading the entire palettes before starting with the texture data and another one for loading game-side texture data.
This now allows fully setting up the palettes before starting with the textures and to fully set up the textures before reading the .def files.

All this is needed because to properly initialize, the fonts need to be able to access the fully initialized texture state, including replacements and hires substitutions from the .def files.
2021-06-01 11:05:26 +02:00
Christoph Oelckers
25e57763af - implemented substitution for incomplete fonts. 2021-05-31 21:20:32 +02:00
Christoph Oelckers
d174b61c3c - allow switching between the two Duke BigFonts and fix Y in Duke's BigFont13. 2021-05-31 21:20:31 +02:00
Christoph Oelckers
af781e0422 - moved all font setup out of the C++ code.
All internal fonts now get defined through FONTDEFS.
Also fixing a few offsets.
2021-05-31 21:20:31 +02:00
Christoph Oelckers
42b70a7d93 - added internationalized fonts.
This still needs a bit of fixing and tweaking but most is working.
2021-05-31 21:20:30 +02:00
Christoph Oelckers
d7e1707b37 - removed the Doom specific font init code.
This has no use in Raze and only got in the way by enforcing unwanted defaults.
2021-05-31 21:20:28 +02:00
Christoph Oelckers
8fae793341 - defined a new constant, CR_NATIVEPAL, to use the font functions with a predefined palette.
This is mainly for code clarification, the value is the same as CR_UNDEFINED.
2021-05-29 11:47:05 +02:00
Christoph Oelckers
22be26bd2d - font system fixes. 2021-05-28 12:16:07 +02:00
Christoph Oelckers
d44500863b - removed the multiplayer scoreboard screens.
Since there is no plan to keep them in case MP gets implemented there's no need to maintain them.
These should later be replaced by a generic screen using a better font and a layout that takes higher resolutions into account.
2021-05-27 13:33:54 +02:00
Christoph Oelckers
4ff4fa643b - rewrote the default translation handling to be compatible with luminosity translations. 2021-05-25 12:59:09 +02:00
Christoph Oelckers
8b1757eee2 - got rid of most of the font system's baggage that's no longer needed.
Mainly this means that it's no longer necessary to reorder the palette to get working translated glyphs, so the FFontChar1 class and the TranslatedPic member and its invasive handling could all be cleaned out.
All font operations now take place on true color data, with the sole execption of FSpecialFont's 'notranslate' handling.
2021-05-25 12:59:09 +02:00
Christoph Oelckers
9769f346ec - refactored the special fonts away from BuildTranslation so that this function and the entire large heap of ugly baggage it drags in can finally be deleted.
Function is gone, baggage will come next.
2021-05-25 12:59:09 +02:00
Christoph Oelckers
372d425e01 - use luminosity translations for single lump fonts and let them use their original palette. 2021-05-25 12:59:08 +02:00
Christoph Oelckers
377829d6a2 - let hex fonts use the luminosity translations. 2021-05-25 12:59:08 +02:00
Christoph Oelckers
0bab333f36 - redid font translation so that it doesn't need to crush the font characters' color set to the base palette.
Right now it creates a special type of luminance translation that can operate on a true color bitmap.
2021-05-25 12:59:08 +02:00
Christoph Oelckers
b2545f8042 - PlayMusic script function. 2021-05-23 16:21:04 +02:00
Christoph Oelckers
d98a567597 - halt the game timer when setting up a cutscene and when starting movie playback.
These are both lengthy operations that can take several 100s of milliseconds, so when starting a streaming video they can throw off the timing quite significantly.
With this the intermissiondelay counter could be removed as it was only there to flush the accumulated time before starting video playback.
2021-05-23 14:36:54 +02:00
Christoph Oelckers
0c6e2f0c9e - silenced some warnings. 2021-05-22 15:34:04 +02:00
Christoph Oelckers
d7a47b2f3a - route all accesses to gameaction from the backend through the sysCallbacks.
gameactions are frontend specific so this needs to be decoupled.
2021-05-22 13:02:34 +02:00
Christoph Oelckers
6ae09f8ec9 - ported Doom's type-on text screens as a screen job overlay. 2021-05-22 12:08:08 +02:00
Christoph Oelckers
5337513044 - ported GZDoom's subtitle drawer to the cutscene framework.
For later use, this isn't used yet.
2021-05-22 10:26:53 +02:00
Christoph Oelckers
0d793a59fd - moved the cutscene core to 'engine'.
More adjustments for making this code compatible with GZDoom.
2021-05-22 02:15:49 +02:00
Christoph Oelckers
e10bcf6294 - split the screen job code into a generic and a Raze specific part.
Preparations for porting this to GZDoom.
2021-05-22 01:35:50 +02:00
Christoph Oelckers
1dff0502b0 - moved libvpx and libsmackerdec to more fitting places, plus some project cleanup. 2021-05-22 01:06:51 +02:00
Christoph Oelckers
16c6e2db05 - silence float truncation warnings for explicit casts. 2021-05-21 21:06:48 +02:00
Christoph Oelckers
4739c71b39 - PNG 16 bit support from GZDoom. 2021-05-21 21:06:11 +02:00
Christoph Oelckers
264d42179e - optimized the wall drawer a bit to avoid repeated calls to the render API's deoth bias function.
The setters in FRenderState should check if the value actually changes and the wall drawer should only call it for non-translucent wall sprites.
2021-05-21 19:07:22 +02:00
Christoph Oelckers
eae97ded1b - backend update from GZDoom. 2021-05-17 20:33:40 +02:00
Christoph Oelckers
60fe1d32fb - Blood: unpositioned sounds must be limited to one per channel. 2021-05-16 11:51:51 +02:00
Christoph Oelckers
781cb32dcf - fixed all issues with Duke's/RR's status bar. 2021-05-15 16:46:08 +02:00
Christoph Oelckers
f84f58e714 - ported Duke and RR status bars.
Compiles but not tested yet.
2021-05-15 14:27:32 +02:00
Christoph Oelckers
d311792e06 - engine side preparations for Duke Statusbar scriptification.
Mainly, gotweapon had to be reverted to a flat bool array to avoid implementing FixedBitArray for the VM.
Also adding a few new tile names and PushV for string arrays.
2021-05-15 10:44:35 +02:00
Christoph Oelckers
bdfe40af7c - properly terminate base64 data. 2021-05-13 22:28:36 +02:00
Christoph Oelckers
e5dd4a8638 - made the scripted version of Blood's status bar functional. 2021-05-12 21:50:02 +02:00
Christoph Oelckers
778378fd5c - scriptified version of Blood's status bar compiles.
Not tested yet.
2021-05-12 21:50:02 +02:00
Christoph Oelckers
783b94f922 - more warning fixes in 'core'. 2021-05-12 21:48:14 +02:00
Christoph Oelckers
499ed52972 - route savegame requests through the newwork, just like GZDoom does.
Although a bit overkill for single player saves only, this will ensure consistent behavior between both engines regarding the menu.
2021-05-12 00:21:26 +02:00
Cacodemon345
36b910a253 Fix compilation on OpenBSD 2021-05-10 08:25:14 +02:00
Christoph Oelckers
2f9e32f748 Merge branch 'newrenderer' 2021-05-06 17:04:35 +02:00
Rachael Alexanderson
7b45144023 - these changes were missing from the last Vulkan update 2021-05-06 04:27:58 -04:00
Christoph Oelckers
56fcf904b5 - Backend update from GZDoom. 2021-05-03 14:48:55 +02:00
Christoph Oelckers
8003ab6fa3 Merge branch 'scriptable_cutscenes' into newrenderer 2021-05-02 22:37:46 +02:00
Christoph Oelckers
4c2266ee88 - fixed incomplete SW ending cutscene. 2021-05-01 20:31:51 +02:00
Christoph Oelckers
4069a5096a - scriptified Exhumed's 2D content (minus the programmatic textures.) 2021-04-30 20:08:36 +02:00
Christoph Oelckers
3c27ec8cbd - tested all of Duke's and RR's cutscenes. 2021-04-30 20:08:33 +02:00