Commit graph

1228 commits

Author SHA1 Message Date
Christoph Oelckers
e41db411e4 - made TFlags mostly constexpr 2021-12-30 09:56:46 +01:00
Christoph Oelckers
b3873be514 - added some utilities to the Plane class that will be needed soon. 2021-12-30 09:53:07 +01:00
Christoph Oelckers
411e3e6f9c - make SectionGeometry create some data. 2021-12-30 09:53:07 +01:00
Christoph Oelckers
b1bf12df9d - section fixes. 2021-12-30 09:53:06 +01:00
Christoph Oelckers
ad018db80a - new section builder. 2021-12-30 09:53:06 +01:00
Christoph Oelckers
6db1ba47c2 - SW: fixed some savegame issues:
* the saveable tables were initialized too late when reading in the actors.
* the abort messages for the saveables did not show. We need to use I_FatalError here, plus some actor list modifications to make this work.
2021-12-26 23:10:07 +01:00
Mitchell Richters
a4d165a84e - Tidy some specified bound equals destination size warnings from GCC. 2021-12-26 23:10:05 +01:00
Christoph Oelckers
74da3e5fa7 - added savegame support for the new actor management. 2021-12-26 23:10:03 +01:00
Mitchell Richters
38842994e0 - Remove the constructors from TObjPtr class.
They're not used in Raze and were preventing build issues under POSIX environment as you can't use constructor objects in anonymous aggregate types (unnamed structs, etc).
2021-12-26 23:10:02 +01:00
Christoph Oelckers
2d913982da - changed map loader to work without relying on spritetype::sectnum.
All access to this field is done through access functions now.
2021-12-26 23:10:01 +01:00
Christoph Oelckers
8ee5d1b0d7 - activated the garbage collector
This finally gets rid of all static storage for actors - so no more indices ever! :)
2021-12-26 23:10:00 +01:00
Christoph Oelckers
0dd756fa32 - added GC handling for all backend pointers in the map data.
GC is not active yet!
2021-12-26 23:10:00 +01:00
Christoph Oelckers
138690d34e - do not use auto to make local copies of TObjPtr's.
This will just copy the object without performing the read barrier on the source data which is not what we want here.
For these assignments the type must be explicit.
2021-12-26 23:09:59 +01:00
Christoph Oelckers
fa62b20d76 - GC setup for Duke. 2021-12-26 23:09:58 +01:00
Christoph Oelckers
97b19a5cb1 - adapted Blood's sound engine to using actors.
Note: Savegames won't work on this commit for the other games!
2021-12-26 23:09:45 +01:00
Christoph Oelckers
96b9572905 - moved parts of the HitInfo subclasses into the backend.
All the game code now needs to do is a single 'using' statement.
2021-12-26 23:08:57 +01:00
Christoph Oelckers
1665e340be - serialization support for BitArray. 2021-12-25 21:28:50 +01:00
Christoph Oelckers
7d2404ce76 - made sector a TArray. 2021-12-25 21:28:49 +01:00
Christoph Oelckers
94a37dfcdc - extended walltype to directly manage Blood's XWALL.
Unfortunately this had to be done in the base class so that we can still maintain the walls in a global array.
The tradeoffs of better abstractions would be far too costly here than the added 16 bytes to the wall struct.
2021-12-25 21:28:47 +01:00
Christoph Oelckers
e21f899989 - added all #includes needed to compile on Windows without using precompiled headers. 2021-12-14 12:24:09 +01:00
Christoph Oelckers
7e2431ebd8 - replaced the remaining content from compat.h 2021-12-14 10:15:58 +01:00
Emile Belanger
9e9bb66e9a GLES: Fix bias state 2021-12-11 13:44:23 +01:00
Emile Belanger
9e1e824f5e GLES: Fixed palette mode and interpolation 2021-12-11 13:23:39 +01:00
Emile Belanger
5a8c57040f GLES: Palette mode now GLES2 compliant. Interpolation not yet working. 2021-12-11 13:23:39 +01:00
Christoph Oelckers
a8c4d61fab - default-enable GL_DEPTH_CLAMP for the GLES renderer.
This brings it in line with the other backends.
2021-12-08 00:19:49 +01:00
Mitch Richters
7f1b8402d1 - Slight optimisation to I_GetInputFrac() by multiplying by inverse instead of dividing on a constant. 2021-12-07 20:02:11 +11:00
Mitch Richters
b6b0887611 - Fix missed flags pass-through in bool StartCutscene(const char* s, int flags, const CompletionFunc& completion) overload. 2021-12-07 19:59:19 +11:00
Christoph Oelckers
c2baa68160 - fixed camera textures breaking in SW when restarting a level.
This was caused by attempting to delete the camera textures when cleaning up the mirror array.
The Build tile manager was not prepared for such a use case and left a broken texture behind.

To allow this to function it now resets the texture replacement type when deleting a tile and to avoid creating new camera textures these will now be stored in a cache and recycled later.
2021-12-02 21:40:43 +01:00
Christoph Oelckers
f765783437 - various small bits of cleanup. 2021-11-29 00:57:11 +01:00
Christoph Oelckers
b54e52330c - Blood: don't play the same looped sound multiple times on the same actor.
This caused some strong echoing on E4M6.
2021-11-29 00:57:11 +01:00
Christoph Oelckers
1de9c63d45 - fixed center aligned rendering of 2D content.
This calculates the centered pivot point in integer texel coordinate space so for odd numbers it must round down instead of using a fractional position.
2021-11-29 00:57:10 +01:00
Christoph Oelckers
793aaf242c - make upscaling of sky textures depend on the single tile size, not the entire composite texture. 2021-11-29 00:57:10 +01:00
Christoph Oelckers
448db9c93d - enable texture upscaling in Polymost, disable it for the movie player's textures. 2021-11-29 00:57:10 +01:00
Christoph Oelckers
5bd53cbe8c - do not use clamp for calculation scale factors in Get...Scale.
These operations are not actual clamps and can assert on some implementations.
2021-11-29 00:57:09 +01:00
Christoph Oelckers
1bbbeb8f4c - Blood: reworked GetClosestSpriteSectors to use dynamic arrays, deleted unused GetClosestSectors.
# Conflicts:
#	source/games/blood/src/aibeast.cpp

# Conflicts:
#	source/games/blood/src/aibeast.cpp
#	source/games/blood/src/gameutil.h
2021-11-29 00:55:43 +01:00
Christoph Oelckers
01abe7b2ac - addressed most unused/uninitialized variable warnings from MSVC. 2021-11-29 00:55:30 +01:00
Christoph Oelckers
f7fdc5af41 - address several warnings reported by GCC 11. 2021-11-29 00:55:29 +01:00
Mitch Richters
e491d15ff9 - Move InputScale() out of inputstate.cpp and into i_time.cpp as I_GetInputFrac() to make it available to GZDoom for potential future requirements.
* As part of this, feed the output of `I_GetInputFrac()` to `gi->GetInput()` instead of having each game's virtual override calling it locally.
2021-11-29 00:55:01 +01:00
Christoph Oelckers
b7c7328cdd - backend update fromGZDoom.
most importantly this addresses issues with key down/key up events being sent in the same tic not having an effect on game actions that require a key being held down.
2021-11-21 10:19:52 +01:00
Christoph Oelckers
75e2d801a7 - SW: only check valid sectors for SecUser entries. 2021-11-11 21:58:14 +01:00
Christoph Oelckers
cc16c02baa - fixed BitArray constructor. 2021-11-11 21:55:46 +01:00
Christoph Oelckers
2840b5f25d - added reverse iterators to tarray.h 2021-11-08 18:55:46 +01:00
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