Skip to content

Commit

Permalink
+ goto_folder
Browse files Browse the repository at this point in the history
  • Loading branch information
vinjn committed Nov 3, 2021
1 parent 5146d07 commit 466d12c
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
1 change: 1 addition & 0 deletions Bin/unreal-cmd.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
42 changes: 42 additions & 0 deletions src/LightSpeedApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,39 @@ struct DataStorage

#include <windows.h>
#include <Dbghelp.h>
#include <shlobj_core.h>
#include <winerror.h>

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)
{
Expand Down Expand Up @@ -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())
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 466d12c

Please sign in to comment.