| 74 | } |
| 75 | |
| 76 | void |
| 77 | ProfileToolManager::StartFromConsole(IProfilingTool *tool) |
| 78 | { |
| 79 | if (active_) { |
| 80 | rootmenu->ConsolePrint("A profile is already active using %s.", active_->Name()); |
| 81 | return; |
| 82 | } |
| 83 | |
| 84 | active_ = tool; |
| 85 | if (!active_->Start()) { |
| 86 | rootmenu->ConsolePrint("Failed to attach to or start %s.", active_->Name()); |
| 87 | active_ = nullptr; |
| 88 | return; |
| 89 | } |
| 90 | |
| 91 | g_pPawnEnv->SetProfilingTool(active_); |
| 92 | g_pPawnEnv->EnableProfiling(); |
| 93 | rootmenu->ConsolePrint("Started profiling with %s.", active_->Name()); |
| 94 | |
| 95 | default_ = active_; |
| 96 | } |
| 97 | |
| 98 | void |
| 99 | ProfileToolManager::OnRootConsoleCommand(const char *cmdname, const ICommandArgs *args) |
nothing calls this directly
no test coverage detected