Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Y
ygopro-2pick
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-2pick
Commits
b90f224b
Commit
b90f224b
authored
Dec 18, 2017
by
mercury233
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
01e9295f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
9 deletions
+14
-9
gframe/sound_manager.cpp
gframe/sound_manager.cpp
+12
-9
gframe/sound_manager.h
gframe/sound_manager.h
+2
-0
No files found.
gframe/sound_manager.cpp
View file @
b90f224b
...
@@ -38,31 +38,34 @@ void SoundManager::RefreshBGMList() {
...
@@ -38,31 +38,34 @@ void SoundManager::RefreshBGMList() {
void
SoundManager
::
RefershBGMDir
(
std
::
wstring
path
,
int
scene
)
{
void
SoundManager
::
RefershBGMDir
(
std
::
wstring
path
,
int
scene
)
{
#ifdef _WIN32
#ifdef _WIN32
WIN32_FIND_DATAW
fdataw
;
WIN32_FIND_DATAW
fdataw
;
std
::
wstring
search
=
L"./sound/BGM/"
+
path
+
L"*.
mp3
"
;
std
::
wstring
search
=
L"./sound/BGM/"
+
path
+
L"*.
*
"
;
HANDLE
fh
=
FindFirstFileW
(
search
.
c_str
(),
&
fdataw
);
HANDLE
fh
=
FindFirstFileW
(
search
.
c_str
(),
&
fdataw
);
if
(
fh
==
INVALID_HANDLE_VALUE
)
if
(
fh
==
INVALID_HANDLE_VALUE
)
return
;
return
;
do
{
do
{
if
(
!
(
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
size_t
len
=
wcslen
(
fdataw
.
cFileName
);
std
::
wstring
filename
=
path
+
(
std
::
wstring
)
fdataw
.
cFileName
;
if
((
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
||
len
<
5
BGMList
[
BGM_ALL
].
push_back
(
filename
);
||
!
(
wcsicmp
(
fdataw
.
cFileName
+
len
-
4
,
L".mp3"
)
==
0
||
wcsicmp
(
fdataw
.
cFileName
+
len
-
4
,
L".ogg"
)
==
0
))
BGMList
[
scene
].
push_back
(
filename
);
continue
;
}
std
::
wstring
filename
=
path
+
(
std
::
wstring
)
fdataw
.
cFileName
;
BGMList
[
BGM_ALL
].
push_back
(
filename
);
BGMList
[
scene
].
push_back
(
filename
);
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
FindClose
(
fh
);
FindClose
(
fh
);
#else
#else
// not fully implemented
DIR
*
dir
;
DIR
*
dir
;
struct
dirent
*
dirp
;
struct
dirent
*
dirp
;
if
((
dir
=
opendir
(
"./sound/BGM/"
))
==
NULL
)
std
::
wstring
searchpath
=
L"./sound/BGM/"
+
path
;
if
((
dir
=
opendir
(
searchpath
.
c_str
()))
==
NULL
)
return
;
return
;
while
((
dirp
=
readdir
(
dir
))
!=
NULL
)
{
while
((
dirp
=
readdir
(
dir
))
!=
NULL
)
{
size_t
len
=
strlen
(
dirp
->
d_name
);
size_t
len
=
strlen
(
dirp
->
d_name
);
if
(
len
<
5
||
strcasecmp
(
dirp
->
d_name
+
len
-
4
,
".ogg"
)
!=
0
)
if
(
len
<
5
||
!
(
strcasecmp
(
dirp
->
d_name
+
len
-
4
,
".mp3"
)
==
0
||
strcasecmp
(
dirp
->
d_name
+
len
-
4
,
".ogg"
))
)
continue
;
continue
;
wchar_t
wname
[
256
];
wchar_t
wname
[
256
];
BufferIO
::
DecodeUTF8
(
dirp
->
d_name
,
wname
);
BufferIO
::
DecodeUTF8
(
dirp
->
d_name
,
wname
);
BGMList
[
BGM_ALL
].
push_back
(
wname
);
BGMList
[
BGM_ALL
].
push_back
(
wname
);
BGMList
[
scene
].
push_back
(
wname
);
}
}
closedir
(
dir
);
closedir
(
dir
);
#endif
#endif
...
...
gframe/sound_manager.h
View file @
b90f224b
...
@@ -10,6 +10,8 @@
...
@@ -10,6 +10,8 @@
#endif
#endif
#endif
#endif
#define wcsicmp _wcsicmp
namespace
ygo
{
namespace
ygo
{
class
SoundManager
{
class
SoundManager
{
...
...
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