diff --git a/src/xenia/gpu/d3d11/d3d11_graphics_system.cc b/src/xenia/gpu/d3d11/d3d11_graphics_system.cc index a28c94a41..a0965fc7e 100644 --- a/src/xenia/gpu/d3d11/d3d11_graphics_system.cc +++ b/src/xenia/gpu/d3d11/d3d11_graphics_system.cc @@ -123,7 +123,7 @@ void D3D11GraphicsSystem::Initialize() { // will take place. XEASSERTNULL(window_); window_ = new D3D11Window(run_loop_, dxgi_factory_, device_); - if (window_->Initialize("Xenia D3D11", 1280, 768)) { + if (window_->Initialize("Xenia D3D11", 1280, 720)) { XELOGE("Failed to create D3D11Window"); exit(1); return; diff --git a/src/xenia/platform.cc b/src/xenia/platform.cc index 0ecba79df..e4e53d0cc 100644 --- a/src/xenia/platform.cc +++ b/src/xenia/platform.cc @@ -18,11 +18,14 @@ namespace { typedef int (*user_main_t)(int argc, xechar_t** argv); -} +} // namespace #if XE_LIKE_WIN32 && defined(UNICODE) && UNICODE +#include +#include + int xe_main_thunk( int argc, wchar_t* argv[], void* user_main, const char* usage) { @@ -53,6 +56,23 @@ int xe_main_thunk( return result; } +int xe_main_window_thunk( + wchar_t* command_line, + void* user_main, const wchar_t* name, const char* usage) { + wchar_t buffer[2048]; + xestrcpy(buffer, XECOUNT(buffer), name); + xestrcat(buffer, XECOUNT(buffer), XETEXT(" ")); + xestrcat(buffer, XECOUNT(buffer), command_line); + int argc; + wchar_t** argv = CommandLineToArgvW(buffer, &argc); + if (!argv) { + return 1; + } + int result = xe_main_thunk(argc, argv, user_main, usage); + LocalFree(argv); + return result; +} + #else int xe_main_thunk( diff --git a/src/xenia/platform.h b/src/xenia/platform.h index 6edec7692..dfe11c9e7 100644 --- a/src/xenia/platform.h +++ b/src/xenia/platform.h @@ -142,6 +142,13 @@ int xe_main_thunk( int wmain(int argc, wchar_t *argv[]) { \ return xe_main_thunk(argc, argv, NAME, USAGE); \ } +int xe_main_window_thunk( + wchar_t* command_line, + void* user_main, const wchar_t* name, const char* usage); +#define XE_MAIN_WINDOW_THUNK(NAME, APP_NAME, USAGE) \ + int APIENTRY wWinMain(HINSTANCE, HINSTANCE, LPTSTR command_line, int) { \ + return xe_main_window_thunk(command_line, NAME, APP_NAME, USAGE); \ + } #else int xe_main_thunk( int argc, char** argv, @@ -150,6 +157,8 @@ int xe_main_thunk( int main(int argc, char **argv) { \ return xe_main_thunk(argc, argv, (void*)NAME, USAGE); \ } +#define XE_MAIN_WINDOW_THUNK(NAME, APP_NAME, USAGE) \ + XE_MAIN_THUNK(NAME, USAGE) #endif // WIN32 diff --git a/tools/xenia-run/xenia-run.cc b/tools/xenia-run/xenia-run.cc index c78454ffe..f5f33d37f 100644 --- a/tools/xenia-run/xenia-run.cc +++ b/tools/xenia-run/xenia-run.cc @@ -88,3 +88,4 @@ XECLEANUP: return result_code; } XE_MAIN_THUNK(xenia_run, "xenia-run some.xex"); +//XE_MAIN_WINDOW_THUNK(xenia_run, XETEXT("xenia-run"), "xenia-run some.xex"); diff --git a/tools/xenia-run/xenia-run.gypi b/tools/xenia-run/xenia-run.gypi index 0c9bfaca9..6b9ba5c23 100644 --- a/tools/xenia-run/xenia-run.gypi +++ b/tools/xenia-run/xenia-run.gypi @@ -5,6 +5,12 @@ 'target_name': 'xenia-run', 'type': 'executable', + 'msvs_settings': { + 'VCLinkerTool': { + #'SubSystem': '2' + } + }, + 'dependencies': [ 'xenia', ], diff --git a/xenia.gyp b/xenia.gyp index 60286fdb6..ddcd45b2a 100644 --- a/xenia.gyp +++ b/xenia.gyp @@ -285,6 +285,7 @@ 'd3dcompiler', 'xinput', 'xaudio2', + 'Shell32', ], }], ['OS == "mac"', {