diff --git a/src/io/file_manager.cpp b/src/io/file_manager.cpp index 2d3dce66f..ece404d23 100644 --- a/src/io/file_manager.cpp +++ b/src/io/file_manager.cpp @@ -849,6 +849,14 @@ std::string FileManager::getGPDir() const return m_gp_dir; } // getGPDir +//----------------------------------------------------------------------------- +/** Returns the directory in which the stdout file should be stored. + */ +std::string FileManager::getStdoutDir() const +{ + return m_stdout_dir; +} // getStdoutDir + //----------------------------------------------------------------------------- /** Returns the full path of a texture file name by searching in all * directories currently in the texture search path. The difference to diff --git a/src/io/file_manager.hpp b/src/io/file_manager.hpp index 82773ed26..96506d890 100644 --- a/src/io/file_manager.hpp +++ b/src/io/file_manager.hpp @@ -155,6 +155,7 @@ public: std::string getReplayDir() const; std::string getCachedTexturesDir() const; std::string getGPDir() const; + std::string getStdoutDir() const; bool checkAndCreateDirectory(const std::string &path); bool checkAndCreateDirectoryP(const std::string &path); const std::string &getAddonsDir() const; diff --git a/src/states_screens/race_result_gui.cpp b/src/states_screens/race_result_gui.cpp index 8f2f64ad7..fa0462cf8 100644 --- a/src/states_screens/race_result_gui.cpp +++ b/src/states_screens/race_result_gui.cpp @@ -570,6 +570,13 @@ void RaceResultGUI::eventCallback(GUIEngine::Widget* widget, if (action == "middle") // Save benchmark results { profiler.writeToFile(); + + // Disable the saving button to make it clearer that it has been done + getWidget("middle")->setActive(false); + // Also push a confirmation to the message queue + core::stringw msg = _("Performance report saved in \"%s\".", + StringUtils::utf8ToWide(file_manager->getStdoutDir())); + MessageQueue::add(MessageQueue::MT_GENERIC, msg); } else // Leave to menu or video settings { diff --git a/src/utils/profiler.cpp b/src/utils/profiler.cpp index 2990c85f7..f6dcd2cbe 100644 --- a/src/utils/profiler.cpp +++ b/src/utils/profiler.cpp @@ -622,7 +622,7 @@ void Profiler::computeStableFPS() m_time_waited_in_slow_frames[i-1] = 0; m_slow_frames[i-1] = m_frame_times.size(); // Will be updated if lower - for (uint j=0; j max_microseconds) {