Commit graph

11890 commits

Author SHA1 Message Date
Mitchell Richters
b8b8e7a638 - Blood: Get synchronised input going in a testable way. This is not a complete re-factor, just enough to get it going. 2020-09-02 13:20:37 +10:00
Mitchell Richters
253d1a3989 - SW: Re-position actortime clocking.
I believe this is the right place and I got it wrong when doing e32cd81cc7. The change in this commit is more like where Duke times actortime.
2020-09-02 09:28:41 +10:00
Mitchell Richters
715a61adbd - Blood: Re-position actortime clocking and remove #ifdef guarded call to non-existent function.
I believe this is the right place and I got it wrong when doing e32cd81cc7. The change in this commit is more like where Duke times actortime.
2020-09-02 09:15:18 +10:00
Christoph Oelckers
921f4e54d9 - made a slash for the ammo display in Blood. 2020-09-02 00:45:27 +02:00
Christoph Oelckers
e5612b82c7 - fixed: The tile manager created its backup arrays before loading .def files.
This could let such textures disappear with the new main loop.
2020-09-02 00:36:49 +02:00
Christoph Oelckers
8d63e735d0 - transitioned Blood to the new main loop.
Mostly working but interpolation is not correct yet and for some strange reason the numbers on the HUD are gone.
2020-09-01 23:34:04 +02:00
Christoph Oelckers
35b14753e7 - "alternative weapon" should be active in all games except Exhumed. 2020-09-01 21:30:22 +02:00
Christoph Oelckers
7747fc7fb0 - rewrote the EndMgr in Blood to work as a screen job.
This removes the special handling for it in the main loop.
Some functions and variables in the kill and secret managers were also given more meaningful names.

Fixes #313
2020-09-01 21:27:32 +02:00
Christoph Oelckers
fda74a47b4 - use gFrameClock plus interpolation for third person view and tick the flash counter for the CTF HUD in the ticker, not the drawer.
This removes a lot of mess.
2020-09-01 20:15:34 +02:00
Christoph Oelckers
e320e79df0 - use gFrameClock in DoSectorLighting
The higher precision of gameclock went totally unused in here.
2020-09-01 20:12:02 +02:00
Christoph Oelckers
d0a3e1781e - Blood: eliminated gameclock in weapon draw code 2020-09-01 20:10:36 +02:00
Christoph Oelckers
4b45ee150f - Blood: replaced several uses of gameclock with gFrameClock
Mainly those which do not use its full precision.
Choke needs interpolation support, though.
2020-09-01 20:08:37 +02:00
Christoph Oelckers
b19681b50c - use gFrameClock plus interpolation for angles in viewProcessSprites
Both more reliable and precise.
2020-09-01 20:02:37 +02:00
Christoph Oelckers
0fa742f0ca - Blood: fixed some issues with precaching.
This code was still unaware of hardware rendering and created useless software buffers for some textures.
2020-09-01 19:59:15 +02:00
Christoph Oelckers
31fc39b051 - Blood code cleanup
deleting blocks of unused code, in particular some networking leftovers.
Also moving a few functions around
2020-09-01 19:49:05 +02:00
Christoph Oelckers
6726c19f9c - removed constexpr from FloatToAngle.
I overlooked the xs_CRoundToInt call in there.
2020-09-01 19:48:21 +02:00
Christoph Oelckers
c957397573 - undid the workarounds for undefined-ness of negative shifts.
For any mainstream platform that is totally irrelevant and besides, in C++20 it will be well defined and all current compilers on the relevant platforms treat it accordingly.
This is not worth deoptimizing the code.
2020-09-01 19:47:01 +02:00
Christoph Oelckers
dfb6c0d6fa - Blood: moved the precaching code to its own file. 2020-09-01 19:39:30 +02:00
Christoph Oelckers
0cc019686d - minor optimization of m_fixed.h
Use constexpr where possible to allow using these function in static initializers.
Avoid dividing by constant values. Better multiply with the inverse which is quite a bit faster.
2020-09-01 19:37:05 +02:00
Christoph Oelckers
763be58134 - tinkering with the savepic code.
This was definitely missing but it's not the cause of the empty savepic.
2020-09-01 19:21:00 +02:00
Mitchell Richters
3f886ad818 - SW: Fix change in 1354d52c05 that accidentally caused minor loss of precision in the panel code. 2020-09-01 23:35:00 +10:00
Mitchell Richters
9605e41f9f - SW: Fix Q16.16 operation not using m_fixed inlines. The one that got away... 2020-09-01 23:28:47 +10:00
Mitchell Richters
17da849add - SW: Get synchronised input going in a testable way. This is not a complete re-factor, just enough to get it going.
* Remove bool `PedanticMode`.
* Transition appropriate lines to `cl_syncinput`.
* Remove inlines added purely only to maintain DOS demo compatibility.
* Fix a few pedantic Q16.16 >> Int >> Q16.16 conversions.
2020-09-01 23:08:23 +10: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
d40e53eb53 - more Exhumed pitch change fixes. 2020-08-31 21:48:17 +02:00
Christoph Oelckers
6b1fa22aed - fixed view centering in Exhumed.
Switched to GDX's code because the one present here looked quite weird.
This still does not feature interpolation.
Fixes #296
2020-08-31 21:41:39 +02:00
Christoph Oelckers
8905c5ee26 - fixed Exhumed inventory menu strings.
Fixes #295
2020-08-31 20:59:29 +02:00
Christoph Oelckers
3204a3e5fc - negated the meaning of SB_AIMMODE.
This is because 'classic' aim mode will reset the view if the mouseaim key is not pressed.
The problem with this is that an empty input packet will trigger a view reset. If the meaning is inverted the default aim mode is free mouse view which doesn't try to alter any view state and is therefore preferable for an empty packet.

Fixes #292
2020-08-31 20:51:22 +02:00
Christoph Oelckers
ac5abd8aac - removed ready2send variable.
It's a leftover from the old netcode.
2020-08-31 20:25:08 +02:00
Christoph Oelckers
678b8223a9 - fixed some errors in the keybind definitions.
Fixes #291
2020-08-31 20:19:41 +02:00
Christoph Oelckers
fcdf2d7bd7 - "Smooth mouse movement" referenced the wrong CVAR.
Fixes #290
2020-08-31 20:05:17 +02:00
Christoph Oelckers
827c406437 - don't play activation sound when not having a Holoduke powerup. 2020-08-31 20:04:20 +02:00
Christoph Oelckers
f0ca87dc82 - fixed mixed up Holoduke messages.
Fixes #289
2020-08-31 20:01:55 +02:00
Christoph Oelckers
923833ccec - animated menus without frame rate cap
The frame rate cap is only deactivated if there's actual animations running so that leaving the game in the menu won't make the engine run at high frame rates.
Fixes #288.
2020-08-31 19:56:13 +02:00
Christoph Oelckers
54d65bfcfc - fixed some warnings 2020-08-31 19:28:05 +02:00
Christoph Oelckers
e5d963c515 - refactored third person view to only access the clock in its worker function
Timer values in interface code are undefined, these should not access anything that changes at real time.
Also use smoothratio to do the calculation in frame time, not tic time.
2020-08-31 19:27:22 +02:00
Christoph Oelckers
a8bb6ba515 - base the turbo turn timer on the actual level tic rate
This has a threshold that could lead to different behavior, depending on whether synchronized or unsynchronized input is used, it also used an undefined state of gameclock for its calculations.

By basing this on the levelclock consistency is ensured.
2020-08-31 19:23:05 +02:00
Christoph Oelckers
71c3441b1e - transitioned cloudclock.
This timer runs at 60 Hz in the render code, so it needs to take smoothratio into account.
2020-08-31 19:22:21 +02:00
Christoph Oelckers
9a208185d6 - levelclock increment after tick.
This ensures that the first tick always gets a value of 0.
2020-08-31 19:21:02 +02:00
Christoph Oelckers
bf4f538c61 - a few more places where gameclock could be substituted.
Nothing here needs higher precision.
2020-08-31 19:20:04 +02:00
Christoph Oelckers
2bf368d49b - redid the timer for the automap zoom
Add more precision and uncouple from the game timer
2020-08-31 19:18:53 +02:00
Christoph Oelckers
45a22eb3cd - do proper interpolation of the snorkel in RR. 2020-08-31 19:06:53 +02:00
Christoph Oelckers
03aad6559b - added a global leveltimer variable to Duke.
This timer only gets incremented by the main game ticker when the playsim is running.

This timer gets used for all playsim-related timing and animations so that these are decoupled from imprecisions in the global timer.
2020-08-31 00:33:41 +02:00
Christoph Oelckers
34104a74d8 reduce dependency of code on global gameclock variable
passing it as parameter to operateweapon*
2020-08-31 00:17:40 +02:00
Christoph Oelckers
007c6e122d - gameclock abstraction
This may need more work to have a reliable timer
2020-08-31 00:16:43 +02:00
Christoph Oelckers
7684f9e3e6 - fixed duplicate symbol error on macOS 2020-08-31 00:15:48 +02: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
00d35bc42c - fixed the number pulsing on Duke's and RR's HUD. 2020-08-30 22:52:50 +02:00
Christoph Oelckers
98557947da - gameclock must also be set before calling gi->Render.
This runs at the display's frame rate so the timer value from the Ticker call is not precise enough to do all the work.
2020-08-30 22:52:20 +02:00