Commit graph

373 commits

Author SHA1 Message Date
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
Mitchell Richters
55f688b13f - SW: Rename q16horz to q16horiz and q16aimvel to q16horz for consistency and to avoid confusion down the track. 2020-08-27 08:00:50 +10:00
Christoph Oelckers
e768a2bf24 - use new bitmask for weapon selection in Duke. 2020-08-26 23:02:55 +02:00
Christoph Oelckers
36d676ca20 - renamed ESyncBits so that the replacement can take that name later. 2020-08-26 22:39:15 +02:00
Christoph Oelckers
4e846f8d66 - do not print game init messages to the notify display. 2020-08-26 20:19:54 +02:00
Christoph Oelckers
f90d953ab5 default cl_smoothsway to false. 2020-08-26 17:23:08 +02:00
Christoph Oelckers
abf715eace - unified the packet structures of all games.
Currently the bit fields are still separate and they have to be merged, but for now the added memory does not matter.
Having this structure in the common parts will allow work on consolidating the input code, though.
2020-08-26 17:12:48 +02:00
Christoph Oelckers
c7f5f05e14 - cleaned up gamecvars.cpp and deleted a large amount of unused ones. 2020-08-26 17:05:17 +02:00
Mitchell Richters
4fcec5f6d3 - SW: Alt implementation for preparing a nuke.
* Given the original code in `pNukeAction()` (poorly named), the intent appeared to be that the weapon should go off-screen for preparation, returning once weapon initialised.
* Commit restores that behaviour behind a CVAR.

# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
2020-08-26 17:00:19 +02:00
Christoph Oelckers
b76168f673 - moved the main event processing functions into the global main loop.
Now, with all the Build timer stuff removed these calls were all identical between games.
2020-08-26 16:59:41 +02:00
Mitchell Richters
a9f556c1bd - SW: Restore random element to player's weapon left/right bobbing behind a CVAR.
# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
2020-08-26 16:45:42 +02:00
Mitchell Richters
88a49b0d22 - Duke: Restore RPG harsh recoil behind a CVAR.
# Conflicts:
#	source/core/gamecvars.cpp
#	source/core/gamecvars.h
2020-08-26 16:45:41 +02:00
Mitchell Richters
62388e30be - fix C_SetNotifyFontScale() for RR.
Fixes #264.
2020-08-26 22:33:19 +10:00
Christoph Oelckers
cc5e6d19c3 - fixed sound updating by moving the engine's UpdateSound call into the main loop.
This needs to be called unconditionally for every frame being rendered, not all of the game modules did that.
Placing this call here ensures that it is independent of anything the games do.
2020-08-26 04:10:16 +02:00
Christoph Oelckers
de871c9ab9 - use the game timer, not the Build timer for the sound eviction delay.
This is supposed to wait for two game frames to be on the safe side.
2020-08-26 03:50:07 +02:00
Mitchell Richters
ef728429e0 - Core: Remove legacy smoothratio calculator CalcSmoothRatio(). 2020-08-26 09:49:47 +10:00
Mitchell Richters
e0aaaf1f60 - All Games: Move gameclock and lastTic to gamecontrol. 2020-08-26 09:49:44 +10:00
Mitchell Richters
76776d24d7 - All Games: Remove use of ClockTicks and replace with int. 2020-08-26 09:49:42 +10:00
Mitchell Richters
1c8b0a20fb - Build: Remove all timer code. 2020-08-26 09:49:40 +10:00
Mitchell Richters
b883204f6a - All Games: Remove remaining use of totalclock and associated timing code. 2020-08-26 09:49:34 +10:00
Christoph Oelckers
6b0e1baf02 - added a timerUpdateClock call to the main loop so that Blood and Exhumed work again.
This may only be removed when nothing uses totalclock anymore. We're not there yet.
2020-08-25 21:24:45 +02:00
Christoph Oelckers
a323591d5a - call C_RunDelayedCommands() from a centralized place. 2020-08-25 21:16:37 +02:00
Christoph Oelckers
fd12ad382f - add shadows to the statistics display.
Fixes #256
2020-08-25 20:58:32 +02:00
Christoph Oelckers
5df0a7241f - disabled a few menu options for unsupported features in Exhumed.
Fixes #255
2020-08-25 20:40:30 +02:00
Christoph Oelckers
8256b54005 - applied a few fixes:
* removed the timer callback stuff that came back through the backdoor.
* do not use gameclock in the UI code - use the underlying timer directly.
* UpdateSounds must still use totalclock, until this can be refactored in its entirety.
2020-08-25 20:20:35 +02:00