Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Richard Gobeille
EDuke32
Commits
16fc20a5
Commit
16fc20a5
authored
Jan 29, 2020
by
Richard Gobeille
Browse files
Improve player view recentering
From-SVN: r8552
parent
d8a523e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/duke3d/src/player.cpp
View file @
16fc20a5
...
...
@@ -3179,12 +3179,12 @@ void P_GetInput(int const playerNum)
}
else
if
(
pPlayer
->
return_to_center
>
0
||
g_horizRecenter
)
{
pPlayer
->
q16horiz
+=
fix16_from_float
(
scaleAdjustmentToInterval
(
fix16_to_float
(
F16
(
33
)
-
fix16_div
(
pPlayer
->
q16horiz
,
F16
(
3
)))));
pPlayer
->
q16horiz
+=
fix16_from_float
(
scaleAdjustmentToInterval
(
fix16_to_float
(
F16
(
66.666
)
-
fix16_div
(
pPlayer
->
q16horiz
,
F16
(
1.5
)))));
if
(
pPlayer
->
q16horiz
>=
F16
(
99.9
)
&&
pPlayer
->
q16horiz
<=
F16
(
100.1
))
if
((
!
pPlayer
->
return_to_center
&&
g_horizRecenter
)
||
(
pPlayer
->
q16horiz
>=
F16
(
99.9
)
&&
pPlayer
->
q16horiz
<=
F16
(
100.1
))
)
{
pPlayer
->
q16horiz
=
F16
(
100
);
g_horizRecenter
=
0
;
g_horizRecenter
=
false
;
}
if
(
pPlayer
->
q16horizoff
>=
F16
(
-
0.1
)
&&
pPlayer
->
q16horizoff
<=
F16
(
0.1
))
...
...
@@ -5510,10 +5510,7 @@ RECHECK:
}
if
(
pPlayer
->
return_to_center
>
0
)
{
pPlayer
->
return_to_center
--
;
g_horizRecenter
=
true
;
}
if
(
TEST_SYNC_KEY
(
playerBits
,
SK_CENTER_VIEW
)
||
pPlayer
->
hard_landing
)
if
(
VM_OnEvent
(
EVENT_RETURNTOCENTER
,
pPlayer
->
i
,
playerNum
)
==
0
)
...
...
@@ -5524,6 +5521,7 @@ RECHECK:
if
(
VM_OnEvent
(
EVENT_LOOKUP
,
pPlayer
->
i
,
playerNum
)
==
0
)
{
pPlayer
->
return_to_center
=
9
;
g_horizRecenter
=
true
;
g_horizAngleAdjust
=
float
(
12
<<
(
int
)(
TEST_SYNC_KEY
(
playerBits
,
SK_RUN
)));
}
}
...
...
@@ -5533,6 +5531,7 @@ RECHECK:
if
(
VM_OnEvent
(
EVENT_LOOKDOWN
,
pPlayer
->
i
,
playerNum
)
==
0
)
{
pPlayer
->
return_to_center
=
9
;
g_horizRecenter
=
true
;
g_horizAngleAdjust
=
-
float
(
12
<<
(
int
)(
TEST_SYNC_KEY
(
playerBits
,
SK_RUN
)));
}
}
...
...
@@ -5587,6 +5586,7 @@ RECHECK:
if
(
!
FURY
&&
pPlayer
->
knee_incs
>
0
)
{
g_horizSkew
=
F16
(
-
48
);
g_horizRecenter
=
true
;
pPlayer
->
return_to_center
=
9
;
if
(
++
pPlayer
->
knee_incs
>
15
)
...
...
LeoD
@LeoD
mentioned in issue
#29
·
May 06, 2020
mentioned in issue
#29
mentioned in issue #29
Toggle commit list
NY00123
@NY00123
mentioned in issue
#146 (closed)
·
Mar 28, 2021
mentioned in issue
#146 (closed)
mentioned in issue #146
Toggle commit list
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment