MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / CDVDsys_SetFile

Function CDVDsys_SetFile

pcsx2/CDVD/CDVDcommon.cpp:292–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void CDVDsys_SetFile(CDVD_SourceType srctype, std::string newfile)
293{
294#ifdef WIN32
295 if (Path::IsAbsolute(newfile))
296 {
297 const auto splitPath = Path::SplitNativePath(newfile);
298 // GetDriveType() Requires trailing backslashes
299 const auto root = fmt::format("{}\\", splitPath.at(0));
300
301 const auto driveType = GetDriveType(StringUtil::UTF8StringToWideString(root).c_str());
302 if (driveType == DRIVE_REMOVABLE)
303 {
304 Host::AddIconOSDMessage("RemovableDriveWarning", ICON_FA_TRIANGLE_EXCLAMATION,
305 TRANSLATE_SV("CDVD", "Game disc location is on a removable drive, performance issues such as jittering "
306 "and freezing may occur."),
307 Host::OSD_WARNING_DURATION);
308 }
309 }
310#endif
311
312 m_SourceFilename[enum_cast(srctype)] = std::move(newfile);
313}
314
315const std::string& CDVDsys_GetFile(CDVD_SourceType srctype)
316{

Callers 4

AutoDetectSourceMethod · 0.85
InitializeMethod · 0.85
ChangeDiscMethod · 0.85
OpenMethod · 0.85

Calls 5

UTF8StringToWideStringFunction · 0.85
enum_castFunction · 0.85
atMethod · 0.80
formatFunction · 0.50
c_strMethod · 0.45

Tested by

no test coverage detected