Commit Graph

737 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
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
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
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 2bf11ad378 - All Games: Remove use of `timerGetTicks()`. 2020-08-26 09:49:38 +10:00
Mitchell Richters aba5c4c134 - All Games: Remove use of `timerGetHiTicks()`. 2020-08-26 09:49:36 +10:00
Mitchell Richters b883204f6a - All Games: Remove remaining use of `totalclock` and associated timing code. 2020-08-26 09:49:34 +10:00