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
1bf74487
Commit
1bf74487
authored
Jul 03, 2016
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
support multi-byte file name on Windows
parent
de2e840a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
1 deletion
+15
-1
gframe/game.cpp
gframe/game.cpp
+3
-1
gframe/gframe.cpp
gframe/gframe.cpp
+8
-0
gframe/single_mode.cpp
gframe/single_mode.cpp
+4
-0
No files found.
gframe/game.cpp
View file @
1bf74487
...
@@ -701,7 +701,9 @@ void Game::RefreshExpansionDB() {
...
@@ -701,7 +701,9 @@ void Game::RefreshExpansionDB() {
if
(
fh
!=
INVALID_HANDLE_VALUE
)
{
if
(
fh
!=
INVALID_HANDLE_VALUE
)
{
do
{
do
{
if
(
!
(
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
if
(
!
(
fdataw
.
dwFileAttributes
&
FILE_ATTRIBUTE_DIRECTORY
))
{
sprintf
(
fpath
,
"./expansions/%ls"
,
fdataw
.
cFileName
);
char
fname
[
780
];
BufferIO
::
EncodeUTF8
(
fdataw
.
cFileName
,
fname
);
sprintf
(
fpath
,
"./expansions/%s"
,
fname
);
dataManager
.
LoadDB
(
fpath
);
dataManager
.
LoadDB
(
fpath
);
}
}
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
}
while
(
FindNextFileW
(
fh
,
&
fdataw
));
...
...
gframe/gframe.cpp
View file @
1bf74487
...
@@ -27,7 +27,15 @@ int main(int argc, char* argv[]) {
...
@@ -27,7 +27,15 @@ int main(int argc, char* argv[]) {
* -d: deck edit
* -d: deck edit
* -r: replay */
* -r: replay */
if
(
argv
[
i
][
0
]
==
'-'
&&
argv
[
i
][
1
]
==
'e'
)
{
if
(
argv
[
i
][
0
]
==
'-'
&&
argv
[
i
][
1
]
==
'e'
)
{
#ifdef _WIN32
wchar_t
fname
[
260
];
MultiByteToWideChar
(
CP_ACP
,
0
,
&
argv
[
i
][
2
],
-
1
,
fname
,
260
);
char
fname2
[
260
];
BufferIO
::
EncodeUTF8
(
fname
,
fname2
);
ygo
::
dataManager
.
LoadDB
(
fname2
);
#else
ygo
::
dataManager
.
LoadDB
(
&
argv
[
i
][
2
]);
ygo
::
dataManager
.
LoadDB
(
&
argv
[
i
][
2
]);
#endif
}
else
if
(
!
strcmp
(
argv
[
i
],
"-j"
)
||
!
strcmp
(
argv
[
i
],
"-d"
)
||
!
strcmp
(
argv
[
i
],
"-r"
)
||
!
strcmp
(
argv
[
i
],
"-s"
))
{
}
else
if
(
!
strcmp
(
argv
[
i
],
"-j"
)
||
!
strcmp
(
argv
[
i
],
"-d"
)
||
!
strcmp
(
argv
[
i
],
"-r"
)
||
!
strcmp
(
argv
[
i
],
"-s"
))
{
exit_on_return
=
true
;
exit_on_return
=
true
;
irr
::
SEvent
event
;
irr
::
SEvent
event
;
...
...
gframe/single_mode.cpp
View file @
1bf74487
...
@@ -31,7 +31,11 @@ int SingleMode::SinglePlayThread(void* param) {
...
@@ -31,7 +31,11 @@ int SingleMode::SinglePlayThread(void* param) {
wchar_t
fname
[
256
];
wchar_t
fname
[
256
];
myswprintf
(
fname
,
L"./single/%ls"
,
name
);
myswprintf
(
fname
,
L"./single/%ls"
,
name
);
char
fname2
[
256
];
char
fname2
[
256
];
#ifdef _WIN32
size_t
slen
=
WideCharToMultiByte
(
CP_ACP
,
0
,
fname
,
-
1
,
fname2
,
256
,
NULL
,
NULL
);
#else
size_t
slen
=
BufferIO
::
EncodeUTF8
(
fname
,
fname2
);
size_t
slen
=
BufferIO
::
EncodeUTF8
(
fname
,
fname2
);
#endif
mtrandom
rnd
;
mtrandom
rnd
;
time_t
seed
=
time
(
0
);
time_t
seed
=
time
(
0
);
rnd
.
reset
(
seed
);
rnd
.
reset
(
seed
);
...
...
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