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
Commits
8818dc40
Commit
8818dc40
authored
Mar 28, 2025
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
3dc2d86f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
23 additions
and
32 deletions
+23
-32
.github/workflows/build.yml
.github/workflows/build.yml
+0
-22
gframe/premake5.lua
gframe/premake5.lua
+8
-4
gframe/sound_manager.cpp
gframe/sound_manager.cpp
+10
-3
gframe/sound_manager.h
gframe/sound_manager.h
+3
-1
premake/miniaudio/premake5.lua
premake/miniaudio/premake5.lua
+2
-2
No files found.
.github/workflows/build.yml
View file @
8818dc40
...
@@ -94,13 +94,6 @@ jobs:
...
@@ -94,13 +94,6 @@ jobs:
shell
:
bash
shell
:
bash
run
:
|
run
:
|
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
cd miniaudio
cp extras/miniaudio_split/* .
cp extras/decoders/libopus/* .
cp extras/decoders/libvorbis/* .
sed -i 's|#include "../../../miniaudio.h"|#include <miniaudio.h>|' miniaudio_libopus.h
sed -i 's|#include "../../../miniaudio.h"|#include <miniaudio.h>|' miniaudio_libvorbis.h
cd ..
-
name
:
Download ogg
-
name
:
Download ogg
id
:
ogg
id
:
ogg
...
@@ -270,13 +263,6 @@ jobs:
...
@@ -270,13 +263,6 @@ jobs:
-
name
:
Download miniaudio
-
name
:
Download miniaudio
run
:
|
run
:
|
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
cd miniaudio
cp extras/miniaudio_split/* .
cp extras/decoders/libopus/* .
cp extras/decoders/libvorbis/* .
sed -i 's|#include "../../../miniaudio.h"|#include <miniaudio.h>|' miniaudio_libopus.h
sed -i 's|#include "../../../miniaudio.h"|#include <miniaudio.h>|' miniaudio_libvorbis.h
cd ..
-
name
:
Download irrlicht
-
name
:
Download irrlicht
run
:
|
run
:
|
...
@@ -369,13 +355,6 @@ jobs:
...
@@ -369,13 +355,6 @@ jobs:
-
name
:
Download miniaudio
-
name
:
Download miniaudio
run
:
|
run
:
|
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
git clone --depth=1 --branch 0.11.22 https://github.com/mackron/miniaudio
cd miniaudio
cp extras/miniaudio_split/* .
cp extras/decoders/libopus/* .
cp extras/decoders/libvorbis/* .
sed -i '' 's|#include "../../../miniaudio.h"|#include <miniaudio.h>|' miniaudio_libopus.h
sed -i '' 's|#include "../../../miniaudio.h"|#include <miniaudio.h>|' miniaudio_libvorbis.h
cd ..
-
name
:
Download irrlicht
-
name
:
Download irrlicht
run
:
|
run
:
|
...
@@ -405,7 +384,6 @@ jobs:
...
@@ -405,7 +384,6 @@ jobs:
-
name
:
Use premake to generate make files (ARM64)
-
name
:
Use premake to generate make files (ARM64)
if
:
runner.arch == 'ARM64'
if
:
runner.arch == 'ARM64'
run
:
|
run
:
|
ls /opt/homebrew/lib
./premake5 gmake \
./premake5 gmake \
--cc=clang \
--cc=clang \
--event-include-dir="/opt/homebrew/include" \
--event-include-dir="/opt/homebrew/include" \
...
...
gframe/premake5.lua
View file @
8818dc40
...
@@ -40,11 +40,15 @@ project "YGOPro"
...
@@ -40,11 +40,15 @@ project "YGOPro"
if
USE_AUDIO
then
if
USE_AUDIO
then
defines
{
"YGOPRO_USE_AUDIO"
}
defines
{
"YGOPRO_USE_AUDIO"
}
includedirs
{
"../miniaudio"
}
includedirs
{
"../miniaudio
/extras/miniaudio_split
"
}
links
{
"miniaudio"
}
links
{
"miniaudio"
}
if
not
BUILD_OPUS_VORBIS
and
MINIAUDIO_SUPPORT_OPUS_VORBIS
then
if
MINIAUDIO_SUPPORT_OPUS_VORBIS
then
links
{
"opusfile"
,
"vorbisfile"
}
defines
{
"YGOPRO_MINIAUDIO_SUPPORT_OPUS_VORBIS"
}
libdirs
{
OPUS_LIB_DIR
,
VORBIS_LIB_DIR
}
includedirs
{
"../miniaudio/extras/decoders/libopus"
,
"../miniaudio/extras/decoders/libvorbis"
}
if
not
BUILD_OPUS_VORBIS
then
links
{
"opusfile"
,
"vorbisfile"
}
libdirs
{
OPUS_LIB_DIR
,
VORBIS_LIB_DIR
}
end
end
end
end
end
...
...
gframe/sound_manager.cpp
View file @
8818dc40
#include "sound_manager.h"
#include "sound_manager.h"
#if
def YGOPRO_USE_AUDIO
#if
defined(YGOPRO_USE_AUDIO) && defined(YGOPRO_MINIAUDIO_SUPPORT_OPUS_VORBIS)
#include <miniaudio_libvorbis.h>
#include <miniaudio_libvorbis.h>
#include <miniaudio_libopus.h>
#include <miniaudio_libopus.h>
#endif
#endif
...
@@ -14,6 +14,8 @@ bool SoundManager::Init() {
...
@@ -14,6 +14,8 @@ bool SoundManager::Init() {
bgm_scene
=
-
1
;
bgm_scene
=
-
1
;
RefreshBGMList
();
RefreshBGMList
();
rnd
.
reset
((
unsigned
int
)
std
::
time
(
nullptr
));
rnd
.
reset
((
unsigned
int
)
std
::
time
(
nullptr
));
engineConfig
=
ma_engine_config_init
();
#ifdef YGOPRO_MINIAUDIO_SUPPORT_OPUS_VORBIS
ma_decoding_backend_vtable
*
pCustomBackendVTables
[]
=
ma_decoding_backend_vtable
*
pCustomBackendVTables
[]
=
{
{
ma_decoding_backend_libvorbis
,
ma_decoding_backend_libvorbis
,
...
@@ -26,8 +28,8 @@ bool SoundManager::Init() {
...
@@ -26,8 +28,8 @@ bool SoundManager::Init() {
if
(
ma_resource_manager_init
(
&
resourceManagerConfig
,
&
resourceManager
)
!=
MA_SUCCESS
)
{
if
(
ma_resource_manager_init
(
&
resourceManagerConfig
,
&
resourceManager
)
!=
MA_SUCCESS
)
{
return
false
;
return
false
;
}
}
engineConfig
=
ma_engine_config_init
();
engineConfig
.
pResourceManager
=
&
resourceManager
;
engineConfig
.
pResourceManager
=
&
resourceManager
;
#endif
if
(
ma_engine_init
(
&
engineConfig
,
&
engineSound
)
!=
MA_SUCCESS
||
ma_engine_init
(
&
engineConfig
,
&
engineMusic
)
!=
MA_SUCCESS
)
{
if
(
ma_engine_init
(
&
engineConfig
,
&
engineSound
)
!=
MA_SUCCESS
||
ma_engine_init
(
&
engineConfig
,
&
engineMusic
)
!=
MA_SUCCESS
)
{
return
false
;
return
false
;
}
else
{
}
else
{
...
@@ -51,7 +53,12 @@ void SoundManager::RefreshBGMList() {
...
@@ -51,7 +53,12 @@ void SoundManager::RefreshBGMList() {
void
SoundManager
::
RefershBGMDir
(
std
::
wstring
path
,
int
scene
)
{
void
SoundManager
::
RefershBGMDir
(
std
::
wstring
path
,
int
scene
)
{
std
::
wstring
search
=
L"./sound/BGM/"
+
path
;
std
::
wstring
search
=
L"./sound/BGM/"
+
path
;
FileSystem
::
TraversalDir
(
search
.
c_str
(),
[
this
,
&
path
,
scene
](
const
wchar_t
*
name
,
bool
isdir
)
{
FileSystem
::
TraversalDir
(
search
.
c_str
(),
[
this
,
&
path
,
scene
](
const
wchar_t
*
name
,
bool
isdir
)
{
if
(
!
isdir
&&
(
IsExtension
(
name
,
L".mp3"
)
||
IsExtension
(
name
,
L".ogg"
)))
{
if
(
!
isdir
&&
(
IsExtension
(
name
,
L".mp3"
)
#ifdef YGOPRO_MINIAUDIO_SUPPORT_OPUS_VORBIS
||
IsExtension
(
name
,
L".ogg"
)
#endif
))
{
std
::
wstring
filename
=
path
+
L"/"
+
name
;
std
::
wstring
filename
=
path
+
L"/"
+
name
;
BGMList
[
BGM_ALL
].
push_back
(
filename
);
BGMList
[
BGM_ALL
].
push_back
(
filename
);
BGMList
[
scene
].
push_back
(
filename
);
BGMList
[
scene
].
push_back
(
filename
);
...
...
gframe/sound_manager.h
View file @
8818dc40
...
@@ -15,9 +15,11 @@ private:
...
@@ -15,9 +15,11 @@ private:
int
bgm_scene
;
int
bgm_scene
;
mt19937
rnd
;
mt19937
rnd
;
#ifdef YGOPRO_USE_AUDIO
#ifdef YGOPRO_USE_AUDIO
ma_engine_config
engineConfig
;
#ifdef YGOPRO_MINIAUDIO_SUPPORT_OPUS_VORBIS
ma_resource_manager_config
resourceManagerConfig
;
ma_resource_manager_config
resourceManagerConfig
;
ma_resource_manager
resourceManager
;
ma_resource_manager
resourceManager
;
ma_engine_config
engineConfig
;
#endif
ma_engine
engineSound
;
ma_engine
engineSound
;
ma_engine
engineMusic
;
ma_engine
engineMusic
;
ma_sound
soundBGM
;
ma_sound
soundBGM
;
...
...
premake/miniaudio/premake5.lua
View file @
8818dc40
project
"miniaudio"
project
"miniaudio"
kind
"StaticLib"
kind
"StaticLib"
files
{
"*.c"
,
"*.h"
}
files
{
"extras/miniaudio_split/miniaudio.*"
}
includedirs
{
"."
}
if
MINIAUDIO_SUPPORT_OPUS_VORBIS
then
if
MINIAUDIO_SUPPORT_OPUS_VORBIS
then
files
{
"extras/decoders/libopus/*"
,
"extras/decoders/libvorbis/*"
}
if
BUILD_OPUS_VORBIS
then
if
BUILD_OPUS_VORBIS
then
files
{
"external/ogg/src/**.c"
,
"external/ogg/src/**.h"
}
files
{
"external/ogg/src/**.c"
,
"external/ogg/src/**.h"
}
files
{
"external/opus/src/**.c"
,
"external/opus/src/**.h"
}
files
{
"external/opus/src/**.c"
,
"external/opus/src/**.h"
}
...
...
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