Commit graph

397 commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
Mitchell Richters
5daaa1fc06 - fix issues with cl_syncinput 0. 2020-08-31 05:24:29 +10:00
Mitchell Richters
6f653da0fc - DBaseStatusBar: Create function DBaseStatusBar::CalcMagazineAmount() for use with calculating magazine values when drawing the HUD. 2020-08-30 20:24:37 +02:00
Mitchell Richters
aeb807bea1 - gamecvars.cpp: Create CVAR cl_showmagamt. 2020-08-30 20:24:37 +02:00
Mitchell Richters
e32cd81cc7 - Unify stat fps for all games. 2020-08-30 20:24:36 +02:00
Christoph Oelckers
3a7b23f655 remove unused stuff 2020-08-30 20:23:48 +02:00
Christoph Oelckers
765f211e05 - things are mostly working again.
Rendering produces an image again, input gets properly processed, but unsynchronised mouse input isn't properly applied yet.
2020-08-30 19:59:46 +02:00
Christoph Oelckers
ffe5b114f3 - the engine starts on the new main loop and is capable of running the intros and the menu, but not the game yet. 2020-08-30 12:49:21 +02:00
Christoph Oelckers
d59284c96b - transitioned Duke to the new main loop.
Everything compiles, but hasn't been tested. Doing a safety commit first.
2020-08-30 12:02:32 +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
Christoph Oelckers
367b4ce051 - this should be all we need from GZDoom to hook up the main loop. 2020-08-30 09:32:34 +02:00
Christoph Oelckers
49106c5b5e - Duke: Do not reset the global ticker.
The new main loop code cannot handle that. Instead set a start value for gameclock so that gameclock can be based on an arbitrary time value instead of directly representing global time.
2020-08-30 08:04:33 +02:00
Christoph Oelckers
34510ae9b3 - added ticker stub to the game interface. 2020-08-30 08:03:03 +02:00
Christoph Oelckers
d49aedacea - continued work on main loop - added a few new entry points to the game interface. 2020-08-30 00:55:49 +02:00
Christoph Oelckers
c0ebe3e08b - hooked up ZDoom's d_net.cpp file.
Still not active but this contains some code needed to do a proper main loop that can work with the networker.
2020-08-29 23:24:18 +02:00
Christoph Oelckers
fab561d757 - cleaned up Duke's main GameTicker function.
* moved the part that alters the input before queuing it to GetInput
* moved moveloop into the main function
* reshuffled a few things for better grouping by task.
2020-08-29 21:20:10 +02:00
Christoph Oelckers
e3839b01bc - removed in_mousesmoothing.
This not only was redundant with m_filter, even worse, it was in the wrong place.
Control_GetInput is used to read the current input state from the backend and can get called at uneven intervals, or even multiple times during the same frame, so smoothing the movement here can lead to erratic behavior.
With this change CONTROL_GetInput will return the same data unless it gets updated between calls.
2020-08-29 18:37:22 +02:00
Christoph Oelckers
56d0647412 - migrated the last 3 remaining UI controls to CCMDs. 2020-08-29 17:49:15 +02:00
Christoph Oelckers
eb34b41716 - fixed keyboard look in Blood. 2020-08-29 17:07:25 +02:00
Christoph Oelckers
694444b62a - converted the remaining input bits.
Looks like it is working in all games except Blood (not that it surprises me that it's Blood again which has issues...)
2020-08-29 13:32:55 +02:00
Christoph Oelckers
7659107b75 - removed SW's SK_AUTO_AIM for good.
When networking becomes a thing again this can be done as a server CVAR without such a messy approach.
2020-08-29 02:19:41 +02:00
Christoph Oelckers
3a9bcb0b64 - moved Exhumed's cheat bits back into the game module.
They are no longer part of the packet interface.
2020-08-29 02:17:28 +02:00
Christoph Oelckers
dc1f56e8f9 Merge remote-tracking branch 'remotes/Github_private/back_to_basics2' into Packet
# Conflicts:
#	source/core/inputstate.cpp
#	source/exhumed/src/exhumed.h
2020-08-29 01:19:48 +02:00
Christoph Oelckers
fe7f3a2f9e - handle the run key. 2020-08-29 00:57:07 +02:00
Christoph Oelckers
b9e0f493b2 - transitioned the 5 primary action keys: Open, Jump, Crouch and Fire/AltFire. 2020-08-28 23:25:08 +02: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
d62d2eaec7 - processed all remaining local input CCMDs and removed some bits only needed for multiplayer.
These MP bits should be reimplemented as network commands later, they only take up valuable space in the bit field.
2020-08-28 00:03:35 +02:00
Christoph Oelckers
ee7d558282 - removed the remains of sending pause with the input packets.
None of this was really working anymore, but will have to be rethought once a network stream exists again.
But even then, this is better sent as a separate command, and in MP only.
2020-08-27 22:38:52 +02:00
Christoph Oelckers
447573aa36 - consolidation of invprev, invnext and invuse. 2020-08-27 22:19:24 +02:00
Christoph Oelckers
43de0d8312 - consolidation of inventory item activation through hotkeys.
This also adds hotkeys for Exhumed which never implemented them.
2020-08-27 21:25:09 +02:00
Mitchell Richters
8bb13bc4c2 - InputState: Exclude volume keys from setting AnyKeyStatus to true. 2020-08-27 13:05:05 +02:00
Christoph Oelckers
10df3e094a - rework of weapon input to use common features in shared code.
This also adds stubs for all unimplemented features in the games for easier addition.
2020-08-27 00:53:35 +02:00
Christoph Oelckers
f597f7c265 - made the GameFunc constants global again.
With most of the more specific features being migrated to CCMDs the list is relatively clean now, with merely 2 buttons that are game specific.
2020-08-27 00:25:59 +02:00
Christoph Oelckers
4b299fa412 - Exhumed also handled. 2020-08-27 00:58:21 +02:00
Christoph Oelckers
99486cba7e - gave Blood the same treatment. 2020-08-27 00:21:11 +02:00
Christoph Oelckers
c7e667a17a - transition weapon selection in SW.
Thanks to the macro insanity for trivial operations in this code base this turned out to be a lot more troublesome than Duke...
2020-08-27 00:06:59 +02:00