Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YGOPRO-520DIY
ygopro
Commits
37625db4
Commit
37625db4
authored
Mar 31, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
simplify logic & fix bgm set volume
parent
e337da72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
gframe/sound_manager.cpp
gframe/sound_manager.cpp
+2
-4
No files found.
gframe/sound_manager.cpp
View file @
37625db4
...
@@ -217,12 +217,11 @@ void SoundManager::PlaySoundEffect(int sound) {
...
@@ -217,12 +217,11 @@ void SoundManager::PlaySoundEffect(int sound) {
}
}
char
soundPath
[
40
];
char
soundPath
[
40
];
std
::
snprintf
(
soundPath
,
40
,
"./sound/%s.wav"
,
soundName
);
std
::
snprintf
(
soundPath
,
40
,
"./sound/%s.wav"
,
soundName
);
SetSoundVolume
(
mainGame
->
gameConf
.
sound_volume
);
#ifdef YGOPRO_USE_MINIAUDIO
#ifdef YGOPRO_USE_MINIAUDIO
ma_engine_set_volume
(
&
engineSound
,
mainGame
->
gameConf
.
sound_volume
);
ma_engine_play_sound
(
&
engineSound
,
soundPath
,
nullptr
);
ma_engine_play_sound
(
&
engineSound
,
soundPath
,
nullptr
);
#endif
#endif
#ifdef YGOPRO_USE_IRRKLANG
#ifdef YGOPRO_USE_IRRKLANG
engineSound
->
setSoundVolume
(
mainGame
->
gameConf
.
sound_volume
);
engineSound
->
play2D
(
soundPath
);
engineSound
->
play2D
(
soundPath
);
#endif
#endif
#endif // YGOPRO_USE_AUDIO
#endif // YGOPRO_USE_AUDIO
...
@@ -265,6 +264,7 @@ void SoundManager::PlayMusic(char* song, bool loop) {
...
@@ -265,6 +264,7 @@ void SoundManager::PlayMusic(char* song, bool loop) {
return
;
return
;
if
(
!
IsCurrentlyPlaying
(
song
))
{
if
(
!
IsCurrentlyPlaying
(
song
))
{
StopBGM
();
StopBGM
();
SetMusicVolume
(
mainGame
->
gameConf
.
music_volume
);
#ifdef YGOPRO_USE_MINIAUDIO
#ifdef YGOPRO_USE_MINIAUDIO
strcpy
(
currentPlayingMusic
,
song
);
strcpy
(
currentPlayingMusic
,
song
);
#ifdef _WIN32
#ifdef _WIN32
...
@@ -278,8 +278,6 @@ void SoundManager::PlayMusic(char* song, bool loop) {
...
@@ -278,8 +278,6 @@ void SoundManager::PlayMusic(char* song, bool loop) {
ma_sound_start
(
&
soundBGM
);
ma_sound_start
(
&
soundBGM
);
#endif
#endif
#ifdef YGOPRO_USE_IRRKLANG
#ifdef YGOPRO_USE_IRRKLANG
engineMusic
->
stopAllSounds
();
engineMusic
->
setSoundVolume
(
mainGame
->
gameConf
.
music_volume
);
soundBGM
=
engineMusic
->
play2D
(
song
,
loop
,
false
,
true
);
soundBGM
=
engineMusic
->
play2D
(
song
,
loop
,
false
,
true
);
#endif
#endif
}
}
...
...
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