System: Improve screenshot naming

This commit is contained in:
Stenzek
2024-03-15 15:21:06 +10:00
parent 6aa491f863
commit 43eb6e20fa
5 changed files with 50 additions and 10 deletions

View File

@ -2209,7 +2209,8 @@ bool GPU::RenderScreenshotToFile(std::string filename, DisplayScreenshotMode mod
return false;
}
auto fp = FileSystem::OpenManagedCFile(filename.c_str(), "wb");
// These filenames tend to be fairly long, so remove any MAX_PATH limit.
auto fp = FileSystem::OpenManagedCFile(Path::RemoveLengthLimits(filename).c_str(), "wb");
if (!fp)
{
Log_ErrorPrintf("Can't open file '%s': errno %d", filename.c_str(), errno);