* 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.
* 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).
* 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.
* 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.
* 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.
* 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.
* 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.
* 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.
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.
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...? ;) )
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.
* 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.
* 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.
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... ;))
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.
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
* 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()`.
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
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.
* 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.
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.
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.
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.
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.
* 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.
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.
* rewrote all uses of timerSetCallback. Most were unnecessary or long obsolete, the sound updates need to run per frame, not per tic and the UI tickers need to be handled in the main loop anyway.
* Use a more precise timer to animate the menu transition.
* uncouple other menu animations from the game timer.
This removes most of the InputState class because it is no longer used.
The only remaining places still checking scan codes are the modifiers for sizeup and sizedown.
All the rest was remapped to safer methods. The multiplayer taunts are currently inoperable, they will need support of shift-bindings to get proper support.
This is to cut down on boilerplate code because these encode the virtual screen size in the mode parameter, making it unnecessary to specify a virtual size separately.
Taking a cue from GDX to properly synchronize it because PCExhumed's approach looked broken by design.
It had no frame rate sync and solely depended on the low level audio stream for it.