Commit graph

1528 commits

Author SHA1 Message Date
Christoph Oelckers
78be8f866b - always use the containing sector's fog when rendering sprites.
This is for consistency, otherwise sprites with a palette translation would stand out. Also use shade dependent fog density instead of a single global value.
Currently this only has an effect in true color rendering mode.
2020-09-20 20:39:11 +02:00
Christoph Oelckers
6776508239 - widescreen asset setup and consolidation of .def file loading. 2020-09-16 19:13:06 +02:00
Christoph Oelckers
5c777eeb38 - moved implementation of 'animtilerange' into buildtiles.cpp. 2020-09-16 19:13:05 +02:00
Christoph Oelckers
616838dd0a - little bit of cleanup on tileImport. 2020-09-16 19:13:05 +02:00
Christoph Oelckers
bc5d3eea88 - split the worker part for tileImportTexture out of the parser. 2020-09-15 01:21:17 +02:00
Christoph Oelckers
09a6534270 - redid scriptfile as a wrapper around FScanner
Another piece of Build licensed code gone, yay!
This will also allow gradual conversion of the DEF parser to our own code, unencumbered by the Build license. :)
2020-09-15 00:11:08 +02:00
Christoph Oelckers
e382690f9c - migrated defs error reporting to FScriptPosition
This not only prints better formatted texts, it also takes a lot of script maintenance out of the code.
2020-09-14 22:55:21 +02:00
Christoph Oelckers
8a7502c00d - I wish, MSVC flagged struct params to variadic functions properly…
XCode reported these as errors.
2020-09-14 22:44:21 +02:00
Christoph Oelckers
7395110ae9 - replaced brace loop condition in def parser with an inline 2020-09-14 00:19:20 +02:00
Christoph Oelckers
fe329b0870 - fixed voxel rendering in palette emulation mode. 2020-09-13 21:08:10 +02:00
Christoph Oelckers
aeeec61f39 - fixed light level setup in palette emulation mode. 2020-09-13 20:48:54 +02:00
Christoph Oelckers
0e58203d92 - fixed rintersect and removed some unused bits from engine.cpp. 2020-09-13 20:15:46 +02:00
Christoph Oelckers
a4754d7f34 - rewrote the map hack parser using sc_man.
This unexpectedly turned out a complete rewrite so now it is under my own license.
Also moved the remaining parts of map hack loading into the engine.

Overall I have to say that the feature is not what I expected, it's merely used to fudge the positioning of model sprites and for adding Polymer lights.
2020-09-13 13:01:44 +02:00
Christoph Oelckers
8ca0e9b97a - avoid using naked pointer for script positioning. 2020-09-13 11:28:32 +02:00
Christoph Oelckers
57a9419f8e - use FString for returning strings from the script parser.
This is mainly a preparation for merging the parser into sc_man, because sc_man does not keep token texts in a static variable.
This commit also fixes a handful of places that were flagged by the stricter conversion rules of FString.
2020-09-13 10:29:57 +02:00
Christoph Oelckers
aac87fc2cf - another unused function. 2020-09-13 09:45:37 +02:00
Christoph Oelckers
19a26f7959 - removed some unused code from engine.cpp.
Looks like editor utilities.
2020-09-13 08:30:03 +02:00
Christoph Oelckers
adf4a25b38 ... 2020-09-12 12:42:08 +02:00
Christoph Oelckers
16deb64e32 - fixed bad file checks in defs parser. 2020-09-12 12:39:18 +02:00
Christoph Oelckers
89316aea33 - demoted the SWCustom parser to the primitive Hexen interface after finding out that this is all the Build parser can do.
This also meant I had to add symbol support to the old style number parsers.
2020-09-12 10:23:47 +02:00
Christoph Oelckers
c4d7e68b4a - removed a bit more useless cruft from compat.h. 2020-09-11 19:45:17 +02:00
Christoph Oelckers
b2105f28e1 - replaced swapptr with std::swap. 2020-09-11 19:28:19 +02:00
Christoph Oelckers
d5b9a9ee43 Merge remote-tracking branch 'remotes/Github_private/InputStuffs' into back_to_basics2 2020-09-10 23:25:43 +02:00
Christoph Oelckers
9ce8202eb1 - Duke: Added a file check for the map to be entered when ending a level.
World Tour contains a map definition for E5L9 but no map for it.
2020-09-10 21:39:52 +02:00
Christoph Oelckers
41a2a63efd - moved the VP8 decoding loop into the movie player class and got rid of animvpx.
This allowed significant simplification of code data and many of the error checks could also be simplified because this player doesn't really need it all.
Also use nanoseconds to count frame delays, not milliseconds, as milliseconds can cause timing anomalies with common frame rates very easily.
2020-09-10 17:54:27 +02:00
Christoph Oelckers
83eba019b8 - added support for Megaton's widescreen assets.
Fixes #386
2020-09-10 00:05:10 +02:00
Christoph Oelckers
1a647e8104 - globally search and replaced TRUE and FALSE in SW.
There were a handful of warnings afterward which were also addressed.
The SWBOOL type has not been handled yet.
2020-09-09 19:52:52 +02:00
Christoph Oelckers
298949ceb8 - more compat.h cleanup
Its elimination is getting closer. :)
2020-09-08 18:48:18 +02:00
Christoph Oelckers
ec1c42b04a - got rid of common.h
All still relevant content was moved to places closer to its use.
2020-09-08 18:39:47 +02:00
Christoph Oelckers
18b39fd952 - first stage of generic automap code.
Lines and textures get rendered, not all colors are correct - sprites yet to do...
2020-09-06 20:49:43 +02:00
Christoph Oelckers
2395749192 - restored the automap texture drawer in the backend.
While ultimately this needs to be tossed into the deepest bowels of hell for being one gargantuan piece of bad code, it is still needed and does not really work when placed in a separate source file, due to its endless list of global dependencies.
2020-09-06 17:35:08 +02:00
Christoph Oelckers
809f8b5d4b - hooked up the new automap framework. 2020-09-06 12:44:58 +02:00
Christoph Oelckers
a6c92aec64 - removed all automap code from SW and the flat drawer from the backend.
This should have been the last parts of automap code.
Now on to rebuild this thing in a cleaner fashion...
2020-09-06 12:14:08 +02:00
Mitchell Richters
72771aeb40 - Fix broken krand() follow changes in 1354d52c05 due to truncation occuring from FixedToInt() inline function.
Very very sorry... :'(
Fixes #321.
2020-09-06 16:37:04 +10:00
Christoph Oelckers
d6b80bda52 - force the renderer to use radial fog.
Plane-distance based fog does not work with Polymost's projection settings - the distance value appears to be completely off and useless.
Fixes #243
2020-09-06 00:19:38 +02:00
Christoph Oelckers
b23424485a - re-implemented VP8 support.
Since the decoder cannot handle sound, there's two options:

1: Use the same sounds as the video it replaces.
2: If an identifiable streamable sound with the same base name is found, it will be played along with the video.
Fixes #133
2020-09-05 11:58:19 +02:00
Christoph Oelckers
8114309e89 - compat.h cleanup.
* use static_assert directly. Raze is C++17, no need for that macro shit.
* removed CONSTEXPR - I seriously fail to see the use here, many of the functions marked as CONSTEXPR cannot possibly even be constant evaluated so the declaration makes no sense. Removed most of these and replaced the valid ones with the official constexpr keyword.
* got rid of EDUKE_PREDICT_FALSE - this makes zero sense in script parsing code, at best it will save a few microseconds. Clean code wins.
* replaced Blrintf with xs_CRoundToInt. Shitty name is shitty name, even if derived from POSIX.
* replaced Bstr*casecmp with str*icmp. As these get defined in the CMake project based on actual compiler checks they are preferable here.
* removed lots of other stuff that is not needed with a minimum compiler requirement of C++17.
2020-09-04 21:24:48 +02:00
Christoph Oelckers
e5e8c02f1d - WIP level transition refactored to a game independent event system. 2020-09-04 19:43:35 +02:00
Mitchell Richters
1354d52c05 - Major cleanup of Q16.16 utilisation within games and engine.
* Remove fix16.h/cpp and utilise library from m_fixed.h.
* Extend m_fixed.h with two inline functions for int to/from float operations.
* Replace fix16_floor operations with those from xs_Float.h
* Replace multiple Q16.16 conversions from 0 to just be 0.
* Replaced all found in-game bit-shifts and multiplications/divisions with inline functions from m_fixed.h
* Replaced many casts of FRACUNIT as double in SW's panel.cpp as it is converted to double by way of type promotion.
* Fixed missed precision fixes in SW's panel.cpp where some types weren't declared correctly.
* Replaced 100+ `Cos()/Sin() >> 16` operations for Blood with inline functions `CosScale16()/SinScale16()`.
2020-09-01 23:00:47 +10:00
Christoph Oelckers
2f05a93547 Merge branch 'Packet' into back_to_basics2
# Conflicts:
#	source/core/gamestruct.h
#	source/games/duke/src/gameloop.cpp
#	source/games/duke/src/player_d.cpp
2020-08-31 00:09:56 +02:00
Christoph Oelckers
b8258da997 - cleaning out some trash from compat.h.
The header from hell...
2020-08-30 23:34:40 +02:00
Christoph Oelckers
c3fa9b76c4 - fixed: The render style must be set to a defined value at the start of rendering a scene. 2020-08-30 17:40:04 +02:00
Christoph Oelckers
0c455acaa2 - more work to switch over to the new loop.
Mainly separation of ticker and render calls
2020-08-30 10:42:44 +02:00
Mitchell Richters
c47b60e193 - Fix compile regression from 847fa48724.
Fixes #283.
2020-08-29 08:16:05 +10:00
Christoph Oelckers
847fa48724 - cleaned out the remaining parts of baselayer.h
In particular this means to remove the option to disable widescreen aspect ratios. The way this was handled makes no sense with the current render backend.

The aspect ratio code will have to be redone entirely to properly obey the backend's settings.
2020-08-28 09:06:49 +02:00
Christoph Oelckers
536e7455f2 - moved I_StartFrame to the top of the loop and cleaned up baselayer.hj 2020-08-28 08:44:44 +02:00
Christoph Oelckers
d73bf62465 Revert "- Set frame-time as close to the buffer swap as possible, and calculate smoothratio for Duke/SW as late as possible."
This reverts commit 97feb483ab.
2020-08-28 08:25:51 +02:00
Mitchell Richters
97feb483ab - Set frame-time as close to the buffer swap as possible, and calculate smoothratio for Duke/SW as late as possible.
* Micro-optimisation, but was getting a very occasional jitter in Duke 3D that seems to have gone with this.
2020-08-28 15:27:16 +10:00
Christoph Oelckers
4e846f8d66 - do not print game init messages to the notify display. 2020-08-26 20:19:54 +02:00
Mitchell Richters
76776d24d7 - All Games: Remove use of ClockTicks and replace with int. 2020-08-26 09:49:42 +10:00