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 @@ ...@@ -13,8 +13,12 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#define myswprintf _swprintf #define myswprintf _swprintf
#define mywcsncasecmp _wcsnicmp
#define mystrncasecmp _strnicmp
#else #else
#define myswprintf swprintf #define myswprintf swprintf
#define mywcsncasecmp wcsncasecmp
#define mystrncasecmp strncasecmp
#endif #endif
#define socklen_t int #define socklen_t int
...@@ -41,6 +45,8 @@ ...@@ -41,6 +45,8 @@
#include <wchar.h> #include <wchar.h>
#define myswprintf(buf, fmt, ...) swprintf(buf, 4096, fmt, ##__VA_ARGS__) #define myswprintf(buf, fmt, ...) swprintf(buf, 4096, fmt, ##__VA_ARGS__)
#define mywcsncasecmp wcsncasecmp
#define mystrncasecmp strncasecmp
inline int _wtoi(const wchar_t * s) { inline int _wtoi(const wchar_t * s) {
wchar_t * endptr; wchar_t * endptr;
return (int)wcstol(s, &endptr, 10); return (int)wcstol(s, &endptr, 10);
......
...@@ -78,6 +78,7 @@ int main(int argc, char* argv[]) { ...@@ -78,6 +78,7 @@ int main(int argc, char* argv[]) {
char param[128]; char param[128];
GetParameter(param, &argv[i][2]); GetParameter(param, &argv[i][2]);
ygo::dataManager.LoadDB(param); ygo::dataManager.LoadDB(param);
continue;
} }
if(!strcmp(argv[i], "-e")) { // extra database if(!strcmp(argv[i], "-e")) { // extra database
++i; ++i;
...@@ -156,6 +157,23 @@ int main(int argc, char* argv[]) { ...@@ -156,6 +157,23 @@ int main(int argc, char* argv[]) {
if(open_file) if(open_file)
ClickButton(ygo::mainGame->btnLoadSinglePlay); ClickButton(ygo::mainGame->btnLoadSinglePlay);
break; 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(); 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