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
REIKAI
ygopro
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() {
void
SoundManager
::
RefershBGMDir
(
std
::
wstring
path
,
int
scene
)
{
#ifdef _WIN32
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
);
if
(
fh
==
INVALID_HANDLE_VALUE
)
return
;
do
{
if
(
!
(
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
std
::
wstring
filename
=
path
+
(
std
::
wstring
)
fdataw
.
cFileName
;
BGMList
[
BGM_ALL
].
push_back
(
filename
);
BGMList
[
scene
].
push_back
(
filename
);
}
size_t
len
=
wcslen
(
fdataw
.
cFileName
);
if
((
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
)
||
len
<
5
||
!
(
wcsicmp
(
fdataw
.
cFileName
+
len
-
4
,
L".mp3"
)
==
0
||
wcsicmp
(
fdataw
.
cFileName
+
len
-
4
,
L".ogg"
)
==
0
))
continue
;
std
::
wstring
filename
=
path
+
(
std
::
wstring
)
fdataw
.
cFileName
;
BGMList
[
BGM_ALL
].
push_back
(
filename
);
BGMList
[
scene
].
push_back
(
filename
);
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
FindClose
(
fh
);
#else
// not fully implemented
DIR
*
dir
;
struct
dirent
*
dirp
;
if
((
dir
=
opendir
(
"./sound/BGM/"
))
==
NULL
)
std
::
wstring
searchpath
=
L"./sound/BGM/"
+
path
;
if
((
dir
=
opendir
(
searchpath
.
c_str
()))
==
NULL
)
return
;
while
((
dirp
=
readdir
(
dir
))
!=
NULL
)
{
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
;
wchar_t
wname
[
256
];
BufferIO
::
DecodeUTF8
(
dirp
->
d_name
,
wname
);
BGMList
[
BGM_ALL
].
push_back
(
wname
);
BGMList
[
scene
].
push_back
(
wname
);
}
closedir
(
dir
);
#endif
...
...
gframe/sound_manager.h
View file @
b90f224b
...
...
@@ -10,6 +10,8 @@
#endif
#endif
#define wcsicmp _wcsicmp
namespace
ygo
{
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