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
34622217
Commit
34622217
authored
Mar 28, 2025
by
nanahira
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into server-develop
parents
896d233b
89eecedd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
136 additions
and
29 deletions
+136
-29
gframe/sound_manager.cpp
gframe/sound_manager.cpp
+8
-8
premake/miniaudio/premake5.lua
premake/miniaudio/premake5.lua
+107
-21
premake5.lua
premake5.lua
+21
-0
No files found.
gframe/sound_manager.cpp
View file @
34622217
#include "sound_manager.h"
#include "sound_manager.h"
#include "myfilesystem.h"
#include "myfilesystem.h"
#if defined(YGOPRO_USE_MINIAUDIO) && defined(YGOPRO_MINIAUDIO_SUPPORT_OPUS_VORBIS)
#if defined(YGOPRO_USE_MINIAUDIO) && defined(YGOPRO_MINIAUDIO_SUPPORT_OPUS_VORBIS)
#include <miniaudio_libvorbis.h>
#include <miniaudio_libopus.h>
#include <miniaudio_libopus.h>
#include <miniaudio_libvorbis.h>
#endif
#endif
#ifdef IRRKLANG_STATIC
#ifdef IRRKLANG_STATIC
#include "../ikpmp3/ikpMP3.h"
#include "../ikpmp3/ikpMP3.h"
...
@@ -270,13 +270,7 @@ void SoundManager::PlayMusic(char* song, bool loop) {
...
@@ -270,13 +270,7 @@ void SoundManager::PlayMusic(char* song, bool loop) {
StopBGM
();
StopBGM
();
#ifdef YGOPRO_USE_MINIAUDIO
#ifdef YGOPRO_USE_MINIAUDIO
strcpy
(
currentPlayingMusic
,
song
);
strcpy
(
currentPlayingMusic
,
song
);
#ifdef _WIN32
ma_sound_init_from_file
(
&
engineMusic
,
song
,
MA_SOUND_FLAG_ASYNC
|
MA_SOUND_FLAG_STREAM
,
nullptr
,
nullptr
,
&
soundBGM
);
wchar_t
song_w
[
1024
];
BufferIO
::
DecodeUTF8
(
song
,
song_w
);
ma_sound_init_from_file_w
(
&
engineMusic
,
song_w
,
MA_SOUND_FLAG_ASYNC
|
MA_SOUND_FLAG_STREAM
,
nullptr
,
nullptr
,
&
soundBGM
);
#else
auto
res
=
ma_sound_init_from_file
(
&
engineMusic
,
song
,
MA_SOUND_FLAG_ASYNC
|
MA_SOUND_FLAG_STREAM
,
nullptr
,
nullptr
,
&
soundBGM
);
#endif
ma_sound_set_looping
(
&
soundBGM
,
loop
);
ma_sound_set_looping
(
&
soundBGM
,
loop
);
ma_sound_start
(
&
soundBGM
);
ma_sound_start
(
&
soundBGM
);
#endif
#endif
...
@@ -330,9 +324,15 @@ void SoundManager::PlayCustomSound(char* SoundName) {
...
@@ -330,9 +324,15 @@ void SoundManager::PlayCustomSound(char* SoundName) {
#ifdef YGOPRO_USE_AUDIO
#ifdef YGOPRO_USE_AUDIO
if
(
!
mainGame
->
chkEnableSound
->
isChecked
())
if
(
!
mainGame
->
chkEnableSound
->
isChecked
())
return
;
return
;
#ifdef YGOPRO_USE_MINIAUDIO
ma_engine_set_volume
(
&
engineSound
,
mainGame
->
gameConf
.
sound_volume
);
ma_engine_set_volume
(
&
engineSound
,
mainGame
->
gameConf
.
sound_volume
);
ma_engine_play_sound
(
&
engineSound
,
SoundName
,
nullptr
);
ma_engine_play_sound
(
&
engineSound
,
SoundName
,
nullptr
);
#endif
#endif
#ifdef YGOPRO_USE_IRRKLANG
engineSound
->
setSoundVolume
(
mainGame
->
gameConf
.
sound_volume
);
engineSound
->
play2D
(
SoundName
);
#endif
#endif
}
}
void
SoundManager
::
StopBGM
()
{
void
SoundManager
::
StopBGM
()
{
#ifdef YGOPRO_USE_MINIAUDIO
#ifdef YGOPRO_USE_MINIAUDIO
...
...
premake/miniaudio/premake5.lua
View file @
34622217
project
"miniaudio"
project
"miniaudio"
kind
"StaticLib"
kind
"StaticLib"
files
{
"extras/miniaudio_split/miniaudio.*"
}
files
{
"extras/miniaudio_split/miniaudio.*"
}
defines
{
"MA_NO_ENCODING"
,
"MA_NO_GENERATION"
,
"MA_NO_NEON"
}
if
MINIAUDIO_SUPPORT_OPUS_VORBIS
then
if
MINIAUDIO_SUPPORT_OPUS_VORBIS
then
files
{
"extras/decoders/libopus/*"
,
"extras/decoders/libvorbis/*"
}
files
{
"extras/decoders/libopus/*"
,
"extras/decoders/libvorbis/*"
}
if
MINIAUDIO_BUILD_OPUS_VORBIS
then
if
MINIAUDIO_BUILD_OPUS_VORBIS
then
files
{
"external/ogg/src/**.c"
,
"external/ogg/src/**.h"
}
files
{
files
{
"external/opus/src/**.c"
,
"external/opus/src/**.h"
}
"external/ogg/src/bitwise.c"
,
files
{
"external/opus/celt/*.c"
,
"external/opus/celt/*.h"
}
"external/ogg/src/framing.c"
,
files
{
"external/opus/silk/*.c"
,
"external/opus/silk/*.h"
}
files
{
"external/opus/silk/float/*.c"
,
"external/opus/silk/float/*.h"
}
files
{
"external/opusfile/src/**.c"
,
"external/opusfile/src/**.h"
}
files
{
"external/vorbis/lib/**.c"
,
"external/vorbis/lib/**.h"
}
removefiles
{
"external/opus/src/opus_demo.c"
,
"external/opus/src/tone.c"
,
"external/opus/src/opus.c"
,
"external/opus/src/opus_encoder.c"
,
"external/opus/src/opus_decoder.c"
,
"external/vorbis/lib/psy.h"
,
"external/vorbis/lib/psytune.c"
,
"external/vorbis/lib/tone.c"
,}
"external/opus/src/opus_multistream.c"
,
"external/opus/src/opus_multistream_decoder.c"
,
defines
{
"USE_ALLOCA"
,
"OPUS_BUILD"
}
"external/opus/celt/bands.c"
,
"external/opus/celt/celt.c"
,
"external/opus/celt/celt_decoder.c"
,
"external/opus/celt/celt_lpc.c"
,
"external/opus/celt/cwrs.c"
,
"external/opus/celt/entcode.c"
,
"external/opus/celt/entdec.c"
,
"external/opus/celt/entenc.c"
,
"external/opus/celt/kiss_fft.c"
,
"external/opus/celt/laplace.c"
,
"external/opus/celt/mathops.c"
,
"external/opus/celt/mdct.c"
,
"external/opus/celt/modes.c"
,
"external/opus/celt/pitch.c"
,
"external/opus/celt/quant_bands.c"
,
"external/opus/celt/rate.c"
,
"external/opus/celt/vq.c"
,
"external/opus/celt/x86/pitch_avx.c"
,
"external/opus/celt/x86/pitch_sse.c"
,
"external/opus/celt/x86/vq_sse2.c"
,
"external/opus/celt/x86/x86_celt_map.c"
,
"external/opus/celt/x86/x86cpu.c"
,
"external/opus/silk/bwexpander.c"
,
"external/opus/silk/bwexpander_32.c"
,
"external/opus/silk/CNG.c"
,
"external/opus/silk/code_signs.c"
,
"external/opus/silk/dec_API.c"
,
"external/opus/silk/decode_core.c"
,
"external/opus/silk/decode_frame.c"
,
"external/opus/silk/decode_indices.c"
,
"external/opus/silk/decode_parameters.c"
,
"external/opus/silk/decode_pitch.c"
,
"external/opus/silk/decode_pulses.c"
,
"external/opus/silk/decoder_set_fs.c"
,
"external/opus/silk/gain_quant.c"
,
"external/opus/silk/init_decoder.c"
,
"external/opus/silk/lin2log.c"
,
"external/opus/silk/log2lin.c"
,
"external/opus/silk/LPC_analysis_filter.c"
,
"external/opus/silk/LPC_fit.c"
,
"external/opus/silk/LPC_inv_pred_gain.c"
,
"external/opus/silk/NLSF_decode.c"
,
"external/opus/silk/NLSF_stabilize.c"
,
"external/opus/silk/NLSF_unpack.c"
,
"external/opus/silk/NLSF2A.c"
,
"external/opus/silk/pitch_est_tables.c"
,
"external/opus/silk/PLC.c"
,
"external/opus/silk/resampler.c"
,
"external/opus/silk/resampler_private_AR2.c"
,
"external/opus/silk/resampler_private_down_FIR.c"
,
"external/opus/silk/resampler_private_IIR_FIR.c"
,
"external/opus/silk/resampler_private_up2_HQ.c"
,
"external/opus/silk/resampler_rom.c"
,
"external/opus/silk/shell_coder.c"
,
"external/opus/silk/sort.c"
,
"external/opus/silk/stereo_decode_pred.c"
,
"external/opus/silk/stereo_MS_to_LR.c"
,
"external/opus/silk/sum_sqr_shift.c"
,
"external/opus/silk/table_LSF_cos.c"
,
"external/opus/silk/tables_gain.c"
,
"external/opus/silk/tables_LTP.c"
,
"external/opus/silk/tables_NLSF_CB_NB_MB.c"
,
"external/opus/silk/tables_NLSF_CB_WB.c"
,
"external/opus/silk/tables_other.c"
,
"external/opus/silk/tables_pitch_lag.c"
,
"external/opus/silk/tables_pulses_per_block.c"
,
"external/opusfile/src/info.c"
,
"external/opusfile/src/internal.c"
,
"external/opusfile/src/opusfile.c"
,
"external/opusfile/src/stream.c"
,
"external/vorbis/lib/bitrate.c"
,
"external/vorbis/lib/block.c"
,
"external/vorbis/lib/codebook.c"
,
"external/vorbis/lib/envelope.c"
,
"external/vorbis/lib/floor0.c"
,
"external/vorbis/lib/floor1.c"
,
"external/vorbis/lib/info.c"
,
"external/vorbis/lib/lpc.c"
,
"external/vorbis/lib/lsp.c"
,
"external/vorbis/lib/mapping0.c"
,
"external/vorbis/lib/mdct.c"
,
"external/vorbis/lib/psy.c"
,
"external/vorbis/lib/registry.c"
,
"external/vorbis/lib/res0.c"
,
"external/vorbis/lib/sharedbook.c"
,
"external/vorbis/lib/smallft.c"
,
"external/vorbis/lib/synthesis.c"
,
"external/vorbis/lib/vorbisfile.c"
,
"external/vorbis/lib/window.c"
,
}
includedirs
{
includedirs
{
"external/ogg/include"
,
"external/ogg/include"
,
"external/opus/include"
,
"external/opus/include"
,
"external/opus/celt"
,
"external/opus/celt"
,
"external/opus/silk"
,
"external/opus/silk"
,
"external/opus/silk/float"
,
"external/opusfile/include"
,
"external/opusfile/include"
,
"external/vorbis/include"
"external/vorbis/include"
,
}
defines
{
"OPUS_BUILD"
,
"USE_ALLOCA"
,
"OPUS_X86_PRESUME_SSE"
,
"OPUS_X86_PRESUME_SSE2"
,
"OPUS_HAVE_RTCD"
,
"OPUS_X86_MAY_HAVE_SSE"
,
"OPUS_X86_MAY_HAVE_SSE4_1"
,
"OPUS_X86_MAY_HAVE_AVX2"
,
}
}
else
else
includedirs
{
OPUS_INCLUDE_DIR
,
VORBIS_INCLUDE_DIR
,
OGG_INCLUDE_DIR
}
includedirs
{
OPUS_INCLUDE_DIR
,
VORBIS_INCLUDE_DIR
,
OGG_INCLUDE_DIR
}
...
@@ -35,11 +129,3 @@ project "miniaudio"
...
@@ -35,11 +129,3 @@ project "miniaudio"
filter
"system:linux"
filter
"system:linux"
links
{
"dl"
,
"pthread"
,
"m"
}
links
{
"dl"
,
"pthread"
,
"m"
}
filter
{
"architecture:ARM"
}
defines
{
"MA_NO_NEON"
}
filter
{
"architecture:ARM64"
}
defines
{
"MA_NO_NEON"
}
filter
{}
premake5.lua
View file @
34622217
...
@@ -70,6 +70,27 @@ newoption { trigger = "no-use-irrklang", category = "YGOPro - irrklang", descrip
...
@@ -70,6 +70,27 @@ newoption { trigger = "no-use-irrklang", category = "YGOPro - irrklang", descrip
newoption
{
trigger
=
"irrklang-include-dir"
,
category
=
"YGOPro - irrklang"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"irrklang-include-dir"
,
category
=
"YGOPro - irrklang"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"irrklang-lib-dir"
,
category
=
"YGOPro - irrklang"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"irrklang-lib-dir"
,
category
=
"YGOPro - irrklang"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"no-audio"
,
category
=
"YGOPro"
,
description
=
""
}
newoption
{
trigger
=
"audio-lib"
,
category
=
"YGOPro"
,
description
=
""
,
value
=
"miniaudio, irrklang"
,
default
=
AUDIO_LIB
}
newoption
{
trigger
=
"miniaudio-include-dir"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"miniaudio-lib-dir"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"miniaudio-support-opus-vorbis"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
}
newoption
{
trigger
=
"no-miniaudio-support-opus-vorbis"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
}
newoption
{
trigger
=
"build-opus-vorbis"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
}
newoption
{
trigger
=
"no-build-opus-vorbis"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
}
newoption
{
trigger
=
"opus-include-dir"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"opus-lib-dir"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"vorbis-include-dir"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"vorbis-lib-dir"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"ogg-include-dir"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"ogg-lib-dir"
,
category
=
"YGOPro - miniaudio"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"use-irrklang"
,
category
=
"YGOPro - irrklang"
,
description
=
"Deprecated, use audio-lib=irrklang"
}
newoption
{
trigger
=
"no-use-irrklang"
,
category
=
"YGOPro - irrklang"
,
description
=
"Deprecated, use no-audio"
}
newoption
{
trigger
=
"irrklang-include-dir"
,
category
=
"YGOPro - irrklang"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"irrklang-lib-dir"
,
category
=
"YGOPro - irrklang"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"irrklang-pro"
,
category
=
"YGOPro - irrklang - pro"
,
description
=
""
}
newoption
{
trigger
=
"irrklang-pro"
,
category
=
"YGOPro - irrklang - pro"
,
description
=
""
}
newoption
{
trigger
=
"no-irrklang-pro"
,
category
=
"YGOPro - irrklang - pro"
,
description
=
""
}
newoption
{
trigger
=
"no-irrklang-pro"
,
category
=
"YGOPro - irrklang - pro"
,
description
=
""
}
newoption
{
trigger
=
"irrklang-pro-release-lib-dir"
,
category
=
"YGOPro - irrklang - pro"
,
description
=
""
,
value
=
"PATH"
}
newoption
{
trigger
=
"irrklang-pro-release-lib-dir"
,
category
=
"YGOPro - irrklang - pro"
,
description
=
""
,
value
=
"PATH"
}
...
...
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