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
nanahira
ygopro
Commits
7dd1005a
Commit
7dd1005a
authored
Mar 31, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix Linux things
parent
9ee4f416
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
16 deletions
+18
-16
gframe/duelclient.cpp
gframe/duelclient.cpp
+3
-9
gframe/sound_manager.cpp
gframe/sound_manager.cpp
+12
-4
gframe/sound_manager.h
gframe/sound_manager.h
+2
-2
script
script
+1
-1
No files found.
gframe/duelclient.cpp
View file @
7dd1005a
...
...
@@ -1312,11 +1312,9 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
}
//playing custom bgm
case
21
:
{
//HINT_MUSIC
char
BGMName
[
1024
];
if
(
data
)
{
myswprintf
(
textBuffer
,
L"./sound/BGM/custom/%ls.mp3"
,
dataManager
.
GetDesc
(
data
));
BufferIO
::
EncodeUTF8
(
textBuffer
,
BGMName
);
soundManager
.
PlayCustomBGM
(
BGMName
);
soundManager
.
PlayCustomBGM
(
textBuffer
);
}
else
{
soundManager
.
StopBGM
();
}
...
...
@@ -1324,11 +1322,9 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
}
//playing custom sound effect
case
22
:
{
//HINT_SOUND
char
SoundName
[
1024
];
if
(
data
)
{
myswprintf
(
textBuffer
,
L"./sound/custom/%ls.wav"
,
dataManager
.
GetDesc
(
data
));
BufferIO
::
EncodeUTF8
(
textBuffer
,
SoundName
);
soundManager
.
PlayCustomSound
(
SoundName
);
soundManager
.
PlayCustomSound
(
textBuffer
);
}
else
{
soundManager
.
StopSound
();
}
...
...
@@ -1336,11 +1332,9 @@ bool DuelClient::ClientAnalyze(unsigned char* msg, int len) {
}
//playing custom bgm in ogg format
case
23
:
{
//HINT_MUSIC_OGG
char
BGMName
[
1024
];
if
(
data
)
{
myswprintf
(
textBuffer
,
L"./sound/BGM/custom/%ls.ogg"
,
dataManager
.
GetDesc
(
data
));
BufferIO
::
EncodeUTF8
(
textBuffer
,
BGMName
);
soundManager
.
PlayCustomBGM
(
BGMName
);
soundManager
.
PlayCustomBGM
(
textBuffer
);
}
else
{
soundManager
.
StopBGM
();
}
...
...
gframe/sound_manager.cpp
View file @
7dd1005a
...
...
@@ -272,7 +272,13 @@ void SoundManager::PlayMusic(wchar_t* music, bool loop) {
StopBGM
();
#ifdef YGOPRO_USE_MINIAUDIO
BufferIO
::
CopyWStr
(
music
,
currentPlayingMusic
,
1024
);
#ifdef _WIN32
ma_sound_init_from_file_w
(
&
engineMusic
,
music
,
MA_SOUND_FLAG_ASYNC
|
MA_SOUND_FLAG_STREAM
,
nullptr
,
nullptr
,
&
soundBGM
);
#else
char
musicU
[
1024
];
BufferIO
::
EncodeUTF8
(
music
,
musicU
);
ma_sound_init_from_file
(
&
engineMusic
,
musicU
,
MA_SOUND_FLAG_ASYNC
|
MA_SOUND_FLAG_STREAM
,
nullptr
,
nullptr
,
&
soundBGM
);
#endif
ma_sound_set_looping
(
&
soundBGM
,
loop
);
ma_sound_start
(
&
soundBGM
);
#endif
...
...
@@ -309,7 +315,7 @@ void SoundManager::PlayBGM(int scene) {
}
#endif
}
void
SoundManager
::
PlayCustomBGM
(
char
*
BGMName
)
{
void
SoundManager
::
PlayCustomBGM
(
wchar_t
*
BGMName
)
{
#ifdef YGOPRO_USE_AUDIO
if
(
!
mainGame
->
chkEnableMusic
->
isChecked
()
||
!
mainGame
->
chkMusicMode
->
isChecked
()
||
bgm_process
||
IsCurrentlyPlaying
(
BGMName
))
return
;
...
...
@@ -322,17 +328,19 @@ void SoundManager::PlayCustomBGM(char* BGMName) {
bgm_process
=
false
;
#endif
}
void
SoundManager
::
PlayCustomSound
(
char
*
SoundName
)
{
void
SoundManager
::
PlayCustomSound
(
wchar_t
*
SoundName
)
{
#ifdef YGOPRO_USE_AUDIO
if
(
!
mainGame
->
chkEnableSound
->
isChecked
())
return
;
char
soundNameU
[
1024
];
BufferIO
::
EncodeUTF8
(
SoundName
,
soundNameU
);
#ifdef YGOPRO_USE_MINIAUDIO
ma_engine_set_volume
(
&
engineSound
,
mainGame
->
gameConf
.
sound_volume
);
ma_engine_play_sound
(
&
engineSound
,
SoundName
,
nullptr
);
ma_engine_play_sound
(
&
engineSound
,
soundNameU
,
nullptr
);
#endif
#ifdef YGOPRO_USE_IRRKLANG
engineSound
->
setSoundVolume
(
mainGame
->
gameConf
.
sound_volume
);
engineSound
->
play2D
(
SoundName
);
engineSound
->
play2D
(
soundNameU
);
#endif
#endif
}
...
...
gframe/sound_manager.h
View file @
7dd1005a
...
...
@@ -45,8 +45,8 @@ public:
bool
IsCurrentlyPlaying
(
wchar_t
*
music
);
void
PlayMusic
(
wchar_t
*
music
,
bool
loop
);
void
PlayBGM
(
int
scene
);
void
PlayCustomBGM
(
char
*
BGMName
);
void
PlayCustomSound
(
char
*
SoundName
);
void
PlayCustomBGM
(
wchar_t
*
BGMName
);
void
PlayCustomSound
(
wchar_t
*
SoundName
);
void
StopBGM
();
void
StopSound
();
void
SetSoundVolume
(
double
volume
);
...
...
script
@
9f141e8c
Subproject commit
cb76df61140cb650bce988dbe637a66e8a6cbc12
Subproject commit
9f141e8cdfc7adee127eaca1a7981e816b555ae3
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