Commit 7e4ab6b4 authored by mercury233's avatar mercury233 Committed by GitHub

update directly open ydk and yrp file (#2090)

parent bbbf15cd
......@@ -13,8 +13,12 @@
#ifdef _MSC_VER
#define myswprintf _swprintf
#define mywcsncasecmp _wcsnicmp
#define mystrncasecmp _strnicmp
#else
#define myswprintf swprintf
#define mywcsncasecmp wcsncasecmp
#define mystrncasecmp strncasecmp
#endif
#define socklen_t int
......@@ -41,6 +45,8 @@
#include <wchar.h>
#define myswprintf(buf, fmt, ...) swprintf(buf, 4096, fmt, ##__VA_ARGS__)
#define mywcsncasecmp wcsncasecmp
#define mystrncasecmp strncasecmp
inline int _wtoi(const wchar_t * s) {
wchar_t * endptr;
return (int)wcstol(s, &endptr, 10);
......
......@@ -78,6 +78,7 @@ int main(int argc, char* argv[]) {
char param[128];
GetParameter(param, &argv[i][2]);
ygo::dataManager.LoadDB(param);
continue;
}
if(!strcmp(argv[i], "-e")) { // extra database
++i;
......@@ -156,6 +157,23 @@ 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(!mystrncasecmp(pstrext, ".ydk", 4)) {
open_file = true;
GetParameterW(open_file_name, &argv[1][0]);
exit_on_return = !keep_on_return;
ClickButton(ygo::mainGame->btnDeckEdit);
break;
}
if(!mystrncasecmp(pstrext, ".yrp", 4)) {
open_file = true;
GetParameterW(open_file_name, &argv[1][0]);
exit_on_return = !keep_on_return;
ClickButton(ygo::mainGame->btnReplayMode);
ClickButton(ygo::mainGame->btnLoadReplay);
break;
}
}
}
ygo::mainGame->MainLoop();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment