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
Jaden
SRB2
Commits
0aa763df
Commit
0aa763df
authored
1 year ago
by
Lactozilla
Browse files
Options
Downloads
Patches
Plain Diff
Do music fade callback on main thread
parent
6f74123c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sdl/mixer_sound.c
+13
-3
13 additions, 3 deletions
src/sdl/mixer_sound.c
with
13 additions
and
3 deletions
src/sdl/mixer_sound.c
+
13
−
3
View file @
0aa763df
...
...
@@ -108,6 +108,7 @@ static UINT32 fading_timer;
static
UINT32
fading_duration
;
static
INT32
fading_id
;
static
void
(
*
fading_callback
)(
void
);
static
boolean
fading_do_callback
;
static
boolean
fading_nocleanup
;
#ifdef HAVE_GME
...
...
@@ -213,7 +214,10 @@ static void var_cleanup(void)
// HACK: See music_loop, where we want the fade timing to proceed after a non-looping
// song has stopped playing
if
(
!
fading_nocleanup
)
{
fading_callback
=
NULL
;
fading_do_callback
=
false
;
}
else
fading_nocleanup
=
false
;
// use it once, set it back immediately
...
...
@@ -330,6 +334,13 @@ void I_ShutdownSound(void)
void
I_UpdateSound
(
void
)
{
if
(
fading_do_callback
)
{
if
(
fading_callback
)
(
*
fading_callback
)();
fading_callback
=
NULL
;
fading_do_callback
=
false
;
}
}
/// ------------------------
...
...
@@ -654,9 +665,8 @@ static UINT32 get_adjusted_position(UINT32 position)
static
void
do_fading_callback
(
void
)
{
if
(
fading_callback
)
(
*
fading_callback
)();
fading_callback
=
NULL
;
// TODO: Should I use a mutex here or something?
fading_do_callback
=
true
;
}
/// ------------------------
...
...
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