MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / WriteScreenshot

Method WriteScreenshot

src/crashlog.cpp:246–255  ·  view source on GitHub ↗

* Write the (crash) screenshot to a file. * @note The filename will be written to \c screenshot_filename. * @return std::nullopt when the crash screenshot could not be made, otherwise the filename. */

Source from the content-addressed store, hash-verified

244 * @return std::nullopt when the crash screenshot could not be made, otherwise the filename.
245 */
246bool CrashLog::WriteScreenshot()
247{
248 /* Don't draw when we have invalid screen size */
249 if (_screen.width < 1 || _screen.height < 1 || _screen.dst_ptr == nullptr) return false;
250
251 std::string filename = this->CreateFileName("", false);
252 bool res = MakeScreenshot(SC_CRASHLOG, std::move(filename));
253 if (res) this->screenshot_filename = _full_screenshot_path;
254 return res;
255}
256
257/**
258 * Send the survey result, noting it was a crash.

Callers 1

MakeCrashLogMethod · 0.95

Calls 2

CreateFileNameMethod · 0.95
MakeScreenshotFunction · 0.85

Tested by

no test coverage detected