Christoph Oelckers
4bab061bd0
- removed some dead code from SW.
2020-08-03 20:53:00 +02:00
Christoph Oelckers
d526c6401f
- use the generic cheat system for Blood.
2020-08-03 20:51:31 +02:00
Christoph Oelckers
d729bc898c
- fixed character counter in MakeUTF8.
2020-08-03 20:18:33 +02:00
Christoph Oelckers
724c811de3
- Moved message storage to the map records.
2020-08-03 20:16:32 +02:00
Christoph Oelckers
35a5c4e23c
- undid hardcoded coupling of Mapinfo slots with episode/level pairs in Blood.
...
This both lifts the imposed limit of 16 levels and will allow dynamic management of global mapinfo data.
2020-08-03 20:11:30 +02:00
Christoph Oelckers
d87f0dc0b0
- uninitialized variable fixed
2020-08-03 20:07:23 +02:00
Christoph Oelckers
0036402be8
- removed most of the network code in Blood.
...
Mainly to expose the parts that still get used in single player because there's some problems here that need addressing.
ENet is also gone now.
2020-08-03 20:06:27 +02:00
Christoph Oelckers
dea0804f9a
- how could this compile?
2020-08-03 19:14:33 +02:00
Christoph Oelckers
825b286424
- removed some redundant parts in level.cpp
...
Let's use the underlying data directly.
2020-08-03 19:11:48 +02:00
Christoph Oelckers
5704c57fe0
- changed the byte order swappers to use ZDoom's versions
...
This is to reduce redundancy, plus, these are native on Windows and macOS.
2020-08-03 19:09:57 +02:00
Christoph Oelckers
3c8da8c421
- moved LocalKeys to controls.cpp
...
to consolidate input code in one file.
2020-08-03 19:08:49 +02:00
Mitchell Richters
7493d4e334
- remove unused getters from player_struct
.
2020-08-03 23:01:53 +10:00
Mitchell Richters
aead65183c
- draw the crosshair using getHalfLookAng()
inline function, making use of its double precision and optionally interpolated result.
2020-08-03 22:56:43 +10:00
Mitchell Richters
d3d9bb0823
- partially revert 19e4393a4f
by adding the player's mouse input after calculating the true pitch of p->q16horiz
.
...
* Need to add `p->horizAdjust` in with `p->q16horiz` because the values passed to that variable are the same as what would have been directly added to `p->q16horiz` in `processinput()`.
* Leaving mouse input to apply after calculating the pitch lets us take advantage of the calculated pitch's accuracy to provide consistent mouse input across the pitch's range.
2020-08-03 22:39:09 +10:00
Mitchell Richters
1556e80dd2
- apply same RR horizon workaround from e474ebc2b7
for when cl_syncinput 1
is set for angle as well.
2020-08-03 22:31:44 +10:00
Mitchell Richters
19e4393a4f
- add all the horizon values before converting into true pitch inside sethorizon()
.
2020-08-03 22:13:10 +10:00
Mitchell Richters
573cb363ae
- add new weapon interpolation variable from player_struct
into savegame code.
2020-08-03 21:26:28 +10:00
Mitchell Richters
e474ebc2b7
- multiple input fixes for both games, and for both cl_syncinput 0
and cl_syncinput 1
modes.
...
* For RR, `processweapon_r()` was performing angle and horizon changes directly which provided a harsh experience with the default `cl_syncinput 0` mode.
* Added `angAdjust` variable to `player_struct` for use with ticrate angle adjustments.
* Renamed `horizAngleAdjust` to `horizAdjust` so that there is less confusion with the new `angAdjust` variable.
* Removed `horizSkew` variable, can just use `horizAdjust` for this.
* Replaced all calls to `addang()` and `addhoriz()` with the appropriate additions/subtractions to `angAdjust` and `horizAdjust` respectively.
* Removed now unused `addang()` and `addhoriz()` setters from `player_struct`.
* Define new function `resetinputhelpers()` to eliminate code duplication between `processinput_d()` and `processinput_r()` functions.
* Remove `p->q16ang` and `p->q16horiz` direct setting from `FinalizeInput()`.
* Change `applylook()` to accept an `fixed_t adjustment` for changing the player's angle. This can either be `input.q16avel` when `cl_syncinput` is 0, or `sync[snum].q16angvel` when `cl_syncinput` is 1.
* Change `sethorizon()` to accept an `fixed_t adjustment` for changing the player's horizon. This can either be `input.q16horz` when `cl_syncinput` is 0, or `sync[snum].q16horz` when `cl_syncinput` is 1.
* Re-work `sethorizon()` to always adjust `p->q16horiz` using the true pitch code. This closer resembles the EDuke32 implementation as per SVN 7342.
* Re-work returning to center to work off the true pitch code and always ensure that the player returns to center.
* Implement work-around for RR where we need to call `sethorizon()` before the call to `fi.doincrements()` like the original game, but also after the call to `processweapon()` to apply any angle or horizon changes due to weapon recoil, etc. We work around this by calling `sethorizon()` from within `doincrements_r()` only if `cl_syncinput` is 1 and only if `doincrements_r()` is to return 1.
2020-08-03 21:19:45 +10:00
Mitchell Richters
d9fab07c31
- interpolate p->hard_landing
for RR.
2020-08-03 17:27:09 +10:00
Mitchell Richters
c600295c93
- apply same fix from c63564eb7a
for returning interpolated value for the player's q16horiz - q16horizoff
if cl_syncinput
is true.
...
* Also changed `gethalflookang()` to camel case `getHalfLookAng()` for easier reading.
* Also broke a very long if statement down into smaller chunks for readability.
2020-08-03 17:06:28 +10:00
Mitchell Richters
c63564eb7a
- replace lookanghalf()
player_struct getter with inline that can accept cl_syncinput
as a bool for whether to return an interpolated calculation or not.
...
New HUD was being let down by using an uninterpolated `q16look_ang` regardless of whether `cl_syncinput` was true.
2020-08-03 16:27:14 +10:00
Mitchell Richters
6bd050e201
- fix some interpolation harshness with p->weapon_pos
.
2020-08-03 15:06:25 +10:00
Mitchell Richters
7efa905a01
- fix some interpolation harshness with p->kickback_pic
.
2020-08-03 15:06:25 +10:00
Mitchell Richters
531df48d38
- interpolate p->hard_landing
for Duke 3D.
2020-08-03 15:06:25 +10:00
Mitchell Richters
43ff42b330
- interpolate p->random_club_frame
for Duke 3D.
2020-08-03 15:06:25 +10:00
Mitchell Richters
038039eb3f
- interpolate p->kickback_pic
for Duke 3D.
2020-08-03 15:06:25 +10:00
Mitchell Richters
8cc4b5062a
Revert "- remove duplicate line.". In hindsight, I believe this was by design.
...
This reverts commit 6fd6926d8d
.
2020-08-03 15:06:25 +10:00
Mitchell Richters
6ad3237b62
- backup p->kickback_pic
in prep for interpolation and tidy up other weapon interpolation variables.
2020-08-03 15:06:25 +10:00
Mitchell Richters
11a10c1d87
- change calc_smoothratio()
inline function from int to double that was missed in 0c12436092
.
2020-08-03 11:57:39 +10:00
Mitchell Richters
034d6e129a
- always calculate smoothratio while paused, but only return it during play. This is so the time keeps elapsing and you don't get a large delta between the first call back to CalcSmoothRatio()
after the previous call.
2020-08-03 11:54:59 +10:00
Mitchell Richters
5792a2389a
- consistency cleanup with a use of calcSinTableView()
use within hudweapon_d.cpp.
2020-08-03 11:07:55 +10:00
Mitchell Richters
80291f9cb7
- For RR, pass vehicle TiltStatus through to backend as the double that it is.
2020-08-03 11:06:23 +10:00
Mitchell Richters
8526bd6a17
- interpolate weapon HUD for RR and make full use of calcSinTableValue()
's double precision.
2020-08-03 11:05:41 +10:00
Mitchell Richters
48e4bccc6d
- oops. Missed change of hudDraw()
zDelta
from int to double while implementing ae2d2c7948
.
2020-08-03 10:23:15 +10:00
Mitchell Richters
348acf95e0
- change division of delta between currentTime and lastTime from 8 to 72 to ensure smoothratio doesn't clip at 65536.
...
* Divisor of delta is there so smoothratio always starts off with some kind of value. After 10 minutes at 1100 fps, closest final result to 65536 was:
ototalclk: 4573
totalclk: 4576
gametics: 33.333 ms
elapsedTime: 33.331 ms
ratio: 0.999938
result: 65531.941356
2020-08-03 10:00:06 +10:00
Mitchell Richters
70794df76c
- remove bitwise & operations on calls to calcSinTableValue()
since they're no longer necessary, and remove last use of sintable[]
from hudweapon_d.cpp.
2020-08-03 09:19:14 +10:00
Mitchell Richters
ae2d2c7948
- interpolate zDelta with higher precision from updated CalcSmoothRatio()
function that returns a double instead of an int.
2020-08-03 09:07:19 +10:00
Mitchell Richters
61820ddef5
- interpolate bobx and boby with higher precision from updated CalcSmoothRatio()
function that returns a double instead of an int.
2020-08-03 08:50:48 +10:00
Christoph Oelckers
8a31e96602
- use all available precision to render Blood's weapon animations mpre smoothly, instead of throwing it away by needlessly storing it in some integer fields.
2020-08-03 00:25:40 +02:00
Christoph Oelckers
be9402c4e0
- fixed Blood not accepting any input after loading a saved game.
2020-08-03 00:10:18 +02:00
Christoph Oelckers
38616d90a3
- renamed some members of Blood's EPISODEINFO struct.
2020-08-02 23:47:21 +02:00
Christoph Oelckers
e434df5328
- always play menu sounds by calling M_MenuSound to check the menu_sounds CVAR.
2020-08-02 22:16:26 +02:00
Christoph Oelckers
d083e12967
- added the "back" sound to the menu.
2020-08-02 22:14:58 +02:00
Christoph Oelckers
8acc4101be
- simplified calcSinTableValue and inlined it.
...
There's no need for all this magic voodoo - the sin function already returns the proper values all by itself.
2020-08-02 22:03:22 +02:00
Christoph Oelckers
9606601554
- wraooed "q16look_ang / (2. * FRACUNIT)" in an inline function.
...
No need to write it out each time, this wpuld be a nightmare if it ever had to be refactored.
2020-08-02 21:45:57 +02:00
Christoph Oelckers
6a305748ff
- removed some C cruft from compat.h.
2020-08-02 21:25:03 +02:00
Mitchell Richters
0bcb37860a
- interpolate p->weapon_pos
for smooth switching of weapons.
2020-08-02 21:20:54 +02:00
Mitchell Richters
85dcffc442
- use new fmulscale16()
static inline for high precision interpolation in place of manual code.
2020-08-02 21:20:54 +02:00
Mitchell Richters
3d165ee182
- extend mulscale/divscale pragmas with double versions of each.
2020-08-02 21:20:54 +02:00
Mitchell Richters
9c8593018b
- define new function calcSinTableValue()
to calculate an equivalent sintable[]
entry.
...
* Returns a true double result.
* Also supports fractional input for fractional input. That is, if `sintable[1]` = 50 and `sintable[2]` = 100, `calcSinTableValue(1.5)` = 75.
* Increased precision of `BANG2RAD` define to use double and not float.
* As such, revert addition of `sintablef[]`.
2020-08-02 21:20:54 +02:00
Mitchell Richters
abb23a7bd0
- fix remaining interpolation issue with weapon swaying when taking off again from a stand-still.
2020-08-02 21:20:53 +02:00
Mitchell Richters
6fd6926d8d
- remove duplicate line.
2020-08-02 21:20:53 +02:00
Mitchell Richters
11b3f5a78a
- increase precision of local variable x
for displaypistol()
.
2020-08-02 21:20:53 +02:00
Mitchell Richters
184465460e
- make full use of sintablef[2048]
.
2020-08-02 21:20:53 +02:00
Mitchell Richters
977ddc5aa8
- make full use of Q16.16 resolution for player's angle and horizon values.
2020-08-02 21:20:52 +02:00
Mitchell Richters
3a4a224877
- interpolate p->weapon_sway
.
2020-08-02 21:20:52 +02:00
Mitchell Richters
4499e05b06
- pass smoothratio
through to displayweapon()
.
2020-08-02 21:20:52 +02:00
Mitchell Richters
0c12436092
- change returned value for CalcSmoothRatio()
from int to double and pass through to displayrest()
for future use with displayweapon()
.
...
* `displayrooms()` ultimately should be adjusted as well. For now, just relying on integer truncation as this is just a proof of concept.
# Conflicts:
# source/core/gamecontrol.cpp
# source/core/gamecontrol.h
2020-08-02 21:20:52 +02:00
Mitchell Richters
4301706e00
- promote fclamp()
and fclamp2()
to double.
2020-08-02 21:20:06 +02:00
Mitchell Richters
7b8e40c7e1
- create sintable sintablef[2048]
as sintables of doubles.
...
* Also change BANG2RAD define to be a double and not a float.
2020-08-02 21:20:06 +02:00
Christoph Oelckers
18c3d9b240
- get the frame time right at the start of the frame, not when performing interpolations.
...
This is to factor think time out of the time span between frames and to avoid changes if the smoothratio gets calculated multiple times.
2020-08-02 21:16:01 +02:00
Mitchell Richters
3861064f62
- use 1/8 of delta time as initial elapsed time when calculating smoothratio on a new ototalclk.
...
* Pushes final result closer to 65536 and always ensures smoothratio never starts at 0.
2020-08-02 20:57:09 +02:00
Mitchell Richters
4830989d32
- remove all code used to get current display's refresh rate.
...
* Serves no purpose in Raze or GZDoom and appears to only have been added to the backend to facilitate the older interpolation code that was excised in 893686709b
.
2020-08-02 20:57:09 +02:00
Mitchell Richters
f8952d5cae
- directly cast steady_clock::now()
to nanoseconds instead of microseconds then multiplying by 1000.
2020-08-02 20:57:08 +02:00
Mitchell Richters
5000fde281
- restore legacy interpolation path behind CVAR cl_legacyintrpl
.
...
* Hoping the old path being available will allow the new code to be merged.
* Applied offset to sum of `(totalclk - ototalclk)` of 0.5 to ensure calculated smoothratio under legacy path always returns a value.
* For the above, consider Duke 3D with 4 game tics per ticrate, the returned values would be:
0
16384
32768
49152
* With offset of 0.5, the following values are returned depending on how far advanced `totalclk` is from `ototalclk`:
8192
24576
40960
57344
2020-08-02 20:57:08 +02:00
Mitchell Richters
0aca26e197
- determine smoothRatio
immediately after a potential change to ototalclock
has occurred.
2020-08-02 20:57:08 +02:00
Mitchell Richters
52d9fd4cda
- add cl_debugintrpl
CVAR to print interpolation information to the console.
...
* Also revert back to use of `xs_CRoundToInt()` that was accidentally removed previously.
2020-08-02 20:57:08 +02:00
Mitchell Richters
1cf857e788
- create an enum for MaxSmoothRatio and replace multiple hard-coded uses of '65536' constant.
2020-08-02 20:57:08 +02:00
Mitchell Richters
733f3aa490
- increase granularity of CalcSmoothRatio()
.
2020-08-02 20:57:07 +02:00
Christoph Oelckers
00ecea47aa
- use CCMDs for input in Blood where appropriate.
2020-08-02 20:44:37 +02:00
Christoph Oelckers
4a049c1a4d
- split sprite animation off view.cpp
2020-08-02 19:59:14 +02:00
Christoph Oelckers
e2498a53a9
- split Blood prediction code into its own file.
2020-08-02 19:43:45 +02:00
Christoph Oelckers
a9820abcae
- migrated the remaining 2D content in Blood away from rotatesprite.
2020-08-02 19:00:32 +02:00
Christoph Oelckers
4e9ea9ef60
- fixed bad merge from some time agp.
2020-08-02 18:12:43 +02:00
Christoph Oelckers
1392f4db01
- handle the view frame with backend features.
2020-08-02 18:02:13 +02:00
Christoph Oelckers
fc390e244f
- background for text screens.
2020-08-02 17:45:03 +02:00
Christoph Oelckers
1150e3ee0d
- removed unused stuff from screen.cpp and deleted screen.h.
2020-08-02 13:54:36 +02:00
Christoph Oelckers
7846178130
- missed this... :(
2020-08-02 13:53:14 +02:00
Christoph Oelckers
3a32e8840f
- ported Blood's status bar to the Status bar class.
...
Now it allows downscaling just like Duke's.
2020-08-02 13:35:34 +02:00
Christoph Oelckers
b259b94300
- implemented status bar scale control for Blood.
2020-08-02 08:48:23 +02:00
Christoph Oelckers
cc8798f6e2
- preparations for rendering Blood's status bar through the Statusbar class.
2020-08-02 08:39:51 +02:00
Christoph Oelckers
49a25c417b
- split Blood's status bar code off into its own file.
2020-08-01 21:23:33 +02:00
Christoph Oelckers
ec846a3e63
- fixed shadows on Blood's text.
2020-08-01 20:07:32 +02:00
Christoph Oelckers
9dac66b6f0
- fudging for the broken FIRE animation.
...
Unfortunately the only thing that can be done here from inside the engine is to increase the likelihood of the animation actually starting.
Ideally the broken script should be replaced but with the way CON replacements are done this is not possible.
2020-08-01 17:54:38 +02:00
Christoph Oelckers
4332d02885
- fixed sound playback for doors etc.
...
The play code locked out the MUSICANDSFX actor but never properly checked for the sound being finished.
Fixes #87
2020-08-01 11:56:02 +02:00
Christoph Oelckers
76ba45ac8d
- fixed the reactor for good.
...
Fixes #70
2020-08-01 09:55:48 +02:00
Christoph Oelckers
f75d30d858
- partial reactor fix.
...
This fixes the position of the debris - but there's still something else as the lightning beam still doesn't get removed.
2020-08-01 01:04:17 +02:00
Christoph Oelckers
c7c59d33ff
- always set the spam timer when a quote is supposed to be printed, even if it gets rejected.
2020-07-31 21:16:07 +02:00
Christoph Oelckers
6d24a20f5c
- QUOTE_DEAD may never repeat.
...
This gets spammed hard enough to get past the timer filter.
2020-07-31 21:14:43 +02:00
Christoph Oelckers
2f94ae8160
- removed Blood's message display.
...
We'll use the common one in c_console from now on.
2020-07-31 21:06:56 +02:00
Christoph Oelckers
a12cdf849e
- fixed text in the menu
2020-07-31 21:05:57 +02:00
Christoph Oelckers
7bf3d5186f
- Blood font refactoring.
2020-07-31 21:05:09 +02:00
Christoph Oelckers
5bae2fcef5
- moved global include out of namespace.
2020-07-31 21:04:28 +02:00
Christoph Oelckers
713c41c0a9
- fixed bad ordering of directives.
2020-07-31 21:03:23 +02:00
Christoph Oelckers
b6cb0ce1a1
- consolidated shade to light conversion
2020-07-31 20:58:55 +02:00
Christoph Oelckers
b308e730ea
- started replacing rotatesprite with DrawTexture.
...
As an added bonus, thia now allows stretching the menu caption box for longer texts, rotatesprite could not do that.
2020-07-31 20:39:02 +02:00
Mitchell Richters
f0e0a3db41
- quick and dirty fix to get SW menu input cranking again (mostly for testing PR #77 under SW since it's the only game with a clock of 120/3).
2020-07-31 16:26:16 +10:00
Mitchell Richters
24b0e4438e
- Reset p->oq16horizoff
to p->q16horizoff
in resetplayerstats()
.
2020-07-31 14:23:58 +10:00
Mitchell Richters
ecf8bb699a
- Reset p->oq16look_ang
to p->q16look_ang
in resetplayerstats()
.
2020-07-31 14:21:10 +10:00
Christoph Oelckers
d0909b8224
- calculate proper distances in the sound code.
...
The original code didn't factor in that z has a different scale than x and y and use a function with severe precision issues.
Fixes #81
2020-07-31 00:08:39 +02:00