Commit graph

853 commits

Author SHA1 Message Date
Mitchell Richters
40a00be202 - SW: Remove inputScale const from processMovement(). Isn't needed anymore since input scaling in DoPlayerTurn() has been removed. 2020-09-07 20:25:26 +10:00
Mitchell Richters
3667116274 - SW: Uplift of DoPlayerHorizon() and PlayerAutoLook().
* Set `PF2_INPUT_CAN_AIM` explicitly where `DoPlayerHorizon()` would have been done within the original game.
* Replace original centering code and route `SB_CENTERVIEW` through the `SB_LOOK_UP`/`SB_LOOK_DOWN` code.
* With this commit, first person input is now nice again. Vehicle code still to be looked at.
2020-09-07 20:20:41 +10:00
Mitchell Richters
e84c8379d9 - SW: Uplift of DoPlayerTurn().
* Set `PF2_INPUT_CAN_TURN` explicitly where `DoPlayerTurn()` would have been done within the original game.
* Uplift the turn 180 code to full Q16.16.
* Eliminate stupid input scaling so input matches that provided by the input device.
* Ticrate angle adjustments outside of the player's control still to be uplifted.
2020-09-07 19:23:48 +10:00
Mitchell Richters
6e6373deda - SW: Remove camq16* variables from game and backend code that supported them.
* `cl_syncinput 0` is very raw at the moment.
2020-09-07 08:40:14 +10:00
Mitchell Richters
d1d40c6982 - SW: Move SW's input scaler into processMovement(). Doesn't need to be available to any other function. 2020-09-07 08:07:53 +10:00
Mitchell Richters
6c091a116f - SW: Fix issues from fa9fa88fce while merging back_to_basics2 into working branch. 2020-09-07 07:56:42 +10:00
Mitchell Richters
fa9fa88fce Merge branch 'back_to_basics2' into InputStuffs
# Conflicts:
#	source/core/gamestruct.h
#	source/games/duke/src/duke3d.h
#	source/sw/src/input.cpp
#	source/sw/src/player.cpp
2020-09-07 07:51:37 +10:00
Christoph Oelckers
57db150ed3 - SW: Fix player sprite on the automap.
Now where did that wrong number come from? I have no idea.
2020-09-06 23:30:19 +02:00
Christoph Oelckers
38cd38f0eb Merge branch 'automap' into back_to_basics2 2020-09-06 23:13:36 +02:00
Christoph Oelckers
1060d74e08 - SW's automap sprite drawer. 2020-09-06 21:50:02 +02:00
Mitchell Richters
cc3551dcaa - SW: Ensure player's fvel/svel is calculated using q16ang, and not camq16ang.
Fixes #328, again.
2020-09-07 05:21:00 +10:00
Mitchell Richters
613c32e6a2 - SW: Ensure player's fvel/svel is calculated using q16ang, and not camq16ang.
Fixes #328, again.
2020-09-07 05:19:49 +10: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
Mitchell Richters
c183143ec6 - SW: Clear out the local input buffer while paused like Duke does. 2020-09-06 21:57:33 +10:00
Mitchell Richters
07d4c78e1f - SW: Manually remove call to MoveScrollMode2D() in anticipation of branch automap being merged. 2020-09-06 21:55:37 +10:00
Mitchell Richters
46a12cf58a - SW: Clean up gi->GetInput() by removing some unneeded local variables. 2020-09-06 21:47:00 +10:00
Mitchell Richters
dfc3a13428 - SW: Finalise cleanup from remaining code in getinput() to processWeapopn(). 2020-09-06 21:46:26 +10:00
Mitchell Richters
e94bd9da04 - SW: Replace use of scaleAdjustmentToInterval() in lieu of backend solution from 290e615807. 2020-09-06 21:30:47 +10:00
Mitchell Richters
256e23673d - SW: Clean up all the game's scaling stuff in processMovement(). 2020-09-06 21:21:12 +10:00
Mitchell Richters
348be65399 - SW: Commence re-factoring getinput() into processMovement(), starting with top-most code. 2020-09-06 21:03:27 +10:00
Mitchell Richters
dd4251da09 - SW: Split getinput()'s input bits code into its own static function. 2020-09-06 20:52:58 +10:00
Mitchell Richters
ce160f7ac1 - SW: Split getinput()'s weapon code into its own static function. 2020-09-06 20:49:21 +10:00
Christoph Oelckers
809f8b5d4b - hooked up the new automap framework. 2020-09-06 12:44:58 +02:00
Mitchell Richters
0ef9da6a0c - SW: Make game's local input buffer static within input.cpp. 2020-09-06 20:19:29 +10:00
Mitchell Richters
722537a1f0 - InputState: Make CONTROL_GetInput() return an object instead of accepting a pointer and provide to games as a function parameter.
* Provide read-only/const results from `CONTROL_GetInput()` so games can't change received input.
* Change non-descript `info` to `hidInput` (Human Interface Device).
* Remove a few unused prototypes.
2020-09-06 20:18:26 +10: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
677efb20ba - SW: Don't check SB_RUN as player action in ChopsCheck().
Fixes #312.
2020-09-06 19:18:14 +10:00
Mitchell Richters
d73ea118df - SW: Get cl_syncinput 0 (default) working properly.
* Joystick input probably not appropriately scaled. Refactor is coming but lets just get the game workable for now.
* Fixes #328.
2020-09-06 19:17:58 +10:00
Christoph Oelckers
7dbae8b8f4 - enabled autosaves.
Fixes #55
This only creates them but does not auto-resume from them.
2020-09-05 22:39:27 +02:00
Christoph Oelckers
c1786001b2 - route all game state changes through game actions.
This is to avoid problems with the main loop not calling Ticker and Render in sync.
2020-09-05 15:43:34 +02:00
Christoph Oelckers
32ec9ff369 - consolidated crosshair drawing and added ZDoom's crosshair code.
For Exhumed this is the default, for the other games it is an option.
Fixes #269.
2020-09-05 13:57:26 +02:00
Christoph Oelckers
adbedd30c4 - consolidated the 4 functions for handling the automap zoom. 2020-09-05 00:58:25 +02:00
Christoph Oelckers
b54fd2f054 - fixed: Entering the menu from SW's intro may not stop the sound.
This is a singular special case, everything else must do it.
Fixes #335
2020-09-05 00:07:06 +02:00
Christoph Oelckers
b7db8b988d - SW: Ignore follow mode setting when not on the automap.
Fixes #311.
2020-09-04 22:54:11 +02:00
Christoph Oelckers
2e8b808683 - added a C_ClearMessages function for the console and fixed game restart after death.
Fixes #322
2020-09-04 22:23:38 +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
5bc80d2468 - macro cleanup 2020-09-04 21:17:24 +02:00
Christoph Oelckers
fd2ce0321e - transitioned SW to level change event system 2020-09-04 21:15:15 +02:00
Christoph Oelckers
b8d2d626ca - cleaned out some leftover network variables 2020-09-04 20:48:29 +02:00
Christoph Oelckers
e5e8c02f1d - WIP level transition refactored to a game independent event system. 2020-09-04 19:43:35 +02:00
Christoph Oelckers
8f0a885f63 - route 'give' through the network for all games. 2020-09-03 17:39:41 +02:00
Christoph Oelckers
fb334e7f1a - transitioned Blood's give command and changed SW's not to call the cheat handler. 2020-09-03 16:31:31 +02:00
Christoph Oelckers
3e5e956b72 - run most cheats through the network.
The remaining excpetions are the "give" CCMD and any level change action.
Unfortunately the implementation of most cheats is not multiplayer safe so right now it'd only be useful for demo recording (assuming that worked to begin with... ;))
2020-09-03 01:32:51 +02:00
Christoph Oelckers
a0874a26a7 - noclip cheat and splitting of Exhumed's cheat code into its own file. 2020-09-03 00:41:32 +02:00
Christoph Oelckers
66bf8113b8 - implemented the 'god' cheat as a network command.
This was mainly chosen as something simple to get the basics set up.
2020-09-03 00:29:17 +02:00
Christoph Oelckers
a222a7d7c9 - transitioned Shadow Warrior to new main loop.
Problem: Does not work yet with cl_syncinput = 0. Something about those angle and horizon settings is not right yet.
2020-09-02 20:58:37 +02:00
Christoph Oelckers
141b5c00cd - cleanup. 2020-09-02 20:58:37 +02:00
Christoph Oelckers
4d5e2f5bda - dead data removal in network.cpp and the player struct. 2020-09-02 20:58:21 +02:00
Christoph Oelckers
b3d4bab4dd - deleted sync.cpp. 2020-09-02 20:57:03 +02:00
Christoph Oelckers
621a1e0b3d - removed the packet averaging code.
This is also part of the backend code and won't be needed here anymore.
2020-09-02 20:57:03 +02:00