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
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AJ Martinez
SRB2
Commits
353fefbd
Commit
353fefbd
authored
5 years ago
by
Marco Z
Browse files
Options
Downloads
Patches
Plain Diff
Slight refactor for jingle resume lapse time
parent
81d08403
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/s_sound.c
+12
-1
12 additions, 1 deletion
src/s_sound.c
with
12 additions
and
1 deletion
src/s_sound.c
+
12
−
1
View file @
353fefbd
...
...
@@ -1732,8 +1732,19 @@ boolean S_RecallMusic(UINT16 status, boolean fromfirst)
else
{
S_ChangeMusicEx
(
entry
->
musname
,
entry
->
musflags
,
entry
->
looping
,
0
,
0
,
music_stack_fadein
);
if
(
!
music_stack_noposition
)
// HACK: Global boolean to toggle position resuming, e.g., de-superize
newpos
=
entry
->
position
+
(
S_GetMusicLength
()
?
(
UINT32
)((
float
)(
gametic
-
entry
->
tic
)
/
(
float
)
TICRATE
*
(
float
)
MUSICRATE
)
:
0
);
{
UINT32
poslapse
=
0
;
// To prevent the game from jumping past the end of the music, we need
// to check if we can get the song's length. Otherwise, if the lapsed resume time goes
// over a LOOPPOINT, mixer_sound.c will be unable to calculate the new resume position.
if
(
S_GetMusicLength
())
poslapse
=
(
UINT32
)((
float
)(
gametic
-
entry
->
tic
)
/
(
float
)
TICRATE
*
(
float
)
MUSICRATE
);
newpos
=
entry
->
position
+
poslapse
;
}
// If the newly recalled music lumpnum does not match the lumpnum that we stored in stack,
// then discard the new position. That way, we will not recall an invalid position
...
...
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