Commit graph

943 commits

Author SHA1 Message Date
Mitchell Richters
f39939d114 - gamecontrol: Initial setup of PlayerHorizon struct and deployment within Duke.
* Started with the most complicated game first.
* Struct made up of fixedhoriz class units.
* Append currently outgoing function names with `2` at the end to avoid conflict.
2020-10-07 17:12:48 +11:00
Mitchell Richters
09a05f354c - Re-standardise horizon around 0 and not 100.
* Blood had this right. It makes sense that the horizon be based around as it's easier to work with.
* Removed all associated game math to deduct default horizon of 100 when doing weapon zvel etc, meaning actual horizon can just be used.
* Re-did return to center function to work on the already converted pitch. Return speed should be 1:1 with previous code.
2020-10-07 13:28:45 +11:00
Christoph Oelckers
0968a9d97e - renamed the Customizer to 'Delegate' because this works very much like a delegate in Objective-C.
- route menu sound calls through the delegate to better deal with differences between games.
2020-10-07 01:00:43 +02:00
Christoph Oelckers
603c3b50ec - reimplemented Blood's menu items. 2020-10-07 00:50:26 +02:00
Christoph Oelckers
06b00887f5 - added a menu control for Blood's dripping blood. 2020-10-06 23:49:34 +02:00
Christoph Oelckers
b8941a09ad - we need this... 2020-10-06 21:11:37 +02:00
Christoph Oelckers
d22bdf9dc7 - use an alias for the menu bar texture in Blood.
Direct tile access has been disabled for now, hopefully this can be buried deep in the engine for all eternity.
2020-10-06 20:05:51 +02:00
Christoph Oelckers
3dbb8cbb11 - safety commit 2020-10-05 21:47:53 +02:00
Christoph Oelckers
82612a1330 - it compiles again (with lots of code commented out.) 2020-10-04 20:11:02 +02:00
Christoph Oelckers
7661720585 - fixed Blood map loading
Whoever designed that map format with its idiotic encryption should burn in Hell >)
It's a needless complication and open invitation for errors.
To avoid follow up problems it now uses its own local struct for loading in the sprites and the global spritetype no longer depends on any map format and can be changed as the need arises.

Fixes #101
2020-10-03 18:35:47 +02:00
Christoph Oelckers
89d5d18b9e - these parts were missed somehow. 2020-10-02 22:42:54 +02:00
Christoph Oelckers
4e67197838 - added back the hijacked 'detail' member to spritetype.
This changes the Blood map loader to not use the in-game sprite structure for loading a level and moves the qsprite_filler array back into the sprite.
2020-10-02 22:18:08 +02:00
Christoph Oelckers
e8cd336f86 - same procedure for Blood.
This time there were 3 additional texts and the notify display, though, except for multiplayer content that wasn't touched yet.
The result is the same: No need to extend the tiny font with international characters
2020-09-29 22:20:25 +02:00
Christoph Oelckers
47c1c22ff7 - do not stop the music in the cross-game level-end handler.
Some maps require that it continues playing here.
2020-09-27 20:42:55 +02:00
Christoph Oelckers
3210dd5782 - fixed the noisiest value truncation warnings after shortly re-enabling them in the compiler, plus a few places where the warning pointed to incorrect code. 2020-09-26 11:59:24 +02:00
Christoph Oelckers
64607834f3 - Blood: fixed application of palette from the QAV data for HUD weapons. 2020-09-25 23:55:20 +02:00
Christoph Oelckers
89bc194035 - added shareware checks to the "start game" menus. 2020-09-25 19:36:50 +02:00
Mitchell Richters
9b12675f4e - processMovement(): Re-arrange parameter variables somewhat so game-specific parameters are at the end and to allow some common defaults so they don't need specifying. 2020-09-25 22:26:50 +10:00
Mitchell Richters
4ff3810711 - Blood/Duke/RR/SW: Improvements to 3rd person viewing by modifying the rendered player's posz so the camera is looking further above the camera sprite as EDuke32 does. Blood just enables the crosshair when using 3rd person view. 2020-09-25 17:52:00 +10:00
Mitchell Richters
04af1d9ce8 - All Games: Unify processMovement(). 2020-09-24 22:32:37 +10:00
Mitchell Richters
8690c633d8 - Blood: Add extra call to inputState.ClearAllInput() in StartLevel(). 2020-09-24 00:20:40 +10:00
Mitchell Richters
e078ea6ebd - Blood/Exhumed/SW: Hook up gi->clearlocalinputstate(). 2020-09-24 00:15:51 +10:00
Mitchell Richters
64113f8f9c - Blood/Duke/SW: Smooth out player's zpos adjustment while in 3rd person view. 2020-09-23 23:12:59 +10:00
Mitchell Richters
407b5346e3 - Blood: Fix issues taking damage following level transitions.
Fixes https://forum.zdoom.org/viewtopic.php?f=340&t=69919.
2020-09-23 13:28:07 +10:00
Mitchell Richters
d391e56d81 - Blood: Fix a few more issues following horizon change. Chase-cam now has proper z-pos. 2020-09-23 13:20:57 +10:00
Mitchell Richters
3d58a09aeb - Blood: Fix player's z-pos with changed horizon. 2020-09-23 08:54:19 +10:00
Christoph Oelckers
5e6317b8b9 Merge remote-tracking branch 'remotes/Github_private/Blood_InputReworking' 2020-09-22 23:32:28 +02:00
Christoph Oelckers
880b811e0d - rewrote map loader to work independently of data structure sizes.
This is needed to extend a few fields that are too narrow - e.g. the texture offset fields have no room for interpolating scrolling textures.
Blood not done yet, will also need to be changed to get rid of the limits.
2020-09-22 22:40:53 +02:00
Christoph Oelckers
43a9be0ad0 - removed Blood's loadboard replacement hook.
It never calls engineLoadBoard but always its own map loading function directly.
2020-09-22 22:38:08 +02:00
Mitchell Richters
2f9783150c - Blood: Correctly set playerHorizMin() and playerHorizMax() with respect to horizon changing from 0 to 100 like the other games (min used to be -180, max used to be 120). 2020-09-22 22:55:23 +10:00
Mitchell Richters
639ad46af1 - Blood: When dead, ensure player's horizon scales to max horizon value like before (old horizon was based on 0, not 100, so 100+120 is gi->playerHorizMax(). 2020-09-22 22:52:17 +10:00
Mitchell Richters
ac635ebd0f - Blood/RR: Replace a few playerSet*() calls with playerAdd*(). Because the setters continually set until target is reached, can cause some perceivable smoothness issues if ticker re-targets's player's angle/horizon before input code has reached target. 2020-09-22 22:50:27 +10:00
Mitchell Richters
f168373ecf - Blood: Repair some ROR regressions from 31fc39b051.
Potentially addresses #87 and #88.
2020-09-22 18:14:43 +10:00
Mitchell Richters
46810ec490 - fix a few places where Q16.16 values were downscaled, only to be scaled back up again. 2020-09-22 15:51:48 +10:00
Mitchell Richters
31bb9e4d8d - Blood: Open up MAXHORIZVEL to SW levels to compensate for removal of q16horz scaling in previous horizon code. 2020-09-22 07:46:30 +10:00
Mitchell Richters
d40a2d3e95 Merge branch 'back_to_basics2' into Blood_InputReworking
# Conflicts:
#	source/blood/src/hudsprites.cpp
#	source/exhumed/src/status.cpp
#	source/games/duke/src/game_misc.cpp
#	source/sw/src/draw.cpp
2020-09-22 07:34:39 +10:00
Mitchell Richters
9859571ded - DrawCrosshair(): Factor in Blood's adjustable horizon which defaults to 90.
* Fixes https://forum.zdoom.org/viewtopic.php?f=340&t=69920.
2020-09-22 07:29:52 +10:00
Mitchell Richters
5c097c4a74 - Blood: Fix player's slope with horizon now based on 100 and not 0. 2020-09-22 07:13:48 +10:00
Mitchell Richters
59e4fae064 - Game input: Fix miscellaneous issues.
* Duke/RR: Fix `SB_CENTERVIEW` not clearing while `cl_syncinput 1`.
* Duke/RR: Remove superfluous call to `apply_seasick()`.
* RR: Change two calls from `playerSetAngle()` to `playerAddAngle()` Updated version of `playerSetAngle()` doesn't stop setting angle until target is reached, a bit too strict for this and compromised vehicle turning.
* `applylook()`: Remove dead flag. Was only used with Duke, no other game called the function when dead anyway. Since the input helpers are processed outside of `applylook()` now this is not needed.
* `applylook()`: Extend function with a bit of commentary.
2020-09-21 17:12:53 +10:00
Mitchell Richters
f806cdcec6 - Blood/Duke/RR/SW: Unify the player's angle/horizon helper functions. 2020-09-21 17:12:51 +10:00
Mitchell Richters
7bf1cacc7f - Blood/Duke/RR/SW: Unify the player's angle function.
* For Blood/SW, exposes `SB_LOOK_LEFT`/`SB_LOOK_RIGHT` to games, hooking up `q16look_ang` and `q16rotscrnang` within.
* For SW, use Duke & Blood's return to center function and remove `PF_TURN_180` bit.
* For RR, replace a few misused bits with some bools inside of `player_struct`.
* Since bulk of functionality is sourced from Duke (30Hz), apply proper scaling so SW speed matches (40Hz).
2020-09-21 17:12:26 +10:00
Christoph Oelckers
3810c4cb51 - Blood: instead of running the indexer after saving a state, just save the pointer before indexing to directly restore it. 2020-09-20 22:00:39 +02:00
Mitchell Richters
0ab3b33a6c - Blood/Duke/RR/SW: Unify the player's horizon function.
* For Duke/SW, we continually apply `SB_CENTERVIEW` only if it was previously a toggled action, similar to Blood.
* For SW, we remove two SW-specific bits (`PF_LOCK_HORIZ` and `PF_LOOKING`) that are no longer needed.
* For Duke, we remove `return_to_center` and just use the `SB_CENTERVIEW` action bit as required.
* For `sethorizon()`, feature set and adjustment speeds are an averaged out accumulation across Duke/SW:
** GameTicRate is factored in for adjustment decisions to provide consistency for SW being the faster game.
** Adjustment amounts are half way between Duke/SW.
2020-09-20 20:01:36 +10:00
Mitchell Richters
0c4fe5f91b - Blood: Fix remaining issues such as starting horizon, remove q16look and clean up some remaining bits in nnexts.cpp. 2020-09-20 16:21:40 +10:00
Mitchell Richters
f7957fc237 - Blood: Factor in game's tic-rate when aiming/looking up/down.
* Doesn't matter for Blood, but will matter for SW in a unified approach. Might as well get it right here.
* Appreciate the literal doubles in lieu of the enums isn't great, but this function will go into the backend in due course.
2020-09-20 16:21:38 +10:00
Mitchell Richters
d2501007f2 - Blood: Adapt uplifted DoPlayerHorizon() from SW to Blood.
* Horizon now standardised on 100 like the other games.
* Need to determine where/why/how the player's horizon is starting out at 0 and get it to init at 100 like the other games.
2020-09-20 16:21:36 +10:00
Mitchell Richters
6a091deb67 - Blood: Re-apply input scaling removed in 495c522096e0c9b31bdf6952e612bc3d03030da2 until the entire return to centre function is standardised across games. 2020-09-20 16:21:31 +10:00
Mitchell Richters
40bbb61239 - Blood: Get death chase-cam going while unsynchronised using input helpers. 2020-09-20 16:21:28 +10:00
Mitchell Richters
6e4ee9e975 - Blood: Forbid unsynchronised input if dead. 2020-09-20 16:21:26 +10:00
Mitchell Richters
85e81c94c7 - Blood: Bring in SW's input helpers and hook up within input code. 2020-09-20 16:21:23 +10:00
Mitchell Richters
db7793bf54 - Blood: Clean up remainder of control.cpp in-line with Duke/SW.
* Split input bits and movement into separate functions.
* Reordered movement to be more like Duke/SW for ease of comparison.
* Removed a global.
* Removed a few includes.
2020-09-20 16:20:20 +10:00
Mitchell Richters
9c56dfffe0 - Blood: Apply horizon input outside of pPlayer->q16look and fix some incorrectly declared types.
* Looking up/down is a bit rough at first as q16look is disproportionate to where the player is currently looking.
* Won't be an issue with a unified horizon algorithm in the backend.
2020-09-20 16:20:18 +10:00
Mitchell Richters
eb0bd9638b - Blood: Re-implement unsynchronised q16horiz. 2020-09-20 16:20:16 +10:00
Mitchell Richters
ae5b6b6a91 - Blood: Re-implement unsynchronised q16ang. 2020-09-20 16:20:14 +10:00
Mitchell Richters
547bf110b2 - Blood: Create high-precision Sinf() and Cosf() inlines and use for player's horizon, using calcSinTableValue() from the backend, bypassing game's costable[]. 2020-09-20 16:20:12 +10:00
Mitchell Richters
c38c1cb1f1 - Blood: Re-do interpolating code in viewDrawScreen() in preparation for returning unsynchronised input.
* Changed config so `cl_interpolate` bool doesn't apply to player's overall movement. While it might be handy for debugging moving sector objects, I see no valid reason why there'd be a need to ever un-interpolate the player's position.
2020-09-20 16:20:10 +10:00
Mitchell Richters
20c73e1249 - Blood: Remove r_horizcenter and standardise horizon in game to that of the default in the backend (currently 100).
* The use of this will go when the input is re-factored to operate on the standard horizon of 100, not 0.
2020-09-20 16:20:08 +10:00
Mitchell Richters
4d47fe7e85 - Blood: Remove bVanilla. 2020-09-20 16:20:06 +10:00
Mitchell Richters
c835d9cadc - Blood: Revert upstream unsynchronised input implementation. 2020-09-20 16:20:04 +10:00
Mitchell Richters
20f94c5895 - Blood: Use backend input scaling. 2020-09-20 16:20:00 +10:00
Mitchell Richters
5e484bddad - Blood: Make gInput static within controls.cpp. 2020-09-20 16:19:58 +10:00
Christoph Oelckers
6776508239 - widescreen asset setup and consolidation of .def file loading. 2020-09-16 19:13:06 +02:00
Christoph Oelckers
d1293da8dc - connecting the dots for Blood's special tile features. 2020-09-15 01:27:24 +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
b4c297da2e - Blood: select inventory item when using it.
Fixes #310
2020-09-11 19:58:16 +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
83eba019b8 - added support for Megaton's widescreen assets.
Fixes #386
2020-09-10 00:05:10 +02:00
Christoph Oelckers
b52a2b0d9a - set up the loadscreen code.
This isn't active, though, because load times are so short these days that all this results in is an irritating screen flash before the level starts.
It may be activated later when hires assets are in use.

Fixes #10 (or not...? ;) )
2020-09-09 22:42:01 +02:00
Mitchell Richters
b72a3326d0 Merge branch 'back_to_basics2' into InputStuffs
# Conflicts:
#	source/core/d_net.cpp
2020-09-09 06:56:27 +10:00
Christoph Oelckers
5d7a51df9d - use a local bit array in Blood's precacher. 2020-09-08 19:18:11 +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
8d2d36457f - consolidated the map name display on startup
Fixes #275
2020-09-08 18:28:41 +02: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
9d39f770d4 - reimplemented player sprite display on Blood's automap. 2020-09-06 21:15:59 +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
e8452a79e8 - implemented the automap serializer.
Also optimized the base64 encoder to avoid creating endless memory copies, thanks to using std::string which is a really poor container for this kind of stuff when workig with larger blocks of data.
2020-09-06 13:39:57 +02:00
Christoph Oelckers
809f8b5d4b - hooked up the new automap framework. 2020-09-06 12:44:58 +02: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
d61d279168 - excised Blood's entire automap code. 2020-09-06 10:59:45 +02: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
a7b198d7ee - Stop music when ending a level, or when going back to the menu in Blood. Also play the sound on Blood's summary screen as an UI sound.
Fixes #349
2020-09-05 19:20:25 +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
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
fd2ce0321e - transitioned SW to level change event system 2020-09-04 21:15:15 +02:00
Christoph Oelckers
3eef0db6f6 - check if a map file exists before starting it. 2020-09-04 20:47:40 +02:00
Christoph Oelckers
97f395bd72 - transitioned Blood to the new level change messaging system 2020-09-04 20:46:44 +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
1cf0ca3f75 - save the global view variables in a savegame.
I have no idea why but these did not get restored to something useful anymore.
2020-09-04 01:17:06 +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
b1a3080671 - migrated Exhumed to a local ticker as well.
gameclock is history - all games now run on a timer that increments once per tick under their own control and not independently of the ticker routine.
2020-09-02 21:42:12 +02:00
Mitchell Richters
6e6f5dbb5b - Blood: Further tweak positioning for when ammo remaining gets lower than 10. 2020-09-02 19:42:16 +10:00
Mitchell Richters
1e8066ac59 - Blood: Tweak positioning for when using cl_showmagamt 1.
This moves the ammo count and inventory item icon/count over by 9px to compensate.
2020-09-02 19:13:30 +10:00
Christoph Oelckers
4feae913cd -Blood: merge redundant gFrameCount and gLevelTime variables, reset the timers as the first thing when loading a level.
They need to be reset when level data gets set because the current value is used as base.
It was most easily observed at the start of the first level where the grave only would open after a lengthy delay - which was the play time of the last level being played.
2020-09-02 07:47:26 +02:00
Christoph Oelckers
b21f49a1e1 - handle r_NoInterpolate in Blood's ticker so that the game isn't locked to 30 fps. 2020-09-02 07:11:47 +02:00
Mitchell Richters
c5636e9917 - Blood: Partially revert b8b8e7a638 in case someone really wants to run with cl_interpolate 0. 2020-09-02 14:55:44 +10:00
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
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
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
dfb6c0d6fa - Blood: moved the precaching code to its own file. 2020-09-01 19:39:30 +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
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
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
Mitchell Richters
d0e390c554 - Blood: Don't treat akimbo shotguns as a reloading weapon. It doesn't go through the reload sequence like when the player doesn't have the power-up. 2020-08-30 20:24:39 +02:00
Mitchell Richters
c555540e24 - Blood: Implement cl_showmagamt for the game's shotgun.
* Tile set for `kSBarNumberAmmo` does not include a slash. Hack put in place to get me a slash from a specific tile of a different font. It "works" and I don't think it looks too bad.
2020-08-30 20:24:38 +02:00
Mitchell Richters
e32cd81cc7 - Unify stat fps for all games. 2020-08-30 20:24:36 +02:00
Christoph Oelckers
84e54e4fdb - deleted several unused local variables
None of the initializers here is modifying gamestate, this looks like overcautious preservation for demo compatibility.
2020-08-30 20:24:23 +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
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
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
Mitchell Richters
be33872b42 - Blood: Implement WeaponSel_Alt for game. 2020-08-29 22:51:20 +10: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
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
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
e0ca98602d - made Blood's inventory cycle-able.
IMO it's a totally annoying limitations to block wraparound of the cursor.
2020-08-27 22:29:45 +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
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
89f5b26988 - fixed badly placed include. 2020-08-27 00:27:10 +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
99486cba7e - gave Blood the same treatment. 2020-08-27 00:21:11 +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
d0655a1068 - renamed the fields in Blood's packet structure to match Duke's. 2020-08-26 16:59:41 +02:00
Christoph Oelckers
3fc79940f2 - merged the bit fields in Blood's packet structure.
Whatever this was for it made that thing extremely unwieldy.
With these merged the resulting structure doesn't look much different from Duke's anymore.
2020-08-26 16:59:41 +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
5bfd4069ef - Blood: Cleanup some timing variables following timing uplift.
* Remove cast of int on `gFrameClock` since gFrameClock is now just an int.
* Remove unused `gFrameTicks`.
* Remove unused `gFrameRate`.
* Rename `gFrame` to `gFrameCount` so it's easier to search and distinguish from `gFrameClock` without relying on regex.
2020-08-26 20:55:46 +10:00