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
MobiusMei
ygopro
Commits
b2996052
Commit
b2996052
authored
Sep 20, 2018
by
DailyShana
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix and unify
parent
f74786b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
31 deletions
+32
-31
gframe/gframe.cpp
gframe/gframe.cpp
+32
-31
No files found.
gframe/gframe.cpp
View file @
b2996052
...
...
@@ -57,84 +57,83 @@ int main(int argc, char* argv[]) {
return
0
;
#ifdef _WIN32
wchar_t
**
wargv
;
int
wargc
;
LPWSTR
commandLine
=
GetCommandLineW
();
wargv
=
CommandLineToArgvW
(
commandLine
,
&
wargc
);
wchar_t
**
wargv
=
CommandLineToArgvW
(
GetCommandLineW
(),
&
wargc
);
#else
wchar_t
wargv
[
argc
][
256
];
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
int
wargc
=
argc
;
wchar_t
(
*
wargv
)[
256
]
=
new
wchar_t
[
wargc
][
256
];
for
(
int
i
=
0
;
i
<
argc
;
++
i
)
{
BufferIO
::
DecodeUTF8
(
argv
[
i
],
wargv
[
i
]);
}
#endif //_WIN32
bool
keep_on_return
=
false
;
for
(
int
i
=
1
;
i
<
argc
;
++
i
)
{
if
(
argv
[
i
][
0
]
==
'-'
&&
argv
[
i
][
1
]
==
'e'
&&
argv
[
i
][
2
]
!=
'\0'
)
{
for
(
int
i
=
1
;
i
<
w
argc
;
++
i
)
{
if
(
wargv
[
i
][
0
]
==
L'-'
&&
wargv
[
i
][
1
]
==
L'e'
&&
wargv
[
i
][
2
]
!=
L
'\0'
)
{
char
param
[
128
];
BufferIO
::
EncodeUTF8
(
&
wargv
[
i
][
2
],
param
);
ygo
::
dataManager
.
LoadDB
(
param
);
continue
;
}
if
(
!
strcmp
(
argv
[
i
],
"-e"
))
{
// extra database
if
(
!
wcscmp
(
wargv
[
i
],
L
"-e"
))
{
// extra database
++
i
;
if
(
i
<
argc
)
{
if
(
i
<
w
argc
)
{
char
param
[
128
];
BufferIO
::
EncodeUTF8
(
wargv
[
i
],
param
);
ygo
::
dataManager
.
LoadDB
(
param
);
}
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-n"
))
{
// nickName
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-n"
))
{
// nickName
++
i
;
if
(
i
<
argc
)
if
(
i
<
w
argc
)
ygo
::
mainGame
->
ebNickName
->
setText
(
wargv
[
i
]);
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-h"
))
{
// Host address
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-h"
))
{
// Host address
++
i
;
if
(
i
<
argc
)
if
(
i
<
w
argc
)
ygo
::
mainGame
->
ebJoinHost
->
setText
(
wargv
[
i
]);
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-p"
))
{
// host Port
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-p"
))
{
// host Port
++
i
;
if
(
i
<
argc
)
if
(
i
<
w
argc
)
ygo
::
mainGame
->
ebJoinPort
->
setText
(
wargv
[
i
]);
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-w"
))
{
// host passWord
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-w"
))
{
// host passWord
++
i
;
if
(
i
<
argc
)
if
(
i
<
w
argc
)
ygo
::
mainGame
->
ebJoinPass
->
setText
(
wargv
[
i
]);
continue
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-k"
))
{
// Keep on return
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-k"
))
{
// Keep on return
exit_on_return
=
false
;
keep_on_return
=
true
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-d"
))
{
// Deck
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-d"
))
{
// Deck
++
i
;
if
(
i
+
1
<
argc
)
{
// select deck
if
(
i
+
1
<
w
argc
)
{
// select deck
wcscpy
(
ygo
::
mainGame
->
gameConf
.
lastdeck
,
wargv
[
i
]);
continue
;
}
else
{
// open deck
exit_on_return
=
!
keep_on_return
;
if
(
i
<
argc
)
{
if
(
i
<
w
argc
)
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]);
}
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
break
;
}
}
else
if
(
!
strcmp
(
argv
[
i
],
"-c"
))
{
// Create host
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-c"
))
{
// Create host
exit_on_return
=
!
keep_on_return
;
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ClickButton
(
ygo
::
mainGame
->
btnHostConfirm
);
break
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-j"
))
{
// Join host
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-j"
))
{
// Join host
exit_on_return
=
!
keep_on_return
;
ygo
::
mainGame
->
HideElement
(
ygo
::
mainGame
->
wMainMenu
);
ClickButton
(
ygo
::
mainGame
->
btnJoinHost
);
break
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-r"
))
{
// Replay
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-r"
))
{
// Replay
exit_on_return
=
!
keep_on_return
;
++
i
;
if
(
i
<
argc
)
{
if
(
i
<
w
argc
)
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]);
}
...
...
@@ -142,10 +141,10 @@ int main(int argc, char* argv[]) {
if
(
open_file
)
ClickButton
(
ygo
::
mainGame
->
btnLoadReplay
);
break
;
}
else
if
(
!
strcmp
(
argv
[
i
],
"-s"
))
{
// Single
}
else
if
(
!
wcscmp
(
wargv
[
i
],
L
"-s"
))
{
// Single
exit_on_return
=
!
keep_on_return
;
++
i
;
if
(
i
<
argc
)
{
if
(
i
<
w
argc
)
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]);
}
...
...
@@ -153,16 +152,16 @@ int main(int argc, char* argv[]) {
if
(
open_file
)
ClickButton
(
ygo
::
mainGame
->
btnLoadSinglePlay
);
break
;
}
else
if
(
argc
==
2
&&
strlen
(
argv
[
1
])
>=
4
)
{
char
*
pstrext
=
argv
[
1
]
+
strlen
(
argv
[
1
])
-
4
;
if
(
!
my
strncasecmp
(
pstrext
,
".ydk"
,
4
))
{
}
else
if
(
wargc
==
2
&&
wcslen
(
w
argv
[
1
])
>=
4
)
{
wchar_t
*
pstrext
=
wargv
[
1
]
+
wcslen
(
w
argv
[
1
])
-
4
;
if
(
!
my
wcsncasecmp
(
pstrext
,
L
".ydk"
,
4
))
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]);
exit_on_return
=
!
keep_on_return
;
ClickButton
(
ygo
::
mainGame
->
btnDeckEdit
);
break
;
}
if
(
!
my
strncasecmp
(
pstrext
,
".yrp"
,
4
))
{
if
(
!
my
wcsncasecmp
(
pstrext
,
L
".yrp"
,
4
))
{
open_file
=
true
;
wcscpy
(
open_file_name
,
wargv
[
i
]);
exit_on_return
=
!
keep_on_return
;
...
...
@@ -174,6 +173,8 @@ int main(int argc, char* argv[]) {
}
#ifdef _WIN32
LocalFree
(
wargv
);
#else
delete
[]
wargv
;
#endif
ygo
::
mainGame
->
MainLoop
();
#ifdef _WIN32
...
...
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