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
8918a65c
Commit
8918a65c
authored
Sep 19, 2018
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get unicode command args on Windows
parent
7a89eeb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
19 deletions
+11
-19
gframe/gframe.cpp
gframe/gframe.cpp
+11
-19
No files found.
gframe/gframe.cpp
View file @
8918a65c
...
@@ -12,21 +12,8 @@ bool open_file = false;
...
@@ -12,21 +12,8 @@ bool open_file = false;
wchar_t
open_file_name
[
256
]
=
L""
;
wchar_t
open_file_name
[
256
]
=
L""
;
bool
bot_mode
=
false
;
bool
bot_mode
=
false
;
void
GetParameter
(
char
*
param
,
const
char
*
arg
)
{
#ifdef _WIN32
wchar_t
arg1
[
260
];
MultiByteToWideChar
(
CP_ACP
,
0
,
arg
,
-
1
,
arg1
,
260
);
BufferIO
::
EncodeUTF8
(
arg1
,
param
);
#else
strcpy
(
param
,
arg
);
#endif
}
void
GetParameterW
(
wchar_t
*
param
,
const
char
*
arg
)
{
void
GetParameterW
(
wchar_t
*
param
,
const
char
*
arg
)
{
#ifdef _WIN32
MultiByteToWideChar
(
CP_ACP
,
0
,
arg
,
-
1
,
param
,
260
);
#else
BufferIO
::
DecodeUTF8
(
arg
,
param
);
BufferIO
::
DecodeUTF8
(
arg
,
param
);
#endif
}
}
void
ClickButton
(
irr
::
gui
::
IGUIElement
*
btn
)
{
void
ClickButton
(
irr
::
gui
::
IGUIElement
*
btn
)
{
irr
::
SEvent
event
;
irr
::
SEvent
event
;
...
@@ -72,19 +59,24 @@ int main(int argc, char* argv[]) {
...
@@ -72,19 +59,24 @@ int main(int argc, char* argv[]) {
if
(
!
ygo
::
mainGame
->
Initialize
())
if
(
!
ygo
::
mainGame
->
Initialize
())
return
0
;
return
0
;
#ifdef _WIN32
wchar_t
*
command
=
GetCommandLineW
();
char
buffer
[
2048
];
BufferIO
::
EncodeUTF8
(
command
,
buffer
);
argv
[
0
]
=
strtok
(
buffer
,
" "
);
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
argv
[
i
]
=
strtok
(
NULL
,
" "
);
#endif // _WIN32
bool
keep_on_return
=
false
;
bool
keep_on_return
=
false
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
argv
[
i
][
0
]
==
'-'
&&
argv
[
i
][
1
]
==
'e'
)
{
if
(
argv
[
i
][
0
]
==
'-'
&&
argv
[
i
][
1
]
==
'e'
)
{
char
param
[
128
];
ygo
::
dataManager
.
LoadDB
(
&
argv
[
i
][
2
]);
GetParameter
(
param
,
&
argv
[
i
][
2
]);
ygo
::
dataManager
.
LoadDB
(
param
);
continue
;
continue
;
}
}
if
(
!
strcmp
(
argv
[
i
],
"-e"
))
{
// extra database
if
(
!
strcmp
(
argv
[
i
],
"-e"
))
{
// extra database
++
i
;
++
i
;
char
param
[
128
];
ygo
::
dataManager
.
LoadDB
(
&
argv
[
i
][
0
]);
GetParameter
(
param
,
&
argv
[
i
][
0
]);
ygo
::
dataManager
.
LoadDB
(
param
);
continue
;
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-n"
))
{
// nickName
}
else
if
(
!
strcmp
(
argv
[
i
],
"-n"
))
{
// nickName
++
i
;
++
i
;
...
...
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