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
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
MyCard
ygopro
Commits
38b2bc5d
Commit
38b2bc5d
authored
Feb 06, 2026
by
salix5
Committed by
GitHub
Feb 06, 2026
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use std::string in PlaySoundEffect (#2967)
parent
dbaa047a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
37 deletions
+36
-37
gframe/sound_manager.cpp
gframe/sound_manager.cpp
+36
-37
No files found.
gframe/sound_manager.cpp
View file @
38b2bc5d
...
@@ -88,143 +88,142 @@ void SoundManager::PlaySoundEffect(int sound) {
...
@@ -88,143 +88,142 @@ void SoundManager::PlaySoundEffect(int sound) {
#ifdef YGOPRO_USE_AUDIO
#ifdef YGOPRO_USE_AUDIO
if
(
!
mainGame
->
chkEnableSound
->
isChecked
())
if
(
!
mainGame
->
chkEnableSound
->
isChecked
())
return
;
return
;
char
soundName
[
32
]
;
std
::
string
soundName
;
switch
(
sound
)
{
switch
(
sound
)
{
case
SOUND_SUMMON
:
{
case
SOUND_SUMMON
:
{
s
trcpy
(
soundName
,
"summon"
)
;
s
oundName
=
"summon"
;
break
;
break
;
}
}
case
SOUND_SPECIAL_SUMMON
:
{
case
SOUND_SPECIAL_SUMMON
:
{
s
trcpy
(
soundName
,
"specialsummon"
)
;
s
oundName
=
"specialsummon"
;
break
;
break
;
}
}
case
SOUND_ACTIVATE
:
{
case
SOUND_ACTIVATE
:
{
s
trcpy
(
soundName
,
"activate"
)
;
s
oundName
=
"activate"
;
break
;
break
;
}
}
case
SOUND_SET
:
{
case
SOUND_SET
:
{
s
trcpy
(
soundName
,
"set"
)
;
s
oundName
=
"set"
;
break
;
break
;
}
}
case
SOUND_FLIP
:
{
case
SOUND_FLIP
:
{
s
trcpy
(
soundName
,
"flip"
)
;
s
oundName
=
"flip"
;
break
;
break
;
}
}
case
SOUND_REVEAL
:
{
case
SOUND_REVEAL
:
{
s
trcpy
(
soundName
,
"reveal"
)
;
s
oundName
=
"reveal"
;
break
;
break
;
}
}
case
SOUND_EQUIP
:
{
case
SOUND_EQUIP
:
{
s
trcpy
(
soundName
,
"equip"
)
;
s
oundName
=
"equip"
;
break
;
break
;
}
}
case
SOUND_DESTROYED
:
{
case
SOUND_DESTROYED
:
{
s
trcpy
(
soundName
,
"destroyed"
)
;
s
oundName
=
"destroyed"
;
break
;
break
;
}
}
case
SOUND_BANISHED
:
{
case
SOUND_BANISHED
:
{
s
trcpy
(
soundName
,
"banished"
)
;
s
oundName
=
"banished"
;
break
;
break
;
}
}
case
SOUND_TOKEN
:
{
case
SOUND_TOKEN
:
{
s
trcpy
(
soundName
,
"token"
)
;
s
oundName
=
"token"
;
break
;
break
;
}
}
case
SOUND_NEGATE
:
{
case
SOUND_NEGATE
:
{
s
trcpy
(
soundName
,
"negate"
)
;
s
oundName
=
"negate"
;
break
;
break
;
}
}
case
SOUND_ATTACK
:
{
case
SOUND_ATTACK
:
{
s
trcpy
(
soundName
,
"attack"
)
;
s
oundName
=
"attack"
;
break
;
break
;
}
}
case
SOUND_DIRECT_ATTACK
:
{
case
SOUND_DIRECT_ATTACK
:
{
s
trcpy
(
soundName
,
"directattack"
)
;
s
oundName
=
"directattack"
;
break
;
break
;
}
}
case
SOUND_DRAW
:
{
case
SOUND_DRAW
:
{
s
trcpy
(
soundName
,
"draw"
)
;
s
oundName
=
"draw"
;
break
;
break
;
}
}
case
SOUND_SHUFFLE
:
{
case
SOUND_SHUFFLE
:
{
s
trcpy
(
soundName
,
"shuffle"
)
;
s
oundName
=
"shuffle"
;
break
;
break
;
}
}
case
SOUND_DAMAGE
:
{
case
SOUND_DAMAGE
:
{
s
trcpy
(
soundName
,
"damage"
)
;
s
oundName
=
"damage"
;
break
;
break
;
}
}
case
SOUND_RECOVER
:
{
case
SOUND_RECOVER
:
{
s
trcpy
(
soundName
,
"gainlp"
)
;
s
oundName
=
"gainlp"
;
break
;
break
;
}
}
case
SOUND_COUNTER_ADD
:
{
case
SOUND_COUNTER_ADD
:
{
s
trcpy
(
soundName
,
"addcounter"
)
;
s
oundName
=
"addcounter"
;
break
;
break
;
}
}
case
SOUND_COUNTER_REMOVE
:
{
case
SOUND_COUNTER_REMOVE
:
{
s
trcpy
(
soundName
,
"removecounter"
)
;
s
oundName
=
"removecounter"
;
break
;
break
;
}
}
case
SOUND_COIN
:
{
case
SOUND_COIN
:
{
s
trcpy
(
soundName
,
"coinflip"
)
;
s
oundName
=
"coinflip"
;
break
;
break
;
}
}
case
SOUND_DICE
:
{
case
SOUND_DICE
:
{
s
trcpy
(
soundName
,
"diceroll"
)
;
s
oundName
=
"diceroll"
;
break
;
break
;
}
}
case
SOUND_NEXT_TURN
:
{
case
SOUND_NEXT_TURN
:
{
s
trcpy
(
soundName
,
"nextturn"
)
;
s
oundName
=
"nextturn"
;
break
;
break
;
}
}
case
SOUND_PHASE
:
{
case
SOUND_PHASE
:
{
s
trcpy
(
soundName
,
"phase"
)
;
s
oundName
=
"phase"
;
break
;
break
;
}
}
case
SOUND_MENU
:
{
case
SOUND_MENU
:
{
s
trcpy
(
soundName
,
"menu"
)
;
s
oundName
=
"menu"
;
break
;
break
;
}
}
case
SOUND_BUTTON
:
{
case
SOUND_BUTTON
:
{
s
trcpy
(
soundName
,
"button"
)
;
s
oundName
=
"button"
;
break
;
break
;
}
}
case
SOUND_INFO
:
{
case
SOUND_INFO
:
{
s
trcpy
(
soundName
,
"info"
)
;
s
oundName
=
"info"
;
break
;
break
;
}
}
case
SOUND_QUESTION
:
{
case
SOUND_QUESTION
:
{
s
trcpy
(
soundName
,
"question"
)
;
s
oundName
=
"question"
;
break
;
break
;
}
}
case
SOUND_CARD_PICK
:
{
case
SOUND_CARD_PICK
:
{
s
trcpy
(
soundName
,
"cardpick"
)
;
s
oundName
=
"cardpick"
;
break
;
break
;
}
}
case
SOUND_CARD_DROP
:
{
case
SOUND_CARD_DROP
:
{
s
trcpy
(
soundName
,
"carddrop"
)
;
s
oundName
=
"carddrop"
;
break
;
break
;
}
}
case
SOUND_PLAYER_ENTER
:
{
case
SOUND_PLAYER_ENTER
:
{
s
trcpy
(
soundName
,
"playerenter"
)
;
s
oundName
=
"playerenter"
;
break
;
break
;
}
}
case
SOUND_CHAT
:
{
case
SOUND_CHAT
:
{
s
trcpy
(
soundName
,
"chatmessage"
)
;
s
oundName
=
"chatmessage"
;
break
;
break
;
}
}
default:
default:
break
;
return
;
}
}
char
soundPath
[
40
];
std
::
string
soundPath
=
"./sound/"
+
soundName
+
".wav"
;
mysnprintf
(
soundPath
,
"./sound/%s.wav"
,
soundName
);
SetSoundVolume
(
mainGame
->
gameConf
.
sound_volume
);
SetSoundVolume
(
mainGame
->
gameConf
.
sound_volume
);
#ifdef YGOPRO_USE_MINIAUDIO
#ifdef YGOPRO_USE_MINIAUDIO
ma_engine_play_sound
(
&
engineSound
,
soundPath
,
nullptr
);
ma_engine_play_sound
(
&
engineSound
,
soundPath
.
c_str
()
,
nullptr
);
#endif
#endif
#ifdef YGOPRO_USE_IRRKLANG
#ifdef YGOPRO_USE_IRRKLANG
engineSound
->
play2D
(
soundPath
);
engineSound
->
play2D
(
soundPath
.
c_str
()
);
#endif
#endif
#endif // YGOPRO_USE_AUDIO
#endif // YGOPRO_USE_AUDIO
}
}
...
...
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