Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
8fb939df
Commit
8fb939df
authored
3 years ago
by
Sal
Committed by
Eidolon
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add functions to handle interpolation
Much less code duplication
parent
ca8698d1
No related branches found
No related tags found
1 merge request
!1783
Uncapped
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/r_fps.c
+20
-0
20 additions, 0 deletions
src/r_fps.c
src/r_fps.h
+4
-0
4 additions, 0 deletions
src/r_fps.h
with
24 additions
and
0 deletions
src/r_fps.c
+
20
−
0
View file @
8fb939df
...
@@ -177,6 +177,26 @@ void R_SetViewContext(enum viewcontext_e _viewcontext)
...
@@ -177,6 +177,26 @@ void R_SetViewContext(enum viewcontext_e _viewcontext)
}
}
}
}
fixed_t
R_InterpolateFixed
(
fixed_t
from
,
fixed_t
to
)
{
if
(
cv_frameinterpolation
.
value
==
0
)
{
return
to
;
}
return
(
R_LerpFixed
(
from
,
to
,
rendertimefrac
));
}
angle_t
R_InterpolateAngle
(
angle_t
from
,
angle_t
to
)
{
if
(
cv_frameinterpolation
.
value
==
0
)
{
return
to
;
}
return
(
R_LerpAngle
(
from
,
to
,
rendertimefrac
));
}
void
R_InterpolateMobjState
(
mobj_t
*
mobj
,
fixed_t
frac
,
interpmobjstate_t
*
out
)
void
R_InterpolateMobjState
(
mobj_t
*
mobj
,
fixed_t
frac
,
interpmobjstate_t
*
out
)
{
{
out
->
x
=
R_LerpFixed
(
mobj
->
old_x
,
mobj
->
x
,
frac
);
out
->
x
=
R_LerpFixed
(
mobj
->
old_x
,
mobj
->
x
,
frac
);
...
...
This diff is collapsed.
Click to expand it.
src/r_fps.h
+
4
−
0
View file @
8fb939df
...
@@ -99,6 +99,10 @@ void R_UpdateViewInterpolation(void);
...
@@ -99,6 +99,10 @@ void R_UpdateViewInterpolation(void);
void
R_ResetViewInterpolation
(
void
);
void
R_ResetViewInterpolation
(
void
);
// Set the current view context (the viewvars pointed to by newview)
// Set the current view context (the viewvars pointed to by newview)
void
R_SetViewContext
(
enum
viewcontext_e
_viewcontext
);
void
R_SetViewContext
(
enum
viewcontext_e
_viewcontext
);
fixed_t
R_InterpolateFixed
(
fixed_t
from
,
fixed_t
to
);
angle_t
R_InterpolateAngle
(
angle_t
from
,
angle_t
to
);
// Evaluate the interpolated mobj state for the given mobj
// Evaluate the interpolated mobj state for the given mobj
void
R_InterpolateMobjState
(
mobj_t
*
mobj
,
fixed_t
frac
,
interpmobjstate_t
*
out
);
void
R_InterpolateMobjState
(
mobj_t
*
mobj
,
fixed_t
frac
,
interpmobjstate_t
*
out
);
// Evaluate the interpolated mobj state for the given precipmobj
// Evaluate the interpolated mobj state for the given precipmobj
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment