diff --git a/Bin/unreal-cmd.txt b/Bin/unreal-cmd.txt index a512410..4a3a7df 100644 --- a/Bin/unreal-cmd.txt +++ b/Bin/unreal-cmd.txt @@ -15,6 +15,7 @@ ProfileGPU // Engine\Source\Runtime\Core\Private\HAL\ConsoleManager.cpp show AntiAliasing|r.MobileMSAA 1|r.MobileMSAA 2|r.MobileMSAA 4 +r.DefaultFeature.AntiAliasing 1|r.DefaultFeature.AntiAliasing 2 r.Mobile.SceneColorFormat 1|r.Mobile.SceneColorFormat 2 r.ScreenPercentage 50|r.ScreenPercentage 100|r.ScreenPercentage 150 r.AllowOcclusionQueries 0|r.AllowOcclusionQueries 1 diff --git a/src/LightSpeedApp.cpp b/src/LightSpeedApp.cpp index 75a47a9..cc5c441 100644 --- a/src/LightSpeedApp.cpp +++ b/src/LightSpeedApp.cpp @@ -282,6 +282,39 @@ struct DataStorage #include #include +#include +#include + +void goto_folder(fs::path folder, fs::path selectPath) +{ + PIDLIST_ABSOLUTE pidl; + if (SUCCEEDED(SHParseDisplayName(folder.wstring().c_str(), 0, &pidl, 0, 0))) + { + // we don't want to actually select anything in the folder, so we pass an empty + // PIDL in the array. if you want to select one or more items in the opened + // folder you'd need to build the PIDL array appropriately + + if (selectPath.empty()) + { + ITEMIDLIST idNull = { 0 }; + LPCITEMIDLIST pidlNull[1] = { &idNull }; + SHOpenFolderAndSelectItems(pidl, 1, pidlNull, 0); + } + else + { + ITEMIDLIST* pidlist; + SFGAOF aog; + SHParseDisplayName(selectPath.wstring().c_str(), NULL, &pidlist, SFGAO_CANCOPY, &aog);//pidlist就是转换以后的shell路径 + + LPCITEMIDLIST pidlNull[1] = { pidlist }; + SHOpenFolderAndSelectItems(pidl, 1, pidlNull, 0); + ILFree(pidlist); + } + + ILFree(pidl); + } +} + void make_minidump(EXCEPTION_POINTERS* e) { @@ -1753,6 +1786,7 @@ struct PerfDoctorApp : public App SetUnhandledExceptionFilter(unhandled_handler); am::addAssetDirectory(getAppPath()); mAutoStart = AUTO_START; + ::SetCurrentDirectoryA(getAppPath().string().c_str()); std::ifstream file(getAppPath() / "unreal-cmd.txt"); if (file.is_open()) @@ -1785,6 +1819,14 @@ struct PerfDoctorApp : public App { string output; runCmd(asyncCmd, output); + if (asyncCmd.find("perfetto") != string::npos) + { + auto cmds = split(asyncCmd, " "); + dispatchAsync([this, cmds] { + launchWebBrowser(Url("https://ui.perfetto.dev/#!/", true)); + goto_folder(getAppPath(), getAppPath() / (cmds[1] + ".perfetto")); + }); + } } if (!mIsProfiling || getElapsedSeconds() - lastTimestamp < REFRESH_SECONDS)